elementary/genlist - reviewed.
[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 //XXX: Elm_Genlist_Item_Type
352  typedef enum
353 {
354    ELM_GENLIST_ITEM_NONE = 0, /**< simple item */
355    ELM_GENLIST_ITEM_SUBITEMS = (1 << 0), /**< may expand and have child items */
356    ELM_GENLIST_ITEM_GROUP = (1 << 1), /**< index of a group of items */
357
358    ELM_GENLIST_ITEM_MAX = (1 << 2)
359 } Elm_Genlist_Item_Flags;
360
361 //XXX: Elm_Genlist_Item_Field_Type
362 typedef enum
363 {
364    ELM_GENLIST_ITEM_FIELD_ALL = 0,
365    //XXX:ELM_GENLSIT_ITEM_FIELD_TEXT
366    ELM_GENLIST_ITEM_FIELD_LABEL = (1 << 0),
367    ELM_GENLIST_ITEM_FIELD_CONTENT = (1 << 1),
368    ELM_GENLIST_ITEM_FIELD_STATE = (1 << 2)
369 } Elm_Genlist_Item_Field_Flags;
370 typedef struct _Elm_Genlist_Item_Class      Elm_Genlist_Item_Class; /**< Genlist item class definition structs */
371
372 #define Elm_Genlist_Item_Class Elm_Gen_Item_Class
373 typedef struct _Elm_Genlist_Item_Class_Func Elm_Genlist_Item_Class_Func;    /**< Class functions for genlist item class */
374
375 /**
376  * Text fetching class function for Elm_Gen_Item_Class.
377  * @param data The data passed in the item creation function
378  * @param obj The base widget object
379  * @param part The part name of the swallow
380  * @return The allocated (NOT stringshared) string to set as the text
381  */
382 typedef char *(*Elm_Genlist_Item_Text_Get_Cb)(void *data, Evas_Object *obj, const char *part);
383
384 /**
385  * Content (swallowed object) fetching class function for Elm_Gen_Item_Class.
386  * @param data The data passed in the item creation function
387  * @param obj The base widget object
388  * @param part The part name of the swallow
389  * @return The content object to swallow
390  */
391 typedef Evas_Object *(*Elm_Genlist_Item_Content_Get_Cb)(void *data, Evas_Object *obj, const char *part);
392
393 /**
394  * State fetching class function for Elm_Gen_Item_Class.
395  * @param data The data passed in the item creation function
396  * @param obj The base widget object
397  * @param part The part name of the swallow
398  * @return The hell if I know
399  */
400 typedef Eina_Bool (*Elm_Genlist_Item_State_Get_Cb)(void *data, Evas_Object *obj, const char *part);
401
402 /**
403  * Deletion class function for Elm_Gen_Item_Class.
404  * @param data The data passed in the item creation function
405  * @param obj The base widget object
406  */
407 typedef void (*Elm_Genlist_Item_Del_Cb)(void *data, Evas_Object *obj);
408
409 /**
410  * @struct _Elm_Genlist_Item_Class
411  *
412  * Genlist item class definition structs.
413  *
414  * This struct contains the style and fetching functions that will define the
415  * contents of each item.
416  *
417  * @see @ref Genlist_Item_Class
418  */
419 struct _Elm_Genlist_Item_Class
420 {
421    const char *item_style; /**< style of this class. */
422    struct Elm_Genlist_Item_Class_Func
423    {
424       Elm_Genlist_Item_Text_Get_Cb    text_get; /**< Text fetching class function for genlist item classes.*/
425       Elm_Genlist_Item_Content_Get_Cb content_get; /**< Content fetching class function for genlist item classes. */
426       Elm_Genlist_Item_State_Get_Cb   state_get; /**< State fetching class function for genlist item classes. */
427       Elm_Genlist_Item_Del_Cb         del; /**< Deletion class function for genlist item classes. */
428    } func;
429 };
430 #define Elm_Genlist_Item_Class_Func Elm_Gen_Item_Class_Func
431 /**
432  * Add a new genlist widget to the given parent Elementary
433  * (container) object
434  *
435  * @param parent The parent object
436  * @return a new genlist widget handle or @c NULL, on errors
437  *
438  * This function inserts a new genlist widget on the canvas.
439  *
440  * @see elm_genlist_item_append()
441  * @see elm_object_item_del()
442  * @see elm_genlist_clear()
443  *
444  * @ingroup Genlist
445  */
446 EAPI Evas_Object                  *elm_genlist_add(Evas_Object *parent);
447
448 /**
449  * Remove all items from a given genlist widget.
450  *
451  * @param obj The genlist object
452  *
453  * This removes (and deletes) all items in @p obj, leaving it empty.
454  *
455  * @see elm_object_item_del(), to remove just one item.
456  *
457  * @ingroup Genlist
458  */
459 EAPI void                          elm_genlist_clear(Evas_Object *obj);
460
461 /**
462  * Enable or disable multi-selection in the genlist
463  *
464  * @param obj The genlist object
465  * @param multi Multi-select enable/disable. Default is disabled.
466  *
467  * This enables (@c EINA_TRUE) or disables (@c EINA_FALSE) multi-selection in
468  * the list. This allows more than 1 item to be selected. To retrieve the list
469  * of selected items, use elm_genlist_selected_items_get().
470  *
471  * @see elm_genlist_selected_items_get()
472  * @see elm_genlist_multi_select_get()
473  *
474  * @ingroup Genlist
475  */
476 EAPI void                          elm_genlist_multi_select_set(Evas_Object *obj, Eina_Bool multi);
477
478 /**
479  * Gets if multi-selection in genlist is enabled or disabled.
480  *
481  * @param obj The genlist object
482  * @return Multi-select enabled/disabled
483  * (@c EINA_TRUE = enabled/@c EINA_FALSE = disabled). Default is @c EINA_FALSE.
484  *
485  * @see elm_genlist_multi_select_set()
486  *
487  * @ingroup Genlist
488  */
489 EAPI Eina_Bool                     elm_genlist_multi_select_get(const Evas_Object *obj);
490
491 /**
492  * This sets the horizontal stretching mode.
493  *
494  * @param obj The genlist object
495  * @param mode The mode to use (one of #ELM_LIST_SCROLL or #ELM_LIST_LIMIT).
496  *
497  * This sets the mode used for sizing items horizontally. Valid modes
498  * are #ELM_LIST_LIMIT and #ELM_LIST_SCROLL. The default is
499  * ELM_LIST_SCROLL. This mode means that if items are too wide to fit,
500  * the scroller will scroll horizontally. Otherwise items are expanded
501  * to fill the width of the viewport of the scroller. If it is
502  * ELM_LIST_LIMIT, items will be expanded to the viewport width and
503  * limited to that size.
504  *
505  * @see elm_genlist_mode_get()
506  *
507  * @ingroup Genlist
508  */
509 EAPI void                          elm_genlist_mode_set(Evas_Object *obj, Elm_List_Mode mode);
510
511 /**
512  * Gets the horizontal stretching mode.
513  *
514  * @param obj The genlist object
515  * @return The mode to use
516  * (#ELM_LIST_LIMIT, #ELM_LIST_SCROLL)
517  *
518  * @see elm_genlist_horizontal_set()
519  *
520  * @ingroup Genlist
521  */
522 EAPI Elm_List_Mode                 elm_genlist_mode_get(const Evas_Object *obj);
523
524 /**
525  * Set the always select mode.
526  *
527  * @param obj The genlist object
528  * @param always_select The always select mode (@c EINA_TRUE = on, @c
529  * EINA_FALSE = off). Default is @c EINA_FALSE.
530  *
531  * Items will only call their selection func and callback when first
532  * becoming selected. Any further clicks will do nothing, unless you
533  * enable always select with elm_genlist_always_select_mode_set().
534  * This means that, even if selected, every click will make the selected
535  * callbacks be called.
536  *
537  * @see elm_genlist_always_select_mode_get()
538  *
539  * @ingroup Genlist
540  */
541 //XXX: How about elm_genlist_select_mode_set() ? 
542 EAPI void                          elm_genlist_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select);
543
544 /**
545  * Get the always select mode.
546  *
547  * @param obj The genlist object
548  * @return The always select mode
549  * (@c EINA_TRUE = on, @c EINA_FALSE = off)
550  *
551  * @see elm_genlist_always_select_mode_set()
552  *
553  * @ingroup Genlist
554  */
555 //XXX: How about elm_genlist_select_mode_get() ? 
556 EAPI Eina_Bool                     elm_genlist_always_select_mode_get(const Evas_Object *obj);
557
558 /**
559  * Enable/disable the no select mode.
560  *
561  * @param obj The genlist object
562  * @param no_select The no select mode
563  * (EINA_TRUE = on, EINA_FALSE = off)
564  *
565  * This will turn off the ability to select items entirely and they
566  * will neither appear selected nor call selected callback functions.
567  *
568  * @see elm_genlist_no_select_mode_get()
569  *
570  * @ingroup Genlist
571  */
572 //XXX: elm_genlist_always_select_mode_set and elm_genlist_no_select_mode_set API could be merged to elm_genlist_select_mode_set() 
573 EAPI void                          elm_genlist_no_select_mode_set(Evas_Object *obj, Eina_Bool no_select);
574
575 /**
576  * Gets whether the no select mode is enabled.
577  *
578  * @param obj The genlist object
579  * @return The no select mode
580  * (@c EINA_TRUE = on, @c EINA_FALSE = off)
581  *
582  * @see elm_genlist_no_select_mode_set()
583  *
584  * @ingroup Genlist
585  */
586 //XXX: elm_genlist_always_select_mode_get and elm_genlist_no_select_mode_get API could be merged to elm_genlist_select_mode_get() 
587 EAPI Eina_Bool                     elm_genlist_no_select_mode_get(const Evas_Object *obj);
588
589 /**
590  * Enable/disable compress mode.
591  *
592  * @param obj The genlist object
593  * @param compress The compress mode
594  * (@c EINA_TRUE = on, @c EINA_FALSE = off). Default is @c EINA_FALSE.
595  *
596  * This will enable the compress mode where items are "compressed"
597  * horizontally to fit the genlist scrollable viewport width. This is
598  * special for genlist.  Do not rely on
599  * elm_genlist_horizontal_set() being set to @c ELM_LIST_COMPRESS to
600  * work as genlist needs to handle it specially.
601  *
602  * @see elm_genlist_compress_mode_get()
603  *
604  * @ingroup Genlist
605  */
606 EAPI void                          elm_genlist_compress_mode_set(Evas_Object *obj, Eina_Bool compress);
607
608 /**
609  * Get whether the compress mode is enabled.
610  *
611  * @param obj The genlist object
612  * @return The compress mode
613  * (@c EINA_TRUE = on, @c EINA_FALSE = off)
614  *
615  * @see elm_genlist_compress_mode_set()
616  *
617  * @ingroup Genlist
618  */
619 EAPI Eina_Bool                     elm_genlist_compress_mode_get(const Evas_Object *obj);
620
621 /**
622  * Enable/disable height-for-width mode.
623  *
624  * @param obj The genlist object
625  * @param height_for_width The height-for-width mode (@c EINA_TRUE = on,
626  * @c EINA_FALSE = off). Default is @c EINA_FALSE.
627  *
628  * With height-for-width mode the item width will be fixed (restricted
629  * to a minimum of) to the list width when calculating its size in
630  * order to allow the height to be calculated based on it. This allows,
631  * for instance, text block to wrap lines if the Edje part is
632  * configured with "text.min: 0 1".
633  *
634  * @note This mode will make list resize slower as it will have to
635  *       recalculate every item height again whenever the list width
636  *       changes!
637  *
638  * @note When height-for-width mode is enabled, it also enables
639  *       compress mode (see elm_genlist_compress_mode_set()) and
640  *       disables homogeneous (see elm_genlist_homogeneous_set()).
641  *
642  * @ingroup Genlist
643  */
644 //XXX: API name is ambiguous.. How about elm_genlist_mode_fixed_width_set? 
645 EAPI void                          elm_genlist_height_for_width_mode_set(Evas_Object *obj, Eina_Bool height_for_width);
646
647 /**
648  * Get whether the height-for-width mode is enabled.
649  *
650  * @param obj The genlist object
651  * @return The height-for-width mode (@c EINA_TRUE = on, @c EINA_FALSE =
652  * off)
653  *
654  * @ingroup Genlist
655  */
656 //XXX: API name is ambigious elm_genlist_mode_fixed_width_get() ?????
657 EAPI Eina_Bool                     elm_genlist_height_for_width_mode_get(const Evas_Object *obj);
658
659 /**
660  * Enable/disable horizontal and vertical bouncing effect.
661  *
662  * @param obj The genlist object
663  * @param h_bounce Allow bounce horizontally (@c EINA_TRUE = on, @c
664  * EINA_FALSE = off). Default is @c EINA_FALSE.
665  * @param v_bounce Allow bounce vertically (@c EINA_TRUE = on, @c
666  * EINA_FALSE = off). Default is @c EINA_TRUE.
667  *
668  * This will enable or disable the scroller bouncing effect for the
669  * genlist. See elm_scroller_bounce_set() for details.
670  *
671  * @see elm_scroller_bounce_set()
672  * @see elm_genlist_bounce_get()
673  *
674  * @ingroup Genlist
675  */
676 EAPI void                          elm_genlist_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce);
677
678 /**
679  * Get whether the horizontal and vertical bouncing effect is enabled.
680  *
681  * @param obj The genlist object
682  * @param h_bounce Pointer to a bool to receive if the bounce horizontally
683  * option is set.
684  * @param v_bounce Pointer to a bool to receive if the bounce vertically
685  * option is set.
686  *
687  * @see elm_genlist_bounce_set()
688  *
689  * @ingroup Genlist
690  */
691 EAPI void                          elm_genlist_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce);
692
693 /**
694  * Enable/disable homogeneous mode.
695  *
696  * @param obj The genlist object
697  * @param homogeneous Assume the items within the genlist are of the
698  * same height and width (EINA_TRUE = on, EINA_FALSE = off). Default is @c
699  * EINA_FALSE.
700  *
701  * This will enable the homogeneous mode where items are of the same
702  * height and width so that genlist may do the lazy-loading at its
703  * maximum (which increases the performance for scrolling the list). This
704  * implies 'compressed' mode.
705  *
706  * @see elm_genlist_compress_mode_set()
707  * @see elm_genlist_homogeneous_get()
708  *
709  * @ingroup Genlist
710  */
711 EAPI void                          elm_genlist_homogeneous_set(Evas_Object *obj, Eina_Bool homogeneous);
712
713 /**
714  * Get whether the homogeneous mode is enabled.
715  *
716  * @param obj The genlist object
717  * @return Assume the items within the genlist are of the same height
718  * and width (EINA_TRUE = on, EINA_FALSE = off)
719  *
720  * @see elm_genlist_homogeneous_set()
721  *
722  * @ingroup Genlist
723  */
724 EAPI Eina_Bool                     elm_genlist_homogeneous_get(const Evas_Object *obj);
725
726 /**
727  * Set the maximum number of items within an item block
728  *
729  * @param obj The genlist object
730  * @param count Maximum number of items within an item block. Default is 32.
731  *
732  * This will configure the block count to tune to the target with particular
733  * performance matrix.
734  *
735  * A block of objects will be used to reduce the number of operations due to
736  * many objects in the screen. It can determine the visibility, or if the
737  * object has changed, it theme needs to be updated, etc. doing this kind of
738  * calculation to the entire block, instead of per object.
739  *
740  * The default value for the block count is enough for most lists, so unless
741  * you know you will have a lot of objects visible in the screen at the same
742  * time, don't try to change this.
743  *
744  * @see elm_genlist_block_count_get()
745  * @see @ref Genlist_Implementation
746  *
747  * @ingroup Genlist
748  */
749 EAPI void                          elm_genlist_block_count_set(Evas_Object *obj, int count);
750
751 /**
752  * Get the maximum number of items within an item block
753  *
754  * @param obj The genlist object
755  * @return Maximum number of items within an item block
756  *
757  * @see elm_genlist_block_count_set()
758  *
759  * @ingroup Genlist
760  */
761 EAPI int                           elm_genlist_block_count_get(const Evas_Object *obj);
762
763 /**
764  * Set the timeout in seconds for the longpress event.
765  *
766  * @param obj The genlist object
767  * @param timeout timeout in seconds. Default is elm config value(1.0)
768  *
769  * This option will change how long it takes to send an event "longpressed"
770  * after the mouse down signal is sent to the list. If this event occurs, no
771  * "clicked" event will be sent.
772  *
773  * @warning If you set the longpress timeout value with this API, your genlist
774  * will not be affected by the longpress value of elementary config value
775  * later.
776  *
777  * @see elm_genlist_longpress_timeout_set()
778  *
779  * @ingroup Genlist
780  */
781 EAPI void                          elm_genlist_longpress_timeout_set(Evas_Object *obj, double timeout);
782
783 /**
784  * Get the timeout in seconds for the longpress event.
785  *
786  * @param obj The genlist object
787  * @return timeout in seconds
788  *
789  * @see elm_genlist_longpress_timeout_get()
790  *
791  * @ingroup Genlist
792  */
793 EAPI double                        elm_genlist_longpress_timeout_get(const Evas_Object *obj);
794
795 /**
796  * Append a new item in a given genlist widget.
797  *
798  * @param obj The genlist object
799  * @param itc The item class for the item
800  * @param data The item data
801  * @param parent The parent item, or NULL if none
802  * @param flags Item flags
803  * @param func Convenience function called when the item is selected
804  * @param func_data Data passed to @p func above.
805  * @return A handle to the item added or @c NULL if not possible
806  *
807  * This adds the given item to the end of the list or the end of
808  * the children list if the @p parent is given.
809  *
810  * @see elm_genlist_item_prepend()
811  * @see elm_genlist_item_insert_before()
812  * @see elm_genlist_item_insert_after()
813  * @see elm_object_item_del()
814  *
815  * @ingroup Genlist
816  */
817 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);
818
819 /**
820  * Prepend a new item in a given genlist widget.
821  *
822  * @param obj The genlist object
823  * @param itc The item class for the item
824  * @param data The item data
825  * @param parent The parent item, or NULL if none
826  * @param flags Item flags
827  * @param func Convenience function called when the item is selected
828  * @param func_data Data passed to @p func above.
829  * @return A handle to the item added or NULL if not possible
830  *
831  * This adds an item to the beginning of the list or beginning of the
832  * children of the parent if given.
833  *
834  * @see elm_genlist_item_append()
835  * @see elm_genlist_item_insert_before()
836  * @see elm_genlist_item_insert_after()
837  * @see elm_object_item_del()
838  *
839  * @ingroup Genlist
840  */
841 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);
842
843 /**
844  * Insert an item before another in a genlist widget
845  *
846  * @param obj The genlist object
847  * @param itc The item class for the item
848  * @param data The item data
849  * @param parent The parent item, or NULL if none
850  * @param before The item to place this new one before.
851  * @param flags Item flags
852  * @param func Convenience function called when the item is selected
853  * @param func_data Data passed to @p func above.
854  * @return A handle to the item added or @c NULL if not possible
855  *
856  * This inserts an item before another in the list. It will be in the
857  * same tree level or group as the item it is inserted before.
858  *
859  * @see elm_genlist_item_append()
860  * @see elm_genlist_item_prepend()
861  * @see elm_genlist_item_insert_after()
862  * @see elm_object_item_del()
863  *
864  * @ingroup Genlist
865  */
866 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);
867
868 /**
869  * Insert an item after another in a genlist widget
870  *
871  * @param obj The genlist object
872  * @param itc The item class for the item
873  * @param data The item data
874  * @param parent The parent item, or NULL if none
875  * @param after The item to place this new one after.
876  * @param flags Item flags
877  * @param func Convenience function called when the item is selected
878  * @param func_data Data passed to @p func above.
879  * @return A handle to the item added or @c NULL if not possible
880  *
881  * This inserts an item after another in the list. It will be in the
882  * same tree level or group as the item it is inserted after.
883  *
884  * @see elm_genlist_item_append()
885  * @see elm_genlist_item_prepend()
886  * @see elm_genlist_item_insert_before()
887  * @see elm_object_item_del()
888  *
889  * @ingroup Genlist
890  */
891 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);
892
893 /**
894  * Insert a new item into the sorted genlist object
895  *
896  * @param obj The genlist object
897  * @param itc The item class for the item
898  * @param data The item data
899  * @param parent The parent item, or NULL if none
900  * @param flags Item flags
901  * @param comp The function called for the sort
902  * @param func Convenience function called when item selected
903  * @param func_data Data passed to @p func above.
904  * @return A handle to the item added or NULL if not possible
905  *
906  * @ingroup Genlist
907  */
908 // XXX: deprecate elm_genlist_item_sorted_insert() and rename
909 // elm_genlist_item_direct_sorted_insert()
910 // XXX: direct_sorted?? how about deprecating elm_genlist_item_direct_sorted_insert insetead?
911 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);
912 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);
913
914 /* operations to retrieve existing items */
915 /**
916  * Get the selected item in the genlist.
917  *
918  * @param obj The genlist object
919  * @return The selected item, or NULL if none is selected.
920  *
921  * This gets the selected item in the list (if multi-selection is enabled, only
922  * the item that was first selected in the list is returned - which is not very
923  * useful, so see elm_genlist_selected_items_get() for when multi-selection is
924  * used).
925  *
926  * If no item is selected, NULL is returned.
927  *
928  * @see elm_genlist_selected_items_get()
929  *
930  * @ingroup Genlist
931  */
932 EAPI Elm_Object_Item             *elm_genlist_selected_item_get(const Evas_Object *obj);
933
934 /**
935  * Get a list of selected items in the genlist.
936  *
937  * @param obj The genlist object
938  * @return The list of selected items, or NULL if none are selected.
939  *
940  * It returns a list of the selected items. This list pointer is only valid so
941  * long as the selection doesn't change (no items are selected or unselected, or
942  * unselected implicitly by deletion). The list contains genlist items
943  * pointers. The order of the items in this list is the order which they were
944  * selected, i.e. the first item in this list is the first item that was
945  * selected, and so on.
946  *
947  * @note If not in multi-select mode, consider using function
948  * elm_genlist_selected_item_get() instead.
949  *
950  * @see elm_genlist_multi_select_set()
951  * @see elm_genlist_selected_item_get()
952  *
953  * @ingroup Genlist
954  */
955 EAPI const Eina_List              *elm_genlist_selected_items_get(const Evas_Object *obj);
956
957 /**
958  * Get a list of realized items in genlist
959  *
960  * @param obj The genlist object
961  * @return The list of realized items, nor NULL if none are realized.
962  *
963  * This returns a list of the realized items in the genlist. The list
964  * contains genlist item pointers. The list must be freed by the
965  * caller when done with eina_list_free(). The item pointers in the
966  * list are only valid so long as those items are not deleted or the
967  * genlist is not deleted.
968  *
969  * @see elm_genlist_realized_items_update()
970  *
971  * @ingroup Genlist
972  */
973 EAPI Eina_List                    *elm_genlist_realized_items_get(const Evas_Object *obj);
974
975 /**
976  * Get the item that is at the x, y canvas coords.
977  *
978  * @param obj The genlist object.
979  * @param x The input x coordinate
980  * @param y The input y coordinate
981  * @param posret The position relative to the item returned here
982  * @return The item at the coordinates or NULL if none
983  *
984  * This returns the item at the given coordinates (which are canvas
985  * relative, not object-relative). If an item is at that coordinate,
986  * that item handle is returned, and if @p posret is not NULL, the
987  * integer pointed to is set to a value of -1, 0 or 1, depending if
988  * the coordinate is on the upper portion of that item (-1), on the
989  * middle section (0) or on the lower part (1). If NULL is returned as
990  * an item (no item found there), then posret may indicate -1 or 1
991  * based if the coordinate is above or below all items respectively in
992  * the genlist.
993  *
994  * @ingroup Genlist
995  */
996 EAPI Elm_Object_Item             *elm_genlist_at_xy_item_get(const Evas_Object *obj, Evas_Coord x, Evas_Coord y, int *posret);
997
998 /**
999  * Get the first item in the genlist
1000  *
1001  * This returns the first item in the list.
1002  *
1003  * @param obj The genlist object
1004  * @return The first item, or NULL if none
1005  *
1006  * @ingroup Genlist
1007  */
1008 EAPI Elm_Object_Item             *elm_genlist_first_item_get(const Evas_Object *obj);
1009
1010 /**
1011  * Get the last item in the genlist
1012  *
1013  * This returns the last item in the list.
1014  *
1015  * @return The last item, or NULL if none
1016  *
1017  * @ingroup Genlist
1018  */
1019 EAPI Elm_Object_Item             *elm_genlist_last_item_get(const Evas_Object *obj);
1020
1021 /**
1022  * Set the scrollbar policy
1023  *
1024  * @param obj The genlist object
1025  * @param policy_h Horizontal scrollbar policy.
1026  * @param policy_v Vertical scrollbar policy.
1027  *
1028  * This sets the scrollbar visibility policy for the given genlist
1029  * scroller. #ELM_SMART_SCROLLER_POLICY_AUTO means the scrollbar is
1030  * made visible if it is needed, and otherwise kept hidden.
1031  * #ELM_SMART_SCROLLER_POLICY_ON turns it on all the time, and
1032  * #ELM_SMART_SCROLLER_POLICY_OFF always keeps it off. This applies
1033  * respectively for the horizontal and vertical scrollbars. Default is
1034  * #ELM_SMART_SCROLLER_POLICY_AUTO
1035  *
1036  * @see elm_genlist_scroller_policy_get()
1037  *
1038  * @ingroup Genlist
1039  */
1040 EAPI void                          elm_genlist_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v);
1041
1042 /**
1043  * Get the scrollbar policy
1044  *
1045  * @param obj The genlist object
1046  * @param policy_h Pointer to store the horizontal scrollbar policy.
1047  * @param policy_v Pointer to store the vertical scrollbar policy.
1048  *
1049  * @see elm_genlist_scroller_policy_set()
1050  *
1051  * @ingroup Genlist
1052  */
1053 EAPI void                          elm_genlist_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v);
1054
1055 /**
1056  * Get the @b next item in a genlist widget's internal list of items,
1057  * given a handle to one of those items.
1058  *
1059  * @param it The genlist item to fetch next from
1060  * @return The item after @p item, or @c NULL if there's none (and
1061  * on errors)
1062  *
1063  * This returns the item placed after the @p item, on the container
1064  * genlist.
1065  *
1066  * @see elm_genlist_item_prev_get()
1067  *
1068  * @ingroup Genlist
1069  */
1070 EAPI Elm_Object_Item             *elm_genlist_item_next_get(const Elm_Object_Item *it);
1071
1072 /**
1073  * Get the @b previous item in a genlist widget's internal list of items,
1074  * given a handle to one of those items.
1075  *
1076  * @param it The genlist item to fetch previous from
1077  * @return The item before @p item, or @c NULL if there's none (and
1078  * on errors)
1079  *
1080  * This returns the item placed before the @p item, on the container
1081  * genlist.
1082  *
1083  * @see elm_genlist_item_next_get()
1084  *
1085  * @ingroup Genlist
1086  */
1087 EAPI Elm_Object_Item             *elm_genlist_item_prev_get(const Elm_Object_Item *it);
1088
1089 /**
1090  * Get the parent item of the given item
1091  *
1092  * @param it The item
1093  * @return The parent of the item or @c NULL if it has no parent.
1094  *
1095  * This returns the item that was specified as parent of the item @p it on
1096  * elm_genlist_item_append() and insertion related functions.
1097  *
1098  * @ingroup Genlist
1099  */
1100 EAPI Elm_Object_Item             *elm_genlist_item_parent_get(const Elm_Object_Item *it);
1101
1102 /**
1103  * Remove all sub-items (children) of the given item
1104  *
1105  * @param it The item
1106  *
1107  * This removes all items that are children (and their descendants) of the
1108  * given item @p it.
1109  *
1110  * @see elm_genlist_clear()
1111  * @see elm_object_item_del()
1112  *
1113  * @ingroup Genlist
1114  */
1115 EAPI void                          elm_genlist_item_subitems_clear(Elm_Object_Item *it);
1116
1117 /**
1118  * Set whether a given genlist item is selected or not
1119  *
1120  * @param it The item
1121  * @param selected Use @c EINA_TRUE, to make it selected, @c
1122  * EINA_FALSE to make it unselected
1123  *
1124  * This sets the selected state of an item. If multi selection is
1125  * not enabled on the containing genlist and @p selected is @c
1126  * EINA_TRUE, any other previously selected items will get
1127  * unselected in favor of this new one.
1128  *
1129  * @see elm_genlist_item_selected_get()
1130  *
1131  * @ingroup Genlist
1132  */
1133 EAPI void                          elm_genlist_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
1134
1135 /**
1136  * Get whether a given genlist item is selected or not
1137  *
1138  * @param it The item
1139  * @return @c EINA_TRUE, if it's selected, @c EINA_FALSE otherwise
1140  *
1141  * @see elm_genlist_item_selected_set() for more details
1142  *
1143  * @ingroup Genlist
1144  */
1145 EAPI Eina_Bool                     elm_genlist_item_selected_get(const Elm_Object_Item *it);
1146
1147 /**
1148  * Sets the expanded state of an item.
1149  *
1150  * @param it The item
1151  * @param expanded The expanded state (@c EINA_TRUE expanded, @c EINA_FALSE not expanded).
1152  *
1153  * This function flags the item of type #ELM_GENLIST_ITEM_SUBITEMS as
1154  * expanded or not.
1155  *
1156  * The theme will respond to this change visually, and a signal "expanded" or
1157  * "contracted" will be sent from the genlist with a pointer to the item that
1158  * has been expanded/contracted.
1159  *
1160  * Calling this function won't show or hide any child of this item (if it is
1161  * a parent). You must manually delete and create them on the callbacks of
1162  * the "expanded" or "contracted" signals.
1163  *
1164  * @see elm_genlist_item_expanded_get()
1165  *
1166  * @ingroup Genlist
1167  */
1168 EAPI void                          elm_genlist_item_expanded_set(Elm_Object_Item *it, Eina_Bool expanded);
1169
1170 /**
1171  * Get the expanded state of an item
1172  *
1173  * @param it The item
1174  * @return The expanded state
1175  *
1176  * This gets the expanded state of an item.
1177  *
1178  * @see elm_genlist_item_expanded_set()
1179  *
1180  * @ingroup Genlist
1181  */
1182 EAPI Eina_Bool                     elm_genlist_item_expanded_get(const Elm_Object_Item *it);
1183
1184 /**
1185  * Get the depth of expanded item
1186  *
1187  * @param it The genlist item object
1188  * @return The depth of expanded item
1189  *
1190  * @ingroup Genlist
1191  */
1192 EAPI int                           elm_genlist_item_expanded_depth_get(const Elm_Object_Item *it);
1193
1194
1195 /**
1196  * Sets the display only state of an item.
1197  *
1198  * @param it The item
1199  * @param display_only @c EINA_TRUE if the item is display only, @c
1200  * EINA_FALSE otherwise.
1201  *
1202  * A display only item cannot be selected or unselected. It is for
1203  * display only and not selecting or otherwise clicking, dragging
1204  * etc. by the user, thus finger size rules will not be applied to
1205  * this item.
1206  *
1207  * It's good to set group index items to display only state.
1208  *
1209  * @see elm_genlist_item_display_only_get()
1210  *
1211  * @ingroup Genlist
1212  */
1213 //XXX: elm_genlist_item_event_freeze_set()?
1214 EAPI void                          elm_genlist_item_display_only_set(Elm_Object_Item *it, Eina_Bool display_only);
1215
1216 /**
1217  * Get the display only state of an item
1218  *
1219  * @param it The item
1220  * @return @c EINA_TRUE if the item is display only, @c
1221  * EINA_FALSE otherwise.
1222  *
1223  * @see elm_genlist_item_display_only_set()
1224  *
1225  * @ingroup Genlist
1226  */
1227 //XXX: elm_genlist_item_event_freeze_get()?
1228 EAPI Eina_Bool                     elm_genlist_item_display_only_get(const Elm_Object_Item *it);
1229
1230 /**
1231  * Show the portion of a genlist's internal list containing a given
1232  * item, immediately.
1233  *
1234  * @param it The item to display
1235  *
1236  * This causes genlist to jump to the given item @p it and show it (by
1237  * jumping to that position), if it is not fully visible.
1238  *
1239  * @see elm_genlist_item_bring_in()
1240  * @see elm_genlist_item_top_show()
1241  * @see elm_genlist_item_middle_show()
1242  *
1243  * @ingroup Genlist
1244  */
1245 //XXX: elm_genlist_item_show(it, TOP/MIDDLE/BOTTOM/...); this kind of API would cover all similar APIs - item_show, item_top_show...
1246 EAPI void                          elm_genlist_item_show(Elm_Object_Item *it);
1247
1248 /**
1249  * Animatedly bring in, to the visible are of a genlist, a given
1250  * item on it.
1251  *
1252  * @param it The item to display
1253  *
1254  * This causes genlist to jump to the given item @p it and show it (by
1255  * animatedly scrolling), if it is not fully visible. This may use animation
1256  * to do so and take a period of time
1257  *
1258  * @see elm_genlist_item_show()
1259  * @see elm_genlist_item_top_bring_in()
1260  * @see elm_genlist_item_middle_bring_in()
1261  *
1262  * @ingroup Genlist
1263  */
1264 //XXX: elm_genlist_item_bring_in(it, TOP/MIDDLE/BOTTOM/...); this kind of API would cover all similar APIs - bring_in, top_bring_in ...
1265 EAPI void                          elm_genlist_item_bring_in(Elm_Object_Item *it);
1266
1267 /**
1268  * Show the portion of a genlist's internal list containing a given
1269  * item, immediately.
1270  *
1271  * @param it The item to display
1272  *
1273  * This causes genlist to jump to the given item @p it and show it (by
1274  * jumping to the top position), if it is not fully visible.
1275  *
1276  * The item will be positioned at the top of the genlist viewport.
1277  *
1278  * @see elm_genlist_item_show()
1279  * @see elm_genlist_item_top_bring_in()
1280  *
1281  * @ingroup Genlist
1282  */
1283 //XXX: elm_genlist_item_show(it, TOP/MIDDLE/BOTTOM/...); this kind of API would cover all similar APIs - item_show, item_top_show...
1284 EAPI void                          elm_genlist_item_top_show(Elm_Object_Item *it);
1285
1286 /**
1287  * Animatedly bring in, to the visible are of a genlist, a given
1288  * item on it.
1289  *
1290  * @param it The item
1291  *
1292  * This causes genlist to jump to the given item @p it and show it (by
1293  * animatedly scrolling), if it is not fully visible. This may use animation
1294  * to do so and take a period of time
1295  *
1296  * The item will be positioned at the top of the genlist viewport.
1297  *
1298  * @see elm_genlist_item_bring_in()
1299  * @see elm_genlist_item_top_show()
1300  *
1301  * @ingroup Genlist
1302  */
1303 //XXX: elm_genlist_item_bring_in(it, TOP/MIDDLE/BOTTOM/...); this kind of API would cover all similar APIs - bring_in, top_bring_in ...
1304 EAPI void                          elm_genlist_item_top_bring_in(Elm_Object_Item *it);
1305
1306 /**
1307  * Show the portion of a genlist's internal list containing a given
1308  * item, immediately.
1309  *
1310  * @param it The item to display
1311  *
1312  * This causes genlist to jump to the given item @p it and show it (by
1313  * immediately scrolling to that position), if it is not fully visible.
1314  *
1315  * The item will be positioned at the middle of the genlist viewport.
1316  *
1317  * @see elm_genlist_item_show()
1318  * @see elm_genlist_item_middle_bring_in()
1319  *
1320  * @ingroup Genlist
1321  */
1322 //XXX: elm_genlist_item_show(it, TOP/MIDDLE/BOTTOM/...); this kind of API would cover all similar APIs - item_show, item_top_show...
1323 EAPI void                          elm_genlist_item_middle_show(Elm_Object_Item *it);
1324
1325 /**
1326  * Animatedly bring in, to the visible are of a genlist, a given
1327  * item on it.
1328  *
1329  * @param it The item
1330  *
1331  * This causes genlist to jump to the given item @p it and show it (by
1332  * animatedly scrolling), if it is not fully visible. This may use animation
1333  * to do so and take a period of time
1334  *
1335  * The item will be positioned at the middle of the genlist viewport.
1336  *
1337  * @see elm_genlist_item_bring_in()
1338  * @see elm_genlist_item_middle_show()
1339  *
1340  * @ingroup Genlist
1341  */
1342 //XXX: elm_genlist_item_bring_in(it, TOP/MIDDLE/BOTTOM/...); this kind of API would cover all similar APIs - bring_in, top_bring_in ...
1343 EAPI void                          elm_genlist_item_middle_bring_in(Elm_Object_Item *it);
1344
1345 /**
1346  * Tells genlist to "orphan" contents fetched by the item class
1347  *
1348  * @param it The item
1349  *
1350  * This instructs genlist to release references to contents in the item,
1351  * meaning that they will no longer be managed by genlist and are
1352  * floating "orphans" that can be re-used elsewhere if the user wants
1353  * to.
1354  *
1355  * @ingroup Genlist
1356  */
1357 //XXX: elm_genlist_item_all_contents_unset() ??
1358 EAPI void                          elm_genlist_item_contents_orphan(Elm_Object_Item *it);
1359
1360 /**
1361  * Get the real Evas object created to implement the view of a
1362  * given genlist item
1363  *
1364  * @param it The genlist item.
1365  * @return the Evas object implementing this item's view.
1366  *
1367  * This returns the actual Evas object used to implement the
1368  * specified genlist item's view. This may be @c NULL, as it may
1369  * not have been created or may have been deleted, at any time, by
1370  * the genlist. <b>Do not modify this object</b> (move, resize,
1371  * show, hide, etc.), as the genlist is controlling it. This
1372  * function is for querying, emitting custom signals or hooking
1373  * lower level callbacks for events on that object. Do not delete
1374  * this object under any circumstances.
1375  *
1376  * @see elm_object_item_data_get()
1377  *
1378  * @ingroup Genlist
1379  */
1380 //XXX: Should be deprecated
1381 EAPI const Evas_Object            *elm_genlist_item_object_get(const Elm_Object_Item *it);
1382
1383 /**
1384  * Update the contents of an item
1385  *
1386  * @param it The item
1387  *
1388  * This updates an item by calling all the item class functions again
1389  * to get the contents, texts and states. Use this when the original
1390  * item data has changed and the changes are desired to be reflected.
1391  *
1392  * Use elm_genlist_realized_items_update() to update all already realized
1393  * items.
1394  *
1395  * @see elm_genlist_realized_items_update()
1396  *
1397  * @ingroup Genlist
1398  */
1399 EAPI void                          elm_genlist_item_update(Elm_Object_Item *it);
1400
1401 /**
1402  * Promote an item to the top of the list
1403  *
1404  * @param it The item
1405  *
1406  * @ingroup Genlist
1407  */
1408 EAPI void                          elm_genlist_item_promote(Elm_Object_Item *it);
1409
1410 /**
1411  * Demote an item to the end of the list
1412  *
1413  * @param it The item
1414  *
1415  * @ingroup Genlist
1416  */
1417 EAPI void                          elm_genlist_item_demote(Elm_Object_Item *it);
1418
1419 /**
1420  * Update the part of an item
1421  *
1422  * @param it The item
1423  * @param parts The name of item's part
1424  * @param itf The flags of item's part type
1425  *
1426  * This updates an item's part by calling item's fetching functions again
1427  * to get the contents, texts and states. Use this when the original
1428  * item data has changed and the changes are desired to be reflected.
1429  * Second parts argument is used for globbing to match '*', '?', and '.'
1430  * It can be used at updating multi fields.
1431  *
1432  * Use elm_genlist_realized_items_update() to update an item's all
1433  * property.
1434  *
1435  * @see elm_genlist_item_update()
1436  *
1437  * @ingroup Genlist
1438  */
1439 EAPI void                          elm_genlist_item_fields_update(Elm_Object_Item *it, const char *parts, Elm_Genlist_Item_Field_Flags itf);
1440
1441 /**
1442  * Update the item class of an item
1443  *
1444  * @param it The item
1445  * @param itc The item class for the item
1446  *
1447  * This sets another class of the item, changing the way that it is
1448  * displayed. After changing the item class, elm_genlist_item_update() is
1449  * called on the item @p it.
1450  *
1451  * @ingroup Genlist
1452  */
1453 EAPI void                          elm_genlist_item_item_class_update(Elm_Object_Item *it, const Elm_Genlist_Item_Class *itc);
1454 EAPI const Elm_Genlist_Item_Class *elm_genlist_item_item_class_get(const Elm_Object_Item *it);
1455
1456 /**
1457  * Set the text to be shown in a given genlist item's tooltips.
1458  *
1459  * @param it The genlist item
1460  * @param text The text to set in the content
1461  *
1462  * This call will setup the text to be used as tooltip to that item
1463  * (analogous to elm_object_tooltip_text_set(), but being item
1464  * tooltips with higher precedence than object tooltips). It can
1465  * have only one tooltip at a time, so any previous tooltip data
1466  * will get removed.
1467  *
1468  * In order to set a content or something else as a tooltip, look at
1469  * elm_genlist_item_tooltip_content_cb_set().
1470  *
1471  * @ingroup Genlist
1472  */
1473 EAPI void                          elm_genlist_item_tooltip_text_set(Elm_Object_Item *it, const char *text);
1474
1475 /**
1476  * Set the content to be shown in a given genlist item's tooltips
1477  *
1478  * @param it The genlist item.
1479  * @param func The function returning the tooltip contents.
1480  * @param data What to provide to @a func as callback data/context.
1481  * @param del_cb Called when data is not needed anymore, either when
1482  *        another callback replaces @p func, the tooltip is unset with
1483  *        elm_genlist_item_tooltip_unset() or the owner @p item
1484  *        dies. This callback receives as its first parameter the
1485  *        given @p data, being @c event_info the item handle.
1486  *
1487  * This call will setup the tooltip's contents to @p item
1488  * (analogous to elm_object_tooltip_content_cb_set(), but being
1489  * item tooltips with higher precedence than object tooltips). It
1490  * can have only one tooltip at a time, so any previous tooltip
1491  * content will get removed. @p func (with @p data) will be called
1492  * every time Elementary needs to show the tooltip and it should
1493  * return a valid Evas object, which will be fully managed by the
1494  * tooltip system, getting deleted when the tooltip is gone.
1495  *
1496  * In order to set just a text as a tooltip, look at
1497  * elm_genlist_item_tooltip_text_set().
1498  *
1499  * @ingroup Genlist
1500  */
1501 //XXX: Need to review tooltip & cursor APIs
1502 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);
1503
1504 /**
1505  * Unset a tooltip from a given genlist item
1506  *
1507  * @param it genlist item to remove a previously set tooltip from.
1508  *
1509  * This call removes any tooltip set on @p item. The callback
1510  * provided as @c del_cb to
1511  * elm_genlist_item_tooltip_content_cb_set() will be called to
1512  * notify it is not used anymore (and have resources cleaned, if
1513  * need be).
1514  *
1515  * @see elm_genlist_item_tooltip_content_cb_set()
1516  *
1517  * @ingroup Genlist
1518  */
1519 EAPI void                          elm_genlist_item_tooltip_unset(Elm_Object_Item *it);
1520
1521 /**
1522  * Set a different @b style for a given genlist item's tooltip.
1523  *
1524  * @param it genlist item with tooltip set
1525  * @param style the <b>theme style</b> to use on tooltips (e.g. @c
1526  * "default", @c "transparent", etc)
1527  *
1528  * Tooltips can have <b>alternate styles</b> to be displayed on,
1529  * which are defined by the theme set on Elementary. This function
1530  * works analogously as elm_object_tooltip_style_set(), but here
1531  * applied only to genlist item objects. The default style for
1532  * tooltips is @c "default".
1533  *
1534  * @note before you set a style you should define a tooltip with
1535  *       elm_genlist_item_tooltip_content_cb_set() or
1536  *       elm_genlist_item_tooltip_text_set()
1537  *
1538  * @see elm_genlist_item_tooltip_style_get()
1539  *
1540  * @ingroup Genlist
1541  */
1542 EAPI void                          elm_genlist_item_tooltip_style_set(Elm_Object_Item *it, const char *style);
1543
1544 /**
1545  * Get the style set a given genlist item's tooltip.
1546  *
1547  * @param it genlist item with tooltip already set on.
1548  * @return style the theme style in use, which defaults to
1549  *         "default". If the object does not have a tooltip set,
1550  *         then @c NULL is returned.
1551  *
1552  * @see elm_genlist_item_tooltip_style_set() for more details
1553  *
1554  * @ingroup Genlist
1555  */
1556 EAPI const char                   *elm_genlist_item_tooltip_style_get(const Elm_Object_Item *it);
1557
1558 /**
1559  * @brief Disable size restrictions on an object's tooltip
1560  * @param it The tooltip's anchor object
1561  * @param disable If EINA_TRUE, size restrictions are disabled
1562  * @return EINA_FALSE on failure, EINA_TRUE on success
1563  *
1564  * This function allows a tooltip to expand beyond its parent window's canvas.
1565  * It will instead be limited only by the size of the display.
1566  */
1567 EAPI Eina_Bool                     elm_genlist_item_tooltip_window_mode_set(Elm_Object_Item *it, Eina_Bool disable);
1568
1569 /**
1570  * @brief Retrieve size restriction state of an object's tooltip
1571  * @param it The tooltip's anchor object
1572  * @return If EINA_TRUE, size restrictions are disabled
1573  *
1574  * This function returns whether a tooltip is allowed to expand beyond
1575  * its parent window's canvas.
1576  * It will instead be limited only by the size of the display.
1577  */
1578 EAPI Eina_Bool                     elm_genlist_item_tooltip_window_mode_get(const Elm_Object_Item *it);
1579
1580 /**
1581  * Set the type of mouse pointer/cursor decoration to be shown,
1582  * when the mouse pointer is over the given genlist widget item
1583  *
1584  * @param it genlist item to customize cursor on
1585  * @param cursor the cursor type's name
1586  *
1587  * This function works analogously as elm_object_cursor_set(), but
1588  * here the cursor's changing area is restricted to the item's
1589  * area, and not the whole widget's. Note that that item cursors
1590  * have precedence over widget cursors, so that a mouse over @p
1591  * item will always show cursor @p type.
1592  *
1593  * If this function is called twice for an object, a previously set
1594  * cursor will be unset on the second call.
1595  *
1596  * @see elm_object_cursor_set()
1597  * @see elm_genlist_item_cursor_get()
1598  * @see elm_genlist_item_cursor_unset()
1599  *
1600  * @ingroup Genlist
1601  */
1602 EAPI void                          elm_genlist_item_cursor_set(Elm_Object_Item *it, const char *cursor);
1603
1604 /**
1605  * Get the type of mouse pointer/cursor decoration set to be shown,
1606  * when the mouse pointer is over the given genlist widget item
1607  *
1608  * @param it genlist item with custom cursor set
1609  * @return the cursor type's name or @c NULL, if no custom cursors
1610  * were set to @p item (and on errors)
1611  *
1612  * @see elm_object_cursor_get()
1613  * @see elm_genlist_item_cursor_set() for more details
1614  * @see elm_genlist_item_cursor_unset()
1615  *
1616  * @ingroup Genlist
1617  */
1618 EAPI const char                   *elm_genlist_item_cursor_get(const Elm_Object_Item *it);
1619
1620 /**
1621  * Unset any custom mouse pointer/cursor decoration set to be
1622  * shown, when the mouse pointer is over the given genlist widget
1623  * item, thus making it show the @b default cursor again.
1624  *
1625  * @param it a genlist item
1626  *
1627  * Use this call to undo any custom settings on this item's cursor
1628  * decoration, bringing it back to defaults (no custom style set).
1629  *
1630  * @see elm_object_cursor_unset()
1631  * @see elm_genlist_item_cursor_set() for more details
1632  *
1633  * @ingroup Genlist
1634  */
1635 EAPI void                          elm_genlist_item_cursor_unset(Elm_Object_Item *it);
1636
1637 /**
1638  * Set a different @b style for a given custom cursor set for a
1639  * genlist item.
1640  *
1641  * @param it genlist item with custom cursor set
1642  * @param style the <b>theme style</b> to use (e.g. @c "default",
1643  * @c "transparent", etc)
1644  *
1645  * This function only makes sense when one is using custom mouse
1646  * cursor decorations <b>defined in a theme file</b> , which can
1647  * have, given a cursor name/type, <b>alternate styles</b> on
1648  * it. It works analogously as elm_object_cursor_style_set(), but
1649  * here applied only to genlist item objects.
1650  *
1651  * @warning Before you set a cursor style you should have defined a
1652  *       custom cursor previously on the item, with
1653  *       elm_genlist_item_cursor_set()
1654  *
1655  * @see elm_genlist_item_cursor_engine_only_set()
1656  * @see elm_genlist_item_cursor_style_get()
1657  *
1658  * @ingroup Genlist
1659  */
1660 EAPI void                          elm_genlist_item_cursor_style_set(Elm_Object_Item *it, const char *style);
1661
1662 /**
1663  * Get the current @b style set for a given genlist item's custom
1664  * cursor
1665  *
1666  * @param it genlist item with custom cursor set.
1667  * @return style the cursor style in use. If the object does not
1668  *         have a cursor set, then @c NULL is returned.
1669  *
1670  * @see elm_genlist_item_cursor_style_set() for more details
1671  *
1672  * @ingroup Genlist
1673  */
1674 EAPI const char                   *elm_genlist_item_cursor_style_get(const Elm_Object_Item *it);
1675
1676 /**
1677  * Set if the (custom) cursor for a given genlist item should be
1678  * searched in its theme, also, or should only rely on the
1679  * rendering engine.
1680  *
1681  * @param it item with custom (custom) cursor already set on
1682  * @param engine_only Use @c EINA_TRUE to have cursors looked for
1683  * only on those provided by the rendering engine, @c EINA_FALSE to
1684  * have them searched on the widget's theme, as well.
1685  *
1686  * @note This call is of use only if you've set a custom cursor
1687  * for genlist items, with elm_genlist_item_cursor_set().
1688  *
1689  * @note By default, cursors will only be looked for between those
1690  * provided by the rendering engine.
1691  *
1692  * @ingroup Genlist
1693  */
1694 EAPI void                          elm_genlist_item_cursor_engine_only_set(Elm_Object_Item *it, Eina_Bool engine_only);
1695
1696 /**
1697  * Get if the (custom) cursor for a given genlist item is being
1698  * searched in its theme, also, or is only relying on the rendering
1699  * engine.
1700  *
1701  * @param it a genlist item
1702  * @return @c EINA_TRUE, if cursors are being looked for only on
1703  * those provided by the rendering engine, @c EINA_FALSE if they
1704  * are being searched on the widget's theme, as well.
1705  *
1706  * @see elm_genlist_item_cursor_engine_only_set(), for more details
1707  *
1708  * @ingroup Genlist
1709  */
1710 EAPI Eina_Bool                     elm_genlist_item_cursor_engine_only_get(const Elm_Object_Item *it);
1711
1712 /**
1713  * Get the index of the item. It is only valid once displayed.
1714  *
1715  * @param it a genlist item
1716  * @return the position inside the list of item.
1717  *
1718  * @ingroup Genlist
1719  */
1720 EAPI int                           elm_genlist_item_index_get(const Elm_Object_Item *it);
1721
1722 /**
1723  * Update the contents of all realized items.
1724  *
1725  * @param obj The genlist object.
1726  *
1727  * This updates all realized items by calling all the item class functions again
1728  * to get the contents, texts and states. Use this when the original
1729  * item data has changed and the changes are desired to be reflected.
1730  *
1731  * To update just one item, use elm_genlist_item_update().
1732  *
1733  * @see elm_genlist_realized_items_get()
1734  * @see elm_genlist_item_update()
1735  *
1736  * @ingroup Genlist
1737  */
1738 EAPI void                          elm_genlist_realized_items_update(Evas_Object *obj);
1739
1740 /**
1741  * Activate a genlist mode on an item
1742  *
1743  * @param it The genlist item
1744  * @param mode_type Mode name
1745  * @param mode_set Boolean to define set or unset mode.
1746  *
1747  * A genlist mode is a different way of selecting an item. Once a mode is
1748  * activated on an item, any other selected item is immediately unselected.
1749  * This feature provides an easy way of implementing a new kind of animation
1750  * for selecting an item, without having to entirely rewrite the item style
1751  * theme. However, the elm_genlist_selected_* API can't be used to get what
1752  * item is activate for a mode.
1753  *
1754  * The current item style will still be used, but applying a genlist mode to
1755  * an item will select it using a different kind of animation.
1756  *
1757  * The current active item for a mode can be found by
1758  * elm_genlist_mode_item_get().
1759  *
1760  * The characteristics of genlist mode are:
1761  * - Only one mode can be active at any time, and for only one item.
1762  * - Genlist handles deactivating other items when one item is activated.
1763  * - A mode is defined in the genlist theme (edc), and more modes can easily
1764  *   be added.
1765  * - A mode style and the genlist item style are different things. They
1766  *   can be combined to provide a default style to the item, with some kind
1767  *   of animation for that item when the mode is activated.
1768  *
1769  * When a mode is activated on an item, a new view for that item is created.
1770  * The theme of this mode defines the animation that will be used to transit
1771  * the item from the old view to the new view. This second (new) view will be
1772  * active for that item while the mode is active on the item, and will be
1773  * destroyed after the mode is totally deactivated from that item.
1774  *
1775  * @see elm_genlist_mode_get()
1776  * @see elm_genlist_mode_item_get()
1777  *
1778  * @ingroup Genlist
1779  */
1780 //XXX: How bout elm_genlist_mode_item_set
1781 EAPI void                          elm_genlist_item_mode_set(Elm_Object_Item *it, const char *mode_type, Eina_Bool mode_set);
1782
1783 /**
1784  * Get the last (or current) genlist mode used.
1785  *
1786  * @param obj The genlist object
1787  *
1788  * This function just returns the name of the last used genlist mode. It will
1789  * be the current mode if it's still active.
1790  *
1791  * @see elm_genlist_item_mode_set()
1792  * @see elm_genlist_mode_item_get()
1793  *
1794  * @ingroup Genlist
1795  */
1796 //XXX: looks weird... set the mode type to item and get the mode type from object...
1797 EAPI const char                   *elm_genlist_mode_type_get(const Evas_Object *obj);
1798
1799 /**
1800  * Get active genlist mode item
1801  *
1802  * @param obj The genlist object
1803  * @return The active item for that current mode. Or @c NULL if no item is
1804  * activated with any mode.
1805  *
1806  * This function returns the item that was activated with a mode, by the
1807  * function elm_genlist_item_mode_set().
1808  *
1809  * @see elm_genlist_item_mode_set()
1810  * @see elm_genlist_mode_get()
1811  *
1812  * @ingroup Genlist
1813  */
1814 EAPI const Elm_Object_Item       *elm_genlist_mode_item_get(const Evas_Object *obj);
1815
1816 /**
1817  * Set reorder mode
1818  *
1819  * @param obj The genlist object
1820  * @param reorder_mode The reorder mode
1821  * (EINA_TRUE = on, EINA_FALSE = off)
1822  *
1823  * @ingroup Genlist
1824  */
1825 EAPI void                          elm_genlist_reorder_mode_set(Evas_Object *obj, Eina_Bool reorder_mode);
1826
1827 /**
1828  * Get the reorder mode
1829  *
1830  * @param obj The genlist object
1831  * @return The reorder mode
1832  * (EINA_TRUE = on, EINA_FALSE = off)
1833  *
1834  * @ingroup Genlist
1835  */
1836 EAPI Eina_Bool                     elm_genlist_reorder_mode_get(const Evas_Object *obj);
1837
1838 /**
1839  * Get the Item's Flags
1840  *
1841  * @param it The genlist item
1842  * @return The item flags.
1843  *
1844  * This function returns the item's type. Normally the item's type.
1845  * If it failed, return value is ELM_GENLIST_ITEM_MAX
1846  *
1847  * @ingroup Genlist
1848  */
1849 //XXX: type would be more intuitive...
1850 EAPI Elm_Genlist_Item_Flags        elm_genlist_item_flags_get(const Elm_Object_Item *it);
1851
1852 #define ELM_GENLIST_ITEM_CLASS_VERSION 2 /* current version number */
1853
1854 /**
1855  * Add a new genlist item class in a given genlist widget.
1856  *
1857  * @return New allocated a genlist item class.
1858  *
1859  * This adds genlist item class for the genlist widget. When adding a item,
1860  * genlist_item_{append, prepend, insert} function needs item class of the item.
1861  * Given callback paramters are used at retrieving {text, content} of
1862  * added item. Set as NULL if it's not used.
1863  * If there's no available memory, return can be NULL.
1864  *
1865  * @see elm_genlist_item_class_free()
1866  * @see elm_genlist_item_append()
1867  *
1868  * @ingroup Genlist
1869  */
1870 EAPI Elm_Genlist_Item_Class *elm_genlist_item_class_new(void);
1871
1872 /**
1873  * Remove a item class in a given genlist widget.
1874  *
1875  * @param itc The itc to be removed.
1876  *
1877  * This removes item class from the genlist widget.
1878  * Whenever it has no more references to it, item class is going to be freed.
1879  * Otherwise it just decreases its reference count.
1880  *
1881  * @see elm_genlist_item_class_new()
1882  * @see elm_genlist_item_class_ref()
1883  * @see elm_genlist_item_class_unref()
1884  *
1885  * @ingroup Genlist
1886  */
1887 EAPI void elm_genlist_item_class_free(Elm_Genlist_Item_Class *itc);
1888
1889 /**
1890  * Increments object reference count for the item class.
1891  *
1892  * @param itc The given item class object to reference
1893  *
1894  * This API just increases its reference count for item class management.
1895  *
1896  * @see elm_genlist_item_class_unref()
1897  *
1898  * @ingroup Genlist
1899  */
1900 EAPI void elm_genlist_item_class_ref(Elm_Genlist_Item_Class *itc);
1901
1902 /**
1903  * Decrements object reference count for the item class.
1904  *
1905  * @param itc The given item class object to reference
1906  *
1907  * This API just decreases its reference count for item class management.
1908  * Reference count can't be less than 0.
1909  *
1910  * @see elm_genlist_item_class_ref()
1911  * @see elm_genlist_item_class_free()
1912  *
1913  * @ingroup Genlist
1914  */
1915 EAPI void elm_genlist_item_class_unref(Elm_Genlist_Item_Class *itc);
1916
1917 /**
1918  * Return how many items are currently in a list
1919  *
1920  * @param obj The list
1921  * @return The total number of list items in the list
1922  *
1923  * This behavior is O(1) and includes items which may or may not be realized.
1924  *
1925  * @ingroup Genlist
1926  */
1927 EAPI unsigned int elm_genlist_items_count(const Evas_Object *obj);
1928 /**
1929  * Set Genlist edit mode
1930  *
1931  * This sets Genlist edit mode.
1932  *
1933  * @param obj The Genlist object
1934  * @param The edit mode status
1935  * (EINA_TRUE = edit mode, EINA_FALSE = normal mode
1936  *
1937  * @ingroup Genlist
1938  */
1939 EAPI void               elm_genlist_edit_mode_set(Evas_Object *obj, Eina_Bool edit_mode);
1940
1941 /**
1942  * Get Genlist edit mode
1943  *
1944  * @param obj The genlist object
1945  * @return The edit mode status
1946  * (EINA_TRUE = edit mode, EINA_FALSE = normal mode
1947  *
1948  * @ingroup Genlist
1949  */
1950 EAPI Eina_Bool          elm_genlist_edit_mode_get(const Evas_Object *obj);
1951
1952 /**
1953  * @}
1954  */