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