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
34 * - @c mode_item_style - This is a constant string and simply defines the name
35 * of the mode item style. It is used to specify mode item style. It can be
36 * used to set sweep mode.
37 * - @c edit_item_style - This is a constant string and simply defines the name
38 * of the edit item style. It is used to specify edit item style. It can be
39 * used to set selection, checking and deletion mode.
40 * - @c func - A struct with pointers to functions that will be called when
41 * an item is going to be actually created. All of them receive a @c data
42 * parameter that will point to the same data passed to
43 * elm_genlist_item_append() and related item creation functions, and an @c
44 * obj parameter that points to the genlist object itself.
46 * The function pointers inside @c func are @c text_get, @c content_get, @c
47 * state_get and @c del. The 3 first functions also receive a @c part
48 * parameter described below. A brief description of these functions follows:
50 * - @c text_get - The @c part parameter is the name string of one of the
51 * existing text parts in the Edje group implementing the item's theme.
52 * This function @b must return a strdup'()ed string, as the caller will
53 * free() it when done. See #Elm_Genlist_Item_Text_Get_Cb.
54 * - @c content_get - The @c part parameter is the name string of one of the
55 * existing (content) swallow parts in the Edje group implementing the item's
56 * theme. It must return @c NULL, when no content is desired, or a valid
57 * object handle, otherwise. The object will be deleted by the genlist on
58 * its deletion or when the item is "unrealized". See
59 * #Elm_Genlist_Item_Content_Get_Cb.
60 * - @c func.state_get - The @c part parameter is the name string of one of
61 * the state parts in the Edje group implementing the item's theme. Return
62 * @c EINA_FALSE for false/off or @c EINA_TRUE for true/on. Genlists will
63 * emit a signal to its theming Edje object with @c "elm,state,xxx,active"
64 * and @c "elm" as "emission" and "source" arguments, respectively, when
65 * the state is true (the default is false), where @c xxx is the name of
66 * the (state) part. See #Elm_Genlist_Item_State_Get_Cb.
67 * - @c func.del - This is intended for use when genlist items are deleted,
68 * so any data attached to the item (e.g. its data parameter on creation)
69 * can be deleted. See #Elm_Genlist_Item_Del_Cb.
71 * available item styles:
73 * - default_style - The text part is a textblock
75 * @image html img/widget/genlist/preview-04.png
76 * @image latex img/widget/genlist/preview-04.eps
80 * @image html img/widget/genlist/preview-01.png
81 * @image latex img/widget/genlist/preview-01.eps
83 * - icon_top_text_bottom
85 * @image html img/widget/genlist/preview-02.png
86 * @image latex img/widget/genlist/preview-02.eps
90 * @image html img/widget/genlist/preview-03.png
91 * @image latex img/widget/genlist/preview-03.eps
93 * @section Genlist_Items Structure of items
95 * An item in a genlist can have 0 or more texts (they can be regular
96 * text or textblock Evas objects - that's up to the style to determine), 0
97 * or more contents (which are simply objects swallowed into the genlist item's
98 * theming Edje object) and 0 or more <b>boolean states</b>, which have the
99 * behavior left to the user to define. The Edje part names for each of
100 * these properties will be looked up, in the theme file for the genlist,
101 * under the Edje (string) data items named @c "labels", @c "contents" and @c
102 * "states", respectively. For each of those properties, if more than one
103 * part is provided, they must have names listed separated by spaces in the
104 * data fields. For the default genlist item theme, we have @b one text
105 * part (@c "elm.text"), @b two content parts (@c "elm.swalllow.icon" and @c
106 * "elm.swallow.end") and @b no state parts.
108 * A genlist item may be at one of several styles. Elementary provides one
109 * by default - "default", but this can be extended by system or application
110 * custom themes/overlays/extensions (see @ref Theme "themes" for more
113 * @section Genlist_Manipulation Editing and Navigating
115 * Items can be added by several calls. All of them return a @ref
116 * Elm_Object_Item handle that is an internal member inside the genlist.
117 * They all take a data parameter that is meant to be used for a handle to
118 * the applications internal data (eg. the struct with the original item
119 * data). The parent parameter is the parent genlist item this belongs to if
120 * it is a tree or an indexed group, and NULL if there is no parent. The
121 * flags can be a bitmask of #ELM_GENLIST_ITEM_NONE,
122 * #ELM_GENLIST_ITEM_SUBITEMS and #ELM_GENLIST_ITEM_GROUP. If
123 * #ELM_GENLIST_ITEM_SUBITEMS is set then this item is displayed as an item
124 * that is able to expand and have child items. If ELM_GENLIST_ITEM_GROUP
125 * is set then this item is group index item that is displayed at the top
126 * until the next group comes. The func parameter is a convenience callback
127 * that is called when the item is selected and the data parameter will be
128 * the func_data parameter, obj be the genlist object and event_info will be
131 * elm_genlist_item_append() adds an item to the end of the list, or if
132 * there is a parent, to the end of all the child items of the parent.
133 * elm_genlist_item_prepend() is the same but adds to the beginning of
134 * the list or children list. elm_genlist_item_insert_before() inserts at
135 * item before another item and elm_genlist_item_insert_after() inserts after
136 * the indicated item.
138 * The application can clear the list with elm_genlist_clear() which deletes
139 * all the items in the list and elm_object_item_del() will delete a specific
140 * item. elm_genlist_item_subitems_clear() will clear all items that are
141 * children of the indicated parent item.
143 * To help inspect list items you can jump to the item at the top of the list
144 * with elm_genlist_first_item_get() which will return the item pointer, and
145 * similarly elm_genlist_last_item_get() gets the item at the end of the list.
146 * elm_genlist_item_next_get() and elm_genlist_item_prev_get() get the next
147 * and previous items respectively relative to the indicated item. Using
148 * these calls you can walk the entire item list/tree. Note that as a tree
149 * the items are flattened in the list, so elm_genlist_item_parent_get() will
150 * let you know which item is the parent (and thus know how to skip them if
153 * @section Genlist_Multi_Selection Multi-selection
155 * If the application wants multiple items to be able to be selected,
156 * elm_genlist_multi_select_set() can enable this. If the list is
157 * single-selection only (the default), then elm_genlist_selected_item_get()
158 * will return the selected item, if any, or NULL if none is selected. If the
159 * list is multi-select then elm_genlist_selected_items_get() will return a
160 * list (that is only valid as long as no items are modified (added, deleted,
161 * selected or unselected)).
163 * @section Genlist_Usage_Hints Usage hints
165 * There are also convenience functions. elm_object_item_widget_get() will
166 * return the genlist object the item belongs to. elm_genlist_item_show()
167 * will make the scroller scroll to show that specific item so its visible.
168 * elm_object_item_data_get() returns the data pointer set by the item
169 * creation functions.
171 * If an item changes (state of boolean changes, text or contents change),
172 * then use elm_genlist_item_update() to have genlist update the item with
173 * the new state. Genlist will re-realize the item and thus call the functions
174 * in the _Elm_Genlist_Item_Class for that item.
176 * To programmatically (un)select an item use elm_genlist_item_selected_set().
177 * To get its selected state use elm_genlist_item_selected_get(). Similarly
178 * to expand/contract an item and get its expanded state, use
179 * elm_genlist_item_expanded_set() and elm_genlist_item_expanded_get(). And
180 * again to make an item disabled (unable to be selected and appear
181 * differently) use elm_object_item_disabled_set() to set this and
182 * elm_object_item_disabled_get() to get the disabled state.
184 * In general to indicate how the genlist should expand items horizontally to
185 * fill the list area, use elm_genlist_mode_set(). Valid modes are
186 * ELM_LIST_LIMIT and ELM_LIST_SCROLL. The default is ELM_LIST_SCROLL. This
187 * mode means that if items are too wide to fit, the scroller will scroll
188 * horizontally. Otherwise items are expanded to fill the width of the
189 * viewport of the scroller. If it is ELM_LIST_LIMIT, items will be expanded
190 * to the viewport width and limited to that size. This can be combined with
191 * a different style that uses edjes' ellipsis feature (cutting text off like
194 * Items will only call their selection func and callback when first becoming
195 * selected. Any further clicks will do nothing, unless you enable always
196 * select with elm_genlist_always_select_mode_set(). This means even if
197 * selected, every click will make the selected callbacks be called.
198 * elm_genlist_no_select_mode_set() will turn off the ability to select
199 * items entirely and they will neither appear selected nor call selected
200 * callback functions.
202 * Remember that you can create new styles and add your own theme augmentation
203 * per application with elm_theme_extension_add(). If you absolutely must
204 * have a specific style that overrides any theme the user or system sets up
205 * you can use elm_theme_overlay_add() to add such a file.
207 * @section Genlist_Implementation Implementation
209 * Evas tracks every object you create. Every time it processes an event
210 * (mouse move, down, up etc.) it needs to walk through objects and find out
211 * what event that affects. Even worse every time it renders display updates,
212 * in order to just calculate what to re-draw, it needs to walk through many
213 * many many objects. Thus, the more objects you keep active, the more
214 * overhead Evas has in just doing its work. It is advisable to keep your
215 * active objects to the minimum working set you need. Also remember that
216 * object creation and deletion carries an overhead, so there is a
217 * middle-ground, which is not easily determined. But don't keep massive lists
218 * of objects you can't see or use. Genlist does this with list objects. It
219 * creates and destroys them dynamically as you scroll around. It groups them
220 * into blocks so it can determine the visibility etc. of a whole block at
221 * once as opposed to having to walk the whole list. This 2-level list allows
222 * for very large numbers of items to be in the list (tests have used up to
223 * 2,000,000 items). Also genlist employs a queue for adding items. As items
224 * may be different sizes, every item added needs to be calculated as to its
225 * size and thus this presents a lot of overhead on populating the list, this
226 * genlist employs a queue. Any item added is queued and spooled off over
227 * time, actually appearing some time later, so if your list has many members
228 * you may find it takes a while for them to all appear, with your process
229 * consuming a lot of CPU while it is busy spooling.
231 * Genlist also implements a tree structure, but it does so with callbacks to
232 * the application, with the application filling in tree structures when
233 * requested (allowing for efficient building of a very deep tree that could
234 * even be used for file-management). See the above smart signal callbacks for
237 * @section Genlist_Smart_Events Genlist smart events
239 * Signals that you can add callbacks for are:
240 * - @c "activated" - The user has double-clicked or pressed
241 * (enter|return|spacebar) on an item. The @c event_info parameter is the
242 * item that was activated.
243 * - @c "clicked,double" - The user has double-clicked an item. The @c
244 * event_info parameter is the item that was double-clicked.
245 * - @c "selected" - This is called when a user has made an item selected.
246 * The event_info parameter is the genlist item that was selected.
247 * - @c "unselected" - This is called when a user has made an item
248 * unselected. The event_info parameter is the genlist item that was
250 * - @c "expanded" - This is called when elm_genlist_item_expanded_set() is
251 * called and the item is now meant to be expanded. The event_info
252 * parameter is the genlist item that was indicated to expand. It is the
253 * job of this callback to then fill in the child items.
254 * - @c "contracted" - This is called when elm_genlist_item_expanded_set() is
255 * called and the item is now meant to be contracted. The event_info
256 * parameter is the genlist item that was indicated to contract. It is the
257 * job of this callback to then delete the child items.
258 * - @c "expand,request" - This is called when a user has indicated they want
259 * to expand a tree branch item. The callback should decide if the item can
260 * expand (has any children) and then call elm_genlist_item_expanded_set()
261 * appropriately to set the state. The event_info parameter is the genlist
262 * item that was indicated to expand.
263 * - @c "contract,request" - This is called when a user has indicated they
264 * want to contract a tree branch item. The callback should decide if the
265 * item can contract (has any children) and then call
266 * elm_genlist_item_expanded_set() appropriately to set the state. The
267 * event_info parameter is the genlist item that was indicated to contract.
268 * - @c "realized" - This is called when the item in the list is created as a
269 * real evas object. event_info parameter is the genlist item that was
271 * - @c "unrealized" - This is called just before an item is unrealized.
272 * After this call content objects provided will be deleted and the item
273 * object itself delete or be put into a floating cache.
274 * - @c "drag,start,up" - This is called when the item in the list has been
275 * dragged (not scrolled) up.
276 * - @c "drag,start,down" - This is called when the item in the list has been
277 * dragged (not scrolled) down.
278 * - @c "drag,start,left" - This is called when the item in the list has been
279 * dragged (not scrolled) left.
280 * - @c "drag,start,right" - This is called when the item in the list has
281 * been dragged (not scrolled) right.
282 * - @c "drag,stop" - This is called when the item in the list has stopped
284 * - @c "drag" - This is called when the item in the list is being dragged.
285 * - @c "longpressed" - This is called when the item is pressed for a certain
286 * amount of time. By default it's 1 second. The event_info parameter is the
287 * longpressed genlist item.
288 * - @c "scroll,anim,start" - This is called when scrolling animation has
290 * - @c "scroll,anim,stop" - This is called when scrolling animation has
292 * - @c "scroll,drag,start" - This is called when dragging the content has
294 * - @c "scroll,drag,stop" - This is called when dragging the content has
296 * - @c "edge,top" - This is called when the genlist is scrolled until
298 * - @c "edge,bottom" - This is called when the genlist is scrolled
299 * until the bottom edge.
300 * - @c "edge,left" - This is called when the genlist is scrolled
301 * until the left edge.
302 * - @c "edge,right" - This is called when the genlist is scrolled
303 * until the right edge.
304 * - @c "multi,swipe,left" - This is called when the genlist is multi-touch
306 * - @c "multi,swipe,right" - This is called when the genlist is multi-touch
308 * - @c "multi,swipe,up" - This is called when the genlist is multi-touch
310 * - @c "multi,swipe,down" - This is called when the genlist is multi-touch
312 * - @c "multi,pinch,out" - This is called when the genlist is multi-touch
313 * pinched out. "- @c multi,pinch,in" - This is called when the genlist is
314 * multi-touch pinched in.
315 * - @c "swipe" - This is called when the genlist is swiped.
316 * - @c "moved" - This is called when a genlist item is moved.
317 * - @c "language,changed" - This is called when the program's language is
319 * - @c "tree,effect,finished" - This is called when a genlist tree effect is finished.
321 * Supported elm_object common APIs
322 * @li elm_object_signal_emit()
324 * Supported elm_object_item common APIs
325 * @li elm_object_item_part_content_get()
326 * @li elm_object_item_part_content_set()
327 * @li elm_object_item_part_content_unset()
328 * @li elm_object_item_part_text_set()
329 * @li elm_object_item_part_text_get()
330 * @li elm_object_item_disabled_set()
331 * @li elm_object_item_disabled_get()
333 * @section Genlist_Examples Examples
335 * Here is a list of examples that use the genlist, trying to show some of
337 * - @ref genlist_example_01
338 * - @ref genlist_example_02
339 * - @ref genlist_example_03
340 * - @ref genlist_example_04
341 * - @ref genlist_example_05
345 * @addtogroup Genlist
349 #define ELM_GENLIST_ITEM_CLASS_VERSION ELM_GEN_ITEM_CLASS_VERSION
350 #define ELM_GENLIST_ITEM_CLASS_HEADER ELM_GEN_ITEM_CLASS_HEADER
353 * Defines if the item is of any special type (has subitems or it's the
354 * index of a group), or is just a simple item.
360 ELM_GENLIST_ITEM_NONE = 0, /**< simple item */
361 //XXX: ELM_GENLIST_ITEM_TREE
362 ELM_GENLIST_ITEM_SUBITEMS = (1 << 0), /**< may expand and have child items */
363 ELM_GENLIST_ITEM_GROUP = (1 << 1), /**< index of a group of items */
365 ELM_GENLIST_ITEM_MAX = (1 << 2)
366 } Elm_Genlist_Item_Type;
370 ELM_GENLIST_ITEM_FIELD_ALL = 0,
371 ELM_GENLIST_ITEM_FIELD_TEXT = (1 << 0),
372 ELM_GENLIST_ITEM_FIELD_CONTENT = (1 << 1),
373 ELM_GENLIST_ITEM_FIELD_STATE = (1 << 2)
374 } Elm_Genlist_Item_Field_Type;
378 ELM_GENLIST_ITEM_SCROLLTO_NONE = 0, /**< no scrollto */
379 ELM_GENLIST_ITEM_SCROLLTO_IN = (1 << 0), /**< show, bring in */
380 ELM_GENLIST_ITEM_SCROLLTO_TOP = (1 << 1), /**< top show, top bring in */
381 ELM_GENLIST_ITEM_SCROLLTO_MIDDLE = (1 << 2) /**< middle show, middle bring in */
382 } Elm_Genlist_Item_Scrollto_Type;
386 ELM_GENLIST_ITEM_MOVE_EFFECT_NONE = 0,
387 ELM_GENLIST_ITEM_MOVE_EFFECT_EXPAND = 1,
388 ELM_GENLIST_ITEM_MOVE_EFFECT_CONTRACT = 2
389 } Elm_Genlist_Item_Move_Effect_Mode;
392 * @see Elm_Gen_Item_Class
394 typedef Elm_Gen_Item_Class Elm_Genlist_Item_Class;
397 * @see Elm_Gen_Item_Text_Get_Cb
399 typedef Elm_Gen_Item_Text_Get_Cb Elm_Genlist_Item_Text_Get_Cb;
402 * @see Elm_Gen_Item_Content_Get_Cb
404 typedef Elm_Gen_Item_Content_Get_Cb Elm_Genlist_Item_Content_Get_Cb;
407 * @see Elm_Gen_Item_State_Get_Cb
409 typedef Elm_Gen_Item_State_Get_Cb Elm_Genlist_Item_State_Get_Cb;
412 * @see Elm_Gen_Item_Del_Cb
414 typedef Elm_Gen_Item_Del_Cb Elm_Genlist_Item_Del_Cb;
417 * Add a new genlist widget to the given parent Elementary
420 * @param parent The parent object
421 * @return a new genlist widget handle or @c NULL, on errors
423 * This function inserts a new genlist widget on the canvas.
425 * @see elm_genlist_item_append()
426 * @see elm_object_item_del()
427 * @see elm_genlist_clear()
431 EAPI Evas_Object *elm_genlist_add(Evas_Object *parent);
434 * Remove all items from a given genlist widget.
436 * @param obj The genlist object
438 * This removes (and deletes) all items in @p obj, leaving it empty.
440 * @see elm_object_item_del(), to remove just one item.
444 EAPI void elm_genlist_clear(Evas_Object *obj);
447 * Enable or disable multi-selection in the genlist
449 * @param obj The genlist object
450 * @param multi Multi-select enable/disable. Default is disabled.
452 * This enables (@c EINA_TRUE) or disables (@c EINA_FALSE) multi-selection in
453 * the list. This allows more than 1 item to be selected. To retrieve the list
454 * of selected items, use elm_genlist_selected_items_get().
456 * @see elm_genlist_selected_items_get()
457 * @see elm_genlist_multi_select_get()
461 EAPI void elm_genlist_multi_select_set(Evas_Object *obj, Eina_Bool multi);
464 * Gets if multi-selection in genlist is enabled or disabled.
466 * @param obj The genlist object
467 * @return Multi-select enabled/disabled
468 * (@c EINA_TRUE = enabled/@c EINA_FALSE = disabled). Default is @c EINA_FALSE.
470 * @see elm_genlist_multi_select_set()
474 EAPI Eina_Bool elm_genlist_multi_select_get(const Evas_Object *obj);
477 * This sets the horizontal stretching mode.
479 * @param obj The genlist object
480 * @param mode The mode to use (one of #ELM_LIST_SCROLL or #ELM_LIST_LIMIT).
482 * This sets the mode used for sizing items horizontally. Valid modes
483 * are #ELM_LIST_LIMIT and #ELM_LIST_SCROLL. The default is
484 * ELM_LIST_SCROLL. This mode means that if items are too wide to fit,
485 * the scroller will scroll horizontally. Otherwise items are expanded
486 * to fill the width of the viewport of the scroller. If it is
487 * ELM_LIST_LIMIT, items will be expanded to the viewport width and
488 * limited to that size.
490 * @see elm_genlist_mode_get()
494 EAPI void elm_genlist_mode_set(Evas_Object *obj, Elm_List_Mode mode);
497 * Gets the horizontal stretching mode.
499 * @param obj The genlist object
500 * @return The mode to use
501 * (#ELM_LIST_LIMIT, #ELM_LIST_SCROLL)
503 * @see elm_genlist_mode_set()
507 EAPI Elm_List_Mode elm_genlist_mode_get(const Evas_Object *obj);
510 * Enable/disable horizontal and vertical bouncing effect.
512 * @param obj The genlist object
513 * @param h_bounce Allow bounce horizontally (@c EINA_TRUE = on, @c
514 * EINA_FALSE = off). Default is @c EINA_FALSE.
515 * @param v_bounce Allow bounce vertically (@c EINA_TRUE = on, @c
516 * EINA_FALSE = off). Default is @c EINA_TRUE.
518 * This will enable or disable the scroller bouncing effect for the
519 * genlist. See elm_scroller_bounce_set() for details.
521 * @see elm_scroller_bounce_set()
522 * @see elm_genlist_bounce_get()
526 EAPI void elm_genlist_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce);
529 * Get whether the horizontal and vertical bouncing effect is enabled.
531 * @param obj The genlist object
532 * @param h_bounce Pointer to a bool to receive if the bounce horizontally
534 * @param v_bounce Pointer to a bool to receive if the bounce vertically
537 * @see elm_genlist_bounce_set()
541 EAPI void elm_genlist_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce);
544 * Append a new item in a given genlist widget.
546 * @param obj The genlist object
547 * @param itc The item class for the item
548 * @param data The item data
549 * @param parent The parent item, or NULL if none
550 * @param type Item type
551 * @param func Convenience function called when the item is selected
552 * @param func_data Data passed to @p func above.
553 * @return A handle to the item added or @c NULL if not possible
555 * This adds the given item to the end of the list or the end of
556 * the children list if the @p parent is given.
558 * @see elm_genlist_item_prepend()
559 * @see elm_genlist_item_insert_before()
560 * @see elm_genlist_item_insert_after()
561 * @see elm_object_item_del()
565 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_Type type, Evas_Smart_Cb func, const void *func_data);
568 * Prepend a new item in a given genlist widget.
570 * @param obj The genlist object
571 * @param itc The item class for the item
572 * @param data The item data
573 * @param parent The parent item, or NULL if none
574 * @param type Item type
575 * @param func Convenience function called when the item is selected
576 * @param func_data Data passed to @p func above.
577 * @return A handle to the item added or NULL if not possible
579 * This adds an item to the beginning of the list or beginning of the
580 * children of the parent if given.
582 * @see elm_genlist_item_append()
583 * @see elm_genlist_item_insert_before()
584 * @see elm_genlist_item_insert_after()
585 * @see elm_object_item_del()
589 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_Type type, Evas_Smart_Cb func, const void *func_data);
592 * Insert an item before another in a genlist widget
594 * @param obj The genlist object
595 * @param itc The item class for the item
596 * @param data The item data
597 * @param parent The parent item, or NULL if none
598 * @param before The item to place this new one before.
599 * @param type Item type
600 * @param func Convenience function called when the item is selected
601 * @param func_data Data passed to @p func above.
602 * @return A handle to the item added or @c NULL if not possible
604 * This inserts an item before another in the list. It will be in the
605 * same tree level or group as the item it is inserted before.
607 * @see elm_genlist_item_append()
608 * @see elm_genlist_item_prepend()
609 * @see elm_genlist_item_insert_after()
610 * @see elm_object_item_del()
614 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_Type type, Evas_Smart_Cb func, const void *func_data);
617 * Insert an item after another in a genlist widget
619 * @param obj The genlist object
620 * @param itc The item class for the item
621 * @param data The item data
622 * @param parent The parent item, or NULL if none
623 * @param after The item to place this new one after.
624 * @param type Item type
625 * @param func Convenience function called when the item is selected
626 * @param func_data Data passed to @p func above.
627 * @return A handle to the item added or @c NULL if not possible
629 * This inserts an item after another in the list. It will be in the
630 * same tree level or group as the item it is inserted after.
632 * @see elm_genlist_item_append()
633 * @see elm_genlist_item_prepend()
634 * @see elm_genlist_item_insert_before()
635 * @see elm_object_item_del()
639 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_Type type, Evas_Smart_Cb func, const void *func_data);
642 * Insert a new item into the sorted genlist object
644 * @param obj The genlist object
645 * @param itc The item class for the item
646 * @param data The item data
647 * @param parent The parent item, or NULL if none
648 * @param type Item type
649 * @param comp The function called for the sort
650 * @param func Convenience function called when item selected
651 * @param func_data Data passed to @p func above.
652 * @return A handle to the item added or NULL if not possible
654 * This inserts an item in the genlist based on user defined comparison
655 * function. The two arguments passed to the function @p func are genlist item
656 * handles to compare.
658 * @see elm_genlist_item_append()
659 * @see elm_genlist_item_prepend()
660 * @see elm_genlist_item_insert_after()
661 * @see elm_object_item_del()
665 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_Type type, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data);
667 /* operations to retrieve existing items */
669 * Get the selected item in the genlist.
671 * @param obj The genlist object
672 * @return The selected item, or NULL if none is selected.
674 * This gets the selected item in the list (if multi-selection is enabled, only
675 * the item that was first selected in the list is returned - which is not very
676 * useful, so see elm_genlist_selected_items_get() for when multi-selection is
679 * If no item is selected, NULL is returned.
681 * @see elm_genlist_selected_items_get()
685 EAPI Elm_Object_Item *elm_genlist_selected_item_get(const Evas_Object *obj);
688 * Get a list of selected items in the genlist.
690 * @param obj The genlist object
691 * @return The list of selected items, or NULL if none are selected.
693 * It returns a list of the selected items. This list pointer is only valid so
694 * long as the selection doesn't change (no items are selected or unselected, or
695 * unselected implicitly by deletion). The list contains genlist items
696 * pointers. The order of the items in this list is the order which they were
697 * selected, i.e. the first item in this list is the first item that was
698 * selected, and so on.
700 * @note If not in multi-select mode, consider using function
701 * elm_genlist_selected_item_get() instead.
703 * @see elm_genlist_multi_select_set()
704 * @see elm_genlist_selected_item_get()
708 EAPI const Eina_List *elm_genlist_selected_items_get(const Evas_Object *obj);
711 * Get a list of realized items in genlist
713 * @param obj The genlist object
714 * @return The list of realized items, nor NULL if none are realized.
716 * This returns a list of the realized items in the genlist. The list
717 * contains genlist item pointers. The list must be freed by the
718 * caller when done with eina_list_free(). The item pointers in the
719 * list are only valid so long as those items are not deleted or the
720 * genlist is not deleted.
722 * @see elm_genlist_realized_items_update()
726 EAPI Eina_List *elm_genlist_realized_items_get(const Evas_Object *obj);
729 * Get the first item in the genlist
731 * This returns the first item in the list.
733 * @param obj The genlist object
734 * @return The first item, or NULL if none
738 EAPI Elm_Object_Item *elm_genlist_first_item_get(const Evas_Object *obj);
741 * Get the last item in the genlist
743 * This returns the last item in the list.
745 * @return The last item, or NULL if none
749 EAPI Elm_Object_Item *elm_genlist_last_item_get(const Evas_Object *obj);
752 * Set the scrollbar policy
754 * @param obj The genlist object
755 * @param policy_h Horizontal scrollbar policy.
756 * @param policy_v Vertical scrollbar policy.
758 * This sets the scrollbar visibility policy for the given genlist
759 * scroller. #ELM_SMART_SCROLLER_POLICY_AUTO means the scrollbar is
760 * made visible if it is needed, and otherwise kept hidden.
761 * #ELM_SMART_SCROLLER_POLICY_ON turns it on all the time, and
762 * #ELM_SMART_SCROLLER_POLICY_OFF always keeps it off. This applies
763 * respectively for the horizontal and vertical scrollbars. Default is
764 * #ELM_SMART_SCROLLER_POLICY_AUTO
766 * @see elm_genlist_scroller_policy_get()
770 EAPI void elm_genlist_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v);
773 * Get the scrollbar policy
775 * @param obj The genlist object
776 * @param policy_h Pointer to store the horizontal scrollbar policy.
777 * @param policy_v Pointer to store the vertical scrollbar policy.
779 * @see elm_genlist_scroller_policy_set()
783 EAPI void elm_genlist_scroller_policy_get(const Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v);
786 * Get the @b next item in a genlist widget's internal list of items,
787 * given a handle to one of those items.
789 * @param it The genlist item to fetch next from
790 * @return The item after @p item, or @c NULL if there's none (and
793 * This returns the item placed after the @p item, on the container
796 * @see elm_genlist_item_prev_get()
800 EAPI Elm_Object_Item *elm_genlist_item_next_get(const Elm_Object_Item *it);
803 * Get the @b previous item in a genlist widget's internal list of items,
804 * given a handle to one of those items.
806 * @param it The genlist item to fetch previous from
807 * @return The item before @p item, or @c NULL if there's none (and
810 * This returns the item placed before the @p item, on the container
813 * @see elm_genlist_item_next_get()
817 EAPI Elm_Object_Item *elm_genlist_item_prev_get(const Elm_Object_Item *it);
820 * Set whether a given genlist item is selected or not
823 * @param selected Use @c EINA_TRUE, to make it selected, @c
824 * EINA_FALSE to make it unselected
826 * This sets the selected state of an item. If multi selection is
827 * not enabled on the containing genlist and @p selected is @c
828 * EINA_TRUE, any other previously selected items will get
829 * unselected in favor of this new one.
831 * @see elm_genlist_item_selected_get()
835 EAPI void elm_genlist_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
838 * Get whether a given genlist item is selected or not
841 * @return @c EINA_TRUE, if it's selected, @c EINA_FALSE otherwise
843 * @see elm_genlist_item_selected_set() for more details
847 EAPI Eina_Bool elm_genlist_item_selected_get(const Elm_Object_Item *it);
850 * Show the portion of a genlist's internal list containing a given
853 * @param it The item to display
854 * @param type The position to bring in, the given item to.
855 * @ref Elm_Genlist_Item_Scrollto_Type
857 * This causes genlist to jump to the given item @p it and show it (by
858 * jumping to that position), if it is not fully visible.
860 * @see elm_genlist_item_bring_in()
864 EAPI void elm_genlist_item_show(Elm_Object_Item *it, Elm_Genlist_Item_Scrollto_Type type);
867 * Animatedly bring in, to the visible are of a genlist, a given
870 * @param it The item to display
871 * @param type The position to bring in, the given item to.
872 * @ref Elm_Genlist_Item_Scrollto_Type
874 * This causes genlist to jump to the given item @p it and show it (by
875 * animatedly scrolling), if it is not fully visible.
876 * This may use animation and take a some time to do so.
878 * @see elm_genlist_item_show()
882 EAPI void elm_genlist_item_bring_in(Elm_Object_Item *it, Elm_Genlist_Item_Scrollto_Type type);
885 * Update the contents of an item
889 * This updates an item by calling all the item class functions again
890 * to get the contents, texts and states. Use this when the original
891 * item data has changed and the changes are desired to be reflected.
893 * Use elm_genlist_realized_items_update() to update all already realized
896 * @see elm_genlist_realized_items_update()
900 EAPI void elm_genlist_item_update(Elm_Object_Item *it);
903 * Update the item class of an item
906 * @param itc The item class for the item
908 * This sets another class of the item, changing the way that it is
909 * displayed. After changing the item class, elm_genlist_item_update() is
910 * called on the item @p it.
914 EAPI void elm_genlist_item_item_class_update(Elm_Object_Item *it, const Elm_Genlist_Item_Class *itc);
917 * Get the Genlist Item class for the given Genlist Item.
919 * @param it The genlist item
921 * This returns the Genlist_Item_Class for the given item. It can be used to
922 * examine the function pointers and item_style.
926 EAPI const Elm_Genlist_Item_Class *elm_genlist_item_item_class_get(const Elm_Object_Item *it);
929 * Get the index of the item. It is only valid once displayed.
931 * @param it a genlist item
932 * @return the position inside the list of item.
936 EAPI int elm_genlist_item_index_get(const Elm_Object_Item *it);
939 * Update the contents of all realized items.
941 * @param obj The genlist object.
943 * This updates all realized items by calling all the item class functions again
944 * to get the contents, texts and states. Use this when the original
945 * item data has changed and the changes are desired to be reflected.
947 * To update just one item, use elm_genlist_item_update().
949 * @see elm_genlist_realized_items_get()
950 * @see elm_genlist_item_update()
954 EAPI void elm_genlist_realized_items_update(Evas_Object *obj);
957 * Return how many items are currently in a list
959 * @param obj The list
960 * @return The total number of list items in the list
962 * This behavior is O(1) and includes items which may or may not be realized.
966 EAPI unsigned int elm_genlist_items_count(const Evas_Object *obj);
969 * Add a new genlist item class in a given genlist widget.
971 * @return New allocated a genlist item class.
973 * This adds genlist item class for the genlist widget. When adding a item,
974 * genlist_item_{append, prepend, insert} function needs item class of the item.
975 * Given callback parameters are used at retrieving {text, content} of
976 * added item. Set as NULL if it's not used.
977 * If there's no available memory, return can be NULL.
979 * @see elm_genlist_item_class_free()
980 * @see elm_genlist_item_append()
984 EAPI Elm_Genlist_Item_Class *elm_genlist_item_class_new(void);
987 * Remove a item class in a given genlist widget.
989 * @param itc The itc to be removed.
991 * This removes item class from the genlist widget.
992 * Whenever it has no more references to it, item class is going to be freed.
993 * Otherwise it just decreases its reference count.
995 * @see elm_genlist_item_class_new()
996 * @see elm_genlist_item_class_ref()
997 * @see elm_genlist_item_class_unref()
1001 EAPI void elm_genlist_item_class_free(Elm_Genlist_Item_Class *itc);
1004 * Increments object reference count for the item class.
1006 * @param itc The given item class object to reference
1008 * This API just increases its reference count for item class management.
1010 * @see elm_genlist_item_class_unref()
1014 EAPI void elm_genlist_item_class_ref(Elm_Genlist_Item_Class *itc);
1017 * Decrements object reference count for the item class.
1019 * @param itc The given item class object to reference
1021 * This API just decreases its reference count for item class management.
1022 * Reference count can't be less than 0.
1024 * @see elm_genlist_item_class_ref()
1025 * @see elm_genlist_item_class_free()
1029 EAPI void elm_genlist_item_class_unref(Elm_Genlist_Item_Class *itc);
1033 //XXX: Need to review tooltip & cursor APIs
1036 * Set the text to be shown in a given genlist item's tooltips.
1038 * @param it The genlist item
1039 * @param text The text to set in the content
1041 * This call will setup the text to be used as tooltip to that item
1042 * (analogous to elm_object_tooltip_text_set(), but being item
1043 * tooltips with higher precedence than object tooltips). It can
1044 * have only one tooltip at a time, so any previous tooltip data
1047 * In order to set a content or something else as a tooltip, look at
1048 * elm_genlist_item_tooltip_content_cb_set().
1052 EAPI void elm_genlist_item_tooltip_text_set(Elm_Object_Item *it, const char *text);
1055 * Set the content to be shown in a given genlist item's tooltips
1057 * @param it The genlist item.
1058 * @param func The function returning the tooltip contents.
1059 * @param data What to provide to @a func as callback data/context.
1060 * @param del_cb Called when data is not needed anymore, either when
1061 * another callback replaces @p func, the tooltip is unset with
1062 * elm_genlist_item_tooltip_unset() or the owner @p item
1063 * dies. This callback receives as its first parameter the
1064 * given @p data, being @c event_info the item handle.
1066 * This call will setup the tooltip's contents to @p item
1067 * (analogous to elm_object_tooltip_content_cb_set(), but being
1068 * item tooltips with higher precedence than object tooltips). It
1069 * can have only one tooltip at a time, so any previous tooltip
1070 * content will get removed. @p func (with @p data) will be called
1071 * every time Elementary needs to show the tooltip and it should
1072 * return a valid Evas object, which will be fully managed by the
1073 * tooltip system, getting deleted when the tooltip is gone.
1075 * In order to set just a text as a tooltip, look at
1076 * elm_genlist_item_tooltip_text_set().
1080 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);
1083 * Unset a tooltip from a given genlist item
1085 * @param it genlist item to remove a previously set tooltip from.
1087 * This call removes any tooltip set on @p item. The callback
1088 * provided as @c del_cb to
1089 * elm_genlist_item_tooltip_content_cb_set() will be called to
1090 * notify it is not used anymore (and have resources cleaned, if
1093 * @see elm_genlist_item_tooltip_content_cb_set()
1097 EAPI void elm_genlist_item_tooltip_unset(Elm_Object_Item *it);
1100 * Set a different @b style for a given genlist item's tooltip.
1102 * @param it genlist item with tooltip set
1103 * @param style the <b>theme style</b> to use on tooltips (e.g. @c
1104 * "default", @c "transparent", etc)
1106 * Tooltips can have <b>alternate styles</b> to be displayed on,
1107 * which are defined by the theme set on Elementary. This function
1108 * works analogously as elm_object_tooltip_style_set(), but here
1109 * applied only to genlist item objects. The default style for
1110 * tooltips is @c "default".
1112 * @note before you set a style you should define a tooltip with
1113 * elm_genlist_item_tooltip_content_cb_set() or
1114 * elm_genlist_item_tooltip_text_set()
1116 * @see elm_genlist_item_tooltip_style_get()
1120 EAPI void elm_genlist_item_tooltip_style_set(Elm_Object_Item *it, const char *style);
1123 * Get the style set a given genlist item's tooltip.
1125 * @param it genlist item with tooltip already set on.
1126 * @return style the theme style in use, which defaults to
1127 * "default". If the object does not have a tooltip set,
1128 * then @c NULL is returned.
1130 * @see elm_genlist_item_tooltip_style_set() for more details
1134 EAPI const char *elm_genlist_item_tooltip_style_get(const Elm_Object_Item *it);
1137 * @brief Disable size restrictions on an object's tooltip
1138 * @param it The tooltip's anchor object
1139 * @param disable If EINA_TRUE, size restrictions are disabled
1140 * @return EINA_FALSE on failure, EINA_TRUE on success
1142 * This function allows a tooltip to expand beyond its parent window's canvas.
1143 * It will instead be limited only by the size of the display.
1145 EAPI Eina_Bool elm_genlist_item_tooltip_window_mode_set(Elm_Object_Item *it, Eina_Bool disable);
1148 * @brief Retrieve size restriction state of an object's tooltip
1149 * @param it The tooltip's anchor object
1150 * @return If EINA_TRUE, size restrictions are disabled
1152 * This function returns whether a tooltip is allowed to expand beyond
1153 * its parent window's canvas.
1154 * It will instead be limited only by the size of the display.
1156 EAPI Eina_Bool elm_genlist_item_tooltip_window_mode_get(const Elm_Object_Item *it);
1159 * Set the type of mouse pointer/cursor decoration to be shown,
1160 * when the mouse pointer is over the given genlist widget item
1162 * @param it genlist item to customize cursor on
1163 * @param cursor the cursor type's name
1165 * This function works analogously as elm_object_cursor_set(), but
1166 * here the cursor's changing area is restricted to the item's
1167 * area, and not the whole widget's. Note that that item cursors
1168 * have precedence over widget cursors, so that a mouse over @p
1169 * item will always show cursor @p type.
1171 * If this function is called twice for an object, a previously set
1172 * cursor will be unset on the second call.
1174 * @see elm_object_cursor_set()
1175 * @see elm_genlist_item_cursor_get()
1176 * @see elm_genlist_item_cursor_unset()
1180 EAPI void elm_genlist_item_cursor_set(Elm_Object_Item *it, const char *cursor);
1183 * Get the type of mouse pointer/cursor decoration set to be shown,
1184 * when the mouse pointer is over the given genlist widget item
1186 * @param it genlist item with custom cursor set
1187 * @return the cursor type's name or @c NULL, if no custom cursors
1188 * were set to @p item (and on errors)
1190 * @see elm_object_cursor_get()
1191 * @see elm_genlist_item_cursor_set() for more details
1192 * @see elm_genlist_item_cursor_unset()
1196 EAPI const char *elm_genlist_item_cursor_get(const Elm_Object_Item *it);
1199 * Unset any custom mouse pointer/cursor decoration set to be
1200 * shown, when the mouse pointer is over the given genlist widget
1201 * item, thus making it show the @b default cursor again.
1203 * @param it a genlist item
1205 * Use this call to undo any custom settings on this item's cursor
1206 * decoration, bringing it back to defaults (no custom style set).
1208 * @see elm_object_cursor_unset()
1209 * @see elm_genlist_item_cursor_set() for more details
1213 EAPI void elm_genlist_item_cursor_unset(Elm_Object_Item *it);
1216 * Set a different @b style for a given custom cursor set for a
1219 * @param it genlist item with custom cursor set
1220 * @param style the <b>theme style</b> to use (e.g. @c "default",
1221 * @c "transparent", etc)
1223 * This function only makes sense when one is using custom mouse
1224 * cursor decorations <b>defined in a theme file</b> , which can
1225 * have, given a cursor name/type, <b>alternate styles</b> on
1226 * it. It works analogously as elm_object_cursor_style_set(), but
1227 * here applied only to genlist item objects.
1229 * @warning Before you set a cursor style you should have defined a
1230 * custom cursor previously on the item, with
1231 * elm_genlist_item_cursor_set()
1233 * @see elm_genlist_item_cursor_engine_only_set()
1234 * @see elm_genlist_item_cursor_style_get()
1238 EAPI void elm_genlist_item_cursor_style_set(Elm_Object_Item *it, const char *style);
1241 * Get the current @b style set for a given genlist item's custom
1244 * @param it genlist item with custom cursor set.
1245 * @return style the cursor style in use. If the object does not
1246 * have a cursor set, then @c NULL is returned.
1248 * @see elm_genlist_item_cursor_style_set() for more details
1252 EAPI const char *elm_genlist_item_cursor_style_get(const Elm_Object_Item *it);
1255 * Set if the (custom) cursor for a given genlist item should be
1256 * searched in its theme, also, or should only rely on the
1259 * @param it item with custom (custom) cursor already set on
1260 * @param engine_only Use @c EINA_TRUE to have cursors looked for
1261 * only on those provided by the rendering engine, @c EINA_FALSE to
1262 * have them searched on the widget's theme, as well.
1264 * @note This call is of use only if you've set a custom cursor
1265 * for genlist items, with elm_genlist_item_cursor_set().
1267 * @note By default, cursors will only be looked for between those
1268 * provided by the rendering engine.
1272 EAPI void elm_genlist_item_cursor_engine_only_set(Elm_Object_Item *it, Eina_Bool engine_only);
1275 * Get if the (custom) cursor for a given genlist item is being
1276 * searched in its theme, also, or is only relying on the rendering
1279 * @param it a genlist item
1280 * @return @c EINA_TRUE, if cursors are being looked for only on
1281 * those provided by the rendering engine, @c EINA_FALSE if they
1282 * are being searched on the widget's theme, as well.
1284 * @see elm_genlist_item_cursor_engine_only_set(), for more details
1288 EAPI Eina_Bool elm_genlist_item_cursor_engine_only_get(const Elm_Object_Item *it);
1291 * Enable/disable compress mode.
1293 * @param obj The genlist object
1294 * @param compress The compress mode
1295 * (@c EINA_TRUE = on, @c EINA_FALSE = off). Default is @c EINA_FALSE.
1297 * This will enable the compress mode where items are "compressed"
1298 * horizontally to fit the genlist scrollable viewport width. This is
1299 * special for genlist. Do not rely on
1300 * elm_genlist_mode_set() being set to @c ELM_LIST_COMPRESS to
1301 * work as genlist needs to handle it specially.
1303 * @see elm_genlist_compress_mode_get()
1307 // XXX: kill this. elm_genlist_height_for_width_mode_set() covers this.
1308 EAPI void elm_genlist_compress_mode_set(Evas_Object *obj, Eina_Bool compress);
1311 * Get whether the compress mode is enabled.
1313 * @param obj The genlist object
1314 * @return The compress mode
1315 * (@c EINA_TRUE = on, @c EINA_FALSE = off)
1317 * @see elm_genlist_compress_mode_set()
1321 EAPI Eina_Bool elm_genlist_compress_mode_get(const Evas_Object *obj);
1324 * Enable/disable height-for-width mode.
1326 * @param obj The genlist object
1327 * @param height_for_width The height-for-width mode (@c EINA_TRUE = on,
1328 * @c EINA_FALSE = off). Default is @c EINA_FALSE.
1330 * With height-for-width mode the item width will be fixed (restricted
1331 * to a minimum of) to the list width when calculating its size in
1332 * order to allow the height to be calculated based on it. This allows,
1333 * for instance, text block to wrap lines if the Edje part is
1334 * configured with "text.min: 0 1".
1336 * @note This mode will make list resize slower as it will have to
1337 * recalculate every item height again whenever the list width
1340 * @note When height-for-width mode is enabled, it also enables
1341 * compress mode (see elm_genlist_compress_mode_set()) and
1342 * disables homogeneous (see elm_genlist_homogeneous_set()).
1347 //XXX: API name is ambiguous.. How about elm_genlist_mode_fixed_width_set?
1348 EAPI void elm_genlist_height_for_width_mode_set(Evas_Object *obj, Eina_Bool height_for_width);
1351 * Get whether the height-for-width mode is enabled.
1353 * @param obj The genlist object
1354 * @return The height-for-width mode (@c EINA_TRUE = on, @c EINA_FALSE =
1359 //XXX: API name is ambiguous elm_genlist_mode_fixed_width_get() ?????
1360 EAPI Eina_Bool elm_genlist_height_for_width_mode_get(const Evas_Object *obj);
1363 * Enable/disable homogeneous mode.
1365 * @param obj The genlist object
1366 * @param homogeneous Assume the items within the genlist are of the
1367 * same height and width (EINA_TRUE = on, EINA_FALSE = off). Default is @c
1370 * This will enable the homogeneous mode where items are of the same
1371 * height and width so that genlist may do the lazy-loading at its
1372 * maximum (which increases the performance for scrolling the list). This
1373 * implies 'compressed' mode.
1375 * @see elm_genlist_compress_mode_set()
1376 * @see elm_genlist_homogeneous_get()
1380 EAPI void elm_genlist_homogeneous_set(Evas_Object *obj, Eina_Bool homogeneous);
1383 * Get whether the homogeneous mode is enabled.
1385 * @param obj The genlist object
1386 * @return Assume the items within the genlist are of the same height
1387 * and width (EINA_TRUE = on, EINA_FALSE = off)
1389 * @see elm_genlist_homogeneous_set()
1393 EAPI Eina_Bool elm_genlist_homogeneous_get(const Evas_Object *obj);
1396 * Set the maximum number of items within an item block
1398 * @param obj The genlist object
1399 * @param count Maximum number of items within an item block. Default is 32.
1401 * This will configure the block count to tune to the target with particular
1402 * performance matrix.
1404 * A block of objects will be used to reduce the number of operations due to
1405 * many objects in the screen. It can determine the visibility, or if the
1406 * object has changed, it theme needs to be updated, etc. doing this kind of
1407 * calculation to the entire block, instead of per object.
1409 * The default value for the block count is enough for most lists, so unless
1410 * you know you will have a lot of objects visible in the screen at the same
1411 * time, don't try to change this.
1413 * @see elm_genlist_block_count_get()
1414 * @see @ref Genlist_Implementation
1418 EAPI void elm_genlist_block_count_set(Evas_Object *obj, int count);
1421 * Get the maximum number of items within an item block
1423 * @param obj The genlist object
1424 * @return Maximum number of items within an item block
1426 * @see elm_genlist_block_count_set()
1430 EAPI int elm_genlist_block_count_get(const Evas_Object *obj);
1433 * Set the timeout in seconds for the longpress event.
1435 * @param obj The genlist object
1436 * @param timeout timeout in seconds. Default is elm config value(1.0)
1438 * This option will change how long it takes to send an event "longpressed"
1439 * after the mouse down signal is sent to the list. If this event occurs, no
1440 * "clicked" event will be sent.
1442 * @warning If you set the longpress timeout value with this API, your genlist
1443 * will not be affected by the longpress value of elementary config value
1446 * @see elm_genlist_longpress_timeout_set()
1450 EAPI void elm_genlist_longpress_timeout_set(Evas_Object *obj, double timeout);
1453 * Get the timeout in seconds for the longpress event.
1455 * @param obj The genlist object
1456 * @return timeout in seconds
1458 * @see elm_genlist_longpress_timeout_get()
1462 EAPI double elm_genlist_longpress_timeout_get(const Evas_Object *obj);
1465 * Get the item that is at the x, y canvas coords.
1467 * @param obj The genlist object.
1468 * @param x The input x coordinate
1469 * @param y The input y coordinate
1470 * @param posret The position relative to the item returned here
1471 * @return The item at the coordinates or NULL if none
1473 * This returns the item at the given coordinates (which are canvas
1474 * relative, not object-relative). If an item is at that coordinate,
1475 * that item handle is returned, and if @p posret is not NULL, the
1476 * integer pointed to is set to a value of -1, 0 or 1, depending if
1477 * the coordinate is on the upper portion of that item (-1), on the
1478 * middle section (0) or on the lower part (1). If NULL is returned as
1479 * an item (no item found there), then posret may indicate -1 or 1
1480 * based if the coordinate is above or below all items respectively in
1485 EAPI Elm_Object_Item *elm_genlist_at_xy_item_get(const Evas_Object *obj, Evas_Coord x, Evas_Coord y, int *posret);
1488 * Get the parent item of the given item
1490 * @param it The item
1491 * @return The parent of the item or @c NULL if it has no parent.
1493 * This returns the item that was specified as parent of the item @p it on
1494 * elm_genlist_item_append() and insertion related functions.
1498 EAPI Elm_Object_Item *elm_genlist_item_parent_get(const Elm_Object_Item *it);
1501 * Remove all sub-items (children) of the given item
1503 * @param it The item
1505 * This removes all items that are children (and their descendants) of the
1508 * @see elm_genlist_clear()
1509 * @see elm_object_item_del()
1513 EAPI void elm_genlist_item_subitems_clear(Elm_Object_Item *it);
1516 * Sets the expanded state of an item.
1518 * @param it The item
1519 * @param expanded The expanded state (@c EINA_TRUE expanded, @c EINA_FALSE not expanded).
1521 * This function flags the item of type #ELM_GENLIST_ITEM_SUBITEMS as
1524 * The theme will respond to this change visually, and a signal "expanded" or
1525 * "contracted" will be sent from the genlist with a pointer to the item that
1526 * has been expanded/contracted.
1528 * Calling this function won't show or hide any child of this item (if it is
1529 * a parent). You must manually delete and create them on the callbacks of
1530 * the "expanded" or "contracted" signals.
1532 * @see elm_genlist_item_expanded_get()
1536 EAPI void elm_genlist_item_expanded_set(Elm_Object_Item *it, Eina_Bool expanded);
1539 * Get the expanded state of an item
1541 * @param it The item
1542 * @return The expanded state
1544 * This gets the expanded state of an item.
1546 * @see elm_genlist_item_expanded_set()
1550 EAPI Eina_Bool elm_genlist_item_expanded_get(const Elm_Object_Item *it);
1553 * Get the depth of expanded item
1555 * @param it The genlist item object
1556 * @return The depth of expanded item
1560 EAPI int elm_genlist_item_expanded_depth_get(const Elm_Object_Item *it);
1563 * Sets the display only state of an item.
1565 * @param it The item
1566 * @param display_only @c EINA_TRUE if the item is display only, @c
1567 * EINA_FALSE otherwise.
1569 * A display only item cannot be selected or unselected. It is for
1570 * display only and not selecting or otherwise clicking, dragging
1571 * etc. by the user, thus finger size rules will not be applied to
1574 * It's good to set group index items to display only state.
1576 * @see elm_genlist_item_display_only_get()
1580 //XXX: elm_genlist_item_no_select_mode_set()?
1581 EAPI void elm_genlist_item_display_only_set(Elm_Object_Item *it, Eina_Bool display_only);
1584 * Get the display only state of an item
1586 * @param it The item
1587 * @return @c EINA_TRUE if the item is display only, @c
1588 * EINA_FALSE otherwise.
1590 * @see elm_genlist_item_display_only_set()
1594 //XXX: elm_genlist_item_no_select_mode_get()?
1595 EAPI Eina_Bool elm_genlist_item_display_only_get(const Elm_Object_Item *it);
1598 * Unset all contents fetched by the item class
1600 * @param it The item
1601 * @param l The contents list to return
1603 * This instructs genlist to release references to contents in the item,
1604 * meaning that they will no longer be managed by genlist and are
1605 * floating "orphans" that can be re-used elsewhere if the user wants
1610 EAPI void elm_genlist_item_all_contents_unset(Elm_Object_Item *it, Eina_List **l);
1613 * Promote an item to the top of the list
1615 * @param it The item
1619 EAPI void elm_genlist_item_promote(Elm_Object_Item *it);
1622 * Demote an item to the end of the list
1624 * @param it The item
1628 EAPI void elm_genlist_item_demote(Elm_Object_Item *it);
1631 * Update the part of an item
1633 * @param it The item
1634 * @param parts The name of item's part
1635 * @param itf The type of item's part type
1637 * This updates an item's part by calling item's fetching functions again
1638 * to get the contents, texts and states. Use this when the original
1639 * item data has changed and the changes are desired to be reflected.
1640 * Second parts argument is used for globbing to match '*', '?', and '.'
1641 * It can be used at updating multi fields.
1643 * Use elm_genlist_realized_items_update() to update an item's all
1646 * @see elm_genlist_item_update()
1650 EAPI void elm_genlist_item_fields_update(Elm_Object_Item *it, const char *parts, Elm_Genlist_Item_Field_Type itf);
1653 * Activate a genlist mode on an item
1655 * @param it The genlist item
1656 * @param mode_type Mode name
1657 * @param mode_set Boolean to define set or unset mode.
1659 * A genlist mode is a different way of selecting an item. Once a mode is
1660 * activated on an item, any other selected item is immediately unselected.
1661 * This feature provides an easy way of implementing a new kind of animation
1662 * for selecting an item, without having to entirely rewrite the item style
1663 * theme. However, the elm_genlist_selected_* API can't be used to get what
1664 * item is activate for a mode.
1666 * The current item style will still be used, but applying a genlist mode to
1667 * an item will select it using a different kind of animation.
1669 * The current active item for a mode can be found by
1670 * elm_genlist_mode_item_get().
1672 * The characteristics of genlist mode are:
1673 * - Only one mode can be active at any time, and for only one item.
1674 * - Genlist handles deactivating other items when one item is activated.
1675 * - A mode is defined in the genlist theme (edc), and more modes can easily
1677 * - A mode style and the genlist item style are different things. They
1678 * can be combined to provide a default style to the item, with some kind
1679 * of animation for that item when the mode is activated.
1681 * When a mode is activated on an item, a new view for that item is created.
1682 * The theme of this mode defines the animation that will be used to transit
1683 * the item from the old view to the new view. This second (new) view will be
1684 * active for that item while the mode is active on the item, and will be
1685 * destroyed after the mode is totally deactivated from that item.
1687 * @see elm_genlist_mode_get()
1688 * @see elm_genlist_mode_item_get()
1692 //XXX: How bout elm_genlist_effect_mode_set
1693 EAPI void elm_genlist_item_mode_set(Elm_Object_Item *it, const char *mode_type, Eina_Bool mode_set);
1696 * Get the last (or current) genlist mode used.
1698 * @param obj The genlist object
1700 * This function just returns the name of the last used genlist mode. It will
1701 * be the current mode if it's still active.
1703 * @see elm_genlist_item_mode_set()
1704 * @see elm_genlist_mode_item_get()
1708 //XXX: looks weird... set the mode type to item and get the mode type from object...
1709 EAPI const char *elm_genlist_mode_type_get(const Evas_Object *obj);
1712 * Get active genlist mode item
1714 * @param obj The genlist object
1715 * @return The active item for that current mode. Or @c NULL if no item is
1716 * activated with any mode.
1718 * This function returns the item that was activated with a mode, by the
1719 * function elm_genlist_item_mode_set().
1721 * @see elm_genlist_item_mode_set()
1722 * @see elm_genlist_mode_get()
1726 EAPI const Elm_Object_Item *elm_genlist_mode_item_get(const Evas_Object *obj);
1731 * @param obj The genlist object
1732 * @param reorder_mode The reorder mode
1733 * (EINA_TRUE = on, EINA_FALSE = off)
1737 EAPI void elm_genlist_reorder_mode_set(Evas_Object *obj, Eina_Bool reorder_mode);
1740 * Get the reorder mode
1742 * @param obj The genlist object
1743 * @return The reorder mode
1744 * (EINA_TRUE = on, EINA_FALSE = off)
1748 EAPI Eina_Bool elm_genlist_reorder_mode_get(const Evas_Object *obj);
1751 * Get the Item's Type
1753 * @param it The genlist item
1754 * @return The item type.
1756 * This function returns the item's type. Normally the item's type.
1757 * If it failed, return value is ELM_GENLIST_ITEM_MAX
1761 EAPI Elm_Genlist_Item_Type elm_genlist_item_type_get(const Elm_Object_Item *it);
1764 * Set Genlist edit mode
1766 * This sets Genlist edit mode.
1768 * @param obj The Genlist object
1769 * @param The edit mode status
1770 * (EINA_TRUE = edit mode, EINA_FALSE = normal mode
1774 //XXX: elm_genlist_effect_mode_set();
1775 EAPI void elm_genlist_edit_mode_set(Evas_Object *obj, Eina_Bool edit_mode);
1778 * Get Genlist edit mode
1780 * @param obj The genlist object
1781 * @return The edit mode status
1782 * (EINA_TRUE = edit mode, EINA_FALSE = normal mode
1786 //XXX: elm_genlist_all_items_effect_mode_get();
1787 EAPI Eina_Bool elm_genlist_edit_mode_get(const Evas_Object *obj);
1790 * Set the flip state of a given genlist item.
1792 * @param it The genlist item object
1793 * @param flip The flip mode
1794 * (EINA_TRUE = on, EINA_FALSE = off)
1796 * This function sets the flip state of a given genlist item.
1797 * Flip mode overrides current item object.
1798 * It can be used for on-the-fly item replace.
1799 * Flip mode can be used with/without edit mode.
1801 * @see elm_genlist_item_flip_get()
1806 EAPI void elm_genlist_item_flip_set(Elm_Object_Item *it, Eina_Bool flip);
1809 * Get the flip state of a given genlist item.
1811 * @param it The genlist item object
1813 * This function returns the flip state of a given genlist item.
1814 * If the parameter is invalid, it returns EINA_FALSE.
1816 * @see elm_genlist_item_flip_set()
1821 EAPI Eina_Bool elm_genlist_item_flip_get(const Elm_Object_Item *it);
1824 * Set Genlist tree effect
1826 * @param obj The genlist object
1827 * @param The tree effect status
1828 * (EINA_TRUE = enabled, EINA_FALSE = disabled
1832 EAPI void elm_genlist_tree_effect_enabled_set(Evas_Object *obj, Eina_Bool enabled);
1835 * Get Genlist tree effect
1837 * @param obj The genlist object
1838 * @return The tree effect status
1839 * (EINA_TRUE = enabled, EINA_FALSE = disabled
1843 EAPI Eina_Bool elm_genlist_tree_effect_enabled_get(const Evas_Object *obj);
1846 * Set the genlist select mode.
1848 * @param obj The genlist object
1849 * @param mode The select mode
1851 * elm_genlist_select_mode_set() changes item select mode in the genlist widget.
1852 * - ELM_OBJECT_NORMAL_SELECT : Items will only call their selection func and
1853 * callback when first becoming selected. Any further clicks will
1854 * do nothing, unless you set always select mode.
1855 * - ELM_OBJECT_ALWAYS_SELECT : This means that, even if selected,
1856 * every click will make the selected callbacks be called.
1857 * - ELM_OBJECT_NO_SELECT : This will turn off the ability to select items
1858 * entirely and they will neither appear selected nor call selected
1859 * callback functions.
1861 * @see elm_genlist_select_mode_get()
1866 elm_genlist_select_mode_set(Evas_Object *obj, Elm_Object_Select_Mode_Type mode);
1869 * Get the genlist select mode.
1871 * @param obj The genlist object
1872 * @return The select mode
1873 * (If getting mode is failed, it returns ELM_OBJECT_SELECT_MODE_MAX)
1875 * @see elm_genlist_select_mode_set()
1879 EAPI Elm_Object_Select_Mode_Type
1880 elm_genlist_select_mode_get(const Evas_Object *obj);