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