elm genlist: Added more documentation for longpressed smart callback.
[framework/uifw/elementary.git] / src / lib / elm_genlist.h
1 /**
2  * @defgroup Genlist Genlist
3  *
4  * @image html img/widget/genlist/preview-00.png
5  * @image latex img/widget/genlist/preview-00.eps
6  * @image html img/genlist.png
7  * @image latex img/genlist.eps
8  *
9  * This widget aims to have more expansive list than the simple list in
10  * Elementary that could have more flexible items and allow many more entries
11  * while still being fast and low on memory usage. At the same time it was
12  * also made to be able to do tree structures. But the price to pay is more
13  * complexity when it comes to usage. If all you want is a simple list with
14  * icons and a single text, use the normal @ref List object.
15  *
16  * Genlist has a fairly large API, mostly because it's relatively complex,
17  * trying to be both expansive, powerful and efficient. First we will begin
18  * an overview on the theory behind genlist.
19  *
20  * @section Genlist_Item_Class Genlist item classes - creating items
21  *
22  * In order to have the ability to add and delete items on the fly, genlist
23  * implements a class (callback) system where the application provides a
24  * structure with information about that type of item (genlist may contain
25  * multiple different items with different classes, states and styles).
26  * Genlist will call the functions in this struct (methods) when an item is
27  * "realized" (i.e., created dynamically, while the user is scrolling the
28  * grid). All objects will simply be deleted when no longer needed with
29  * evas_object_del(). The #Elm_Genlist_Item_Class structure contains the
30  * following members:
31  * - @c item_style - This is a constant string and simply defines the name
32  *   of the item style. It @b must be specified and the default should be @c
33  *   "default".
34  *
35  * - @c func - A struct with pointers to functions that will be called when
36  *   an item is going to be actually created. All of them receive a @c data
37  *   parameter that will point to the same data passed to
38  *   elm_genlist_item_append() and related item creation functions, and an @c
39  *   obj parameter that points to the genlist object itself.
40  *
41  * The function pointers inside @c func are @c text_get, @c content_get, @c
42  * state_get and @c del. The 3 first functions also receive a @c part
43  * parameter described below. A brief description of these functions follows:
44  *
45  * - @c text_get - The @c part parameter is the name string of one of the
46  *   existing text parts in the Edje group implementing the item's theme.
47  *   This function @b must return a strdup'()ed string, as the caller will
48  *   free() it when done. See #Elm_Genlist_Item_Text_Get_Cb.
49  * - @c content_get - The @c part parameter is the name string of one of the
50  *   existing (content) swallow parts in the Edje group implementing the item's
51  *   theme. It must return @c NULL, when no content is desired, or a valid
52  *   object handle, otherwise.  The object will be deleted by the genlist on
53  *   its deletion or when the item is "unrealized".  See
54  *   #Elm_Genlist_Item_Content_Get_Cb.
55  * - @c func.state_get - The @c part parameter is the name string of one of
56  *   the state parts in the Edje group implementing the item's theme. Return
57  *   @c EINA_FALSE for false/off or @c EINA_TRUE for true/on. Genlists will
58  *   emit a signal to its theming Edje object with @c "elm,state,XXX,active"
59  *   and @c "elm" as "emission" and "source" arguments, respectively, when
60  *   the state is true (the default is false), where @c XXX is the name of
61  *   the (state) part.  See #Elm_Genlist_Item_State_Get_Cb.
62  * - @c func.del - This is intended for use when genlist items are deleted,
63  *   so any data attached to the item (e.g. its data parameter on creation)
64  *   can be deleted. See #Elm_Genlist_Item_Del_Cb.
65  *
66  * available item styles:
67  * - default
68  * - default_style - The text part is a textblock
69  *
70  * @image html img/widget/genlist/preview-04.png
71  * @image latex img/widget/genlist/preview-04.eps
72  *
73  * - double_label
74  *
75  * @image html img/widget/genlist/preview-01.png
76  * @image latex img/widget/genlist/preview-01.eps
77  *
78  * - icon_top_text_bottom
79  *
80  * @image html img/widget/genlist/preview-02.png
81  * @image latex img/widget/genlist/preview-02.eps
82  *
83  * - group_index
84  *
85  * @image html img/widget/genlist/preview-03.png
86  * @image latex img/widget/genlist/preview-03.eps
87  *
88  * @section Genlist_Items Structure of items
89  *
90  * An item in a genlist can have 0 or more texts (they can be regular
91  * text or textblock Evas objects - that's up to the style to determine), 0
92  * or more contents (which are simply objects swallowed into the genlist item's
93  * theming Edje object) and 0 or more <b>boolean states</b>, which have the
94  * behavior left to the user to define. The Edje part names for each of
95  * these properties will be looked up, in the theme file for the genlist,
96  * under the Edje (string) data items named @c "labels", @c "contents" and @c
97  * "states", respectively. For each of those properties, if more than one
98  * part is provided, they must have names listed separated by spaces in the
99  * data fields. For the default genlist item theme, we have @b one text
100  * part (@c "elm.text"), @b two content parts (@c "elm.swalllow.icon" and @c
101  * "elm.swallow.end") and @b no state parts.
102  *
103  * A genlist item may be at one of several styles. Elementary provides one
104  * by default - "default", but this can be extended by system or application
105  * custom themes/overlays/extensions (see @ref Theme "themes" for more
106  * details).
107  *
108  * @section Genlist_Manipulation Editing and Navigating
109  *
110  * Items can be added by several calls. All of them return a @ref
111  * Elm_Object_Item handle that is an internal member inside the genlist.
112  * They all take a data parameter that is meant to be used for a handle to
113  * the applications internal data (eg. the struct with the original item
114  * data). The parent parameter is the parent genlist item this belongs to if
115  * it is a tree or an indexed group, and NULL if there is no parent. The
116  * flags can be a bitmask of #ELM_GENLIST_ITEM_NONE,
117  * #ELM_GENLIST_ITEM_SUBITEMS and #ELM_GENLIST_ITEM_GROUP. If
118  * #ELM_GENLIST_ITEM_SUBITEMS is set then this item is displayed as an item
119  * that is able to expand and have child items.  If ELM_GENLIST_ITEM_GROUP
120  * is set then this item is group index item that is displayed at the top
121  * until the next group comes. The func parameter is a convenience callback
122  * that is called when the item is selected and the data parameter will be
123  * the func_data parameter, obj be the genlist object and event_info will be
124  * the genlist item.
125  *
126  * elm_genlist_item_append() adds an item to the end of the list, or if
127  * there is a parent, to the end of all the child items of the parent.
128  * elm_genlist_item_prepend() is the same but adds to the beginning of
129  * the list or children list. elm_genlist_item_insert_before() inserts at
130  * item before another item and elm_genlist_item_insert_after() inserts after
131  * the indicated item.
132  *
133  * The application can clear the list with elm_genlist_clear() which deletes
134  * all the items in the list and elm_object_item_del() will delete a specific
135  * item. elm_genlist_item_subitems_clear() will clear all items that are
136  * children of the indicated parent item.
137  *
138  * To help inspect list items you can jump to the item at the top of the list
139  * with elm_genlist_first_item_get() which will return the item pointer, and
140  * similarly elm_genlist_last_item_get() gets the item at the end of the list.
141  * elm_genlist_item_next_get() and elm_genlist_item_prev_get() get the next
142  * and previous items respectively relative to the indicated item. Using
143  * these calls you can walk the entire item list/tree. Note that as a tree
144  * the items are flattened in the list, so elm_genlist_item_parent_get() will
145  * let you know which item is the parent (and thus know how to skip them if
146  * wanted).
147  *
148  * @section Genlist_Multi_Selection Multi-selection
149  *
150  * If the application wants multiple items to be able to be selected,
151  * elm_genlist_multi_select_set() can enable this. If the list is
152  * single-selection only (the default), then elm_genlist_selected_item_get()
153  * will return the selected item, if any, or NULL if none is selected. If the
154  * list is multi-select then elm_genlist_selected_items_get() will return a
155  * list (that is only valid as long as no items are modified (added, deleted,
156  * selected or unselected)).
157  *
158  * @section Genlist_Usage_Hints Usage hints
159  *
160  * There are also convenience functions. elm_genlist_item_genlist_get() will
161  * return the genlist object the item belongs to. elm_genlist_item_show()
162  * will make the scroller scroll to show that specific item so its visible.
163  * elm_object_item_data_get() returns the data pointer set by the item
164  * creation functions.
165  *
166  * If an item changes (state of boolean changes, text or contents change),
167  * then use elm_genlist_item_update() to have genlist update the item with
168  * the new state. Genlist will re-realize the item and thus call the functions
169  * in the _Elm_Genlist_Item_Class for that item.
170  *
171  * To programmatically (un)select an item use elm_genlist_item_selected_set().
172  * To get its selected state use elm_genlist_item_selected_get(). Similarly
173  * to expand/contract an item and get its expanded state, use
174  * elm_genlist_item_expanded_set() and elm_genlist_item_expanded_get(). And
175  * again to make an item disabled (unable to be selected and appear
176  * differently) use elm_object_item_disabled_set() to set this and
177  * elm_object_item_disabled_get() to get the disabled state.
178  *
179  * In general to indicate how the genlist should expand items horizontally to
180  * fill the list area, use elm_genlist_horizontal_set(). Valid modes are
181  * ELM_LIST_LIMIT and ELM_LIST_SCROLL. The default is ELM_LIST_SCROLL. This
182  * mode means that if items are too wide to fit, the scroller will scroll
183  * horizontally. Otherwise items are expanded to fill the width of the
184  * viewport of the scroller. If it is ELM_LIST_LIMIT, items will be expanded
185  * to the viewport width and limited to that size. This can be combined with
186  * a different style that uses edjes' ellipsis feature (cutting text off like
187  * this: "tex...").
188  *
189  * Items will only call their selection func and callback when first becoming
190  * selected. Any further clicks will do nothing, unless you enable always
191  * select with elm_genlist_always_select_mode_set(). This means even if
192  * selected, every click will make the selected callbacks be called.
193  * elm_genlist_no_select_mode_set() will turn off the ability to select
194  * items entirely and they will neither appear selected nor call selected
195  * callback functions.
196  *
197  * Remember that you can create new styles and add your own theme augmentation
198  * per application with elm_theme_extension_add(). If you absolutely must
199  * have a specific style that overrides any theme the user or system sets up
200  * you can use elm_theme_overlay_add() to add such a file.
201  *
202  * @section Genlist_Implementation Implementation
203  *
204  * Evas tracks every object you create. Every time it processes an event
205  * (mouse move, down, up etc.) it needs to walk through objects and find out
206  * what event that affects. Even worse every time it renders display updates,
207  * in order to just calculate what to re-draw, it needs to walk through many
208  * many many objects. Thus, the more objects you keep active, the more
209  * overhead Evas has in just doing its work. It is advisable to keep your
210  * active objects to the minimum working set you need. Also remember that
211  * object creation and deletion carries an overhead, so there is a
212  * middle-ground, which is not easily determined. But don't keep massive lists
213  * of objects you can't see or use. Genlist does this with list objects. It
214  * creates and destroys them dynamically as you scroll around. It groups them
215  * into blocks so it can determine the visibility etc. of a whole block at
216  * once as opposed to having to walk the whole list. This 2-level list allows
217  * for very large numbers of items to be in the list (tests have used up to
218  * 2,000,000 items). Also genlist employs a queue for adding items. As items
219  * may be different sizes, every item added needs to be calculated as to its
220  * size and thus this presents a lot of overhead on populating the list, this
221  * genlist employs a queue. Any item added is queued and spooled off over
222  * time, actually appearing some time later, so if your list has many members
223  * you may find it takes a while for them to all appear, with your process
224  * consuming a lot of CPU while it is busy spooling.
225  *
226  * Genlist also implements a tree structure, but it does so with callbacks to
227  * the application, with the application filling in tree structures when
228  * requested (allowing for efficient building of a very deep tree that could
229  * even be used for file-management). See the above smart signal callbacks for
230  * details.
231  *
232  * @section Genlist_Smart_Events Genlist smart events
233  *
234  * Signals that you can add callbacks for are:
235  * - @c "activated" - The user has double-clicked or pressed
236  *   (enter|return|spacebar) on an item. The @c event_info parameter is the
237  *   item that was activated.
238  * - @c "clicked,double" - The user has double-clicked an item.  The @c
239  *   event_info parameter is the item that was double-clicked.
240  * - @c "selected" - This is called when a user has made an item selected.
241  *   The event_info parameter is the genlist item that was selected.
242  * - @c "unselected" - This is called when a user has made an item
243  *   unselected. The event_info parameter is the genlist item that was
244  *   unselected.
245  * - @c "expanded" - This is called when elm_genlist_item_expanded_set() is
246  *   called and the item is now meant to be expanded. The event_info
247  *   parameter is the genlist item that was indicated to expand.  It is the
248  *   job of this callback to then fill in the child items.
249  * - @c "contracted" - This is called when elm_genlist_item_expanded_set() is
250  *   called and the item is now meant to be contracted. The event_info
251  *   parameter is the genlist item that was indicated to contract. It is the
252  *   job of this callback to then delete the child items.
253  * - @c "expand,request" - This is called when a user has indicated they want
254  *   to expand a tree branch item. The callback should decide if the item can
255  *   expand (has any children) and then call elm_genlist_item_expanded_set()
256  *   appropriately to set the state. The event_info parameter is the genlist
257  *   item that was indicated to expand.
258  * - @c "contract,request" - This is called when a user has indicated they
259  *   want to contract a tree branch item. The callback should decide if the
260  *   item can contract (has any children) and then call
261  *   elm_genlist_item_expanded_set() appropriately to set the state. The
262  *   event_info parameter is the genlist item that was indicated to contract.
263  * - @c "realized" - This is called when the item in the list is created as a
264  *   real evas object. event_info parameter is the genlist item that was
265  *   created. The object may be deleted at any time, so it is up to the
266  *   caller to not use the object pointer from elm_genlist_item_object_get()
267  *   in a way where it may point to freed objects.
268  * - @c "unrealized" - This is called just before an item is unrealized.
269  *   After this call content objects provided will be deleted and the item
270  *   object itself delete or be put into a floating cache.
271  * - @c "drag,start,up" - This is called when the item in the list has been
272  *   dragged (not scrolled) up.
273  * - @c "drag,start,down" - This is called when the item in the list has been
274  *   dragged (not scrolled) down.
275  * - @c "drag,start,left" - This is called when the item in the list has been
276  *   dragged (not scrolled) left.
277  * - @c "drag,start,right" - This is called when the item in the list has
278  *   been dragged (not scrolled) right.
279  * - @c "drag,stop" - This is called when the item in the list has stopped
280  *   being dragged.
281  * - @c "drag" - This is called when the item in the list is being dragged.
282  * - @c "longpressed" - This is called when the item is pressed for a certain
283  *   amount of time. By default it's 1 second. The event_info parameter is the
284  *   longpressed genlist item.
285  * - @c "scroll,anim,start" - This is called when scrolling animation has
286  *   started.
287  * - @c "scroll,anim,stop" - This is called when scrolling animation has
288  *   stopped.
289  * - @c "scroll,drag,start" - This is called when dragging the content has
290  *   started.
291  * - @c "scroll,drag,stop" - This is called when dragging the content has
292  *   stopped.
293  * - @c "edge,top" - This is called when the genlist is scrolled until
294  *   the top edge.
295  * - @c "edge,bottom" - This is called when the genlist is scrolled
296  *   until the bottom edge.
297  * - @c "edge,left" - This is called when the genlist is scrolled
298  *   until the left edge.
299  * - @c "edge,right" - This is called when the genlist is scrolled
300  *   until the right edge.
301  * - @c "multi,swipe,left" - This is called when the genlist is multi-touch
302  *   swiped left.
303  * - @c "multi,swipe,right" - This is called when the genlist is multi-touch
304  *   swiped right.
305  * - @c "multi,swipe,up" - This is called when the genlist is multi-touch
306  *   swiped up.
307  * - @c "multi,swipe,down" - This is called when the genlist is multi-touch
308  *   swiped down.
309  * - @c "multi,pinch,out" - This is called when the genlist is multi-touch
310  *   pinched out.  "- @c multi,pinch,in" - This is called when the genlist is
311  *   multi-touch pinched in.
312  * - @c "swipe" - This is called when the genlist is swiped.
313  * - @c "moved" - This is called when a genlist item is moved.
314  * - @c "language,changed" - This is called when the program's language is
315  *   changed.
316  *
317  * Supported elm_object common APIs
318  * @li elm_object_signal_emit()
319  *
320  * Supported elm_object_item common APIs
321  * @li elm_object_item_part_content_get()
322  * @li elm_object_item_part_content_set()
323  * @li elm_object_item_part_content_unset()
324  * @li elm_object_item_part_text_set()
325  * @li elm_object_item_part_text_get()
326  * @li elm_object_item_disabled_set()
327  * @li elm_object_item_disabled_get()
328  *
329  * @section Genlist_Examples Examples
330  *
331  * Here is a list of examples that use the genlist, trying to show some of
332  * its capabilities:
333  * - @ref genlist_example_01
334  * - @ref genlist_example_02
335  * - @ref genlist_example_03
336  * - @ref genlist_example_04
337  * - @ref genlist_example_05
338  */
339
340 /**
341  * @addtogroup Genlist
342  * @{
343  */
344
345 /**
346  * Defines if the item is of any special type (has subitems or it's the
347  * index of a group), or is just a simple item.
348  *
349  * @ingroup Genlist
350  */
351 typedef enum
352 {
353    ELM_GENLIST_ITEM_NONE = 0, /**< simple item */
354    ELM_GENLIST_ITEM_SUBITEMS = (1 << 0), /**< may expand and have child items */
355    ELM_GENLIST_ITEM_GROUP = (1 << 1), /**< index of a group of items */
356
357    ELM_GENLIST_ITEM_MAX = (1 << 2)
358 } Elm_Genlist_Item_Flags;
359
360 typedef enum
361 {
362    ELM_GENLIST_ITEM_FIELD_ALL = 0,
363    ELM_GENLIST_ITEM_FIELD_LABEL = (1 << 0),
364    ELM_GENLIST_ITEM_FIELD_CONTENT = (1 << 1),
365    ELM_GENLIST_ITEM_FIELD_STATE = (1 << 2)
366 } Elm_Genlist_Item_Field_Flags;
367 typedef struct _Elm_Genlist_Item_Class      Elm_Genlist_Item_Class; /**< Genlist item class definition structs */
368 #define ELM_GENLIST_ITEM_CLASS_HEADER       0, 0, 0
369
370 #define Elm_Genlist_Item_Class Elm_Gen_Item_Class
371 typedef struct _Elm_Genlist_Item_Class_Func Elm_Genlist_Item_Class_Func;    /**< Class functions for genlist item class */
372
373 /**
374  * Text fetching class function for Elm_Gen_Item_Class.
375  * @param data The data passed in the item creation function
376  * @param obj The base widget object
377  * @param part The part name of the swallow
378  * @return The allocated (NOT stringshared) string to set as the text
379  */
380 typedef char *(*Elm_Genlist_Item_Text_Get_Cb)(void *data, Evas_Object *obj, const char *part);
381
382 /**
383  * Content (swallowed object) fetching class function for Elm_Gen_Item_Class.
384  * @param data The data passed in the item creation function
385  * @param obj The base widget object
386  * @param part The part name of the swallow
387  * @return The content object to swallow
388  */
389 typedef Evas_Object *(*Elm_Genlist_Item_Content_Get_Cb)(void *data, Evas_Object *obj, const char *part);
390
391 /**
392  * State fetching class function for Elm_Gen_Item_Class.
393  * @param data The data passed in the item creation function
394  * @param obj The base widget object
395  * @param part The part name of the swallow
396  * @return The hell if I know
397  */
398 typedef Eina_Bool (*Elm_Genlist_Item_State_Get_Cb)(void *data, Evas_Object *obj, const char *part);
399
400 /**
401  * Deletion class function for Elm_Gen_Item_Class.
402  * @param data The data passed in the item creation function
403  * @param obj The base widget object
404  */
405 typedef void (*Elm_Genlist_Item_Del_Cb)(void *data, Evas_Object *obj);
406
407 /**
408  * @struct _Elm_Genlist_Item_Class
409  *
410  * Genlist item class definition structs.
411  *
412  * This struct contains the style and fetching functions that will define the
413  * contents of each item.
414  *
415  * @see @ref Genlist_Item_Class
416  */
417 struct _Elm_Genlist_Item_Class
418 {
419    const char *item_style; /**< style of this class. */
420    struct Elm_Genlist_Item_Class_Func
421    {
422       Elm_Genlist_Item_Text_Get_Cb    text_get; /**< Text fetching class function for genlist item classes.*/
423       Elm_Genlist_Item_Content_Get_Cb content_get; /**< Content fetching class function for genlist item classes. */
424       Elm_Genlist_Item_State_Get_Cb   state_get; /**< State fetching class function for genlist item classes. */
425       Elm_Genlist_Item_Del_Cb         del; /**< Deletion class function for genlist item classes. */
426    } func;
427 };
428 #define Elm_Genlist_Item_Class_Func Elm_Gen_Item_Class_Func
429 /**
430  * Add a new genlist widget to the given parent Elementary
431  * (container) object
432  *
433  * @param parent The parent object
434  * @return a new genlist widget handle or @c NULL, on errors
435  *
436  * This function inserts a new genlist widget on the canvas.
437  *
438  * @see elm_genlist_item_append()
439  * @see elm_object_item_del()
440  * @see elm_genlist_clear()
441  *
442  * @ingroup Genlist
443  */
444 EAPI Evas_Object                  *elm_genlist_add(Evas_Object *parent);
445
446 /**
447  * Remove all items from a given genlist widget.
448  *
449  * @param obj The genlist object
450  *
451  * This removes (and deletes) all items in @p obj, leaving it empty.
452  *
453  * @see elm_object_item_del(), to remove just one item.
454  *
455  * @ingroup Genlist
456  */
457 EAPI void                          elm_genlist_clear(Evas_Object *obj);
458
459 /**
460  * Enable or disable multi-selection in the genlist
461  *
462  * @param obj The genlist object
463  * @param multi Multi-select enable/disable. Default is disabled.
464  *
465  * This enables (@c EINA_TRUE) or disables (@c EINA_FALSE) multi-selection in
466  * the list. This allows more than 1 item to be selected. To retrieve the list
467  * of selected items, use elm_genlist_selected_items_get().
468  *
469  * @see elm_genlist_selected_items_get()
470  * @see elm_genlist_multi_select_get()
471  *
472  * @ingroup Genlist
473  */
474 EAPI void                          elm_genlist_multi_select_set(Evas_Object *obj, Eina_Bool multi);
475
476 /**
477  * Gets if multi-selection in genlist is enabled or disabled.
478  *
479  * @param obj The genlist object
480  * @return Multi-select enabled/disabled
481  * (@c EINA_TRUE = enabled/@c EINA_FALSE = disabled). Default is @c EINA_FALSE.
482  *
483  * @see elm_genlist_multi_select_set()
484  *
485  * @ingroup Genlist
486  */
487 EAPI Eina_Bool                     elm_genlist_multi_select_get(const Evas_Object *obj);
488
489 /**
490  * This sets the horizontal stretching mode.
491  *
492  * @param obj The genlist object
493  * @param mode The mode to use (one of #ELM_LIST_SCROLL or #ELM_LIST_LIMIT).
494  *
495  * This sets the mode used for sizing items horizontally. Valid modes
496  * are #ELM_LIST_LIMIT and #ELM_LIST_SCROLL. The default is
497  * ELM_LIST_SCROLL. This mode means that if items are too wide to fit,
498  * the scroller will scroll horizontally. Otherwise items are expanded
499  * to fill the width of the viewport of the scroller. If it is
500  * ELM_LIST_LIMIT, items will be expanded to the viewport width and
501  * limited to that size.
502  *
503  * @see elm_genlist_mode_get()
504  *
505  * @ingroup Genlist
506  */
507 EAPI void                          elm_genlist_mode_set(Evas_Object *obj, Elm_List_Mode mode);
508
509 /**
510  * Gets the horizontal stretching mode.
511  *
512  * @param obj The genlist object
513  * @return The mode to use
514  * (#ELM_LIST_LIMIT, #ELM_LIST_SCROLL)
515  *
516  * @see elm_genlist_horizontal_set()
517  *
518  * @ingroup Genlist
519  */
520 EAPI Elm_List_Mode                 elm_genlist_mode_get(const Evas_Object *obj);
521
522 /**
523  * Set the always select mode.
524  *
525  * @param obj The genlist object
526  * @param always_select The always select mode (@c EINA_TRUE = on, @c
527  * EINA_FALSE = off). Default is @c EINA_FALSE.
528  *
529  * Items will only call their selection func and callback when first
530  * becoming selected. Any further clicks will do nothing, unless you
531  * enable always select with elm_genlist_always_select_mode_set().
532  * This means that, even if selected, every click will make the selected
533  * callbacks be called.
534  *
535  * @see elm_genlist_always_select_mode_get()
536  *
537  * @ingroup Genlist
538  */
539 EAPI void                          elm_genlist_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select);
540
541 /**
542  * Get the always select mode.
543  *
544  * @param obj The genlist object
545  * @return The always select mode
546  * (@c EINA_TRUE = on, @c EINA_FALSE = off)
547  *
548  * @see elm_genlist_always_select_mode_set()
549  *
550  * @ingroup Genlist
551  */
552 EAPI Eina_Bool                     elm_genlist_always_select_mode_get(const Evas_Object *obj);
553
554 /**
555  * Enable/disable the no select mode.
556  *
557  * @param obj The genlist object
558  * @param no_select The no select mode
559  * (EINA_TRUE = on, EINA_FALSE = off)
560  *
561  * This will turn off the ability to select items entirely and they
562  * will neither appear selected nor call selected callback functions.
563  *
564  * @see elm_genlist_no_select_mode_get()
565  *
566  * @ingroup Genlist
567  */
568 EAPI void                          elm_genlist_no_select_mode_set(Evas_Object *obj, Eina_Bool no_select);
569
570 /**
571  * Gets whether the no select mode is enabled.
572  *
573  * @param obj The genlist object
574  * @return The no select mode
575  * (@c EINA_TRUE = on, @c EINA_FALSE = off)
576  *
577  * @see elm_genlist_no_select_mode_set()
578  *
579  * @ingroup Genlist
580  */
581 EAPI Eina_Bool                     elm_genlist_no_select_mode_get(const Evas_Object *obj);
582
583 /**
584  * Enable/disable compress mode.
585  *
586  * @param obj The genlist object
587  * @param compress The compress mode
588  * (@c EINA_TRUE = on, @c EINA_FALSE = off). Default is @c EINA_FALSE.
589  *
590  * This will enable the compress mode where items are "compressed"
591  * horizontally to fit the genlist scrollable viewport width. This is
592  * special for genlist.  Do not rely on
593  * elm_genlist_horizontal_set() being set to @c ELM_LIST_COMPRESS to
594  * work as genlist needs to handle it specially.
595  *
596  * @see elm_genlist_compress_mode_get()
597  *
598  * @ingroup Genlist
599  */
600 EAPI void                          elm_genlist_compress_mode_set(Evas_Object *obj, Eina_Bool compress);
601
602 /**
603  * Get whether the compress mode is enabled.
604  *
605  * @param obj The genlist object
606  * @return The compress mode
607  * (@c EINA_TRUE = on, @c EINA_FALSE = off)
608  *
609  * @see elm_genlist_compress_mode_set()
610  *
611  * @ingroup Genlist
612  */
613 EAPI Eina_Bool                     elm_genlist_compress_mode_get(const Evas_Object *obj);
614
615 /**
616  * Enable/disable height-for-width mode.
617  *
618  * @param obj The genlist object
619  * @param height_for_width The height-for-width mode (@c EINA_TRUE = on,
620  * @c EINA_FALSE = off). Default is @c EINA_FALSE.
621  *
622  * With height-for-width mode the item width will be fixed (restricted
623  * to a minimum of) to the list width when calculating its size in
624  * order to allow the height to be calculated based on it. This allows,
625  * for instance, text block to wrap lines if the Edje part is
626  * configured with "text.min: 0 1".
627  *
628  * @note This mode will make list resize slower as it will have to
629  *       recalculate every item height again whenever the list width
630  *       changes!
631  *
632  * @note When height-for-width mode is enabled, it also enables
633  *       compress mode (see elm_genlist_compress_mode_set()) and
634  *       disables homogeneous (see elm_genlist_homogeneous_set()).
635  *
636  * @ingroup Genlist
637  */
638 EAPI void                          elm_genlist_height_for_width_mode_set(Evas_Object *obj, Eina_Bool height_for_width);
639
640 /**
641  * Get whether the height-for-width mode is enabled.
642  *
643  * @param obj The genlist object
644  * @return The height-for-width mode (@c EINA_TRUE = on, @c EINA_FALSE =
645  * off)
646  *
647  * @ingroup Genlist
648  */
649 EAPI Eina_Bool                     elm_genlist_height_for_width_mode_get(const Evas_Object *obj);
650
651 /**
652  * Enable/disable horizontal and vertical bouncing effect.
653  *
654  * @param obj The genlist object
655  * @param h_bounce Allow bounce horizontally (@c EINA_TRUE = on, @c
656  * EINA_FALSE = off). Default is @c EINA_FALSE.
657  * @param v_bounce Allow bounce vertically (@c EINA_TRUE = on, @c
658  * EINA_FALSE = off). Default is @c EINA_TRUE.
659  *
660  * This will enable or disable the scroller bouncing effect for the
661  * genlist. See elm_scroller_bounce_set() for details.
662  *
663  * @see elm_scroller_bounce_set()
664  * @see elm_genlist_bounce_get()
665  *
666  * @ingroup Genlist
667  */
668 EAPI void                          elm_genlist_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce);
669
670 /**
671  * Get whether the horizontal and vertical bouncing effect is enabled.
672  *
673  * @param obj The genlist object
674  * @param h_bounce Pointer to a bool to receive if the bounce horizontally
675  * option is set.
676  * @param v_bounce Pointer to a bool to receive if the bounce vertically
677  * option is set.
678  *
679  * @see elm_genlist_bounce_set()
680  *
681  * @ingroup Genlist
682  */
683 EAPI void                          elm_genlist_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce);
684
685 /**
686  * Enable/disable homogeneous mode.
687  *
688  * @param obj The genlist object
689  * @param homogeneous Assume the items within the genlist are of the
690  * same height and width (EINA_TRUE = on, EINA_FALSE = off). Default is @c
691  * EINA_FALSE.
692  *
693  * This will enable the homogeneous mode where items are of the same
694  * height and width so that genlist may do the lazy-loading at its
695  * maximum (which increases the performance for scrolling the list). This
696  * implies 'compressed' mode.
697  *
698  * @see elm_genlist_compress_mode_set()
699  * @see elm_genlist_homogeneous_get()
700  *
701  * @ingroup Genlist
702  */
703 EAPI void                          elm_genlist_homogeneous_set(Evas_Object *obj, Eina_Bool homogeneous);
704
705 /**
706  * Get whether the homogeneous mode is enabled.
707  *
708  * @param obj The genlist object
709  * @return Assume the items within the genlist are of the same height
710  * and width (EINA_TRUE = on, EINA_FALSE = off)
711  *
712  * @see elm_genlist_homogeneous_set()
713  *
714  * @ingroup Genlist
715  */
716 EAPI Eina_Bool                     elm_genlist_homogeneous_get(const Evas_Object *obj);
717
718 /**
719  * Set the maximum number of items within an item block
720  *
721  * @param obj The genlist object
722  * @param n   Maximum number of items within an item block. Default is 32.
723  *
724  * This will configure the block count to tune to the target with
725  * particular performance matrix.
726  *
727  * A block of objects will be used to reduce the number of operations due to
728  * many objects in the screen. It can determine the visibility, or if the
729  * object has changed, it theme needs to be updated, etc. doing this kind of
730  * calculation to the entire block, instead of per object.
731  *
732  * The default value for the block count is enough for most lists, so unless
733  * you know you will have a lot of objects visible in the screen at the same
734  * time, don't try to change this.
735  *
736  * @see elm_genlist_block_count_get()
737  * @see @ref Genlist_Implementation
738  *
739  * @ingroup Genlist
740  */
741 EAPI void                          elm_genlist_block_count_set(Evas_Object *obj, int n);
742
743 /**
744  * Get the maximum number of items within an item block
745  *
746  * @param obj The genlist object
747  * @return Maximum number of items within an item block
748  *
749  * @see elm_genlist_block_count_set()
750  *
751  * @ingroup Genlist
752  */
753 EAPI int                           elm_genlist_block_count_get(const Evas_Object *obj);
754
755 /**
756  * Set the timeout in seconds for the longpress event.
757  *
758  * @param obj The genlist object
759  * @param timeout timeout in seconds. Default is 1.
760  *
761  * This option will change how long it takes to send an event "longpressed"
762  * after the mouse down signal is sent to the list. If this event occurs, no
763  * "clicked" event will be sent.
764  *
765  * @see elm_genlist_longpress_timeout_set()
766  *
767  * @ingroup Genlist
768  */
769 EAPI void                          elm_genlist_longpress_timeout_set(Evas_Object *obj, double timeout);
770
771 /**
772  * Get the timeout in seconds for the longpress event.
773  *
774  * @param obj The genlist object
775  * @return timeout in seconds
776  *
777  * @see elm_genlist_longpress_timeout_get()
778  *
779  * @ingroup Genlist
780  */
781 EAPI double                        elm_genlist_longpress_timeout_get(const Evas_Object *obj);
782
783 /**
784  * Append a new item in a given genlist widget.
785  *
786  * @param obj The genlist object
787  * @param itc The item class for the item
788  * @param data The item data
789  * @param parent The parent item, or NULL if none
790  * @param flags Item flags
791  * @param func Convenience function called when the item is selected
792  * @param func_data Data passed to @p func above.
793  * @return A handle to the item added or @c NULL if not possible
794  *
795  * This adds the given item to the end of the list or the end of
796  * the children list if the @p parent is given.
797  *
798  * @see elm_genlist_item_prepend()
799  * @see elm_genlist_item_insert_before()
800  * @see elm_genlist_item_insert_after()
801  * @see elm_object_item_del()
802  *
803  * @ingroup Genlist
804  */
805 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_Flags flags, Evas_Smart_Cb func, const void *func_data);
806
807 /**
808  * Prepend a new item in a given genlist widget.
809  *
810  * @param obj The genlist object
811  * @param itc The item class for the item
812  * @param data The item data
813  * @param parent The parent item, or NULL if none
814  * @param flags Item flags
815  * @param func Convenience function called when the item is selected
816  * @param func_data Data passed to @p func above.
817  * @return A handle to the item added or NULL if not possible
818  *
819  * This adds an item to the beginning of the list or beginning of the
820  * children of the parent if given.
821  *
822  * @see elm_genlist_item_append()
823  * @see elm_genlist_item_insert_before()
824  * @see elm_genlist_item_insert_after()
825  * @see elm_object_item_del()
826  *
827  * @ingroup Genlist
828  */
829 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_Flags flags, Evas_Smart_Cb func, const void *func_data);
830
831 /**
832  * Insert an item before another in a genlist widget
833  *
834  * @param obj The genlist object
835  * @param itc The item class for the item
836  * @param data The item data
837  * @param parent The parent item, or NULL if none
838  * @param before The item to place this new one before.
839  * @param flags Item flags
840  * @param func Convenience function called when the item is selected
841  * @param func_data Data passed to @p func above.
842  * @return A handle to the item added or @c NULL if not possible
843  *
844  * This inserts an item before another in the list. It will be in the
845  * same tree level or group as the item it is inserted before.
846  *
847  * @see elm_genlist_item_append()
848  * @see elm_genlist_item_prepend()
849  * @see elm_genlist_item_insert_after()
850  * @see elm_object_item_del()
851  *
852  * @ingroup Genlist
853  */
854 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_Flags flags, Evas_Smart_Cb func, const void *func_data);
855
856 /**
857  * Insert an item after another in a genlist widget
858  *
859  * @param obj The genlist object
860  * @param itc The item class for the item
861  * @param data The item data
862  * @param parent The parent item, or NULL if none
863  * @param after The item to place this new one after.
864  * @param flags Item flags
865  * @param func Convenience function called when the item is selected
866  * @param func_data Data passed to @p func above.
867  * @return A handle to the item added or @c NULL if not possible
868  *
869  * This inserts an item after another in the list. It will be in the
870  * same tree level or group as the item it is inserted after.
871  *
872  * @see elm_genlist_item_append()
873  * @see elm_genlist_item_prepend()
874  * @see elm_genlist_item_insert_before()
875  * @see elm_object_item_del()
876  *
877  * @ingroup Genlist
878  */
879 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_Flags flags, Evas_Smart_Cb func, const void *func_data);
880
881 /**
882  * Insert a new item into the sorted genlist object
883  *
884  * @param obj The genlist object
885  * @param itc The item class for the item
886  * @param data The item data
887  * @param parent The parent item, or NULL if none
888  * @param flags Item flags
889  * @param comp The function called for the sort
890  * @param func Convenience function called when item selected
891  * @param func_data Data passed to @p func above.
892  * @return A handle to the item added or NULL if not possible
893  *
894  * @ingroup Genlist
895  */
896 // XXX: deprecate elm_genlist_item_sorted_insert() and rename
897 // elm_genlist_item_direct_sorted_insert() 
898 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_Flags flags, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data);
899 EAPI Elm_Object_Item             *elm_genlist_item_direct_sorted_insert(Evas_Object *obj, const Elm_Genlist_Item_Class *itc, const void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Flags flags, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data);
900
901 /* operations to retrieve existing items */
902 /**
903  * Get the selected item in the genlist.
904  *
905  * @param obj The genlist object
906  * @return The selected item, or NULL if none is selected.
907  *
908  * This gets the selected item in the list (if multi-selection is enabled, only
909  * the item that was first selected in the list is returned - which is not very
910  * useful, so see elm_genlist_selected_items_get() for when multi-selection is
911  * used).
912  *
913  * If no item is selected, NULL is returned.
914  *
915  * @see elm_genlist_selected_items_get()
916  *
917  * @ingroup Genlist
918  */
919 EAPI Elm_Object_Item             *elm_genlist_selected_item_get(const Evas_Object *obj);
920
921 /**
922  * Get a list of selected items in the genlist.
923  *
924  * @param obj The genlist object
925  * @return The list of selected items, or NULL if none are selected.
926  *
927  * It returns a list of the selected items. This list pointer is only valid so
928  * long as the selection doesn't change (no items are selected or unselected, or
929  * unselected implicitly by deletion). The list contains genlist items
930  * pointers. The order of the items in this list is the order which they were
931  * selected, i.e. the first item in this list is the first item that was
932  * selected, and so on.
933  *
934  * @note If not in multi-select mode, consider using function
935  * elm_genlist_selected_item_get() instead.
936  *
937  * @see elm_genlist_multi_select_set()
938  * @see elm_genlist_selected_item_get()
939  *
940  * @ingroup Genlist
941  */
942 EAPI const Eina_List              *elm_genlist_selected_items_get(const Evas_Object *obj);
943
944 /**
945  * Get the mode item style of items in the genlist
946  * @param obj The genlist object
947  * @return The mode item style string, or NULL if none is specified
948  *
949  * This is a constant string and simply defines the name of the
950  * style that will be used for mode animations. It can be
951  * @c NULL if you don't plan to use Genlist mode. See
952  * elm_genlist_item_mode_set() for more info.
953  *
954  * @ingroup Genlist
955  */
956 EAPI const char                   *elm_genlist_mode_item_style_get(const Evas_Object *obj);
957
958 /**
959  * Set the mode item style of items in the genlist
960  * @param obj The genlist object
961  * @param style The mode item style string, or NULL if none is desired
962  *
963  * This is a constant string and simply defines the name of the
964  * style that will be used for mode animations. It can be
965  * @c NULL if you don't plan to use Genlist mode. See
966  * elm_genlist_item_mode_set() for more info.
967  *
968  * @ingroup Genlist
969  */
970 EAPI void                          elm_genlist_mode_item_style_set(Evas_Object *obj, const char *style);
971
972 /**
973  * Get a list of realized items in genlist
974  *
975  * @param obj The genlist object
976  * @return The list of realized items, nor NULL if none are realized.
977  *
978  * This returns a list of the realized items in the genlist. The list
979  * contains genlist item pointers. The list must be freed by the
980  * caller when done with eina_list_free(). The item pointers in the
981  * list are only valid so long as those items are not deleted or the
982  * genlist is not deleted.
983  *
984  * @see elm_genlist_realized_items_update()
985  *
986  * @ingroup Genlist
987  */
988 EAPI Eina_List                    *elm_genlist_realized_items_get(const Evas_Object *obj);
989
990 /**
991  * Get the item that is at the x, y canvas coords.
992  *
993  * @param obj The genlist object.
994  * @param x The input x coordinate
995  * @param y The input y coordinate
996  * @param posret The position relative to the item returned here
997  * @return The item at the coordinates or NULL if none
998  *
999  * This returns the item at the given coordinates (which are canvas
1000  * relative, not object-relative). If an item is at that coordinate,
1001  * that item handle is returned, and if @p posret is not NULL, the
1002  * integer pointed to is set to a value of -1, 0 or 1, depending if
1003  * the coordinate is on the upper portion of that item (-1), on the
1004  * middle section (0) or on the lower part (1). If NULL is returned as
1005  * an item (no item found there), then posret may indicate -1 or 1
1006  * based if the coordinate is above or below all items respectively in
1007  * the genlist.
1008  *
1009  * @ingroup Genlist
1010  */
1011 EAPI Elm_Object_Item             *elm_genlist_at_xy_item_get(const Evas_Object *obj, Evas_Coord x, Evas_Coord y, int *posret);
1012
1013 /**
1014  * Get the first item in the genlist
1015  *
1016  * This returns the first item in the list.
1017  *
1018  * @param obj The genlist object
1019  * @return The first item, or NULL if none
1020  *
1021  * @ingroup Genlist
1022  */
1023 EAPI Elm_Object_Item             *elm_genlist_first_item_get(const Evas_Object *obj);
1024
1025 /**
1026  * Get the last item in the genlist
1027  *
1028  * This returns the last item in the list.
1029  *
1030  * @return The last item, or NULL if none
1031  *
1032  * @ingroup Genlist
1033  */
1034 EAPI Elm_Object_Item             *elm_genlist_last_item_get(const Evas_Object *obj);
1035
1036 /**
1037  * Set the scrollbar policy
1038  *
1039  * @param obj The genlist object
1040  * @param policy_h Horizontal scrollbar policy.
1041  * @param policy_v Vertical scrollbar policy.
1042  *
1043  * This sets the scrollbar visibility policy for the given genlist
1044  * scroller. #ELM_SMART_SCROLLER_POLICY_AUTO means the scrollbar is
1045  * made visible if it is needed, and otherwise kept hidden.
1046  * #ELM_SMART_SCROLLER_POLICY_ON turns it on all the time, and
1047  * #ELM_SMART_SCROLLER_POLICY_OFF always keeps it off. This applies
1048  * respectively for the horizontal and vertical scrollbars. Default is
1049  * #ELM_SMART_SCROLLER_POLICY_AUTO
1050  *
1051  * @see elm_genlist_scroller_policy_get()
1052  *
1053  * @ingroup Genlist
1054  */
1055 EAPI void                          elm_genlist_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v);
1056
1057 /**
1058  * Get the scrollbar policy
1059  *
1060  * @param obj The genlist object
1061  * @param policy_h Pointer to store the horizontal scrollbar policy.
1062  * @param policy_v Pointer to store the vertical scrollbar policy.
1063  *
1064  * @see elm_genlist_scroller_policy_set()
1065  *
1066  * @ingroup Genlist
1067  */
1068 EAPI void                          elm_genlist_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v);
1069
1070 /**
1071  * Get the @b next item in a genlist widget's internal list of items,
1072  * given a handle to one of those items.
1073  *
1074  * @param it The genlist item to fetch next from
1075  * @return The item after @p item, or @c NULL if there's none (and
1076  * on errors)
1077  *
1078  * This returns the item placed after the @p item, on the container
1079  * genlist.
1080  *
1081  * @see elm_genlist_item_prev_get()
1082  *
1083  * @ingroup Genlist
1084  */
1085 EAPI Elm_Object_Item             *elm_genlist_item_next_get(const Elm_Object_Item *it);
1086
1087 /**
1088  * Get the @b previous item in a genlist widget's internal list of items,
1089  * given a handle to one of those items.
1090  *
1091  * @param it The genlist item to fetch previous from
1092  * @return The item before @p item, or @c NULL if there's none (and
1093  * on errors)
1094  *
1095  * This returns the item placed before the @p item, on the container
1096  * genlist.
1097  *
1098  * @see elm_genlist_item_next_get()
1099  *
1100  * @ingroup Genlist
1101  */
1102 EAPI Elm_Object_Item             *elm_genlist_item_prev_get(const Elm_Object_Item *it);
1103
1104 /**
1105  * Get the parent item of the given item
1106  *
1107  * @param it The item
1108  * @return The parent of the item or @c NULL if it has no parent.
1109  *
1110  * This returns the item that was specified as parent of the item @p it on
1111  * elm_genlist_item_append() and insertion related functions.
1112  *
1113  * @ingroup Genlist
1114  */
1115 EAPI Elm_Object_Item             *elm_genlist_item_parent_get(const Elm_Object_Item *it);
1116
1117 /**
1118  * Remove all sub-items (children) of the given item
1119  *
1120  * @param it The item
1121  *
1122  * This removes all items that are children (and their descendants) of the
1123  * given item @p it.
1124  *
1125  * @see elm_genlist_clear()
1126  * @see elm_object_item_del()
1127  *
1128  * @ingroup Genlist
1129  */
1130 EAPI void                          elm_genlist_item_subitems_clear(Elm_Object_Item *it);
1131
1132 /**
1133  * Set whether a given genlist item is selected or not
1134  *
1135  * @param it The item
1136  * @param selected Use @c EINA_TRUE, to make it selected, @c
1137  * EINA_FALSE to make it unselected
1138  *
1139  * This sets the selected state of an item. If multi selection is
1140  * not enabled on the containing genlist and @p selected is @c
1141  * EINA_TRUE, any other previously selected items will get
1142  * unselected in favor of this new one.
1143  *
1144  * @see elm_genlist_item_selected_get()
1145  *
1146  * @ingroup Genlist
1147  */
1148 EAPI void                          elm_genlist_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
1149
1150 /**
1151  * Get whether a given genlist item is selected or not
1152  *
1153  * @param it The item
1154  * @return @c EINA_TRUE, if it's selected, @c EINA_FALSE otherwise
1155  *
1156  * @see elm_genlist_item_selected_set() for more details
1157  *
1158  * @ingroup Genlist
1159  */
1160 EAPI Eina_Bool                     elm_genlist_item_selected_get(const Elm_Object_Item *it);
1161
1162 /**
1163  * Sets the expanded state of an item.
1164  *
1165  * @param it The item
1166  * @param expanded The expanded state (@c EINA_TRUE expanded, @c EINA_FALSE not expanded).
1167  *
1168  * This function flags the item of type #ELM_GENLIST_ITEM_SUBITEMS as
1169  * expanded or not.
1170  *
1171  * The theme will respond to this change visually, and a signal "expanded" or
1172  * "contracted" will be sent from the genlist with a pointer to the item that
1173  * has been expanded/contracted.
1174  *
1175  * Calling this function won't show or hide any child of this item (if it is
1176  * a parent). You must manually delete and create them on the callbacks of
1177  * the "expanded" or "contracted" signals.
1178  *
1179  * @see elm_genlist_item_expanded_get()
1180  *
1181  * @ingroup Genlist
1182  */
1183 EAPI void                          elm_genlist_item_expanded_set(Elm_Object_Item *it, Eina_Bool expanded);
1184
1185 /**
1186  * Get the expanded state of an item
1187  *
1188  * @param it The item
1189  * @return The expanded state
1190  *
1191  * This gets the expanded state of an item.
1192  *
1193  * @see elm_genlist_item_expanded_set()
1194  *
1195  * @ingroup Genlist
1196  */
1197 EAPI Eina_Bool                     elm_genlist_item_expanded_get(const Elm_Object_Item *it);
1198
1199 /**
1200  * Get the depth of expanded item
1201  *
1202  * @param it The genlist item object
1203  * @return The depth of expanded item
1204  *
1205  * @ingroup Genlist
1206  */
1207 EAPI int                           elm_genlist_item_expanded_depth_get(const Elm_Object_Item *it);
1208
1209
1210 /**
1211  * Sets the display only state of an item.
1212  *
1213  * @param it The item
1214  * @param display_only @c EINA_TRUE if the item is display only, @c
1215  * EINA_FALSE otherwise.
1216  *
1217  * A display only item cannot be selected or unselected. It is for
1218  * display only and not selecting or otherwise clicking, dragging
1219  * etc. by the user, thus finger size rules will not be applied to
1220  * this item.
1221  *
1222  * It's good to set group index items to display only state.
1223  *
1224  * @see elm_genlist_item_display_only_get()
1225  *
1226  * @ingroup Genlist
1227  */
1228 EAPI void                          elm_genlist_item_display_only_set(Elm_Object_Item *it, Eina_Bool display_only);
1229
1230 /**
1231  * Get the display only state of an item
1232  *
1233  * @param it The item
1234  * @return @c EINA_TRUE if the item is display only, @c
1235  * EINA_FALSE otherwise.
1236  *
1237  * @see elm_genlist_item_display_only_set()
1238  *
1239  * @ingroup Genlist
1240  */
1241 EAPI Eina_Bool                     elm_genlist_item_display_only_get(const Elm_Object_Item *it);
1242
1243 /**
1244  * Show the portion of a genlist's internal list containing a given
1245  * item, immediately.
1246  *
1247  * @param it The item to display
1248  *
1249  * This causes genlist to jump to the given item @p it and show it (by
1250  * immediately scrolling to that position), if it is not fully visible.
1251  *
1252  * @see elm_genlist_item_bring_in()
1253  * @see elm_genlist_item_top_show()
1254  * @see elm_genlist_item_middle_show()
1255  *
1256  * @ingroup Genlist
1257  */
1258 EAPI void                          elm_genlist_item_show(Elm_Object_Item *it);
1259
1260 /**
1261  * Animatedly bring in, to the visible are of a genlist, a given
1262  * item on it.
1263  *
1264  * @param it The item to display
1265  *
1266  * This causes genlist to jump to the given item @p it and show it (by
1267  * animatedly scrolling), if it is not fully visible. This may use animation
1268  * to do so and take a period of time
1269  *
1270  * @see elm_genlist_item_show()
1271  * @see elm_genlist_item_top_bring_in()
1272  * @see elm_genlist_item_middle_bring_in()
1273  *
1274  * @ingroup Genlist
1275  */
1276 EAPI void                          elm_genlist_item_bring_in(Elm_Object_Item *it);
1277
1278 /**
1279  * Show the portion of a genlist's internal list containing a given
1280  * item, immediately.
1281  *
1282  * @param it The item to display
1283  *
1284  * This causes genlist to jump to the given item @p it and show it (by
1285  * immediately scrolling to that position), if it is not fully visible.
1286  *
1287  * The item will be positioned at the top of the genlist viewport.
1288  *
1289  * @see elm_genlist_item_show()
1290  * @see elm_genlist_item_top_bring_in()
1291  *
1292  * @ingroup Genlist
1293  */
1294 EAPI void                          elm_genlist_item_top_show(Elm_Object_Item *it);
1295
1296 /**
1297  * Animatedly bring in, to the visible are of a genlist, a given
1298  * item on it.
1299  *
1300  * @param it The item
1301  *
1302  * This causes genlist to jump to the given item @p it and show it (by
1303  * animatedly scrolling), if it is not fully visible. This may use animation
1304  * to do so and take a period of time
1305  *
1306  * The item will be positioned at the top of the genlist viewport.
1307  *
1308  * @see elm_genlist_item_bring_in()
1309  * @see elm_genlist_item_top_show()
1310  *
1311  * @ingroup Genlist
1312  */
1313 EAPI void                          elm_genlist_item_top_bring_in(Elm_Object_Item *it);
1314
1315 /**
1316  * Show the portion of a genlist's internal list containing a given
1317  * item, immediately.
1318  *
1319  * @param it The item to display
1320  *
1321  * This causes genlist to jump to the given item @p it and show it (by
1322  * immediately scrolling to that position), if it is not fully visible.
1323  *
1324  * The item will be positioned at the middle of the genlist viewport.
1325  *
1326  * @see elm_genlist_item_show()
1327  * @see elm_genlist_item_middle_bring_in()
1328  *
1329  * @ingroup Genlist
1330  */
1331 EAPI void                          elm_genlist_item_middle_show(Elm_Object_Item *it);
1332
1333 /**
1334  * Animatedly bring in, to the visible are of a genlist, a given
1335  * item on it.
1336  *
1337  * @param it The item
1338  *
1339  * This causes genlist to jump to the given item @p it and show it (by
1340  * animatedly scrolling), if it is not fully visible. This may use animation
1341  * to do so and take a period of time
1342  *
1343  * The item will be positioned at the middle of the genlist viewport.
1344  *
1345  * @see elm_genlist_item_bring_in()
1346  * @see elm_genlist_item_middle_show()
1347  *
1348  * @ingroup Genlist
1349  */
1350 EAPI void                          elm_genlist_item_middle_bring_in(Elm_Object_Item *it);
1351
1352 /**
1353  * Tells genlist to "orphan" contents fetched by the item class
1354  *
1355  * @param it The item
1356  *
1357  * This instructs genlist to release references to contents in the item,
1358  * meaning that they will no longer be managed by genlist and are
1359  * floating "orphans" that can be re-used elsewhere if the user wants
1360  * to.
1361  *
1362  * @ingroup Genlist
1363  */
1364 EAPI void                          elm_genlist_item_contents_orphan(Elm_Object_Item *it);
1365
1366 /**
1367  * Get the real Evas object created to implement the view of a
1368  * given genlist item
1369  *
1370  * @param it The genlist item.
1371  * @return the Evas object implementing this item's view.
1372  *
1373  * This returns the actual Evas object used to implement the
1374  * specified genlist item's view. This may be @c NULL, as it may
1375  * not have been created or may have been deleted, at any time, by
1376  * the genlist. <b>Do not modify this object</b> (move, resize,
1377  * show, hide, etc.), as the genlist is controlling it. This
1378  * function is for querying, emitting custom signals or hooking
1379  * lower level callbacks for events on that object. Do not delete
1380  * this object under any circumstances.
1381  *
1382  * @see elm_object_item_data_get()
1383  *
1384  * @ingroup Genlist
1385  */
1386 EAPI const Evas_Object            *elm_genlist_item_object_get(const Elm_Object_Item *it);
1387
1388 /**
1389  * Update the contents of an item
1390  *
1391  * @param it The item
1392  *
1393  * This updates an item by calling all the item class functions again
1394  * to get the contents, texts and states. Use this when the original
1395  * item data has changed and the changes are desired to be reflected.
1396  *
1397  * Use elm_genlist_realized_items_update() to update all already realized
1398  * items.
1399  *
1400  * @see elm_genlist_realized_items_update()
1401  *
1402  * @ingroup Genlist
1403  */
1404 EAPI void                          elm_genlist_item_update(Elm_Object_Item *it);
1405
1406 /**
1407  * Promote an item to the top of the list
1408  *
1409  * @param it The item
1410  *
1411  * @ingroup Genlist
1412  */
1413 EAPI void                          elm_genlist_item_promote(Elm_Object_Item *it);
1414
1415 /**
1416  * Demote an item to the end of the list
1417  *
1418  * @param it The item
1419  *
1420  * @ingroup Genlist
1421  */
1422 EAPI void                          elm_genlist_item_demote(Elm_Object_Item *it);
1423
1424 /**
1425  * Update the part of an item
1426  *
1427  * @param it The item
1428  * @param parts The name of item's part
1429  * @param itf The flags of item's part type
1430  *
1431  * This updates an item's part by calling item's fetching functions again
1432  * to get the contents, texts and states. Use this when the original
1433  * item data has changed and the changes are desired to be reflected.
1434  * Second parts argument is used for globbing to match '*', '?', and '.'
1435  * It can be used at updating multi fields.
1436  *
1437  * Use elm_genlist_realized_items_update() to update an item's all
1438  * property.
1439  *
1440  * @see elm_genlist_item_update()
1441  *
1442  * @ingroup Genlist
1443  */
1444 EAPI void                          elm_genlist_item_fields_update(Elm_Object_Item *it, const char *parts, Elm_Genlist_Item_Field_Flags itf);
1445
1446 /**
1447  * Update the item class of an item
1448  *
1449  * @param it The item
1450  * @param itc The item class for the item
1451  *
1452  * This sets another class of the item, changing the way that it is
1453  * displayed. After changing the item class, elm_genlist_item_update() is
1454  * called on the item @p it.
1455  *
1456  * @ingroup Genlist
1457  */
1458 EAPI void                          elm_genlist_item_item_class_update(Elm_Object_Item *it, const Elm_Genlist_Item_Class *itc);
1459 EAPI const Elm_Genlist_Item_Class *elm_genlist_item_item_class_get(const Elm_Object_Item *it);
1460
1461 /**
1462  * Set the text to be shown in a given genlist item's tooltips.
1463  *
1464  * @param it The genlist item
1465  * @param text The text to set in the content
1466  *
1467  * This call will setup the text to be used as tooltip to that item
1468  * (analogous to elm_object_tooltip_text_set(), but being item
1469  * tooltips with higher precedence than object tooltips). It can
1470  * have only one tooltip at a time, so any previous tooltip data
1471  * will get removed.
1472  *
1473  * In order to set a content or something else as a tooltip, look at
1474  * elm_genlist_item_tooltip_content_cb_set().
1475  *
1476  * @ingroup Genlist
1477  */
1478 EAPI void                          elm_genlist_item_tooltip_text_set(Elm_Object_Item *it, const char *text);
1479
1480 /**
1481  * Set the content to be shown in a given genlist item's tooltips
1482  *
1483  * @param it The genlist item.
1484  * @param func The function returning the tooltip contents.
1485  * @param data What to provide to @a func as callback data/context.
1486  * @param del_cb Called when data is not needed anymore, either when
1487  *        another callback replaces @p func, the tooltip is unset with
1488  *        elm_genlist_item_tooltip_unset() or the owner @p item
1489  *        dies. This callback receives as its first parameter the
1490  *        given @p data, being @c event_info the item handle.
1491  *
1492  * This call will setup the tooltip's contents to @p item
1493  * (analogous to elm_object_tooltip_content_cb_set(), but being
1494  * item tooltips with higher precedence than object tooltips). It
1495  * can have only one tooltip at a time, so any previous tooltip
1496  * content will get removed. @p func (with @p data) will be called
1497  * every time Elementary needs to show the tooltip and it should
1498  * return a valid Evas object, which will be fully managed by the
1499  * tooltip system, getting deleted when the tooltip is gone.
1500  *
1501  * In order to set just a text as a tooltip, look at
1502  * elm_genlist_item_tooltip_text_set().
1503  *
1504  * @ingroup Genlist
1505  */
1506 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);
1507
1508 /**
1509  * Unset a tooltip from a given genlist item
1510  *
1511  * @param it genlist item to remove a previously set tooltip from.
1512  *
1513  * This call removes any tooltip set on @p item. The callback
1514  * provided as @c del_cb to
1515  * elm_genlist_item_tooltip_content_cb_set() will be called to
1516  * notify it is not used anymore (and have resources cleaned, if
1517  * need be).
1518  *
1519  * @see elm_genlist_item_tooltip_content_cb_set()
1520  *
1521  * @ingroup Genlist
1522  */
1523 EAPI void                          elm_genlist_item_tooltip_unset(Elm_Object_Item *it);
1524
1525 /**
1526  * Set a different @b style for a given genlist item's tooltip.
1527  *
1528  * @param it genlist item with tooltip set
1529  * @param style the <b>theme style</b> to use on tooltips (e.g. @c
1530  * "default", @c "transparent", etc)
1531  *
1532  * Tooltips can have <b>alternate styles</b> to be displayed on,
1533  * which are defined by the theme set on Elementary. This function
1534  * works analogously as elm_object_tooltip_style_set(), but here
1535  * applied only to genlist item objects. The default style for
1536  * tooltips is @c "default".
1537  *
1538  * @note before you set a style you should define a tooltip with
1539  *       elm_genlist_item_tooltip_content_cb_set() or
1540  *       elm_genlist_item_tooltip_text_set()
1541  *
1542  * @see elm_genlist_item_tooltip_style_get()
1543  *
1544  * @ingroup Genlist
1545  */
1546 EAPI void                          elm_genlist_item_tooltip_style_set(Elm_Object_Item *it, const char *style);
1547
1548 /**
1549  * Get the style set a given genlist item's tooltip.
1550  *
1551  * @param it genlist item with tooltip already set on.
1552  * @return style the theme style in use, which defaults to
1553  *         "default". If the object does not have a tooltip set,
1554  *         then @c NULL is returned.
1555  *
1556  * @see elm_genlist_item_tooltip_style_set() for more details
1557  *
1558  * @ingroup Genlist
1559  */
1560 EAPI const char                   *elm_genlist_item_tooltip_style_get(const Elm_Object_Item *it);
1561
1562 /**
1563  * @brief Disable size restrictions on an object's tooltip
1564  * @param it The tooltip's anchor object
1565  * @param disable If EINA_TRUE, size restrictions are disabled
1566  * @return EINA_FALSE on failure, EINA_TRUE on success
1567  *
1568  * This function allows a tooltip to expand beyond its parent window's canvas.
1569  * It will instead be limited only by the size of the display.
1570  */
1571 EAPI Eina_Bool                     elm_genlist_item_tooltip_window_mode_set(Elm_Object_Item *it, Eina_Bool disable);
1572
1573 /**
1574  * @brief Retrieve size restriction state of an object's tooltip
1575  * @param it The tooltip's anchor object
1576  * @return If EINA_TRUE, size restrictions are disabled
1577  *
1578  * This function returns whether a tooltip is allowed to expand beyond
1579  * its parent window's canvas.
1580  * It will instead be limited only by the size of the display.
1581  */
1582 EAPI Eina_Bool                     elm_genlist_item_tooltip_window_mode_get(const Elm_Object_Item *it);
1583
1584 /**
1585  * Set the type of mouse pointer/cursor decoration to be shown,
1586  * when the mouse pointer is over the given genlist widget item
1587  *
1588  * @param it genlist item to customize cursor on
1589  * @param cursor the cursor type's name
1590  *
1591  * This function works analogously as elm_object_cursor_set(), but
1592  * here the cursor's changing area is restricted to the item's
1593  * area, and not the whole widget's. Note that that item cursors
1594  * have precedence over widget cursors, so that a mouse over @p
1595  * item will always show cursor @p type.
1596  *
1597  * If this function is called twice for an object, a previously set
1598  * cursor will be unset on the second call.
1599  *
1600  * @see elm_object_cursor_set()
1601  * @see elm_genlist_item_cursor_get()
1602  * @see elm_genlist_item_cursor_unset()
1603  *
1604  * @ingroup Genlist
1605  */
1606 EAPI void                          elm_genlist_item_cursor_set(Elm_Object_Item *it, const char *cursor);
1607
1608 /**
1609  * Get the type of mouse pointer/cursor decoration set to be shown,
1610  * when the mouse pointer is over the given genlist widget item
1611  *
1612  * @param it genlist item with custom cursor set
1613  * @return the cursor type's name or @c NULL, if no custom cursors
1614  * were set to @p item (and on errors)
1615  *
1616  * @see elm_object_cursor_get()
1617  * @see elm_genlist_item_cursor_set() for more details
1618  * @see elm_genlist_item_cursor_unset()
1619  *
1620  * @ingroup Genlist
1621  */
1622 EAPI const char                   *elm_genlist_item_cursor_get(const Elm_Object_Item *it);
1623
1624 /**
1625  * Unset any custom mouse pointer/cursor decoration set to be
1626  * shown, when the mouse pointer is over the given genlist widget
1627  * item, thus making it show the @b default cursor again.
1628  *
1629  * @param it a genlist item
1630  *
1631  * Use this call to undo any custom settings on this item's cursor
1632  * decoration, bringing it back to defaults (no custom style set).
1633  *
1634  * @see elm_object_cursor_unset()
1635  * @see elm_genlist_item_cursor_set() for more details
1636  *
1637  * @ingroup Genlist
1638  */
1639 EAPI void                          elm_genlist_item_cursor_unset(Elm_Object_Item *it);
1640
1641 /**
1642  * Set a different @b style for a given custom cursor set for a
1643  * genlist item.
1644  *
1645  * @param it genlist item with custom cursor set
1646  * @param style the <b>theme style</b> to use (e.g. @c "default",
1647  * @c "transparent", etc)
1648  *
1649  * This function only makes sense when one is using custom mouse
1650  * cursor decorations <b>defined in a theme file</b> , which can
1651  * have, given a cursor name/type, <b>alternate styles</b> on
1652  * it. It works analogously as elm_object_cursor_style_set(), but
1653  * here applied only to genlist item objects.
1654  *
1655  * @warning Before you set a cursor style you should have defined a
1656  *       custom cursor previously on the item, with
1657  *       elm_genlist_item_cursor_set()
1658  *
1659  * @see elm_genlist_item_cursor_engine_only_set()
1660  * @see elm_genlist_item_cursor_style_get()
1661  *
1662  * @ingroup Genlist
1663  */
1664 EAPI void                          elm_genlist_item_cursor_style_set(Elm_Object_Item *it, const char *style);
1665
1666 /**
1667  * Get the current @b style set for a given genlist item's custom
1668  * cursor
1669  *
1670  * @param it genlist item with custom cursor set.
1671  * @return style the cursor style in use. If the object does not
1672  *         have a cursor set, then @c NULL is returned.
1673  *
1674  * @see elm_genlist_item_cursor_style_set() for more details
1675  *
1676  * @ingroup Genlist
1677  */
1678 EAPI const char                   *elm_genlist_item_cursor_style_get(const Elm_Object_Item *it);
1679
1680 /**
1681  * Set if the (custom) cursor for a given genlist item should be
1682  * searched in its theme, also, or should only rely on the
1683  * rendering engine.
1684  *
1685  * @param it item with custom (custom) cursor already set on
1686  * @param engine_only Use @c EINA_TRUE to have cursors looked for
1687  * only on those provided by the rendering engine, @c EINA_FALSE to
1688  * have them searched on the widget's theme, as well.
1689  *
1690  * @note This call is of use only if you've set a custom cursor
1691  * for genlist items, with elm_genlist_item_cursor_set().
1692  *
1693  * @note By default, cursors will only be looked for between those
1694  * provided by the rendering engine.
1695  *
1696  * @ingroup Genlist
1697  */
1698 EAPI void                          elm_genlist_item_cursor_engine_only_set(Elm_Object_Item *it, Eina_Bool engine_only);
1699
1700 /**
1701  * Get if the (custom) cursor for a given genlist item is being
1702  * searched in its theme, also, or is only relying on the rendering
1703  * engine.
1704  *
1705  * @param it a genlist item
1706  * @return @c EINA_TRUE, if cursors are being looked for only on
1707  * those provided by the rendering engine, @c EINA_FALSE if they
1708  * are being searched on the widget's theme, as well.
1709  *
1710  * @see elm_genlist_item_cursor_engine_only_set(), for more details
1711  *
1712  * @ingroup Genlist
1713  */
1714 EAPI Eina_Bool                     elm_genlist_item_cursor_engine_only_get(const Elm_Object_Item *it);
1715
1716 /**
1717  * Get the index of the item. It is only valid once displayed.
1718  *
1719  * @param it a genlist item
1720  * @return the position inside the list of item.
1721  *
1722  * @ingroup Genlist
1723  */
1724 EAPI int                           elm_genlist_item_index_get(Elm_Object_Item *it);
1725
1726 /**
1727  * Update the contents of all realized items.
1728  *
1729  * @param obj The genlist object.
1730  *
1731  * This updates all realized items by calling all the item class functions again
1732  * to get the contents, texts and states. Use this when the original
1733  * item data has changed and the changes are desired to be reflected.
1734  *
1735  * To update just one item, use elm_genlist_item_update().
1736  *
1737  * @see elm_genlist_realized_items_get()
1738  * @see elm_genlist_item_update()
1739  *
1740  * @ingroup Genlist
1741  */
1742 EAPI void                          elm_genlist_realized_items_update(Evas_Object *obj);
1743
1744 /**
1745  * Activate a genlist mode on an item
1746  *
1747  * @param it The genlist item
1748  * @param mode_type Mode name
1749  * @param mode_set Boolean to define set or unset mode.
1750  *
1751  * A genlist mode is a different way of selecting an item. Once a mode is
1752  * activated on an item, any other selected item is immediately unselected.
1753  * This feature provides an easy way of implementing a new kind of animation
1754  * for selecting an item, without having to entirely rewrite the item style
1755  * theme. However, the elm_genlist_selected_* API can't be used to get what
1756  * item is activate for a mode.
1757  *
1758  * The current item style will still be used, but applying a genlist mode to
1759  * an item will select it using a different kind of animation.
1760  *
1761  * The current active item for a mode can be found by
1762  * elm_genlist_mode_item_get().
1763  *
1764  * The characteristics of genlist mode are:
1765  * - Only one mode can be active at any time, and for only one item.
1766  * - Genlist handles deactivating other items when one item is activated.
1767  * - A mode is defined in the genlist theme (edc), and more modes can easily
1768  *   be added.
1769  * - A mode style and the genlist item style are different things. They
1770  *   can be combined to provide a default style to the item, with some kind
1771  *   of animation for that item when the mode is activated.
1772  *
1773  * When a mode is activated on an item, a new view for that item is created.
1774  * The theme of this mode defines the animation that will be used to transit
1775  * the item from the old view to the new view. This second (new) view will be
1776  * active for that item while the mode is active on the item, and will be
1777  * destroyed after the mode is totally deactivated from that item.
1778  *
1779  * @see elm_genlist_mode_get()
1780  * @see elm_genlist_mode_item_get()
1781  *
1782  * @ingroup Genlist
1783  */
1784 EAPI void                          elm_genlist_item_mode_set(Elm_Object_Item *it, const char *mode_type, Eina_Bool mode_set);
1785
1786 /**
1787  * Get the last (or current) genlist mode used.
1788  *
1789  * @param obj The genlist object
1790  *
1791  * This function just returns the name of the last used genlist mode. It will
1792  * be the current mode if it's still active.
1793  *
1794  * @see elm_genlist_item_mode_set()
1795  * @see elm_genlist_mode_item_get()
1796  *
1797  * @ingroup Genlist
1798  */
1799 EAPI const char                   *elm_genlist_mode_type_get(const Evas_Object *obj);
1800
1801 /**
1802  * Get active genlist mode item
1803  *
1804  * @param obj The genlist object
1805  * @return The active item for that current mode. Or @c NULL if no item is
1806  * activated with any mode.
1807  *
1808  * This function returns the item that was activated with a mode, by the
1809  * function elm_genlist_item_mode_set().
1810  *
1811  * @see elm_genlist_item_mode_set()
1812  * @see elm_genlist_mode_get()
1813  *
1814  * @ingroup Genlist
1815  */
1816 EAPI const Elm_Object_Item       *elm_genlist_mode_item_get(const Evas_Object *obj);
1817
1818 /**
1819  * Set reorder mode
1820  *
1821  * @param obj The genlist object
1822  * @param reorder_mode The reorder mode
1823  * (EINA_TRUE = on, EINA_FALSE = off)
1824  *
1825  * @ingroup Genlist
1826  */
1827 EAPI void                          elm_genlist_reorder_mode_set(Evas_Object *obj, Eina_Bool reorder_mode);
1828
1829 /**
1830  * Get the reorder mode
1831  *
1832  * @param obj The genlist object
1833  * @return The reorder mode
1834  * (EINA_TRUE = on, EINA_FALSE = off)
1835  *
1836  * @ingroup Genlist
1837  */
1838 EAPI Eina_Bool                     elm_genlist_reorder_mode_get(const Evas_Object *obj);
1839
1840 /**
1841  * Get the Item's Flags
1842  *
1843  * @param it The genlist item
1844  * @return The item flags.
1845  *
1846  * This function returns the item's type. Normally the item's type.
1847  * If it failed, return value is ELM_GENLIST_ITEM_MAX
1848  *
1849  * @ingroup Genlist
1850  */
1851 EAPI Elm_Genlist_Item_Flags        elm_genlist_item_flags_get(const Elm_Object_Item *it);
1852
1853 #define ELM_GENLIST_ITEM_CLASS_VERSION 2 /* current version number */
1854
1855 /**
1856  * Add a new genlist item class in a given genlist widget.
1857  *
1858  * @return New allocated a genlist item class.
1859  *
1860  * This adds genlist item class for the genlist widget. When adding a item,
1861  * genlist_item_{append, prepend, insert} function needs item class of the item.
1862  * Given callback paramters are used at retrieving {text, content} of
1863  * added item. Set as NULL if it's not used.
1864  * If there's no available memory, return can be NULL.
1865  *
1866  * @see elm_genlist_item_class_free()
1867  * @see elm_genlist_item_append()
1868  *
1869  * @ingroup Genlist
1870  */
1871 EAPI Elm_Genlist_Item_Class *elm_genlist_item_class_new(void);
1872
1873 /**
1874  * Remove a item class in a given genlist widget.
1875  *
1876  * @param itc The itc to be removed.
1877  *
1878  * This removes item class from the genlist widget.
1879  * Whenever it has no more references to it, item class is going to be freed.
1880  * Otherwise it just decreases its reference count.
1881  *
1882  * @see elm_genlist_item_class_new()
1883  * @see elm_genlist_item_class_ref()
1884  * @see elm_genlist_item_class_unref()
1885  *
1886  * @ingroup Genlist
1887  */
1888 EAPI void elm_genlist_item_class_free(Elm_Genlist_Item_Class *itc);
1889
1890 /**
1891  * Increments object reference count for the item class.
1892  *
1893  * @param itc The given item class object to reference
1894  *
1895  * This API just increases its reference count for item class management.
1896  *
1897  * @see elm_genlist_item_class_unref()
1898  *
1899  * @ingroup Genlist
1900  */
1901 EAPI void elm_genlist_item_class_ref(Elm_Genlist_Item_Class *itc);
1902
1903 /**
1904  * Decrements object reference count for the item class.
1905  *
1906  * @param itc The given item class object to reference
1907  *
1908  * This API just decreases its reference count for item class management.
1909  * Reference count can't be less than 0.
1910  *
1911  * @see elm_genlist_item_class_ref()
1912  * @see elm_genlist_item_class_free()
1913  *
1914  * @ingroup Genlist
1915  */
1916 EAPI void elm_genlist_item_class_unref(Elm_Genlist_Item_Class *itc);
1917
1918 /**
1919  * Return how many items are currently in a list
1920  *
1921  * @param obj The list
1922  * @return The total number of list items in the list
1923  *
1924  * This behavior is O(1) and includes items which may or may not be realized.
1925  *
1926  * @ingroup Genlist
1927  */
1928 EAPI unsigned int elm_genlist_items_count(const Evas_Object *obj);
1929 /**
1930  * @}
1931  */