2 * @defgroup Genlist Genlist
5 * @image html genlist_inheritance_tree.png
6 * @image latex genlist_inheritance_tree.eps
8 * @image html img/widget/genlist/preview-00.png
9 * @image latex img/widget/genlist/preview-00.eps
10 * @image html img/genlist.png
11 * @image latex img/genlist.eps
13 * This widget aims to have more expansive list than the simple list in
14 * Elementary that could have more flexible items and allow many more entries
15 * while still being fast and low on memory usage. At the same time it was
16 * also made to be able to do tree structures. But the price to pay is more
17 * complexity when it comes to usage. If all you want is a simple list with
18 * icons and a single text, use the normal @ref List object.
20 * Genlist has a fairly large API, mostly because it's relatively complex,
21 * trying to be both expansive, powerful and efficient. First we will begin
22 * an overview on the theory behind genlist.
24 * This widget inherits from the @ref Layout one, so that all the
25 * functions acting on it also work for genlist objects.
27 * This widget implements the @b @ref elm-scrollable-interface
28 * interface, so that all (non-deprecated) functions for the base @ref
29 * Scroller widget also work for genlists.
31 * Some calls on the genlist's API are marked as @b deprecated, as
32 * they just wrap the scrollable widgets counterpart functions. Use
33 * the ones we point you to, for each case of deprecation here,
34 * instead -- eventually the deprecated ones will be discarded (next
37 * @section Genlist_Item_Class Genlist item classes - creating items
39 * In order to have the ability to add and delete items on the fly, genlist
40 * implements a class (callback) system where the application provides a
41 * structure with information about that type of item (genlist may contain
42 * multiple different items with different classes, states and styles).
43 * Genlist will call the functions in this struct (methods) when an item is
44 * "realized" (i.e., created dynamically, while the user is scrolling the
45 * list). All objects will simply be deleted when no longer needed with
46 * evas_object_del(). The #Elm_Genlist_Item_Class structure contains the
48 * - @c item_style - This is a constant string and simply defines the name
49 * of the item style. It @b must be specified and the default should be @c
51 * - @c decorate_item_style - This is a constant string and simply defines the name
52 * of the decorate mode item style. It is used to specify decorate mode item style. It can be
53 * used when you call elm_genlist_item_decorate_mode_set().
54 * - @c decorate_all_item_style - This is a constant string and simply defines the name
55 * of the decorate all item style. It is used to specify decorate all item style. It can be
56 * used to set selection, checking and deletion mode. This is used when you
57 * call elm_genlist_decorate_mode_set().
58 * - @c func - A struct with pointers to functions that will be called when
59 * an item is going to be actually created. All of them receive a @c data
60 * parameter that will point to the same data passed to
61 * elm_genlist_item_append() and related item creation functions, and an @c
62 * obj parameter that points to the genlist object itself.
64 * The function pointers inside @c func are @c text_get, @c content_get, @c
65 * state_get and @c del. The 3 first functions also receive a @c part
66 * parameter described below. A brief description of these functions follows:
68 * - @c text_get - The @c part parameter is the name string of one of the
69 * existing text parts in the Edje group implementing the item's theme.
70 * This function @b must return a strdup'()ed string, as the caller will
71 * free() it when done. See #Elm_Genlist_Item_Text_Get_Cb.
72 * - @c content_get - The @c part parameter is the name string of one of the
73 * existing (content) swallow parts in the Edje group implementing the item's
74 * theme. It must return @c NULL, when no content is desired, or a valid
75 * object handle, otherwise. The object will be deleted by the genlist on
76 * its deletion or when the item is "unrealized".
77 * See #Elm_Genlist_Item_Content_Get_Cb.
78 * - @c func.state_get - The @c part parameter is the name string of one of
79 * the state parts in the Edje group implementing the item's theme. Return
80 * @c EINA_FALSE for false/off or @c EINA_TRUE for true/on. Genlists will
81 * emit a signal to its theming Edje object with @c "elm,state,xxx,active"
82 * and @c "elm" as "emission" and "source" arguments, respectively, when
83 * the state is true (the default is false), where @c xxx is the name of
84 * the (state) part. See #Elm_Genlist_Item_State_Get_Cb.
85 * - @c func.del - This is intended for use when genlist items are deleted,
86 * so any data attached to the item (e.g. its data parameter on creation)
87 * can be deleted. See #Elm_Genlist_Item_Del_Cb.
89 * available item styles:
91 * - default_style - The text part is a textblock
93 * @image html img/widget/genlist/preview-04.png
94 * @image latex img/widget/genlist/preview-04.eps
98 * @image html img/widget/genlist/preview-01.png
99 * @image latex img/widget/genlist/preview-01.eps
101 * - icon_top_text_bottom
103 * @image html img/widget/genlist/preview-02.png
104 * @image latex img/widget/genlist/preview-02.eps
108 * @image html img/widget/genlist/preview-03.png
109 * @image latex img/widget/genlist/preview-03.eps
111 * - one_icon - Only 1 icon (left) @since 1.7
112 * - end_icon - Only 1 icon (at end/right) @since 1.7
113 * - no_icon - No icon (at end/right) @since 1.7
115 * @section Genlist_Items Structure of items
117 * An item in a genlist can have 0 or more texts (they can be regular
118 * text or textblock Evas objects - that's up to the style to determine), 0
119 * or more contents (which are simply objects swallowed into the genlist item's
120 * theming Edje object) and 0 or more <b>boolean states</b>, which have the
121 * behavior left to the user to define. The Edje part names for each of
122 * these properties will be looked up, in the theme file for the genlist,
123 * under the Edje (string) data items named @c "labels", @c "contents" and @c
124 * "states", respectively. For each of those properties, if more than one
125 * part is provided, they must have names listed separated by spaces in the
126 * data fields. For the default genlist item theme, we have @b one text
127 * part (@c "elm.text"), @b two content parts (@c "elm.swalllow.icon" and @c
128 * "elm.swallow.end") and @b no state parts.
130 * A genlist item may be at one of several styles. Elementary provides one
131 * by default - "default", but this can be extended by system or application
132 * custom themes/overlays/extensions (see @ref Theme "themes" for more
135 * @section Genlist_Manipulation Editing and Navigating
137 * Items can be added by several calls. All of them return a @ref
138 * Elm_Object_Item handle that is an internal member inside the genlist.
139 * They all take a data parameter that is meant to be used for a handle to
140 * the applications internal data (eg. the struct with the original item
141 * data). The parent parameter is the parent genlist item this belongs to if
142 * it is a tree or an indexed group, and NULL if there is no parent. The
143 * flags can be a bitmask of #ELM_GENLIST_ITEM_NONE, #ELM_GENLIST_ITEM_TREE
144 * and #ELM_GENLIST_ITEM_GROUP. If #ELM_GENLIST_ITEM_TREE is set then this
145 * item is displayed as an item that is able to expand and have child items.
146 * If #ELM_GENLIST_ITEM_GROUP is set then this item is group index item that
147 * is displayed at the top until the next group comes. The func parameter is
148 * a convenience callback that is called when the item is selected and the
149 * data parameter will be the func_data parameter, @c obj be the genlist
150 * object and event_info will be the genlist item.
152 * elm_genlist_item_append() adds an item to the end of the list, or if
153 * there is a parent, to the end of all the child items of the parent.
154 * elm_genlist_item_prepend() is the same but adds to the beginning of
155 * the list or children list. elm_genlist_item_insert_before() inserts at
156 * item before another item and elm_genlist_item_insert_after() inserts after
157 * the indicated item.
159 * The application can clear the list with elm_genlist_clear() which deletes
160 * all the items in the list and elm_object_item_del() will delete a specific
161 * item. elm_genlist_item_subitems_clear() will clear all items that are
162 * children of the indicated parent item.
164 * To help inspect list items you can jump to the item at the top of the list
165 * with elm_genlist_first_item_get() which will return the item pointer, and
166 * similarly elm_genlist_last_item_get() gets the item at the end of the list.
167 * elm_genlist_item_next_get() and elm_genlist_item_prev_get() get the next
168 * and previous items respectively relative to the indicated item. Using
169 * these calls you can walk the entire item list/tree. Note that as a tree
170 * the items are flattened in the list, so elm_genlist_item_parent_get() will
171 * let you know which item is the parent (and thus know how to skip them if
174 * @section Genlist_Multi_Selection Multi-selection
176 * If the application wants multiple items to be able to be selected,
177 * elm_genlist_multi_select_set() can enable this. If the list is
178 * single-selection only (the default), then elm_genlist_selected_item_get()
179 * will return the selected item, if any, or NULL if none is selected. If the
180 * list is multi-select then elm_genlist_selected_items_get() will return a
181 * list (that is only valid as long as no items are modified (added, deleted,
182 * selected or unselected)).
184 * @section Genlist_Usage_Hints Usage hints
186 * There are also convenience functions. elm_object_item_widget_get() will
187 * return the genlist object the item belongs to. elm_genlist_item_show()
188 * will make the scroller scroll to show that specific item so its visible.
189 * elm_object_item_data_get() returns the data pointer set by the item
190 * creation functions.
192 * If an item changes (state of boolean changes, text or contents change),
193 * then use elm_genlist_item_update() to have genlist update the item with
194 * the new state. Genlist will re-realize the item and thus call the functions
195 * in the _Elm_Genlist_Item_Class for that item.
197 * To programmatically (un)select an item use elm_genlist_item_selected_set().
198 * To get its selected state use elm_genlist_item_selected_get(). Similarly
199 * to expand/contract an item and get its expanded state, use
200 * elm_genlist_item_expanded_set() and elm_genlist_item_expanded_get(). And
201 * again to make an item disabled (unable to be selected and appear
202 * differently) use elm_object_item_disabled_set() to set this and
203 * elm_object_item_disabled_get() to get the disabled state.
205 * In general to indicate how the genlist should expand items horizontally to
206 * fill the list area, use elm_genlist_mode_set(). Valid modes are
207 * ELM_LIST_LIMIT, ELM_LIST_COMPRESS and ELM_LIST_SCROLL. The default is
208 * ELM_LIST_SCROLL. This mode means that if items are too wide to fit, the
209 * scroller will scroll horizontally. Otherwise items are expanded to
210 * fill the width of the viewport of the scroller. If it is
211 * ELM_LIST_LIMIT, items will be expanded to the viewport width
212 * if larger than the item, but genlist widget witdh is
213 * limited to the largest item. Do not use ELM_LIST_LIMIT mode with homogenous
214 * mode turned on. ELM_LIST_COMPRESS can be combined with a different style
215 * that uses edjes' ellipsis feature (cutting text off like this: "tex...").
217 * Items will call their selection func and callback only once when first becoming
218 * selected. Any further clicks will do nothing, unless you enable always
219 * select with elm_genlist_select_mode_set() as ELM_OBJECT_SELECT_MODE_ALWAYS.
220 * This means even if selected, every click will make the selected callbacks
221 * be called. elm_genlist_select_mode_set() as ELM_OBJECT_SELECT_MODE_NONE will
222 * turn off the ability to select items entirely and they will neither
223 * appear selected nor call selected callback functions.
225 * Remember that you can create new styles and add your own theme augmentation
226 * per application with elm_theme_extension_add(). If you absolutely must
227 * have a specific style that overrides any theme the user or system sets up
228 * you can use elm_theme_overlay_add() to add such a file.
230 * @section Genlist_Implementation Implementation
232 * Evas tracks every object you create. Every time it processes an event
233 * (mouse move, down, up etc.) it needs to walk through objects and find out
234 * what event that affects. Even worse every time it renders display updates,
235 * in order to just calculate what to re-draw, it needs to walk through many
236 * many many objects. Thus, the more objects you keep active, the more
237 * overhead Evas has in just doing its work. It is advisable to keep your
238 * active objects to the minimum working set you need. Also remember that
239 * object creation and deletion carries an overhead, so there is a
240 * middle-ground, which is not easily determined. But don't keep massive lists
241 * of objects you can't see or use. Genlist does this with list objects. It
242 * creates and destroys them dynamically as you scroll around. It groups them
243 * into blocks so it can determine the visibility etc. of a whole block at
244 * once as opposed to having to walk the whole list. This 2-level list allows
245 * for very large numbers of items to be in the list (tests have used up to
246 * 2,000,000 items). Also genlist employs a queue for adding items. As items
247 * may be different sizes, every item added needs to be calculated as to its
248 * size and thus this presents a lot of overhead on populating the list, this
249 * genlist employs a queue. Any item added is queued and spooled off over
250 * time, actually appearing some time later, so if your list has many members
251 * you may find it takes a while for them to all appear, with your process
252 * consuming a lot of CPU while it is busy spooling.
254 * Genlist also implements a tree structure for items, but it does so with
255 * callbacks to the application, with the application filling in tree
256 * structures when requested (allowing for efficient building of a very
257 * deep tree that could even be used for file-management).
258 * See the above smart signal callbacks for details.
260 * @section Genlist_Smart_Events Genlist smart events
262 * This widget emits the following signals, besides the ones sent from
264 * - @c "activated" - The user has double-clicked or pressed
265 * (enter|return|spacebar) on an item. The @c event_info parameter is the
266 * item that was activated.
267 * - @c "clicked,double" - The user has double-clicked an item. The @c
268 * event_info parameter is the item that was double-clicked.
269 * - @c "selected" - This is called when a user has made an item selected.
270 * The event_info parameter is the genlist item that was selected.
271 * - @c "unselected" - This is called when a user has made an item
272 * unselected. The event_info parameter is the genlist item that was
274 * - @c "expanded" - This is called when elm_genlist_item_expanded_set() is
275 * called and the item is now meant to be expanded. The event_info
276 * parameter is the genlist item that was indicated to expand. It is the
277 * job of this callback to then fill in the child items.
278 * - @c "contracted" - This is called when elm_genlist_item_expanded_set() is
279 * called and the item is now meant to be contracted. The event_info
280 * parameter is the genlist item that was indicated to contract. It is the
281 * job of this callback to then delete the child items.
282 * - @c "expand,request" - This is called when a user has indicated they want
283 * to expand a tree branch item. The callback should decide if the item can
284 * expand (has any children) and then call elm_genlist_item_expanded_set()
285 * appropriately to set the state. The event_info parameter is the genlist
286 * item that was indicated to expand.
287 * - @c "contract,request" - This is called when a user has indicated they
288 * want to contract a tree branch item. The callback should decide if the
289 * item can contract (has any children) and then call
290 * elm_genlist_item_expanded_set() appropriately to set the state. The
291 * event_info parameter is the genlist item that was indicated to contract.
292 * - @c "realized" - This is called when the item in the list is created as a
293 * real evas object. event_info parameter is the genlist item that was
295 * - @c "unrealized" - This is called just before an item is unrealized.
296 * After this call content objects provided will be deleted and the item
297 * object itself delete or be put into a floating cache.
298 * - @c "drag,start,up" - This is called when the item in the list has been
299 * dragged (not scrolled) up.
300 * - @c "drag,start,down" - This is called when the item in the list has been
301 * dragged (not scrolled) down.
302 * - @c "drag,start,left" - This is called when the item in the list has been
303 * dragged (not scrolled) left.
304 * - @c "drag,start,right" - This is called when the item in the list has
305 * been dragged (not scrolled) right.
306 * - @c "drag,stop" - This is called when the item in the list has stopped
308 * - @c "drag" - This is called when the item in the list is being dragged.
309 * - @c "longpressed" - This is called when the item is pressed for a certain
310 * amount of time. By default it's 1 second. The event_info parameter is the
311 * longpressed genlist item.
312 * - @c "scroll,anim,start" - This is called when scrolling animation has
314 * - @c "scroll,anim,stop" - This is called when scrolling animation has
316 * - @c "scroll,drag,start" - This is called when dragging the content has
318 * - @c "scroll,drag,stop" - This is called when dragging the content has
320 * - @c "edge,top" - This is called when the genlist is scrolled until
322 * - @c "edge,bottom" - This is called when the genlist is scrolled
323 * until the bottom edge.
324 * - @c "edge,left" - This is called when the genlist is scrolled
325 * until the left edge.
326 * - @c "edge,right" - This is called when the genlist is scrolled
327 * until the right edge.
328 * - @c "multi,swipe,left" - This is called when the genlist is multi-touch
330 * - @c "multi,swipe,right" - This is called when the genlist is multi-touch
332 * - @c "multi,swipe,up" - This is called when the genlist is multi-touch
334 * - @c "multi,swipe,down" - This is called when the genlist is multi-touch
336 * - @c "multi,pinch,out" - This is called when the genlist is multi-touch
338 * - @c multi,pinch,in" - This is called when the genlist is multi-touch
340 * - @c "swipe" - This is called when the genlist is swiped.
341 * - @c "moved" - This is called when a genlist item is moved in reorder mode.
342 * - @c "moved,after" - This is called when a genlist item is moved after
343 * another item in reorder mode. The event_info parameter is the reordered
344 * item. To get the relative previous item, use elm_genlist_item_prev_get().
345 * This signal is called along with "moved" signal.
346 * - @c "moved,before" - This is called when a genlist item is moved before
347 * another item in reorder mode. The event_info parameter is the reordered
348 * item. To get the relative previous item, use elm_genlist_item_next_get().
349 * This signal is called along with "moved" signal.
350 * - @c "language,changed" - This is called when the program's language is
351 * changed. Call the elm_genlist_realized_items_update() if items text should
353 * - @c "tree,effect,finished" - This is called when a genlist tree effect is finished.
354 * - @c "highlighted" - an item in the list is pressed and highlighted.
355 * The %c event_info parameter is the item that was highlighted.
356 * - @c "unhighlighted" - an item in the list is unpressed and unhighlighted.
357 * The %c event_info parameter is the item that was unhighlighted.
360 * Supported elm_object_item common APIs
361 * @li @ref elm_object_item_part_content_get()
362 * @li @ref elm_object_item_part_text_get()
363 * @li @ref elm_object_item_disabled_set()
364 * @li @ref elm_object_item_disabled_get()
365 * @li @ref elm_object_item_signal_emit()
367 * Unsupported elm_object_item common APIs due to the genlist concept.
368 * Genlist fills content/text according to the appropriate callback functions.
369 * Please use elm_genlist_item_update() or elm_genlist_item_fields_update()
371 * @li @ref elm_object_item_part_content_set()
372 * @li @ref elm_object_item_part_content_unset()
373 * @li @ref elm_object_item_part_text_set()
375 * @section Genlist_Examples Examples
377 * Here is a list of examples that use the genlist, trying to show some of
379 * - @ref genlist_example_01
380 * - @ref genlist_example_02
381 * - @ref genlist_example_03
382 * - @ref genlist_example_04
383 * - @ref genlist_example_05
387 * @addtogroup Genlist
391 #define ELM_GENLIST_ITEM_CLASS_VERSION ELM_GEN_ITEM_CLASS_VERSION
392 #define ELM_GENLIST_ITEM_CLASS_HEADER ELM_GEN_ITEM_CLASS_HEADER
395 * Defines if the item is of any special type (has subitems or it's the
396 * index of a group), or is just a simple item.
402 ELM_GENLIST_ITEM_NONE = 0, /**< simple item */
403 ELM_GENLIST_ITEM_TREE = (1 << 0), /**< this may be expanded and have child items. */
404 ELM_GENLIST_ITEM_GROUP = (1 << 1), /**< an index item of a group of items. this item can have child items. */
406 ELM_GENLIST_ITEM_MAX = (1 << 2)
407 } Elm_Genlist_Item_Type;
410 * Defines the type of the item part
411 * Used while updating item's parts
412 * It can be used at updating multi fields.
418 ELM_GENLIST_ITEM_FIELD_ALL = 0,
419 ELM_GENLIST_ITEM_FIELD_TEXT = (1 << 0),
420 ELM_GENLIST_ITEM_FIELD_CONTENT = (1 << 1),
421 ELM_GENLIST_ITEM_FIELD_STATE = (1 << 2)
422 } Elm_Genlist_Item_Field_Type;
425 * Defines where to position the item in the genlist.
431 ELM_GENLIST_ITEM_SCROLLTO_NONE = 0, /**< no scrollto */
432 ELM_GENLIST_ITEM_SCROLLTO_IN = (1 << 0), /**< to the nearest viewport */
433 ELM_GENLIST_ITEM_SCROLLTO_TOP = (1 << 1), /**< to the top of viewport */
434 ELM_GENLIST_ITEM_SCROLLTO_MIDDLE = (1 << 2) /**< to the middle of viewport */
435 } Elm_Genlist_Item_Scrollto_Type;
438 * @see Elm_Gen_Item_Class
440 typedef Elm_Gen_Item_Class Elm_Genlist_Item_Class;
443 * @see Elm_Gen_Item_Text_Get_Cb
445 typedef Elm_Gen_Item_Text_Get_Cb Elm_Genlist_Item_Text_Get_Cb;
448 * @see Elm_Gen_Item_Content_Get_Cb
450 typedef Elm_Gen_Item_Content_Get_Cb Elm_Genlist_Item_Content_Get_Cb;
453 * @see Elm_Gen_Item_State_Get_Cb
455 typedef Elm_Gen_Item_State_Get_Cb Elm_Genlist_Item_State_Get_Cb;
458 * @see Elm_Gen_Item_Del_Cb
460 typedef Elm_Gen_Item_Del_Cb Elm_Genlist_Item_Del_Cb;
463 * Add a new genlist widget to the given parent Elementary
466 * @param parent The parent object
467 * @return a new genlist widget handle or @c NULL, on errors
469 * This function inserts a new genlist widget on the canvas.
471 * @see elm_genlist_item_append()
472 * @see elm_object_item_del()
473 * @see elm_genlist_clear()
477 EAPI Evas_Object *elm_genlist_add(Evas_Object *parent);
480 * Remove all items from a given genlist widget.
482 * @param obj The genlist object
484 * This removes (and deletes) all items in @p obj, leaving it empty.
486 * @see elm_object_item_del(), to remove just one item.
490 EAPI void elm_genlist_clear(Evas_Object *obj);
493 * Enable or disable multi-selection in the genlist
495 * @param obj The genlist object
496 * @param multi Multi-select enable/disable. Default is disabled.
498 * This enables (@c EINA_TRUE) or disables (@c EINA_FALSE) multi-selection in
499 * the list. This allows more than 1 item to be selected. To retrieve the list
500 * of selected items, use elm_genlist_selected_items_get().
502 * @see elm_genlist_selected_items_get()
503 * @see elm_genlist_multi_select_get()
507 EAPI void elm_genlist_multi_select_set(Evas_Object *obj, Eina_Bool multi);
510 * Gets if multi-selection in genlist is enabled or disabled.
512 * @param obj The genlist object
513 * @return Multi-select enabled/disabled
514 * (@c EINA_TRUE = enabled/@c EINA_FALSE = disabled). Default is @c EINA_FALSE.
516 * @see elm_genlist_multi_select_set()
520 EAPI Eina_Bool elm_genlist_multi_select_get(const Evas_Object *obj);
523 * This sets the horizontal stretching mode.
525 * @param obj The genlist object
526 * @param mode The mode to use (one of #ELM_LIST_SCROLL or #ELM_LIST_LIMIT).
528 * This sets the mode used for sizing items horizontally. Valid modes
529 * are #ELM_LIST_LIMIT, #ELM_LIST_SCROLL, and #ELM_LIST_COMPRESS. The default is
530 * ELM_LIST_SCROLL. This mode means that if items are too wide to fit,
531 * the scroller will scroll horizontally. Otherwise items are expanded
532 * to fill the width of the viewport of the scroller. If it is
533 * ELM_LIST_LIMIT, items will be expanded to the viewport width and
534 * limited to that size. If it is ELM_LIST_COMPRESS, the item width will be
535 * fixed (restricted to a minimum of) to the list width when calculating its
536 * size in order to allow the height to be calculated based on it. This allows,
537 * for instance, text block to wrap lines if the Edje part is configured with
539 * @note ELM_LIST_COMPRESS will make list resize slower as it will have to
540 * recalculate every item height again whenever the list width
542 * @note Homogeneous mode is for that all items in the genlist same
543 * width/height. With ELM_LIST_COMPRESS, it makes genlist items to fast
544 * initializing. However there's no sub-objects in genlist which can be
545 * on the flying resizable (such as TEXTBLOCK). If then, some dynamic
546 * resizable objects in genlist would not diplayed properly.
548 * @see elm_genlist_mode_get()
552 EAPI void elm_genlist_mode_set(Evas_Object *obj, Elm_List_Mode mode);
555 * Gets the horizontal stretching mode.
557 * @param obj The genlist object
558 * @return The mode to use
559 * (#ELM_LIST_LIMIT, #ELM_LIST_SCROLL)
561 * @see elm_genlist_mode_set()
565 EAPI Elm_List_Mode elm_genlist_mode_get(const Evas_Object *obj);
568 * Enable/disable horizontal and vertical bouncing effect.
570 * @param obj The genlist object
571 * @param h_bounce Allow bounce horizontally (@c EINA_TRUE = on, @c
572 * EINA_FALSE = off). Default is @c EINA_FALSE.
573 * @param v_bounce Allow bounce vertically (@c EINA_TRUE = on, @c
574 * EINA_FALSE = off). Default is @c EINA_TRUE.
576 * This will enable or disable the scroller bouncing effect for the
577 * genlist. See elm_scroller_bounce_set() for details.
579 * @deprecated Use elm_scroller_bounce_set() instead.
581 * @see elm_scroller_bounce_set()
582 * @see elm_genlist_bounce_get()
586 EINA_DEPRECATED EAPI void elm_genlist_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce);
589 * Get whether the horizontal and vertical bouncing effect is enabled.
591 * @param obj The genlist object
592 * @param h_bounce Pointer to a bool to receive if the bounce horizontally
594 * @param v_bounce Pointer to a bool to receive if the bounce vertically
597 * @deprecated Use elm_scroller_bounce_get() instead.
599 * @see elm_scroller_bounce_get()
600 * @see elm_genlist_bounce_set()
604 EINA_DEPRECATED EAPI void elm_genlist_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce);
607 * Append a new item in a given genlist widget.
609 * @param obj The genlist object
610 * @param itc The item class for the item
611 * @param data The item data
612 * @param parent The parent item, or NULL if none
613 * @param type Item type
614 * @param func Convenience function called when the item is selected
615 * @param func_data Data passed to @p func above.
616 * @return A handle to the item added or @c NULL if not possible
618 * This adds the given item to the end of the list or the end of
619 * the children list if the @p parent is given.
621 * @see elm_genlist_item_prepend()
622 * @see elm_genlist_item_insert_before()
623 * @see elm_genlist_item_insert_after()
624 * @see elm_object_item_del()
628 EAPI Elm_Object_Item *elm_genlist_item_append(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data);
631 * Prepend a new item in a given genlist widget.
633 * @param obj The genlist object
634 * @param itc The item class for the item
635 * @param data The item data
636 * @param parent The parent item, or NULL if none
637 * @param type Item type
638 * @param func Convenience function called when the item is selected
639 * @param func_data Data passed to @p func above.
640 * @return A handle to the item added or NULL if not possible
642 * This adds an item to the beginning of the list or beginning of the
643 * children of the parent if given.
645 * @see elm_genlist_item_append()
646 * @see elm_genlist_item_insert_before()
647 * @see elm_genlist_item_insert_after()
648 * @see elm_object_item_del()
652 EAPI Elm_Object_Item *elm_genlist_item_prepend(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data);
655 * Insert an item before another in a genlist widget
657 * @param obj The genlist object
658 * @param itc The item class for the item
659 * @param data The item data
660 * @param parent The parent item, or NULL if none
661 * @param before The item to place this new one before.
662 * @param type Item type
663 * @param func Convenience function called when the item is selected
664 * @param func_data Data passed to @p func above.
665 * @return A handle to the item added or @c NULL if not possible
667 * This inserts an item before another in the list. It will be in the
668 * same tree level or group as the item it is inserted before.
670 * @see elm_genlist_item_append()
671 * @see elm_genlist_item_prepend()
672 * @see elm_genlist_item_insert_after()
673 * @see elm_object_item_del()
677 EAPI Elm_Object_Item *elm_genlist_item_insert_before(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Object_Item *before, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data);
680 * Insert an item after another in a genlist widget
682 * @param obj The genlist object
683 * @param itc The item class for the item
684 * @param data The item data
685 * @param parent The parent item, or NULL if none
686 * @param after The item to place this new one after.
687 * @param type Item type
688 * @param func Convenience function called when the item is selected
689 * @param func_data Data passed to @p func above.
690 * @return A handle to the item added or @c NULL if not possible
692 * This inserts an item after another in the list. It will be in the
693 * same tree level or group as the item it is inserted after.
695 * @see elm_genlist_item_append()
696 * @see elm_genlist_item_prepend()
697 * @see elm_genlist_item_insert_before()
698 * @see elm_object_item_del()
702 EAPI Elm_Object_Item *elm_genlist_item_insert_after(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Object_Item *after, Elm_Genlist_Item_Type type, Evas_Smart_Cb func, const void *func_data);
705 * Insert a new item into the sorted genlist object
707 * @param obj The genlist object
708 * @param itc The item class for the item
709 * @param data The item data
710 * @param parent The parent item, or NULL if none
711 * @param type Item type
712 * @param comp The function called for the sort
713 * @param func Convenience function called when item selected
714 * @param func_data Data passed to @p func above.
715 * @return A handle to the item added or NULL if not possible
717 * This inserts an item in the genlist based on user defined comparison
718 * function. The two arguments passed to the function @p func are genlist item
719 * handles to compare.
721 * @see elm_genlist_item_append()
722 * @see elm_genlist_item_prepend()
723 * @see elm_genlist_item_insert_after()
724 * @see elm_object_item_del()
728 EAPI Elm_Object_Item *elm_genlist_item_sorted_insert(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Type type, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data);
730 /* operations to retrieve existing items */
732 * Get the selected item in the genlist.
734 * @param obj The genlist object
735 * @return The selected item, or NULL if none is selected.
737 * This gets the selected item in the list (if multi-selection is enabled, only
738 * the item that was first selected in the list is returned - which is not very
739 * useful, so see elm_genlist_selected_items_get() for when multi-selection is
742 * If no item is selected, NULL is returned.
744 * @see elm_genlist_selected_items_get()
748 EAPI Elm_Object_Item *elm_genlist_selected_item_get(const Evas_Object *obj);
751 * Get a list of selected items in the genlist.
753 * @param obj The genlist object
754 * @return The list of selected items, or NULL if none are selected.
756 * It returns a list of the selected items. This list pointer is only valid so
757 * long as the selection doesn't change (no items are selected or unselected, or
758 * unselected implicitly by deletion). The list contains genlist items
759 * pointers. The order of the items in this list is the order which they were
760 * selected, i.e. the first item in this list is the first item that was
761 * selected, and so on.
763 * @note If not in multi-select mode, consider using function
764 * elm_genlist_selected_item_get() instead.
766 * @see elm_genlist_multi_select_set()
767 * @see elm_genlist_selected_item_get()
771 EAPI Eina_List *elm_genlist_selected_items_get(const Evas_Object *obj);
774 * Get a list of realized items in genlist
776 * @param obj The genlist object
777 * @return The list of realized items, nor NULL if none are realized.
779 * This returns a list of the realized items in the genlist. The list
780 * contains genlist item pointers. The list must be freed by the
781 * caller when done with eina_list_free(). The item pointers in the
782 * list are only valid so long as those items are not deleted or the
783 * genlist is not deleted.
785 * @see elm_genlist_realized_items_update()
789 EAPI Eina_List *elm_genlist_realized_items_get(const Evas_Object *obj);
792 * Get the first item in the genlist
794 * This returns the first item in the list.
796 * @param obj The genlist object
797 * @return The first item, or NULL if none
801 EAPI Elm_Object_Item *elm_genlist_first_item_get(const Evas_Object *obj);
804 * Get the last item in the genlist
806 * This returns the last item in the list.
808 * @return The last item, or NULL if none
812 EAPI Elm_Object_Item *elm_genlist_last_item_get(const Evas_Object *obj);
815 * Set the scrollbar policy
817 * @param obj The genlist object
818 * @param policy_h Horizontal scrollbar policy.
819 * @param policy_v Vertical scrollbar policy.
821 * This sets the scrollbar visibility policy for the given genlist
822 * scroller. #ELM_SCROLLER_POLICY_AUTO means the scrollbar is
823 * made visible if it is needed, and otherwise kept hidden. #ELM_SCROLLER_POLICY_ON
824 * turns it on all the time, and #ELM_SCROLLER_POLICY_OFF always keeps it off.
825 * This applies respectively for the horizontal and vertical scrollbars.
826 * Default is #ELM_SCROLLER_POLICY_AUTO
828 * @deprecated Use elm_scroller_policy_set() instead.
830 * @see elm_scroller_policy_set()
834 EINA_DEPRECATED EAPI void elm_genlist_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v);
837 * Get the scrollbar policy
839 * @param obj The genlist object
840 * @param policy_h Pointer to store the horizontal scrollbar policy.
841 * @param policy_v Pointer to store the vertical scrollbar policy.
843 * @deprecated Use elm_scroller_policy_get() instead.
845 * @see elm_scroller_policy_get()
849 EINA_DEPRECATED EAPI void elm_genlist_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v);
852 * Get the @b next item in a genlist widget's internal list of items,
853 * given a handle to one of those items.
855 * @param it The genlist item to fetch next from
856 * @return The item after @p item, or @c NULL if there's none (and
859 * This returns the item placed after the @p item, on the container
862 * @see elm_genlist_item_prev_get()
866 EAPI Elm_Object_Item *elm_genlist_item_next_get(const Elm_Object_Item *it);
869 * Get the @b previous item in a genlist widget's internal list of items,
870 * given a handle to one of those items.
872 * @param it The genlist item to fetch previous from
873 * @return The item before @p item, or @c NULL if there's none (and
876 * This returns the item placed before the @p item, on the container
879 * @see elm_genlist_item_next_get()
883 EAPI Elm_Object_Item *elm_genlist_item_prev_get(const Elm_Object_Item *it);
886 * Set whether a given genlist item is selected or not
889 * @param selected Use @c EINA_TRUE, to make it selected, @c
890 * EINA_FALSE to make it unselected
892 * This sets the selected state of an item. If multi selection is
893 * not enabled on the containing genlist and @p selected is @c
894 * EINA_TRUE, any other previously selected items will get
895 * unselected in favor of this new one.
897 * @see elm_genlist_item_selected_get()
901 EAPI void elm_genlist_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
904 * Get whether a given genlist item is selected or not
907 * @return @c EINA_TRUE, if it's selected, @c EINA_FALSE otherwise
909 * @see elm_genlist_item_selected_set() for more details
913 EAPI Eina_Bool elm_genlist_item_selected_get(const Elm_Object_Item *it);
916 * Show the portion of a genlist's internal list containing a given
919 * @param it The item to display
920 * @param type The position to bring in, the given item to.
921 * @ref Elm_Genlist_Item_Scrollto_Type
923 * This causes genlist to jump to the given item @p it and show it (by
924 * jumping to that position), if it is not fully visible.
926 * @see elm_genlist_item_bring_in()
930 EAPI void elm_genlist_item_show(Elm_Object_Item *it, Elm_Genlist_Item_Scrollto_Type type);
933 * Animatedly bring in, to the visible are of a genlist, a given
936 * @param it The item to display
937 * @param type The position to bring in, the given item to.
938 * @ref Elm_Genlist_Item_Scrollto_Type
940 * This causes genlist to jump to the given item @p it and show it (by
941 * animatedly scrolling), if it is not fully visible.
942 * This may use animation and take a some time to do so.
944 * @see elm_genlist_item_show()
948 EAPI void elm_genlist_item_bring_in(Elm_Object_Item *it, Elm_Genlist_Item_Scrollto_Type type);
951 * Update all the contents of an item
955 * This updates an item by calling all the item class functions again
956 * to get the contents, texts and states. Use this when the original
957 * item data has changed and the changes are desired to be reflected.
959 * Use elm_genlist_realized_items_update() to update all already realized
962 * @note This also updates internal genlist item object(edje_object as of now).
963 * So when this is called between mouse down and mouse up, mouse up event will
964 * be ignored because edje_object is deleted and created again by this API. If
965 * you want to avoid this, please use @ref elm_genlist_item_fields_update.
967 * @see elm_genlist_realized_items_update()
971 EAPI void elm_genlist_item_update(Elm_Object_Item *it);
974 * Update the item class of an item
977 * @param itc The item class for the item
979 * This sets another class of the item, changing the way that it is
980 * displayed. After changing the item class, elm_genlist_item_update() is
981 * called on the item @p it.
985 EAPI void elm_genlist_item_item_class_update(Elm_Object_Item *it, const Elm_Genlist_Item_Class *itc);
988 * Get the Genlist Item class for the given Genlist Item.
990 * @param it The genlist item
992 * This returns the Genlist_Item_Class for the given item. It can be used to
993 * examine the function pointers and item_style.
997 EAPI const Elm_Genlist_Item_Class *elm_genlist_item_item_class_get(const Elm_Object_Item *it);
1000 * Get the index of the item. It is only valid once displayed.
1002 * @param it a genlist item
1003 * @return the position inside the list of item.
1007 EAPI int elm_genlist_item_index_get(const Elm_Object_Item *it);
1010 * Update the contents of all realized items.
1012 * @param obj The genlist object.
1014 * This updates all realized items by calling all the item class functions again
1015 * to get the contents, texts and states. Use this when the original
1016 * item data has changed and the changes are desired to be reflected.
1018 * To update just one item, use elm_genlist_item_update().
1020 * @see elm_genlist_realized_items_get()
1021 * @see elm_genlist_item_update()
1025 EAPI void elm_genlist_realized_items_update(Evas_Object *obj);
1028 * Return how many items are currently in a list
1030 * @param obj The list
1031 * @return The total number of list items in the list
1033 * This behavior is O(1) and includes items which may or may not be realized.
1037 EAPI unsigned int elm_genlist_items_count(const Evas_Object *obj);
1040 * Create a new genlist item class in a given genlist widget.
1042 * @return New allocated a genlist item class.
1044 * This adds genlist item class for the genlist widget. When adding an item,
1045 * genlist_item_{append, prepend, insert} function needs item class of the item.
1046 * Given callback parameters are used at retrieving {text, content} of
1047 * added item. Set as NULL if it's not used.
1048 * If there's no available memory, return can be NULL.
1050 * @see elm_genlist_item_class_free()
1051 * @see elm_genlist_item_append()
1055 EAPI Elm_Genlist_Item_Class *elm_genlist_item_class_new(void);
1058 * Remove an item class in a given genlist widget.
1060 * @param itc The itc to be removed.
1062 * This removes item class from the genlist widget.
1063 * Whenever it has no more references to it, item class is going to be freed.
1064 * Otherwise it just decreases its reference count.
1066 * @see elm_genlist_item_class_new()
1067 * @see elm_genlist_item_class_ref()
1068 * @see elm_genlist_item_class_unref()
1072 EAPI void elm_genlist_item_class_free(Elm_Genlist_Item_Class *itc);
1075 * Increments object reference count for the item class.
1077 * @param itc The given item class object to reference
1079 * This API just increases its reference count for item class management.
1081 * @see elm_genlist_item_class_unref()
1085 EAPI void elm_genlist_item_class_ref(Elm_Genlist_Item_Class *itc);
1088 * Decrements object reference count for the item class.
1090 * @param itc The given item class object to reference
1092 * This API just decreases its reference count for item class management.
1093 * Reference count can't be less than 0.
1095 * @see elm_genlist_item_class_ref()
1096 * @see elm_genlist_item_class_free()
1100 EAPI void elm_genlist_item_class_unref(Elm_Genlist_Item_Class *itc);
1103 * Set the text to be shown in a given genlist item's tooltips.
1105 * @param it The genlist item
1106 * @param text The text to set in the content
1108 * This call will setup the text to be used as tooltip to that item
1109 * (analogous to elm_object_tooltip_text_set(), but being item
1110 * tooltips with higher precedence than object tooltips). It can
1111 * have only one tooltip at a time, so any previous tooltip data
1114 * In order to set a content or something else as a tooltip, look at
1115 * elm_genlist_item_tooltip_content_cb_set().
1119 EAPI void elm_genlist_item_tooltip_text_set(Elm_Object_Item *it, const char *text);
1122 * Set the content to be shown in a given genlist item's tooltips
1124 * @param it The genlist item.
1125 * @param func The function returning the tooltip contents.
1126 * @param data What to provide to @a func as callback data/context.
1127 * @param del_cb Called when data is not needed anymore, either when
1128 * another callback replaces @p func, the tooltip is unset with
1129 * elm_genlist_item_tooltip_unset() or the owner @p item
1130 * dies. This callback receives as its first parameter the
1131 * given @p data, being @c event_info the item handle.
1133 * This call will setup the tooltip's contents to @p item
1134 * (analogous to elm_object_tooltip_content_cb_set(), but being
1135 * item tooltips with higher precedence than object tooltips). It
1136 * can have only one tooltip at a time, so any previous tooltip
1137 * content will get removed. @p func (with @p data) will be called
1138 * every time Elementary needs to show the tooltip and it should
1139 * return a valid Evas object, which will be fully managed by the
1140 * tooltip system, getting deleted when the tooltip is gone.
1142 * In order to set just a text as a tooltip, look at
1143 * elm_genlist_item_tooltip_text_set().
1147 EAPI void elm_genlist_item_tooltip_content_cb_set(Elm_Object_Item *it, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb);
1150 * Unset a tooltip from a given genlist item
1152 * @param it genlist item to remove a previously set tooltip from.
1154 * This call removes any tooltip set on @p item. The callback
1155 * provided as @c del_cb to
1156 * elm_genlist_item_tooltip_content_cb_set() will be called to
1157 * notify it is not used anymore (and have resources cleaned, if
1160 * @see elm_genlist_item_tooltip_content_cb_set()
1164 EAPI void elm_genlist_item_tooltip_unset(Elm_Object_Item *it);
1167 * Set a different @b style for a given genlist item's tooltip.
1169 * @param it genlist item with tooltip set
1170 * @param style the <b>theme style</b> to use on tooltips (e.g. @c
1171 * "default", @c "transparent", etc)
1173 * Tooltips can have <b>alternate styles</b> to be displayed on,
1174 * which are defined by the theme set on Elementary. This function
1175 * works analogously as elm_object_tooltip_style_set(), but here
1176 * applied only to genlist item objects. The default style for
1177 * tooltips is @c "default".
1179 * @note before you set a style you should define a tooltip with
1180 * elm_genlist_item_tooltip_content_cb_set() or
1181 * elm_genlist_item_tooltip_text_set()
1183 * @see elm_genlist_item_tooltip_style_get()
1187 EAPI void elm_genlist_item_tooltip_style_set(Elm_Object_Item *it, const char *style);
1190 * Get the style set a given genlist item's tooltip.
1192 * @param it genlist item with tooltip already set on.
1193 * @return style the theme style in use, which defaults to
1194 * "default". If the object does not have a tooltip set,
1195 * then @c NULL is returned.
1197 * @see elm_genlist_item_tooltip_style_set() for more details
1201 EAPI const char *elm_genlist_item_tooltip_style_get(const Elm_Object_Item *it);
1204 * @brief Disable size restrictions on an object's tooltip
1205 * @param it The tooltip's anchor object
1206 * @param disable If EINA_TRUE, size restrictions are disabled
1207 * @return EINA_FALSE on failure, EINA_TRUE on success
1209 * This function allows a tooltip to expand beyond its parent window's canvas.
1210 * It will instead be limited only by the size of the display.
1212 EAPI Eina_Bool elm_genlist_item_tooltip_window_mode_set(Elm_Object_Item *it, Eina_Bool disable);
1215 * @brief Retrieve size restriction state of an object's tooltip
1216 * @param it The tooltip's anchor object
1217 * @return If EINA_TRUE, size restrictions are disabled
1219 * This function returns whether a tooltip is allowed to expand beyond
1220 * its parent window's canvas.
1221 * It will instead be limited only by the size of the display.
1223 EAPI Eina_Bool elm_genlist_item_tooltip_window_mode_get(const Elm_Object_Item *it);
1226 * Set the type of mouse pointer/cursor decoration to be shown,
1227 * when the mouse pointer is over the given genlist widget item
1229 * @param it genlist item to customize cursor on
1230 * @param cursor the cursor type's name
1232 * This function works analogously as elm_object_cursor_set(), but
1233 * here the cursor's changing area is restricted to the item's
1234 * area, and not the whole widget's. Note that that item cursors
1235 * have precedence over widget cursors, so that a mouse over @p
1236 * item will always show cursor @p type.
1238 * If this function is called twice for an object, a previously set
1239 * cursor will be unset on the second call.
1241 * @see elm_object_cursor_set()
1242 * @see elm_genlist_item_cursor_get()
1243 * @see elm_genlist_item_cursor_unset()
1247 EAPI void elm_genlist_item_cursor_set(Elm_Object_Item *it, const char *cursor);
1250 * Get the type of mouse pointer/cursor decoration set to be shown,
1251 * when the mouse pointer is over the given genlist widget item
1253 * @param it genlist item with custom cursor set
1254 * @return the cursor type's name or @c NULL, if no custom cursors
1255 * were set to @p item (and on errors)
1257 * @see elm_object_cursor_get()
1258 * @see elm_genlist_item_cursor_set() for more details
1259 * @see elm_genlist_item_cursor_unset()
1263 EAPI const char *elm_genlist_item_cursor_get(const Elm_Object_Item *it);
1266 * Unset any custom mouse pointer/cursor decoration set to be
1267 * shown, when the mouse pointer is over the given genlist widget
1268 * item, thus making it show the @b default cursor again.
1270 * @param it a genlist item
1272 * Use this call to undo any custom settings on this item's cursor
1273 * decoration, bringing it back to defaults (no custom style set).
1275 * @see elm_object_cursor_unset()
1276 * @see elm_genlist_item_cursor_set() for more details
1280 EAPI void elm_genlist_item_cursor_unset(Elm_Object_Item *it);
1283 * Set a different @b style for a given custom cursor set for a
1286 * @param it genlist item with custom cursor set
1287 * @param style the <b>theme style</b> to use (e.g. @c "default",
1288 * @c "transparent", etc)
1290 * This function only makes sense when one is using custom mouse
1291 * cursor decorations <b>defined in a theme file</b> , which can
1292 * have, given a cursor name/type, <b>alternate styles</b> on
1293 * it. It works analogously as elm_object_cursor_style_set(), but
1294 * here applied only to genlist item objects.
1296 * @warning Before you set a cursor style you should have defined a
1297 * custom cursor previously on the item, with
1298 * elm_genlist_item_cursor_set()
1300 * @see elm_genlist_item_cursor_engine_only_set()
1301 * @see elm_genlist_item_cursor_style_get()
1305 EAPI void elm_genlist_item_cursor_style_set(Elm_Object_Item *it, const char *style);
1308 * Get the current @b style set for a given genlist item's custom
1311 * @param it genlist item with custom cursor set.
1312 * @return style the cursor style in use. If the object does not
1313 * have a cursor set, then @c NULL is returned.
1315 * @see elm_genlist_item_cursor_style_set() for more details
1319 EAPI const char *elm_genlist_item_cursor_style_get(const Elm_Object_Item *it);
1322 * Set if the (custom) cursor for a given genlist item should be
1323 * searched in its theme, also, or should only rely on the
1326 * @param it item with custom (custom) cursor already set on
1327 * @param engine_only Use @c EINA_TRUE to have cursors looked for
1328 * only on those provided by the rendering engine, @c EINA_FALSE to
1329 * have them searched on the widget's theme, as well.
1331 * @note This call is of use only if you've set a custom cursor
1332 * for genlist items, with elm_genlist_item_cursor_set().
1334 * @note By default, cursors will only be looked for between those
1335 * provided by the rendering engine.
1339 EAPI void elm_genlist_item_cursor_engine_only_set(Elm_Object_Item *it, Eina_Bool engine_only);
1342 * Get if the (custom) cursor for a given genlist item is being
1343 * searched in its theme, also, or is only relying on the rendering
1346 * @param it a genlist item
1347 * @return @c EINA_TRUE, if cursors are being looked for only on
1348 * those provided by the rendering engine, @c EINA_FALSE if they
1349 * are being searched on the widget's theme, as well.
1351 * @see elm_genlist_item_cursor_engine_only_set(), for more details
1355 EAPI Eina_Bool elm_genlist_item_cursor_engine_only_get(const Elm_Object_Item *it);
1358 * Enable/disable homogeneous mode.
1360 * @param obj The genlist object
1361 * @param homogeneous Assume the items within the genlist are of the
1362 * same height and width (EINA_TRUE = on, EINA_FALSE = off). Default is @c
1365 * This will enable the homogeneous mode where items are of the same
1366 * height and width so that genlist may do the lazy-loading at its
1367 * maximum (which increases the performance for scrolling the list).
1368 * In the normal mode, genlist will pre-calculate all the items' sizes even
1369 * though they are not in use. So items' callbacks are called many times than
1370 * expected. But homogeneous mode will skip the item size pre-calculation
1371 * process so items' callbacks are called only when the item is needed.
1373 * @note This also works well with group index.
1375 * @see elm_genlist_mode_set()
1376 * @see elm_genlist_homogeneous_get()
1380 EAPI void elm_genlist_homogeneous_set(Evas_Object *obj, Eina_Bool homogeneous);
1383 * Get whether the homogeneous mode is enabled.
1385 * @param obj The genlist object
1386 * @return Assume the items within the genlist are of the same height
1387 * and width (EINA_TRUE = on, EINA_FALSE = off)
1389 * @see elm_genlist_homogeneous_set()
1393 EAPI Eina_Bool elm_genlist_homogeneous_get(const Evas_Object *obj);
1396 * Set the maximum number of items within an item block
1398 * @param obj The genlist object
1399 * @param count Maximum number of items within an item block. Default is 32.
1401 * This will configure the block count to tune to the target with particular
1402 * performance matrix.
1404 * A block of objects will be used to reduce the number of operations due to
1405 * many objects in the screen. It can determine the visibility, or if the
1406 * object has changed, it theme needs to be updated, etc. doing this kind of
1407 * calculation to the entire block, instead of per object.
1409 * The default value for the block count is enough for most lists, so unless
1410 * you know you will have a lot of objects visible in the screen at the same
1411 * time, don't try to change this.
1413 * @see elm_genlist_block_count_get()
1414 * @see @ref Genlist_Implementation
1418 EAPI void elm_genlist_block_count_set(Evas_Object *obj, int count);
1421 * Get the maximum number of items within an item block
1423 * @param obj The genlist object
1424 * @return Maximum number of items within an item block
1426 * @see elm_genlist_block_count_set()
1430 EAPI int elm_genlist_block_count_get(const Evas_Object *obj);
1433 * Set the timeout in seconds for the longpress event.
1435 * @param obj The genlist object
1436 * @param timeout timeout in seconds. Default is elm config value(1.0)
1438 * This option will change how long it takes to send an event "longpressed"
1439 * after the mouse down signal is sent to the list. If this event occurs, no
1440 * "clicked" event will be sent.
1442 * @warning If you set the longpress timeout value with this API, your genlist
1443 * will not be affected by the longpress value of elementary config value
1446 * @see elm_genlist_longpress_timeout_set()
1450 EAPI void elm_genlist_longpress_timeout_set(Evas_Object *obj, double timeout);
1453 * Get the timeout in seconds for the longpress event.
1455 * @param obj The genlist object
1456 * @return timeout in seconds
1458 * @see elm_genlist_longpress_timeout_get()
1462 EAPI double elm_genlist_longpress_timeout_get(const Evas_Object *obj);
1465 * Get the item that is at the x, y canvas coords.
1467 * @param obj The genlist object.
1468 * @param x The input x coordinate
1469 * @param y The input y coordinate
1470 * @param posret The position relative to the item returned here
1471 * @return The item at the coordinates or NULL if none
1473 * This returns the item at the given coordinates (which are canvas
1474 * relative, not object-relative). If an item is at that coordinate,
1475 * that item handle is returned, and if @p posret is not NULL, the
1476 * integer pointed to is set to a value of -1, 0 or 1, depending if
1477 * the coordinate is on the upper portion of that item (-1), on the
1478 * middle section (0) or on the lower part (1). If NULL is returned as
1479 * an item (no item found there), then posret may indicate -1 or 1
1480 * based if the coordinate is above or below all items respectively in
1485 EAPI Elm_Object_Item *elm_genlist_at_xy_item_get(const Evas_Object *obj, Evas_Coord x, Evas_Coord y, int *posret);
1488 * Get the parent item of the given item
1490 * @param it The item
1491 * @return The parent of the item or @c NULL if it has no parent.
1493 * This returns the item that was specified as parent of the item @p it on
1494 * elm_genlist_item_append() and insertion related functions.
1498 EAPI Elm_Object_Item *elm_genlist_item_parent_get(const Elm_Object_Item *it);
1501 * Remove all sub-items (children) of the given item
1503 * @param it The item
1505 * This removes all items that are children (and their descendants) of the
1508 * @see elm_genlist_clear()
1509 * @see elm_object_item_del()
1513 EAPI void elm_genlist_item_subitems_clear(Elm_Object_Item *it);
1516 * Sets the expanded state of an item.
1518 * @param it The item
1519 * @param expanded The expanded state (@c EINA_TRUE expanded, @c EINA_FALSE not expanded).
1521 * This function flags the item of type #ELM_GENLIST_ITEM_TREE as
1524 * The theme will respond to this change visually, and a signal "expanded" or
1525 * "contracted" will be sent from the genlist with a pointer to the item that
1526 * has been expanded/contracted.
1528 * Calling this function won't show or hide any child of this item (if it is
1529 * a parent). You must manually delete and create them on the callbacks of
1530 * the "expanded" or "contracted" signals.
1532 * @see elm_genlist_item_expanded_get()
1536 EAPI void elm_genlist_item_expanded_set(Elm_Object_Item *it, Eina_Bool expanded);
1539 * Get the expanded state of an item
1541 * @param it The item
1542 * @return The expanded state
1544 * This gets the expanded state of an item.
1546 * @see elm_genlist_item_expanded_set()
1550 EAPI Eina_Bool elm_genlist_item_expanded_get(const Elm_Object_Item *it);
1553 * Get the depth of expanded item
1555 * @param it The genlist item object
1556 * @return The depth of expanded item
1560 EAPI int elm_genlist_item_expanded_depth_get(const Elm_Object_Item *it);
1563 * Unset all contents fetched by the item class
1565 * @param it The item
1566 * @param l The contents list to return
1568 * This instructs genlist to release references to contents in the item,
1569 * meaning that they will no longer be managed by genlist and are
1570 * floating "orphans" that can be re-used elsewhere if the user wants
1575 EAPI void elm_genlist_item_all_contents_unset(Elm_Object_Item *it, Eina_List **l);
1578 * Promote an item to the top of the list
1580 * @param it The item
1584 EAPI void elm_genlist_item_promote(Elm_Object_Item *it);
1587 * Demote an item to the end of the list
1589 * @param it The item
1593 EAPI void elm_genlist_item_demote(Elm_Object_Item *it);
1596 * Update the part of an item
1598 * @param it The item
1599 * @param parts The name of item's part
1600 * @param itf The type of item's part type
1602 * This updates an item's part by calling item's fetching functions again
1603 * to get the contents, texts and states. Use this when the original
1604 * item data has changed and the changes are desired to be reflected.
1605 * Second parts argument is used for globbing to match '*', '?', and '.'
1606 * It can be used at updating multi fields.
1608 * Use elm_genlist_realized_items_update() to update an item's all
1611 * @see elm_genlist_item_update()
1615 EAPI void elm_genlist_item_fields_update(Elm_Object_Item *it, const char *parts, Elm_Genlist_Item_Field_Type itf);
1618 * Activate a genlist mode on an item
1620 * @param it The genlist item
1621 * @param decorate_it_type Mode name
1622 * @param decorate_it_set Boolean to define set or unset mode.
1625 * A genlist mode is a different way of selecting an item. Once a mode is
1626 * activated on an item, any other selected item is immediately unselected.
1627 * This feature provides an easy way of implementing a new kind of animation
1628 * for selecting an item, without having to entirely rewrite the item style
1629 * theme. However, the elm_genlist_selected_* API can't be used to get what
1630 * item is activate for a mode.
1632 * The current item style will still be used, but applying a genlist mode to
1633 * an item will select it using a different kind of animation.
1635 * The current active item for a mode can be found by
1636 * elm_genlist_decorated_item_get().
1638 * The characteristics of genlist mode are:
1639 * - Only one mode can be active at any time, and for only one item.
1640 * - Genlist handles deactivating other items when one item is activated.
1641 * - A mode is defined in the genlist theme (edc), and more modes can easily
1643 * - A mode style and the genlist item style are different things. They
1644 * can be combined to provide a default style to the item, with some kind
1645 * of animation for that item when the mode is activated.
1647 * When a mode is activated on an item, a new view for that item is created.
1648 * The theme of this mode defines the animation that will be used to transit
1649 * the item from the old view to the new view. This second (new) view will be
1650 * active for that item while the mode is active on the item, and will be
1651 * destroyed after the mode is totally deactivated from that item.
1653 * @see elm_genlist_mode_get()
1654 * @see elm_genlist_decorated_item_get()
1658 EAPI void elm_genlist_item_decorate_mode_set(Elm_Object_Item *it, const char *decorate_it_type, Eina_Bool decorate_it_set);
1661 * Get the item's decorate mode.
1663 * @param it The genlist item
1665 * This function just returns the name of the item's decorate mode.
1667 * @see elm_genlist_item_decorate_mode_set()
1668 * @see elm_genlist_decorated_item_get()
1672 EAPI const char *elm_genlist_item_decorate_mode_get(const Elm_Object_Item *it);
1675 * Get active genlist mode item
1677 * @param obj The genlist object
1678 * @return The active item for that current mode. Or @c NULL if no item is
1679 * activated with any mode.
1681 * This function returns the item that was activated with a mode, by the
1682 * function elm_genlist_item_decorate_mode_set().
1684 * @see elm_genlist_item_decorate_mode_set()
1685 * @see elm_genlist_mode_get()
1689 EAPI Elm_Object_Item *elm_genlist_decorated_item_get(const Evas_Object *obj);
1694 * @param obj The genlist object
1695 * @param reorder_mode The reorder mode
1696 * (EINA_TRUE = on, EINA_FALSE = off)
1698 * After turning on the reorder mode, longpress on normal item will trigger
1699 * reordering of the item. You can move the item up and down. However, reorder
1700 * does not work with group item.
1704 EAPI void elm_genlist_reorder_mode_set(Evas_Object *obj, Eina_Bool reorder_mode);
1707 * Get the reorder mode
1709 * @param obj The genlist object
1710 * @return The reorder mode
1711 * (EINA_TRUE = on, EINA_FALSE = off)
1715 EAPI Eina_Bool elm_genlist_reorder_mode_get(const Evas_Object *obj);
1718 * Get the Item's Type
1720 * @param it The genlist item
1721 * @return The item type.
1723 * This function returns the item's type. Normally the item's type.
1724 * If it failed, return value is ELM_GENLIST_ITEM_MAX
1728 EAPI Elm_Genlist_Item_Type elm_genlist_item_type_get(const Elm_Object_Item *it);
1731 * Set Genlist decorate mode
1733 * This sets Genlist decorate mode to all items.
1735 * @param obj The Genlist object
1736 * @param decorated The decorate mode status
1737 * (EINA_TRUE = decorate mode, EINA_FALSE = normal mode
1741 EAPI void elm_genlist_decorate_mode_set(Evas_Object *obj, Eina_Bool decorated);
1744 * Get Genlist decorate mode
1746 * @param obj The genlist object
1747 * @return The decorate mode status
1748 * (EINA_TRUE = decorate mode, EINA_FALSE = normal mode
1752 EAPI Eina_Bool elm_genlist_decorate_mode_get(const Evas_Object *obj);
1755 * Set the flip state of a given genlist item.
1757 * @param it The genlist item object
1758 * @param flip The flip mode
1759 * (EINA_TRUE = on, EINA_FALSE = off)
1761 * This function sets the flip state of a given genlist item.
1762 * Flip mode overrides current item object.
1763 * It can be used for on-the-fly item replace.
1764 * Flip mode can be used with/without decorate mode.
1766 * @see elm_genlist_item_flip_get()
1771 EAPI void elm_genlist_item_flip_set(Elm_Object_Item *it, Eina_Bool flip);
1774 * Get the flip state of a given genlist item.
1776 * @param it The genlist item object
1778 * This function returns the flip state of a given genlist item.
1779 * If the parameter is invalid, it returns EINA_FALSE.
1781 * @see elm_genlist_item_flip_set()
1786 EAPI Eina_Bool elm_genlist_item_flip_get(const Elm_Object_Item *it);
1789 * Set Genlist tree effect
1791 * @param obj The genlist object
1792 * @param enabled The tree effect status
1793 * (EINA_TRUE = enabled, EINA_FALSE = disabled
1797 EAPI void elm_genlist_tree_effect_enabled_set(Evas_Object *obj, Eina_Bool enabled);
1800 * Get Genlist tree effect
1802 * @param obj The genlist object
1803 * @return The tree effect status
1804 * (EINA_TRUE = enabled, EINA_FALSE = disabled
1808 EAPI Eina_Bool elm_genlist_tree_effect_enabled_get(const Evas_Object *obj);
1811 * Set the genlist select mode.
1813 * @param obj The genlist object
1814 * @param mode The select mode
1816 * elm_genlist_select_mode_set() changes item select mode in the genlist widget.
1817 * - ELM_OBJECT_SELECT_MODE_DEFAULT : Items will call their selection func and
1818 * callback once when first becoming selected. Any further clicks will
1819 * do nothing, unless you set always select mode.
1820 * - ELM_OBJECT_SELECT_MODE_ALWAYS : This means that, even if selected,
1821 * every click will make the selected callbacks be called.
1822 * - ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select items
1823 * entirely and they will neither appear selected nor call selected
1824 * callback functions.
1826 * @see elm_genlist_select_mode_get()
1830 EAPI void elm_genlist_select_mode_set(Evas_Object *obj, Elm_Object_Select_Mode mode);
1833 * Get the genlist select mode.
1835 * @param obj The genlist object
1836 * @return The select mode
1837 * (If getting mode is failed, it returns ELM_OBJECT_SELECT_MODE_MAX)
1839 * @see elm_genlist_select_mode_set()
1843 EAPI Elm_Object_Select_Mode elm_genlist_select_mode_get(const Evas_Object *obj);
1846 * Set whether the genlist items' should be highlighted when item selected.
1848 * @param obj The genlist object.
1849 * @param highlight @c EINA_TRUE to enable highlighting or @c EINA_FALSE to
1852 * This will turn on/off the highlight effect when item selection and
1853 * they will, or will not highlighted. The selected and clicked
1854 * callback functions will still be called.
1856 * Highlight is enabled by default.
1858 * @see elm_genlist_highlight_mode_get().
1862 EAPI void elm_genlist_highlight_mode_set(Evas_Object *obj, Eina_Bool highlight);
1865 * Get whether the genlist items' should be highlighted when item selected.
1867 * @param obj The genlist object.
1868 * @return @c EINA_TRUE means items can be highlighted. @c EINA_FALSE indicates
1869 * they can't. If @p obj is @c NULL, @c EINA_FALSE is returned.
1871 * @see elm_genlist_highlight_mode_set() for details.
1875 EAPI Eina_Bool elm_genlist_highlight_mode_get(const Evas_Object *obj);
1878 * Set the genlist item's select mode.
1880 * @param it The genlist item object
1881 * @param mode The select mode
1883 * elm_genlist_select_mode_set() changes item's select mode.
1884 * - ELM_OBJECT_SELECT_MODE_DEFAULT : The item will only call their selection func and
1885 * callback when first becoming selected. Any further clicks will
1886 * do nothing, unless you set always select mode.
1887 * - ELM_OBJECT_SELECT_MODE_ALWAYS : This means that, even if selected,
1888 * every click will make the selected callbacks be called.
1889 * - ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select the item
1890 * entirely and they will neither appear selected nor call selected
1891 * callback functions.
1892 * - ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY : This will apply no-finger-size rule
1893 * with ELM_OBJECT_SELECT_MODE_NONE. No-finger-size rule makes an item can be
1894 * smaller than lower limit. Clickable objects should be bigger than
1895 * human touch point device (your finger) for some touch or
1896 * small screen devices. So it is enabled, the item can be shrink than
1897 * predefined finger-size value. And the item will be updated.
1899 * @see elm_genlist_item_select_mode_get()
1904 elm_genlist_item_select_mode_set(Elm_Object_Item *it,
1905 Elm_Object_Select_Mode mode);
1908 * Get the genlist item's select mode.
1910 * @param it The genlist item object
1911 * @return The select mode
1912 * (If getting mode is failed, it returns ELM_OBJECT_SELECT_MODE_MAX)
1914 * @see elm_genlist_item_select_mode_set()
1918 EAPI Elm_Object_Select_Mode
1919 elm_genlist_item_select_mode_get(const Elm_Object_Item *it);
1923 * Get the nth item, in a given genlist widget, placed at position @p nth, in
1924 * its internal items list
1926 * @param obj The genlist object
1927 * @param nth The number of the item to grab (0 being the first)
1929 * @return The item stored in @p obj at position @p nth or @c NULL, if there's
1930 * no item with that index (and on errors)
1935 EAPI Elm_Object_Item *
1936 elm_genlist_nth_item_get(const Evas_Object *obj, unsigned int nth);