2 * @defgroup Diskselector Diskselector
5 * @image html img/widget/diskselector/preview-00.png
6 * @image latex img/widget/diskselector/preview-00.eps
8 * A diskselector is a kind of list widget. It scrolls horizontally,
9 * and can contain label and icon objects. Three items are displayed
10 * with the selected one in the middle.
12 * It can act like a circular list with round mode and labels can be
13 * reduced for a defined length for side items.
15 * Smart callbacks one can listen to:
16 * - "selected" - when item is selected, i.e. scroller stops.
18 * Available styles for it:
22 * Default contents parts of the diskseletor items that you can use for are:
24 * Default content parts of the diskselector items that you can use for are:
25 >>>>>>> remotes/origin/upstream
26 * @li "icon" - An icon in the diskselector item
28 * Default text parts of the diskselector items that you can use for are:
29 * @li "default" - Label of the diskselector item
31 * Supported elm_object_item common APIs.
32 * @li elm_object_item_part_text_set
33 * @li elm_object_item_part_text_get
34 * @li elm_object_item_part_content_set
35 * @li elm_object_item_part_content_get
38 * @li @ref diskselector_example_01
39 * @li @ref diskselector_example_02
43 * @addtogroup Diskselector
48 * Add a new diskselector widget to the given parent Elementary
51 * @param parent The parent object.
52 * @return a new diskselector widget handle or @c NULL, on errors.
54 * This function inserts a new diskselector widget on the canvas.
56 * @ingroup Diskselector
58 EAPI Evas_Object *elm_diskselector_add(Evas_Object *parent);
61 * Enable or disable round mode.
63 * @param obj The diskselector object.
65 * @param round @c EINA_TRUE to enable round mode or @c EINA_FALSE to
68 * Disabled by default. If round mode is enabled the items list will
69 * work like a circle list, so when the user reaches the last item,
70 * the first one will popup.
72 * @see elm_diskselector_round_get()
74 * @ingroup Diskselector
76 EAPI void elm_diskselector_round_set(Evas_Object *obj, Eina_Bool round);
78 * @param enabled @c EINA_TRUE to enable round mode or @c EINA_FALSE to
81 * Disabled by default. If round mode is enabled the items list will
82 * work like a circular list, so when the user reaches the last item,
83 * the first one will popup.
85 * @see elm_diskselector_round_enabled_get()
87 * @ingroup Diskselector
89 EAPI void elm_diskselector_round_enabled_set(Evas_Object *obj, Eina_Bool enabled);
90 >>>>>>> remotes/origin/upstream
93 * Get a value whether round mode is enabled or not.
96 * @see elm_diskselector_round_set() for details.
98 * @see elm_diskselector_round_enabled_set() for details.
99 >>>>>>> remotes/origin/upstream
101 * @param obj The diskselector object.
102 * @return @c EINA_TRUE means round mode is enabled. @c EINA_FALSE indicates
103 * it's disabled. If @p obj is @c NULL, @c EINA_FALSE is returned.
105 * @ingroup Diskselector
108 EAPI Eina_Bool elm_diskselector_round_get(const Evas_Object *obj);
110 EAPI Eina_Bool elm_diskselector_round_enabled_get(const Evas_Object *obj);
111 >>>>>>> remotes/origin/upstream
114 * Get the side labels max length.
117 * @see elm_diskselector_side_label_length_set() for details.
119 * @see elm_diskselector_side_text_max_length_set() for details.
120 >>>>>>> remotes/origin/upstream
122 * @param obj The diskselector object.
123 * @return The max length defined for side labels, or 0 if not a valid
126 * @ingroup Diskselector
129 EAPI int elm_diskselector_side_label_length_get(const Evas_Object *obj);
131 EAPI int elm_diskselector_side_text_max_length_get(const Evas_Object *obj);
132 >>>>>>> remotes/origin/upstream
135 * Set the side labels max length.
137 * @param obj The diskselector object.
138 * @param len The max length defined for side labels.
140 * Length is the number of characters of items' label that will be
141 * visible when it's set on side positions. It will just crop
142 * the string after defined size. E.g.:
144 * An item with label "January" would be displayed on side position as
145 * "Jan" if max length is set to 3, or "Janu", if this property
148 * When it's selected, the entire label will be displayed, except for
149 * width restrictions. In this case label will be cropped and "..."
150 * will be concatenated.
152 * Default side label max length is 3.
155 * This property will be applyed over all items, included before or
157 * This property will be applied over all items, included before or
158 >>>>>>> remotes/origin/upstream
159 * later this function call.
161 * @ingroup Diskselector
164 EAPI void elm_diskselector_side_label_length_set(Evas_Object *obj, int len);
166 EAPI void elm_diskselector_side_text_max_length_set(Evas_Object *obj, int len);
167 >>>>>>> remotes/origin/upstream
170 * Set the number of items to be displayed.
172 * @param obj The diskselector object.
173 * @param num The number of items the diskselector will display.
176 * Default value is 3, and also it's the minimun. If @p num is less
178 * Default value is 3, and also it's the minimum. If @p num is less
179 >>>>>>> remotes/origin/upstream
180 * than 3, it will be set to 3.
182 * Also, it can be set on theme, using data item @c display_item_num
183 * on group "elm/diskselector/item/X", where X is style set.
186 * group { name: "elm/diskselector/item/X";
188 * item: "display_item_num" "5";
191 * @ingroup Diskselector
193 EAPI void elm_diskselector_display_item_num_set(Evas_Object *obj, int num);
196 * Get the number of items in the diskselector object.
198 * @param obj The diskselector object.
200 * @ingroup Diskselector
202 EAPI int elm_diskselector_display_item_num_get(const Evas_Object *obj);
205 * Set bouncing behaviour when the scrolled content reaches an edge.
207 * Tell the internal scroller object whether it should bounce or not
208 * when it reaches the respective edges for each axis.
210 * @param obj The diskselector object.
211 * @param h_bounce Whether to bounce or not in the horizontal axis.
212 * @param v_bounce Whether to bounce or not in the vertical axis.
214 * @see elm_scroller_bounce_set()
216 * @ingroup Diskselector
218 EAPI void elm_diskselector_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce);
221 * Get the bouncing behaviour of the internal scroller.
223 * Get whether the internal scroller should bounce when the edge of each
224 * axis is reached scrolling.
226 * @param obj The diskselector object.
228 * @param h_bounce Pointer where to store the bounce state of the horizontal
230 * @param v_bounce Pointer where to store the bounce state of the vertical
232 * @param h_bounce Pointer to store the bounce state of the horizontal
234 * @param v_bounce Pointer to store the bounce state of the vertical
235 >>>>>>> remotes/origin/upstream
238 * @see elm_scroller_bounce_get()
239 * @see elm_diskselector_bounce_set()
241 * @ingroup Diskselector
243 EAPI void elm_diskselector_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce);
246 * Get the scrollbar policy.
248 * @see elm_diskselector_scroller_policy_get() for details.
250 * @param obj The diskselector object.
252 * @param policy_h Pointer where to store horizontal scrollbar policy.
253 * @param policy_v Pointer where to store vertical scrollbar policy.
255 * @param policy_h Pointer to store horizontal scrollbar policy.
256 * @param policy_v Pointer to store vertical scrollbar policy.
257 >>>>>>> remotes/origin/upstream
259 * @ingroup Diskselector
261 EAPI void elm_diskselector_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v);
264 * Set the scrollbar policy.
266 * @param obj The diskselector object.
267 * @param policy_h Horizontal scrollbar policy.
268 * @param policy_v Vertical scrollbar policy.
270 * This sets the scrollbar visibility policy for the given scroller.
271 * #ELM_SCROLLER_POLICY_AUTO means the scrollbar is made visible if it
272 * is needed, and otherwise kept hidden. #ELM_SCROLLER_POLICY_ON turns
273 * it on all the time, and #ELM_SCROLLER_POLICY_OFF always keeps it off.
274 * This applies respectively for the horizontal and vertical scrollbars.
276 * The both are disabled by default, i.e., are set to
277 * #ELM_SCROLLER_POLICY_OFF.
279 * @ingroup Diskselector
281 EAPI void elm_diskselector_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v);
284 * Remove all diskselector's items.
286 * @param obj The diskselector object.
288 * @see elm_object_item_del()
289 * @see elm_diskselector_item_append()
291 * @ingroup Diskselector
293 EAPI void elm_diskselector_clear(Evas_Object *obj);
296 * Get a list of all the diskselector items.
298 * @param obj The diskselector object.
299 * @return An @c Eina_List of diskselector items, #Elm_Object_Item,
300 * or @c NULL on failure.
302 * @see elm_diskselector_item_append()
303 * @see elm_object_item_del()
304 * @see elm_diskselector_clear()
306 * @ingroup Diskselector
308 EAPI const Eina_List *elm_diskselector_items_get(const Evas_Object *obj);
311 * Appends a new item to the diskselector object.
313 * @param obj The diskselector object.
314 * @param label The label of the diskselector item.
315 * @param icon The icon object to use at left side of the item. An
316 * icon can be any Evas object, but usually it is an icon created
317 * with elm_icon_add().
318 * @param func The function to call when the item is selected.
319 * @param data The data to associate with the item for related callbacks.
321 * @return The created item or @c NULL upon failure.
323 * A new item will be created and appended to the diskselector, i.e., will
324 * be set as last item. Also, if there is no selected item, it will
325 * be selected. This will always happens for the first appended item.
327 * If no icon is set, label will be centered on item position, otherwise
328 * the icon will be placed at left of the label, that will be shifted
331 * Items created with this method can be deleted with
332 * elm_object_item_del().
334 * Associated @p data can be properly freed when item is deleted if a
335 * callback function is set with elm_object_item_del_cb_set().
338 * If a function is passed as argument, it will be called everytime this item
340 * If a function is passed as argument, it will be called every time this item
341 >>>>>>> remotes/origin/upstream
342 * is selected, i.e., the user stops the diskselector with this
343 * item on center position. If such function isn't needed, just passing
344 * @c NULL as @p func is enough. The same should be done for @p data.
346 * Simple example (with no function callback or data associated):
348 * disk = elm_diskselector_add(win);
349 * ic = elm_icon_add(win);
350 * elm_icon_file_set(ic, "path/to/image", NULL);
352 * elm_icon_scale_set(ic, EINA_TRUE, EINA_TRUE);
354 * elm_icon_resizable_set(ic, EINA_TRUE, EINA_TRUE);
355 >>>>>>> remotes/origin/upstream
356 * elm_diskselector_item_append(disk, "label", ic, NULL, NULL);
359 * @see elm_object_item_del()
360 * @see elm_diskselector_clear()
361 * @see elm_icon_add()
363 * @ingroup Diskselector
365 EAPI Elm_Object_Item *elm_diskselector_item_append(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Smart_Cb func, const void *data);
368 * Get the selected item.
370 * @param obj The diskselector object.
371 * @return The selected diskselector item.
373 * The selected item can be unselected with function
374 * elm_diskselector_item_selected_set(), and the first item of
375 * diskselector will be selected.
377 * The selected item always will be centered on diskselector, with
379 * full label displayed, i.e., max lenght set to side labels won't
380 * apply on the selected item. More details on
381 * elm_diskselector_side_label_length_set().
383 * full label displayed, i.e., max length set to side labels won't
384 * apply on the selected item. More details on
385 * elm_diskselector_side_text_max_length_set().
386 >>>>>>> remotes/origin/upstream
388 * @ingroup Diskselector
390 EAPI Elm_Object_Item *elm_diskselector_selected_item_get(const Evas_Object *obj);
393 * Set the selected state of an item.
395 * @param it The diskselector item
396 * @param selected The selected state
398 * This sets the selected state of the given item @p it.
399 * @c EINA_TRUE for selected, @c EINA_FALSE for not selected.
402 * If a new item is selected the previosly selected will be unselected.
403 * Previoulsy selected item can be get with function
405 * If a new item is selected the previously selected will be unselected.
406 * Previously selected item can be get with function
407 >>>>>>> remotes/origin/upstream
408 * elm_diskselector_selected_item_get().
410 * If the item @p it is unselected, the first item of diskselector will
413 * Selected items will be visible on center position of diskselector.
414 * So if it was on another position before selected, or was invisible,
415 * diskselector will animate items until the selected item reaches center
418 * @see elm_diskselector_item_selected_get()
419 * @see elm_diskselector_selected_item_get()
421 * @ingroup Diskselector
423 EAPI void elm_diskselector_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
426 * Get whether the @p item is selected or not.
428 * @param it The diskselector item.
429 * @return @c EINA_TRUE means item is selected. @c EINA_FALSE indicates
430 * it's not. If @p obj is @c NULL, @c EINA_FALSE is returned.
432 * @see elm_diskselector_selected_item_set() for details.
433 * @see elm_diskselector_item_selected_get()
435 * @ingroup Diskselector
437 EAPI Eina_Bool elm_diskselector_item_selected_get(const Elm_Object_Item *it);
440 * Get the first item of the diskselector.
442 * @param obj The diskselector object.
443 * @return The first item, or @c NULL if none.
445 * The list of items follows append order. So it will return the first
446 * item appended to the widget that wasn't deleted.
448 * @see elm_diskselector_item_append()
449 * @see elm_diskselector_items_get()
451 * @ingroup Diskselector
453 EAPI Elm_Object_Item *elm_diskselector_first_item_get(const Evas_Object *obj);
456 * Get the last item of the diskselector.
458 * @param obj The diskselector object.
459 * @return The last item, or @c NULL if none.
461 * The list of items follows append order. So it will return last first
462 * item appended to the widget that wasn't deleted.
464 * @see elm_diskselector_item_append()
465 * @see elm_diskselector_items_get()
467 * @ingroup Diskselector
469 EAPI Elm_Object_Item *elm_diskselector_last_item_get(const Evas_Object *obj);
472 * Get the item before @p item in diskselector.
474 * @param it The diskselector item.
475 * @return The item before @p item, or @c NULL if none or on failure.
477 * The list of items follows append order. So it will return item appended
478 * just before @p item and that wasn't deleted.
480 * If it is the first item, @c NULL will be returned.
481 * First item can be get by elm_diskselector_first_item_get().
483 * @see elm_diskselector_item_append()
484 * @see elm_diskselector_items_get()
486 * @ingroup Diskselector
488 EAPI Elm_Object_Item *elm_diskselector_item_prev_get(const Elm_Object_Item *it);
491 * Get the item after @p item in diskselector.
493 * @param it The diskselector item.
494 * @return The item after @p item, or @c NULL if none or on failure.
496 * The list of items follows append order. So it will return item appended
497 * just after @p item and that wasn't deleted.
499 * If it is the last item, @c NULL will be returned.
500 * Last item can be get by elm_diskselector_last_item_get().
502 * @see elm_diskselector_item_append()
503 * @see elm_diskselector_items_get()
505 * @ingroup Diskselector
507 EAPI Elm_Object_Item *elm_diskselector_item_next_get(const Elm_Object_Item *it);
512 * Set the cursor to be shown when mouse is over the diskselector item
514 * @param it Target item
515 * @param cursor the cursor name to be used.
517 * @see elm_object_cursor_set() for more details.
519 * @ingroup Diskselector
521 EAPI void elm_diskselector_item_cursor_set(Elm_Object_Item *it, const char *cursor);
524 * Get the cursor to be shown when mouse is over the diskselector item
526 * @param it diskselector item with cursor already set.
527 * @return the cursor name.
529 * @see elm_object_cursor_get() for more details.
530 * @see elm_diskselector_cursor_set()
532 * @ingroup Diskselector
534 EAPI const char *elm_diskselector_item_cursor_get(const Elm_Object_Item *it);
537 * Unset the cursor to be shown when mouse is over the diskselector item
539 * @param it Target item
541 * @see elm_object_cursor_unset() for more details.
542 * @see elm_diskselector_cursor_set()
544 * @ingroup Diskselector
546 EAPI void elm_diskselector_item_cursor_unset(Elm_Object_Item *it);
549 * Sets a different style for this item cursor.
551 * @note before you set a style you should define a cursor with
552 * elm_diskselector_item_cursor_set()
554 * @param it diskselector item with cursor already set.
555 * @param style the theme style to use (default, transparent, ...)
557 * @see elm_object_cursor_style_set() for more details.
559 * @ingroup Diskselector
561 EAPI void elm_diskselector_item_cursor_style_set(Elm_Object_Item *it, const char *style);
564 * Get the style for this item cursor.
566 * @param it diskselector item with cursor already set.
567 * @return style the theme style in use, defaults to "default". If the
568 * object does not have a cursor set, then @c NULL is returned.
570 * @see elm_object_cursor_style_get() for more details.
571 * @see elm_diskselector_item_cursor_style_set()
573 * @ingroup Diskselector
575 EAPI const char *elm_diskselector_item_cursor_style_get(const Elm_Object_Item *it);
579 * Set if the cursor set should be searched on the theme or should use
580 * the provided by the engine, only.
582 * @note before you set if should look on theme you should define a cursor
583 * with elm_diskselector_item_cursor_set().
584 * By default it will only look for cursors provided by the engine.
586 * @param it widget item with cursor already set.
587 * @param engine_only boolean to define if cursors set with
588 * elm_diskselector_item_cursor_set() should be searched only
589 * between cursors provided by the engine or searched on widget's
592 * @see elm_object_cursor_engine_only_set() for more details.
594 * @ingroup Diskselector
596 EAPI void elm_diskselector_item_cursor_engine_only_set(Elm_Object_Item *it, Eina_Bool engine_only);
599 * Get the cursor engine only usage for this item cursor.
601 * @param it widget item with cursor already set.
602 * @return engine_only boolean to define it cursors should be looked only
603 * between the provided by the engine or searched on widget's theme as well.
604 * If the item does not have a cursor set, then @c EINA_FALSE is returned.
606 * @see elm_object_cursor_engine_only_get() for more details.
607 * @see elm_diskselector_item_cursor_engine_only_set()
609 * @ingroup Diskselector
611 EAPI Eina_Bool elm_diskselector_item_cursor_engine_only_get(const Elm_Object_Item *it);
614 >>>>>>> remotes/origin/upstream