2 * @defgroup Genlist Genlist
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
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.
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.
20 * @section Genlist_Item_Class Genlist item classes - creating items
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
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
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.
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:
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.
66 * available item styles:
68 * - default_style - The text part is a textblock
70 * @image html img/widget/genlist/preview-04.png
71 * @image latex img/widget/genlist/preview-04.eps
75 * @image html img/widget/genlist/preview-01.png
76 * @image latex img/widget/genlist/preview-01.eps
78 * - icon_top_text_bottom
80 * @image html img/widget/genlist/preview-02.png
81 * @image latex img/widget/genlist/preview-02.eps
85 * @image html img/widget/genlist/preview-03.png
86 * @image latex img/widget/genlist/preview-03.eps
88 * @section Genlist_Items Structure of items
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.
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
108 * @section Genlist_Manipulation Editing and Navigating
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
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.
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.
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
148 * @section Genlist_Multi_Selection Multi-selection
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)).
158 * @section Genlist_Usage_Hints Usage hints
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.
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.
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.
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
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.
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.
202 * @section Genlist_Implementation Implementation
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.
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
232 * @section Genlist_Smart_Events Genlist smart events
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
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
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
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
285 * - @c "scroll,anim,stop" - This is called when scrolling animation has
287 * - @c "scroll,drag,start" - This is called when dragging the content has
289 * - @c "scroll,drag,stop" - This is called when dragging the content has
291 * - @c "edge,top" - This is called when the genlist is scrolled until
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
301 * - @c "multi,swipe,right" - This is called when the genlist is multi-touch
303 * - @c "multi,swipe,up" - This is called when the genlist is multi-touch
305 * - @c "multi,swipe,down" - This is called when the genlist is multi-touch
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
315 * Supported elm_object common APIs
316 * @li elm_object_signal_emit()
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()
327 * @section Genlist_Examples Examples
329 * Here is a list of examples that use the genlist, trying to show some of
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
339 * @addtogroup Genlist
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.
349 //XXX: Elm_Genlist_Item_Type
352 ELM_GENLIST_ITEM_NONE = 0, /**< simple item */
353 //XXX: ELM_GENLIST_ITEM_TREE
354 ELM_GENLIST_ITEM_SUBITEMS = (1 << 0), /**< may expand and have child items */
355 ELM_GENLIST_ITEM_GROUP = (1 << 1), /**< index of a group of items */
357 ELM_GENLIST_ITEM_MAX = (1 << 2)
358 } Elm_Genlist_Item_Flags;
360 //XXX: Elm_Genlist_Item_Field_Type
363 ELM_GENLIST_ITEM_FIELD_ALL = 0,
364 ELM_GENLIST_ITEM_FIELD_TEXT = (1 << 0),
365 ELM_GENLIST_ITEM_FIELD_CONTENT = (1 << 1),
366 ELM_GENLIST_ITEM_FIELD_STATE = (1 << 2)
367 } Elm_Genlist_Item_Field_Flags;
368 typedef struct _Elm_Genlist_Item_Class Elm_Genlist_Item_Class; /**< Genlist item class definition structs */
370 #define Elm_Genlist_Item_Class Elm_Gen_Item_Class
371 typedef struct _Elm_Genlist_Item_Class_Func Elm_Genlist_Item_Class_Func; /**< Class functions for genlist item class */
374 * Text fetching class function for Elm_Gen_Item_Class.
375 * @param data The data passed in the item creation function
376 * @param obj The base widget object
377 * @param part The part name of the swallow
378 * @return The allocated (NOT stringshared) string to set as the text
380 typedef char *(*Elm_Genlist_Item_Text_Get_Cb)(void *data, Evas_Object *obj, const char *part);
383 * Content (swallowed object) fetching class function for Elm_Gen_Item_Class.
384 * @param data The data passed in the item creation function
385 * @param obj The base widget object
386 * @param part The part name of the swallow
387 * @return The content object to swallow
389 typedef Evas_Object *(*Elm_Genlist_Item_Content_Get_Cb)(void *data, Evas_Object *obj, const char *part);
392 * State fetching class function for Elm_Gen_Item_Class.
393 * @param data The data passed in the item creation function
394 * @param obj The base widget object
395 * @param part The part name of the swallow
396 * @return The hell if I know
398 typedef Eina_Bool (*Elm_Genlist_Item_State_Get_Cb)(void *data, Evas_Object *obj, const char *part);
401 * Deletion class function for Elm_Gen_Item_Class.
402 * @param data The data passed in the item creation function
403 * @param obj The base widget object
405 typedef void (*Elm_Genlist_Item_Del_Cb)(void *data, Evas_Object *obj);
408 * @struct _Elm_Genlist_Item_Class
410 * Genlist item class definition structs.
412 * This struct contains the style and fetching functions that will define the
413 * contents of each item.
415 * @see @ref Genlist_Item_Class
417 struct _Elm_Genlist_Item_Class
419 const char *item_style; /**< style of this class. */
420 struct Elm_Genlist_Item_Class_Func
422 Elm_Genlist_Item_Text_Get_Cb text_get; /**< Text fetching class function for genlist item classes.*/
423 Elm_Genlist_Item_Content_Get_Cb content_get; /**< Content fetching class function for genlist item classes. */
424 Elm_Genlist_Item_State_Get_Cb state_get; /**< State fetching class function for genlist item classes. */
425 Elm_Genlist_Item_Del_Cb del; /**< Deletion class function for genlist item classes. */
428 #define Elm_Genlist_Item_Class_Func Elm_Gen_Item_Class_Func
430 * Add a new genlist widget to the given parent Elementary
433 * @param parent The parent object
434 * @return a new genlist widget handle or @c NULL, on errors
436 * This function inserts a new genlist widget on the canvas.
438 * @see elm_genlist_item_append()
439 * @see elm_object_item_del()
440 * @see elm_genlist_clear()
444 EAPI Evas_Object *elm_genlist_add(Evas_Object *parent);
447 * Remove all items from a given genlist widget.
449 * @param obj The genlist object
451 * This removes (and deletes) all items in @p obj, leaving it empty.
453 * @see elm_object_item_del(), to remove just one item.
457 EAPI void elm_genlist_clear(Evas_Object *obj);
460 * Enable or disable multi-selection in the genlist
462 * @param obj The genlist object
463 * @param multi Multi-select enable/disable. Default is disabled.
465 * This enables (@c EINA_TRUE) or disables (@c EINA_FALSE) multi-selection in
466 * the list. This allows more than 1 item to be selected. To retrieve the list
467 * of selected items, use elm_genlist_selected_items_get().
469 * @see elm_genlist_selected_items_get()
470 * @see elm_genlist_multi_select_get()
474 EAPI void elm_genlist_multi_select_set(Evas_Object *obj, Eina_Bool multi);
477 * Gets if multi-selection in genlist is enabled or disabled.
479 * @param obj The genlist object
480 * @return Multi-select enabled/disabled
481 * (@c EINA_TRUE = enabled/@c EINA_FALSE = disabled). Default is @c EINA_FALSE.
483 * @see elm_genlist_multi_select_set()
487 EAPI Eina_Bool elm_genlist_multi_select_get(const Evas_Object *obj);
490 * This sets the horizontal stretching mode.
492 * @param obj The genlist object
493 * @param mode The mode to use (one of #ELM_LIST_SCROLL or #ELM_LIST_LIMIT).
495 * This sets the mode used for sizing items horizontally. Valid modes
496 * are #ELM_LIST_LIMIT and #ELM_LIST_SCROLL. The default is
497 * ELM_LIST_SCROLL. This mode means that if items are too wide to fit,
498 * the scroller will scroll horizontally. Otherwise items are expanded
499 * to fill the width of the viewport of the scroller. If it is
500 * ELM_LIST_LIMIT, items will be expanded to the viewport width and
501 * limited to that size.
503 * @see elm_genlist_mode_get()
507 EAPI void elm_genlist_mode_set(Evas_Object *obj, Elm_List_Mode mode);
510 * Gets the horizontal stretching mode.
512 * @param obj The genlist object
513 * @return The mode to use
514 * (#ELM_LIST_LIMIT, #ELM_LIST_SCROLL)
516 * @see elm_genlist_horizontal_set()
520 EAPI Elm_List_Mode elm_genlist_mode_get(const Evas_Object *obj);
523 * Set the always select mode.
525 * @param obj The genlist object
526 * @param always_select The always select mode (@c EINA_TRUE = on, @c
527 * EINA_FALSE = off). Default is @c EINA_FALSE.
529 * Items will only call their selection func and callback when first
530 * becoming selected. Any further clicks will do nothing, unless you
531 * enable always select with elm_genlist_always_select_mode_set().
532 * This means that, even if selected, every click will make the selected
533 * callbacks be called.
535 * @see elm_genlist_always_select_mode_get()
539 //XXX: How about elm_genlist_select_mode_set() ?
540 EAPI void elm_genlist_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select);
543 * Get the always select mode.
545 * @param obj The genlist object
546 * @return The always select mode
547 * (@c EINA_TRUE = on, @c EINA_FALSE = off)
549 * @see elm_genlist_always_select_mode_set()
553 //XXX: How about elm_genlist_select_mode_get() ?
554 EAPI Eina_Bool elm_genlist_always_select_mode_get(const Evas_Object *obj);
557 * Enable/disable the no select mode.
559 * @param obj The genlist object
560 * @param no_select The no select mode
561 * (EINA_TRUE = on, EINA_FALSE = off)
563 * This will turn off the ability to select items entirely and they
564 * will neither appear selected nor call selected callback functions.
566 * @see elm_genlist_no_select_mode_get()
570 //XXX: elm_genlist_always_select_mode_set and elm_genlist_no_select_mode_set API could be merged to elm_genlist_select_mode_set()
571 EAPI void elm_genlist_no_select_mode_set(Evas_Object *obj, Eina_Bool no_select);
574 * Gets whether the no select mode is enabled.
576 * @param obj The genlist object
577 * @return The no select mode
578 * (@c EINA_TRUE = on, @c EINA_FALSE = off)
580 * @see elm_genlist_no_select_mode_set()
584 //XXX: elm_genlist_always_select_mode_get and elm_genlist_no_select_mode_get API could be merged to elm_genlist_select_mode_get()
585 EAPI Eina_Bool elm_genlist_no_select_mode_get(const Evas_Object *obj);
588 * Enable/disable horizontal and vertical bouncing effect.
590 * @param obj The genlist object
591 * @param h_bounce Allow bounce horizontally (@c EINA_TRUE = on, @c
592 * EINA_FALSE = off). Default is @c EINA_FALSE.
593 * @param v_bounce Allow bounce vertically (@c EINA_TRUE = on, @c
594 * EINA_FALSE = off). Default is @c EINA_TRUE.
596 * This will enable or disable the scroller bouncing effect for the
597 * genlist. See elm_scroller_bounce_set() for details.
599 * @see elm_scroller_bounce_set()
600 * @see elm_genlist_bounce_get()
604 EAPI void elm_genlist_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce);
607 * Get whether the horizontal and vertical bouncing effect is enabled.
609 * @param obj The genlist object
610 * @param h_bounce Pointer to a bool to receive if the bounce horizontally
612 * @param v_bounce Pointer to a bool to receive if the bounce vertically
615 * @see elm_genlist_bounce_set()
619 EAPI void elm_genlist_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce);
622 * Append a new item in a given genlist widget.
624 * @param obj The genlist object
625 * @param itc The item class for the item
626 * @param data The item data
627 * @param parent The parent item, or NULL if none
628 * @param flags Item flags
629 * @param func Convenience function called when the item is selected
630 * @param func_data Data passed to @p func above.
631 * @return A handle to the item added or @c NULL if not possible
633 * This adds the given item to the end of the list or the end of
634 * the children list if the @p parent is given.
636 * @see elm_genlist_item_prepend()
637 * @see elm_genlist_item_insert_before()
638 * @see elm_genlist_item_insert_after()
639 * @see elm_object_item_del()
643 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);
646 * Prepend a new item in a given genlist widget.
648 * @param obj The genlist object
649 * @param itc The item class for the item
650 * @param data The item data
651 * @param parent The parent item, or NULL if none
652 * @param flags Item flags
653 * @param func Convenience function called when the item is selected
654 * @param func_data Data passed to @p func above.
655 * @return A handle to the item added or NULL if not possible
657 * This adds an item to the beginning of the list or beginning of the
658 * children of the parent if given.
660 * @see elm_genlist_item_append()
661 * @see elm_genlist_item_insert_before()
662 * @see elm_genlist_item_insert_after()
663 * @see elm_object_item_del()
667 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);
670 * Insert an item before another in a genlist widget
672 * @param obj The genlist object
673 * @param itc The item class for the item
674 * @param data The item data
675 * @param parent The parent item, or NULL if none
676 * @param before The item to place this new one before.
677 * @param flags Item flags
678 * @param func Convenience function called when the item is selected
679 * @param func_data Data passed to @p func above.
680 * @return A handle to the item added or @c NULL if not possible
682 * This inserts an item before another in the list. It will be in the
683 * same tree level or group as the item it is inserted before.
685 * @see elm_genlist_item_append()
686 * @see elm_genlist_item_prepend()
687 * @see elm_genlist_item_insert_after()
688 * @see elm_object_item_del()
692 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);
695 * Insert an item after another in a genlist widget
697 * @param obj The genlist object
698 * @param itc The item class for the item
699 * @param data The item data
700 * @param parent The parent item, or NULL if none
701 * @param after The item to place this new one after.
702 * @param flags Item flags
703 * @param func Convenience function called when the item is selected
704 * @param func_data Data passed to @p func above.
705 * @return A handle to the item added or @c NULL if not possible
707 * This inserts an item after another in the list. It will be in the
708 * same tree level or group as the item it is inserted after.
710 * @see elm_genlist_item_append()
711 * @see elm_genlist_item_prepend()
712 * @see elm_genlist_item_insert_before()
713 * @see elm_object_item_del()
717 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);
720 * Insert a new item into the sorted genlist object
722 * @param obj The genlist object
723 * @param itc The item class for the item
724 * @param data The item data
725 * @param parent The parent item, or NULL if none
726 * @param flags Item flags
727 * @param comp The function called for the sort
728 * @param func Convenience function called when item selected
729 * @param func_data Data passed to @p func above.
730 * @return A handle to the item added or NULL if not possible
732 * This inserts an item in the genlist based on user defined comparison
733 * function. The two arguments passed to the function @p func are genlist item
734 * handles to compare.
736 * @see elm_genlist_item_append()
737 * @see elm_genlist_item_prepend()
738 * @see elm_genlist_item_insert_after()
739 * @see elm_object_item_del()
743 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);
745 /* operations to retrieve existing items */
747 * Get the selected item in the genlist.
749 * @param obj The genlist object
750 * @return The selected item, or NULL if none is selected.
752 * This gets the selected item in the list (if multi-selection is enabled, only
753 * the item that was first selected in the list is returned - which is not very
754 * useful, so see elm_genlist_selected_items_get() for when multi-selection is
757 * If no item is selected, NULL is returned.
759 * @see elm_genlist_selected_items_get()
763 EAPI Elm_Object_Item *elm_genlist_selected_item_get(const Evas_Object *obj);
766 * Get a list of selected items in the genlist.
768 * @param obj The genlist object
769 * @return The list of selected items, or NULL if none are selected.
771 * It returns a list of the selected items. This list pointer is only valid so
772 * long as the selection doesn't change (no items are selected or unselected, or
773 * unselected implicitly by deletion). The list contains genlist items
774 * pointers. The order of the items in this list is the order which they were
775 * selected, i.e. the first item in this list is the first item that was
776 * selected, and so on.
778 * @note If not in multi-select mode, consider using function
779 * elm_genlist_selected_item_get() instead.
781 * @see elm_genlist_multi_select_set()
782 * @see elm_genlist_selected_item_get()
786 EAPI const Eina_List *elm_genlist_selected_items_get(const Evas_Object *obj);
789 * Get a list of realized items in genlist
791 * @param obj The genlist object
792 * @return The list of realized items, nor NULL if none are realized.
794 * This returns a list of the realized items in the genlist. The list
795 * contains genlist item pointers. The list must be freed by the
796 * caller when done with eina_list_free(). The item pointers in the
797 * list are only valid so long as those items are not deleted or the
798 * genlist is not deleted.
800 * @see elm_genlist_realized_items_update()
804 EAPI Eina_List *elm_genlist_realized_items_get(const Evas_Object *obj);
807 * Get the first item in the genlist
809 * This returns the first item in the list.
811 * @param obj The genlist object
812 * @return The first item, or NULL if none
816 EAPI Elm_Object_Item *elm_genlist_first_item_get(const Evas_Object *obj);
819 * Get the last item in the genlist
821 * This returns the last item in the list.
823 * @return The last item, or NULL if none
827 EAPI Elm_Object_Item *elm_genlist_last_item_get(const Evas_Object *obj);
830 * Set the scrollbar policy
832 * @param obj The genlist object
833 * @param policy_h Horizontal scrollbar policy.
834 * @param policy_v Vertical scrollbar policy.
836 * This sets the scrollbar visibility policy for the given genlist
837 * scroller. #ELM_SMART_SCROLLER_POLICY_AUTO means the scrollbar is
838 * made visible if it is needed, and otherwise kept hidden.
839 * #ELM_SMART_SCROLLER_POLICY_ON turns it on all the time, and
840 * #ELM_SMART_SCROLLER_POLICY_OFF always keeps it off. This applies
841 * respectively for the horizontal and vertical scrollbars. Default is
842 * #ELM_SMART_SCROLLER_POLICY_AUTO
844 * @see elm_genlist_scroller_policy_get()
848 EAPI void elm_genlist_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v);
851 * Get the scrollbar policy
853 * @param obj The genlist object
854 * @param policy_h Pointer to store the horizontal scrollbar policy.
855 * @param policy_v Pointer to store the vertical scrollbar policy.
857 * @see elm_genlist_scroller_policy_set()
861 EAPI void elm_genlist_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v);
864 * Get the @b next item in a genlist widget's internal list of items,
865 * given a handle to one of those items.
867 * @param it The genlist item to fetch next from
868 * @return The item after @p item, or @c NULL if there's none (and
871 * This returns the item placed after the @p item, on the container
874 * @see elm_genlist_item_prev_get()
878 EAPI Elm_Object_Item *elm_genlist_item_next_get(const Elm_Object_Item *it);
881 * Get the @b previous item in a genlist widget's internal list of items,
882 * given a handle to one of those items.
884 * @param it The genlist item to fetch previous from
885 * @return The item before @p item, or @c NULL if there's none (and
888 * This returns the item placed before the @p item, on the container
891 * @see elm_genlist_item_next_get()
895 EAPI Elm_Object_Item *elm_genlist_item_prev_get(const Elm_Object_Item *it);
898 * Set whether a given genlist item is selected or not
901 * @param selected Use @c EINA_TRUE, to make it selected, @c
902 * EINA_FALSE to make it unselected
904 * This sets the selected state of an item. If multi selection is
905 * not enabled on the containing genlist and @p selected is @c
906 * EINA_TRUE, any other previously selected items will get
907 * unselected in favor of this new one.
909 * @see elm_genlist_item_selected_get()
913 EAPI void elm_genlist_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
916 * Get whether a given genlist item is selected or not
919 * @return @c EINA_TRUE, if it's selected, @c EINA_FALSE otherwise
921 * @see elm_genlist_item_selected_set() for more details
925 EAPI Eina_Bool elm_genlist_item_selected_get(const Elm_Object_Item *it);
928 * Show the portion of a genlist's internal list containing a given
931 * @param it The item to display
933 * This causes genlist to jump to the given item @p it and show it (by
934 * jumping to that position), if it is not fully visible.
936 * @see elm_genlist_item_bring_in()
937 * @see elm_genlist_item_top_show()
938 * @see elm_genlist_item_middle_show()
942 //XXX: elm_genlist_item_show(it, TOP/MIDDLE/BOTTOM/...); this kind of API would cover all similar APIs - item_show, item_top_show...
943 EAPI void elm_genlist_item_show(Elm_Object_Item *it);
946 * Animatedly bring in, to the visible are of a genlist, a given
949 * @param it The item to display
951 * This causes genlist to jump to the given item @p it and show it (by
952 * animatedly scrolling), if it is not fully visible. This may use animation
953 * to do so and take a period of time
955 * @see elm_genlist_item_show()
956 * @see elm_genlist_item_top_bring_in()
957 * @see elm_genlist_item_middle_bring_in()
961 //XXX: elm_genlist_item_bring_in(it, TOP/MIDDLE/BOTTOM/...); this kind of API would cover all similar APIs - bring_in, top_bring_in ...
962 EAPI void elm_genlist_item_bring_in(Elm_Object_Item *it);
965 * Show the portion of a genlist's internal list containing a given
968 * @param it The item to display
970 * This causes genlist to jump to the given item @p it and show it (by
971 * jumping to the top position), if it is not fully visible.
973 * The item will be positioned at the top of the genlist viewport.
975 * @see elm_genlist_item_show()
976 * @see elm_genlist_item_top_bring_in()
980 //XXX: elm_genlist_item_show(it, TOP/MIDDLE/BOTTOM/...); this kind of API would cover all similar APIs - item_show, item_top_show...
981 EAPI void elm_genlist_item_top_show(Elm_Object_Item *it);
984 * Animatedly bring in, to the visible are of a genlist, a given
989 * This causes genlist to jump to the given item @p it and show it (by
990 * animatedly scrolling), if it is not fully visible. This may use animation
991 * to do so and take a period of time
993 * The item will be positioned at the top of the genlist viewport.
995 * @see elm_genlist_item_bring_in()
996 * @see elm_genlist_item_top_show()
1000 //XXX: elm_genlist_item_bring_in(it, TOP/MIDDLE/BOTTOM/...); this kind of API would cover all similar APIs - bring_in, top_bring_in ...
1001 EAPI void elm_genlist_item_top_bring_in(Elm_Object_Item *it);
1004 * Show the portion of a genlist's internal list containing a given
1005 * item, immediately.
1007 * @param it The item to display
1009 * This causes genlist to jump to the given item @p it and show it (by
1010 * immediately scrolling to that position), if it is not fully visible.
1012 * The item will be positioned at the middle of the genlist viewport.
1014 * @see elm_genlist_item_show()
1015 * @see elm_genlist_item_middle_bring_in()
1019 //XXX: elm_genlist_item_show(it, TOP/MIDDLE/BOTTOM/...); this kind of API would cover all similar APIs - item_show, item_top_show...
1020 EAPI void elm_genlist_item_middle_show(Elm_Object_Item *it);
1023 * Animatedly bring in, to the visible are of a genlist, a given
1026 * @param it The item
1028 * This causes genlist to jump to the given item @p it and show it (by
1029 * animatedly scrolling), if it is not fully visible. This may use animation
1030 * to do so and take a period of time
1032 * The item will be positioned at the middle of the genlist viewport.
1034 * @see elm_genlist_item_bring_in()
1035 * @see elm_genlist_item_middle_show()
1039 //XXX: elm_genlist_item_bring_in(it, TOP/MIDDLE/BOTTOM/...); this kind of API would cover all similar APIs - bring_in, top_bring_in ...
1040 EAPI void elm_genlist_item_middle_bring_in(Elm_Object_Item *it);
1043 * Update the contents of an item
1045 * @param it The item
1047 * This updates an item by calling all the item class functions again
1048 * to get the contents, texts and states. Use this when the original
1049 * item data has changed and the changes are desired to be reflected.
1051 * Use elm_genlist_realized_items_update() to update all already realized
1054 * @see elm_genlist_realized_items_update()
1058 EAPI void elm_genlist_item_update(Elm_Object_Item *it);
1061 * Update the item class of an item
1063 * @param it The item
1064 * @param itc The item class for the item
1066 * This sets another class of the item, changing the way that it is
1067 * displayed. After changing the item class, elm_genlist_item_update() is
1068 * called on the item @p it.
1072 EAPI void elm_genlist_item_item_class_update(Elm_Object_Item *it, const Elm_Genlist_Item_Class *itc);
1075 * Get the Genlist Item class for the given Genlist Item.
1077 * @param it The genlist item
1079 * This returns the Genlist_Item_Class for the given item. It can be used to
1080 * examine the function pointers and item_style.
1084 EAPI const Elm_Genlist_Item_Class *elm_genlist_item_item_class_get(const Elm_Object_Item *it);
1087 * Get the index of the item. It is only valid once displayed.
1089 * @param it a genlist item
1090 * @return the position inside the list of item.
1094 EAPI int elm_genlist_item_index_get(const Elm_Object_Item *it);
1097 * Update the contents of all realized items.
1099 * @param obj The genlist object.
1101 * This updates all realized items by calling all the item class functions again
1102 * to get the contents, texts and states. Use this when the original
1103 * item data has changed and the changes are desired to be reflected.
1105 * To update just one item, use elm_genlist_item_update().
1107 * @see elm_genlist_realized_items_get()
1108 * @see elm_genlist_item_update()
1112 EAPI void elm_genlist_realized_items_update(Evas_Object *obj);
1115 * Return how many items are currently in a list
1117 * @param obj The list
1118 * @return The total number of list items in the list
1120 * This behavior is O(1) and includes items which may or may not be realized.
1124 EAPI unsigned int elm_genlist_items_count(const Evas_Object *obj);
1126 #define ELM_GENLIST_ITEM_CLASS_VERSION 2 /* current version number */
1129 * Add a new genlist item class in a given genlist widget.
1131 * @return New allocated a genlist item class.
1133 * This adds genlist item class for the genlist widget. When adding a item,
1134 * genlist_item_{append, prepend, insert} function needs item class of the item.
1135 * Given callback parameters are used at retrieving {text, content} of
1136 * added item. Set as NULL if it's not used.
1137 * If there's no available memory, return can be NULL.
1139 * @see elm_genlist_item_class_free()
1140 * @see elm_genlist_item_append()
1144 EAPI Elm_Genlist_Item_Class *elm_genlist_item_class_new(void);
1147 * Remove a item class in a given genlist widget.
1149 * @param itc The itc to be removed.
1151 * This removes item class from the genlist widget.
1152 * Whenever it has no more references to it, item class is going to be freed.
1153 * Otherwise it just decreases its reference count.
1155 * @see elm_genlist_item_class_new()
1156 * @see elm_genlist_item_class_ref()
1157 * @see elm_genlist_item_class_unref()
1161 EAPI void elm_genlist_item_class_free(Elm_Genlist_Item_Class *itc);
1164 * Increments object reference count for the item class.
1166 * @param itc The given item class object to reference
1168 * This API just increases its reference count for item class management.
1170 * @see elm_genlist_item_class_unref()
1174 EAPI void elm_genlist_item_class_ref(Elm_Genlist_Item_Class *itc);
1177 * Decrements object reference count for the item class.
1179 * @param itc The given item class object to reference
1181 * This API just decreases its reference count for item class management.
1182 * Reference count can't be less than 0.
1184 * @see elm_genlist_item_class_ref()
1185 * @see elm_genlist_item_class_free()
1189 EAPI void elm_genlist_item_class_unref(Elm_Genlist_Item_Class *itc);
1193 //XXX: Need to review tooltip & cursor APIs
1196 * Set the text to be shown in a given genlist item's tooltips.
1198 * @param it The genlist item
1199 * @param text The text to set in the content
1201 * This call will setup the text to be used as tooltip to that item
1202 * (analogous to elm_object_tooltip_text_set(), but being item
1203 * tooltips with higher precedence than object tooltips). It can
1204 * have only one tooltip at a time, so any previous tooltip data
1207 * In order to set a content or something else as a tooltip, look at
1208 * elm_genlist_item_tooltip_content_cb_set().
1212 EAPI void elm_genlist_item_tooltip_text_set(Elm_Object_Item *it, const char *text);
1215 * Set the content to be shown in a given genlist item's tooltips
1217 * @param it The genlist item.
1218 * @param func The function returning the tooltip contents.
1219 * @param data What to provide to @a func as callback data/context.
1220 * @param del_cb Called when data is not needed anymore, either when
1221 * another callback replaces @p func, the tooltip is unset with
1222 * elm_genlist_item_tooltip_unset() or the owner @p item
1223 * dies. This callback receives as its first parameter the
1224 * given @p data, being @c event_info the item handle.
1226 * This call will setup the tooltip's contents to @p item
1227 * (analogous to elm_object_tooltip_content_cb_set(), but being
1228 * item tooltips with higher precedence than object tooltips). It
1229 * can have only one tooltip at a time, so any previous tooltip
1230 * content will get removed. @p func (with @p data) will be called
1231 * every time Elementary needs to show the tooltip and it should
1232 * return a valid Evas object, which will be fully managed by the
1233 * tooltip system, getting deleted when the tooltip is gone.
1235 * In order to set just a text as a tooltip, look at
1236 * elm_genlist_item_tooltip_text_set().
1240 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);
1243 * Unset a tooltip from a given genlist item
1245 * @param it genlist item to remove a previously set tooltip from.
1247 * This call removes any tooltip set on @p item. The callback
1248 * provided as @c del_cb to
1249 * elm_genlist_item_tooltip_content_cb_set() will be called to
1250 * notify it is not used anymore (and have resources cleaned, if
1253 * @see elm_genlist_item_tooltip_content_cb_set()
1257 EAPI void elm_genlist_item_tooltip_unset(Elm_Object_Item *it);
1260 * Set a different @b style for a given genlist item's tooltip.
1262 * @param it genlist item with tooltip set
1263 * @param style the <b>theme style</b> to use on tooltips (e.g. @c
1264 * "default", @c "transparent", etc)
1266 * Tooltips can have <b>alternate styles</b> to be displayed on,
1267 * which are defined by the theme set on Elementary. This function
1268 * works analogously as elm_object_tooltip_style_set(), but here
1269 * applied only to genlist item objects. The default style for
1270 * tooltips is @c "default".
1272 * @note before you set a style you should define a tooltip with
1273 * elm_genlist_item_tooltip_content_cb_set() or
1274 * elm_genlist_item_tooltip_text_set()
1276 * @see elm_genlist_item_tooltip_style_get()
1280 EAPI void elm_genlist_item_tooltip_style_set(Elm_Object_Item *it, const char *style);
1283 * Get the style set a given genlist item's tooltip.
1285 * @param it genlist item with tooltip already set on.
1286 * @return style the theme style in use, which defaults to
1287 * "default". If the object does not have a tooltip set,
1288 * then @c NULL is returned.
1290 * @see elm_genlist_item_tooltip_style_set() for more details
1294 EAPI const char *elm_genlist_item_tooltip_style_get(const Elm_Object_Item *it);
1297 * @brief Disable size restrictions on an object's tooltip
1298 * @param it The tooltip's anchor object
1299 * @param disable If EINA_TRUE, size restrictions are disabled
1300 * @return EINA_FALSE on failure, EINA_TRUE on success
1302 * This function allows a tooltip to expand beyond its parent window's canvas.
1303 * It will instead be limited only by the size of the display.
1305 EAPI Eina_Bool elm_genlist_item_tooltip_window_mode_set(Elm_Object_Item *it, Eina_Bool disable);
1308 * @brief Retrieve size restriction state of an object's tooltip
1309 * @param it The tooltip's anchor object
1310 * @return If EINA_TRUE, size restrictions are disabled
1312 * This function returns whether a tooltip is allowed to expand beyond
1313 * its parent window's canvas.
1314 * It will instead be limited only by the size of the display.
1316 EAPI Eina_Bool elm_genlist_item_tooltip_window_mode_get(const Elm_Object_Item *it);
1319 * Set the type of mouse pointer/cursor decoration to be shown,
1320 * when the mouse pointer is over the given genlist widget item
1322 * @param it genlist item to customize cursor on
1323 * @param cursor the cursor type's name
1325 * This function works analogously as elm_object_cursor_set(), but
1326 * here the cursor's changing area is restricted to the item's
1327 * area, and not the whole widget's. Note that that item cursors
1328 * have precedence over widget cursors, so that a mouse over @p
1329 * item will always show cursor @p type.
1331 * If this function is called twice for an object, a previously set
1332 * cursor will be unset on the second call.
1334 * @see elm_object_cursor_set()
1335 * @see elm_genlist_item_cursor_get()
1336 * @see elm_genlist_item_cursor_unset()
1340 EAPI void elm_genlist_item_cursor_set(Elm_Object_Item *it, const char *cursor);
1343 * Get the type of mouse pointer/cursor decoration set to be shown,
1344 * when the mouse pointer is over the given genlist widget item
1346 * @param it genlist item with custom cursor set
1347 * @return the cursor type's name or @c NULL, if no custom cursors
1348 * were set to @p item (and on errors)
1350 * @see elm_object_cursor_get()
1351 * @see elm_genlist_item_cursor_set() for more details
1352 * @see elm_genlist_item_cursor_unset()
1356 EAPI const char *elm_genlist_item_cursor_get(const Elm_Object_Item *it);
1359 * Unset any custom mouse pointer/cursor decoration set to be
1360 * shown, when the mouse pointer is over the given genlist widget
1361 * item, thus making it show the @b default cursor again.
1363 * @param it a genlist item
1365 * Use this call to undo any custom settings on this item's cursor
1366 * decoration, bringing it back to defaults (no custom style set).
1368 * @see elm_object_cursor_unset()
1369 * @see elm_genlist_item_cursor_set() for more details
1373 EAPI void elm_genlist_item_cursor_unset(Elm_Object_Item *it);
1376 * Set a different @b style for a given custom cursor set for a
1379 * @param it genlist item with custom cursor set
1380 * @param style the <b>theme style</b> to use (e.g. @c "default",
1381 * @c "transparent", etc)
1383 * This function only makes sense when one is using custom mouse
1384 * cursor decorations <b>defined in a theme file</b> , which can
1385 * have, given a cursor name/type, <b>alternate styles</b> on
1386 * it. It works analogously as elm_object_cursor_style_set(), but
1387 * here applied only to genlist item objects.
1389 * @warning Before you set a cursor style you should have defined a
1390 * custom cursor previously on the item, with
1391 * elm_genlist_item_cursor_set()
1393 * @see elm_genlist_item_cursor_engine_only_set()
1394 * @see elm_genlist_item_cursor_style_get()
1398 EAPI void elm_genlist_item_cursor_style_set(Elm_Object_Item *it, const char *style);
1401 * Get the current @b style set for a given genlist item's custom
1404 * @param it genlist item with custom cursor set.
1405 * @return style the cursor style in use. If the object does not
1406 * have a cursor set, then @c NULL is returned.
1408 * @see elm_genlist_item_cursor_style_set() for more details
1412 EAPI const char *elm_genlist_item_cursor_style_get(const Elm_Object_Item *it);
1415 * Set if the (custom) cursor for a given genlist item should be
1416 * searched in its theme, also, or should only rely on the
1419 * @param it item with custom (custom) cursor already set on
1420 * @param engine_only Use @c EINA_TRUE to have cursors looked for
1421 * only on those provided by the rendering engine, @c EINA_FALSE to
1422 * have them searched on the widget's theme, as well.
1424 * @note This call is of use only if you've set a custom cursor
1425 * for genlist items, with elm_genlist_item_cursor_set().
1427 * @note By default, cursors will only be looked for between those
1428 * provided by the rendering engine.
1432 EAPI void elm_genlist_item_cursor_engine_only_set(Elm_Object_Item *it, Eina_Bool engine_only);
1435 * Get if the (custom) cursor for a given genlist item is being
1436 * searched in its theme, also, or is only relying on the rendering
1439 * @param it a genlist item
1440 * @return @c EINA_TRUE, if cursors are being looked for only on
1441 * those provided by the rendering engine, @c EINA_FALSE if they
1442 * are being searched on the widget's theme, as well.
1444 * @see elm_genlist_item_cursor_engine_only_set(), for more details
1448 EAPI Eina_Bool elm_genlist_item_cursor_engine_only_get(const Elm_Object_Item *it);
1451 * Enable/disable compress mode.
1453 * @param obj The genlist object
1454 * @param compress The compress mode
1455 * (@c EINA_TRUE = on, @c EINA_FALSE = off). Default is @c EINA_FALSE.
1457 * This will enable the compress mode where items are "compressed"
1458 * horizontally to fit the genlist scrollable viewport width. This is
1459 * special for genlist. Do not rely on
1460 * elm_genlist_horizontal_set() being set to @c ELM_LIST_COMPRESS to
1461 * work as genlist needs to handle it specially.
1463 * @see elm_genlist_compress_mode_get()
1467 // XXX: kill this. elm_genlist_height_for_width_mode_set() covers this.
1468 EAPI void elm_genlist_compress_mode_set(Evas_Object *obj, Eina_Bool compress);
1471 * Get whether the compress mode is enabled.
1473 * @param obj The genlist object
1474 * @return The compress mode
1475 * (@c EINA_TRUE = on, @c EINA_FALSE = off)
1477 * @see elm_genlist_compress_mode_set()
1481 EAPI Eina_Bool elm_genlist_compress_mode_get(const Evas_Object *obj);
1484 * Enable/disable height-for-width mode.
1486 * @param obj The genlist object
1487 * @param height_for_width The height-for-width mode (@c EINA_TRUE = on,
1488 * @c EINA_FALSE = off). Default is @c EINA_FALSE.
1490 * With height-for-width mode the item width will be fixed (restricted
1491 * to a minimum of) to the list width when calculating its size in
1492 * order to allow the height to be calculated based on it. This allows,
1493 * for instance, text block to wrap lines if the Edje part is
1494 * configured with "text.min: 0 1".
1496 * @note This mode will make list resize slower as it will have to
1497 * recalculate every item height again whenever the list width
1500 * @note When height-for-width mode is enabled, it also enables
1501 * compress mode (see elm_genlist_compress_mode_set()) and
1502 * disables homogeneous (see elm_genlist_homogeneous_set()).
1507 //XXX: API name is ambiguous.. How about elm_genlist_mode_fixed_width_set?
1508 EAPI void elm_genlist_height_for_width_mode_set(Evas_Object *obj, Eina_Bool height_for_width);
1511 * Get whether the height-for-width mode is enabled.
1513 * @param obj The genlist object
1514 * @return The height-for-width mode (@c EINA_TRUE = on, @c EINA_FALSE =
1519 //XXX: API name is ambiguous elm_genlist_mode_fixed_width_get() ?????
1520 EAPI Eina_Bool elm_genlist_height_for_width_mode_get(const Evas_Object *obj);
1523 * Enable/disable homogeneous mode.
1525 * @param obj The genlist object
1526 * @param homogeneous Assume the items within the genlist are of the
1527 * same height and width (EINA_TRUE = on, EINA_FALSE = off). Default is @c
1530 * This will enable the homogeneous mode where items are of the same
1531 * height and width so that genlist may do the lazy-loading at its
1532 * maximum (which increases the performance for scrolling the list). This
1533 * implies 'compressed' mode.
1535 * @see elm_genlist_compress_mode_set()
1536 * @see elm_genlist_homogeneous_get()
1540 EAPI void elm_genlist_homogeneous_set(Evas_Object *obj, Eina_Bool homogeneous);
1543 * Get whether the homogeneous mode is enabled.
1545 * @param obj The genlist object
1546 * @return Assume the items within the genlist are of the same height
1547 * and width (EINA_TRUE = on, EINA_FALSE = off)
1549 * @see elm_genlist_homogeneous_set()
1553 EAPI Eina_Bool elm_genlist_homogeneous_get(const Evas_Object *obj);
1556 * Set the maximum number of items within an item block
1558 * @param obj The genlist object
1559 * @param count Maximum number of items within an item block. Default is 32.
1561 * This will configure the block count to tune to the target with particular
1562 * performance matrix.
1564 * A block of objects will be used to reduce the number of operations due to
1565 * many objects in the screen. It can determine the visibility, or if the
1566 * object has changed, it theme needs to be updated, etc. doing this kind of
1567 * calculation to the entire block, instead of per object.
1569 * The default value for the block count is enough for most lists, so unless
1570 * you know you will have a lot of objects visible in the screen at the same
1571 * time, don't try to change this.
1573 * @see elm_genlist_block_count_get()
1574 * @see @ref Genlist_Implementation
1578 EAPI void elm_genlist_block_count_set(Evas_Object *obj, int count);
1581 * Get the maximum number of items within an item block
1583 * @param obj The genlist object
1584 * @return Maximum number of items within an item block
1586 * @see elm_genlist_block_count_set()
1590 EAPI int elm_genlist_block_count_get(const Evas_Object *obj);
1593 * Set the timeout in seconds for the longpress event.
1595 * @param obj The genlist object
1596 * @param timeout timeout in seconds. Default is elm config value(1.0)
1598 * This option will change how long it takes to send an event "longpressed"
1599 * after the mouse down signal is sent to the list. If this event occurs, no
1600 * "clicked" event will be sent.
1602 * @warning If you set the longpress timeout value with this API, your genlist
1603 * will not be affected by the longpress value of elementary config value
1606 * @see elm_genlist_longpress_timeout_set()
1610 EAPI void elm_genlist_longpress_timeout_set(Evas_Object *obj, double timeout);
1613 * Get the timeout in seconds for the longpress event.
1615 * @param obj The genlist object
1616 * @return timeout in seconds
1618 * @see elm_genlist_longpress_timeout_get()
1622 EAPI double elm_genlist_longpress_timeout_get(const Evas_Object *obj);
1625 * Get the item that is at the x, y canvas coords.
1627 * @param obj The genlist object.
1628 * @param x The input x coordinate
1629 * @param y The input y coordinate
1630 * @param posret The position relative to the item returned here
1631 * @return The item at the coordinates or NULL if none
1633 * This returns the item at the given coordinates (which are canvas
1634 * relative, not object-relative). If an item is at that coordinate,
1635 * that item handle is returned, and if @p posret is not NULL, the
1636 * integer pointed to is set to a value of -1, 0 or 1, depending if
1637 * the coordinate is on the upper portion of that item (-1), on the
1638 * middle section (0) or on the lower part (1). If NULL is returned as
1639 * an item (no item found there), then posret may indicate -1 or 1
1640 * based if the coordinate is above or below all items respectively in
1645 EAPI Elm_Object_Item *elm_genlist_at_xy_item_get(const Evas_Object *obj, Evas_Coord x, Evas_Coord y, int *posret);
1648 * Get the parent item of the given item
1650 * @param it The item
1651 * @return The parent of the item or @c NULL if it has no parent.
1653 * This returns the item that was specified as parent of the item @p it on
1654 * elm_genlist_item_append() and insertion related functions.
1658 EAPI Elm_Object_Item *elm_genlist_item_parent_get(const Elm_Object_Item *it);
1661 * Remove all sub-items (children) of the given item
1663 * @param it The item
1665 * This removes all items that are children (and their descendants) of the
1668 * @see elm_genlist_clear()
1669 * @see elm_object_item_del()
1673 EAPI void elm_genlist_item_subitems_clear(Elm_Object_Item *it);
1676 * Sets the expanded state of an item.
1678 * @param it The item
1679 * @param expanded The expanded state (@c EINA_TRUE expanded, @c EINA_FALSE not expanded).
1681 * This function flags the item of type #ELM_GENLIST_ITEM_SUBITEMS as
1684 * The theme will respond to this change visually, and a signal "expanded" or
1685 * "contracted" will be sent from the genlist with a pointer to the item that
1686 * has been expanded/contracted.
1688 * Calling this function won't show or hide any child of this item (if it is
1689 * a parent). You must manually delete and create them on the callbacks of
1690 * the "expanded" or "contracted" signals.
1692 * @see elm_genlist_item_expanded_get()
1696 EAPI void elm_genlist_item_expanded_set(Elm_Object_Item *it, Eina_Bool expanded);
1699 * Get the expanded state of an item
1701 * @param it The item
1702 * @return The expanded state
1704 * This gets the expanded state of an item.
1706 * @see elm_genlist_item_expanded_set()
1710 EAPI Eina_Bool elm_genlist_item_expanded_get(const Elm_Object_Item *it);
1713 * Get the depth of expanded item
1715 * @param it The genlist item object
1716 * @return The depth of expanded item
1720 EAPI int elm_genlist_item_expanded_depth_get(const Elm_Object_Item *it);
1723 * Sets the display only state of an item.
1725 * @param it The item
1726 * @param display_only @c EINA_TRUE if the item is display only, @c
1727 * EINA_FALSE otherwise.
1729 * A display only item cannot be selected or unselected. It is for
1730 * display only and not selecting or otherwise clicking, dragging
1731 * etc. by the user, thus finger size rules will not be applied to
1734 * It's good to set group index items to display only state.
1736 * @see elm_genlist_item_display_only_get()
1740 //XXX: elm_genlist_item_no_select_mode_set()?
1741 EAPI void elm_genlist_item_display_only_set(Elm_Object_Item *it, Eina_Bool display_only);
1744 * Get the display only state of an item
1746 * @param it The item
1747 * @return @c EINA_TRUE if the item is display only, @c
1748 * EINA_FALSE otherwise.
1750 * @see elm_genlist_item_display_only_set()
1754 //XXX: elm_genlist_item_no_select_mode_get()?
1755 EAPI Eina_Bool elm_genlist_item_display_only_get(const Elm_Object_Item *it);
1758 * Tells genlist to "orphan" contents fetched by the item class
1760 * @param it The item
1762 * This instructs genlist to release references to contents in the item,
1763 * meaning that they will no longer be managed by genlist and are
1764 * floating "orphans" that can be re-used elsewhere if the user wants
1769 //XXX: Eina_List *elm_genlist_item_all_contents_unset() ??
1770 EAPI void elm_genlist_item_contents_orphan(Elm_Object_Item *it);
1773 * Promote an item to the top of the list
1775 * @param it The item
1779 EAPI void elm_genlist_item_promote(Elm_Object_Item *it);
1782 * Demote an item to the end of the list
1784 * @param it The item
1788 EAPI void elm_genlist_item_demote(Elm_Object_Item *it);
1791 * Update the part of an item
1793 * @param it The item
1794 * @param parts The name of item's part
1795 * @param itf The flags of item's part type
1797 * This updates an item's part by calling item's fetching functions again
1798 * to get the contents, texts and states. Use this when the original
1799 * item data has changed and the changes are desired to be reflected.
1800 * Second parts argument is used for globbing to match '*', '?', and '.'
1801 * It can be used at updating multi fields.
1803 * Use elm_genlist_realized_items_update() to update an item's all
1806 * @see elm_genlist_item_update()
1810 EAPI void elm_genlist_item_fields_update(Elm_Object_Item *it, const char *parts, Elm_Genlist_Item_Field_Flags itf);
1813 * Activate a genlist mode on an item
1815 * @param it The genlist item
1816 * @param mode_type Mode name
1817 * @param mode_set Boolean to define set or unset mode.
1819 * A genlist mode is a different way of selecting an item. Once a mode is
1820 * activated on an item, any other selected item is immediately unselected.
1821 * This feature provides an easy way of implementing a new kind of animation
1822 * for selecting an item, without having to entirely rewrite the item style
1823 * theme. However, the elm_genlist_selected_* API can't be used to get what
1824 * item is activate for a mode.
1826 * The current item style will still be used, but applying a genlist mode to
1827 * an item will select it using a different kind of animation.
1829 * The current active item for a mode can be found by
1830 * elm_genlist_mode_item_get().
1832 * The characteristics of genlist mode are:
1833 * - Only one mode can be active at any time, and for only one item.
1834 * - Genlist handles deactivating other items when one item is activated.
1835 * - A mode is defined in the genlist theme (edc), and more modes can easily
1837 * - A mode style and the genlist item style are different things. They
1838 * can be combined to provide a default style to the item, with some kind
1839 * of animation for that item when the mode is activated.
1841 * When a mode is activated on an item, a new view for that item is created.
1842 * The theme of this mode defines the animation that will be used to transit
1843 * the item from the old view to the new view. This second (new) view will be
1844 * active for that item while the mode is active on the item, and will be
1845 * destroyed after the mode is totally deactivated from that item.
1847 * @see elm_genlist_mode_get()
1848 * @see elm_genlist_mode_item_get()
1852 //XXX: How bout elm_genlist_effect_mode_set
1853 EAPI void elm_genlist_item_mode_set(Elm_Object_Item *it, const char *mode_type, Eina_Bool mode_set);
1856 * Get the last (or current) genlist mode used.
1858 * @param obj The genlist object
1860 * This function just returns the name of the last used genlist mode. It will
1861 * be the current mode if it's still active.
1863 * @see elm_genlist_item_mode_set()
1864 * @see elm_genlist_mode_item_get()
1868 //XXX: looks weird... set the mode type to item and get the mode type from object...
1869 EAPI const char *elm_genlist_mode_type_get(const Evas_Object *obj);
1872 * Get active genlist mode item
1874 * @param obj The genlist object
1875 * @return The active item for that current mode. Or @c NULL if no item is
1876 * activated with any mode.
1878 * This function returns the item that was activated with a mode, by the
1879 * function elm_genlist_item_mode_set().
1881 * @see elm_genlist_item_mode_set()
1882 * @see elm_genlist_mode_get()
1886 EAPI const Elm_Object_Item *elm_genlist_mode_item_get(const Evas_Object *obj);
1891 * @param obj The genlist object
1892 * @param reorder_mode The reorder mode
1893 * (EINA_TRUE = on, EINA_FALSE = off)
1897 EAPI void elm_genlist_reorder_mode_set(Evas_Object *obj, Eina_Bool reorder_mode);
1900 * Get the reorder mode
1902 * @param obj The genlist object
1903 * @return The reorder mode
1904 * (EINA_TRUE = on, EINA_FALSE = off)
1908 EAPI Eina_Bool elm_genlist_reorder_mode_get(const Evas_Object *obj);
1911 * Get the Item's Flags
1913 * @param it The genlist item
1914 * @return The item flags.
1916 * This function returns the item's type. Normally the item's type.
1917 * If it failed, return value is ELM_GENLIST_ITEM_MAX
1921 //XXX: type would be more intuitive...
1922 EAPI Elm_Genlist_Item_Flags elm_genlist_item_flags_get(const Elm_Object_Item *it);
1925 * Set Genlist edit mode
1927 * This sets Genlist edit mode.
1929 * @param obj The Genlist object
1930 * @param The edit mode status
1931 * (EINA_TRUE = edit mode, EINA_FALSE = normal mode
1935 //XXX: elm_genlist_effect_mode_set();
1936 EAPI void elm_genlist_edit_mode_set(Evas_Object *obj, Eina_Bool edit_mode);
1939 * Get Genlist edit mode
1941 * @param obj The genlist object
1942 * @return The edit mode status
1943 * (EINA_TRUE = edit mode, EINA_FALSE = normal mode
1947 //XXX: elm_genlist_all_items_effect_mode_get();
1948 EAPI Eina_Bool elm_genlist_edit_mode_get(const Evas_Object *obj);
1951 * Set the flip state of a given genlist item.
1953 * @param it The genlist item object
1954 * @param flip The flip mode
1955 * (EINA_TRUE = on, EINA_FALSE = off)
1957 * This function sets the flip state of a given genlist item.
1958 * Flip mode overrides current item object.
1959 * It can be used for on-the-fly item replace.
1961 * @see elm_genlist_item_flip_get()
1966 EAPI void elm_genlist_item_flip_set(Elm_Object_Item *it, Eina_Bool flip);
1969 * Get the flip state of a given genlist item.
1971 * @param it The genlist item object
1973 * This function returns the flip state of a given genlist item.
1974 * If the parameter is invalid, it returns EINA_FALSE.
1976 * @see elm_genlist_item_flip_set()
1981 EAPI Eina_Bool elm_genlist_item_flip_get(const Elm_Object_Item *it);