1 #ifndef _ELM_GENLIST_ITEM_EO_H_
2 #define _ELM_GENLIST_ITEM_EO_H_
3 
4 #ifndef _ELM_GENLIST_ITEM_EO_CLASS_TYPE
5 #define _ELM_GENLIST_ITEM_EO_CLASS_TYPE
6 
7 typedef Eo Elm_Genlist_Item;
8 
9 #endif
10 
11 #ifndef _ELM_GENLIST_ITEM_EO_TYPES
12 #define _ELM_GENLIST_ITEM_EO_TYPES
13 
14 
15 #endif
16 /**
17  * Elementary genlist item class
18  *
19  * @defgroup Elm_Genlist_Item_Group Genlist Item
20  * @ingroup Elm_Genlist_Group
21  */
22 
23 /**
24  * @brief Get genlist item class
25  *
26  * @ingroup Elm_Genlist_Item_Group
27  */
28 #define ELM_GENLIST_ITEM_CLASS elm_genlist_item_class_get()
29 
30 EWAPI const Efl_Class *elm_genlist_item_class_get(void) EINA_CONST;
31 
32 /**
33  * @brief Get the previous item in a genlist widget's internal list of items,
34  * given a handle to one of those items.
35  *
36  * This returns the item placed before the @c item, on the container genlist.
37  *
38  * If filter is set on genlist, this returns the filtered item placed before
39  * @c item in the list.
40  *
41  * Note that parent / child relationship is not taken into account, the
42  * previous visual item is always returned, could it be a parent, a child or a
43  * group item.
44  *
45  * NULL is returned if called on the first item.
46  *
47  * @param[in] obj The object.
48  *
49  * @return The item before @c item, or @c null if there's none (and on errors).
50  *
51  * @ingroup Elm_Genlist_Item_Group
52  */
53 EOAPI Elm_Widget_Item *elm_obj_genlist_item_prev_get(const Eo *obj);
54 
55 /**
56  * @brief Get the next item in a genlist widget's internal lis of items, given
57  * a handle to one of those items.
58  *
59  * This returns the item placed after the @c item, on the container genlist.
60  *
61  * If filter is set on genlist, this returns the filtered item placed after
62  * @c item in the list.
63  *
64  * Note that parent / child relationship is not taken into account, the next
65  * visual item is always returned, could it be a parent, a child or a group
66  * item.
67  *
68  * NULL is returned if called on the last item.
69  *
70  * @param[in] obj The object.
71  *
72  * @return The item after @c item, or @c null if there's none (and on errors).
73  *
74  * @ingroup Elm_Genlist_Item_Group
75  */
76 EOAPI Elm_Widget_Item *elm_obj_genlist_item_next_get(const Eo *obj);
77 
78 /**
79  * @brief Get the parent item of the given item
80  *
81  * This returns the item that was specified as parent of the item @c it on @ref
82  * elm_genlist_item_append and insertion related functions.
83  *
84  * @param[in] obj The object.
85  *
86  * @return The parent of the item or @c null if it has no parent.
87  *
88  * @ingroup Elm_Genlist_Item_Group
89  */
90 EOAPI Elm_Widget_Item *elm_obj_genlist_item_parent_item_get(const Eo *obj);
91 
92 /**
93  * @brief Get the list of subitems of a given item
94  *
95  * This returns the list of subitems that an item possesses. It cannot be
96  * changed.
97  *
98  * @param[in] obj The object.
99  *
100  * @return The list of subitems, @c null on error.
101  *
102  * @since 1.9
103  *
104  * @ingroup Elm_Genlist_Item_Group
105  */
106 EOAPI const Eina_List *elm_obj_genlist_item_subitems_get(const Eo *obj);
107 
108 /**
109  * @brief Set whether a given genlist item is selected or not
110  *
111  * This sets the selected state of an item. If multi selection is not enabled
112  * on the containing genlist and @c selected is @c true, any other previously
113  * selected items will get unselected in favor of this new one.
114  *
115  * @param[in] obj The object.
116  * @param[in] selected The selected state ($true selected, @c false not
117  * selected).
118  *
119  * @ingroup Elm_Genlist_Item_Group
120  */
121 EOAPI void elm_obj_genlist_item_selected_set(Eo *obj, Eina_Bool selected);
122 
123 /**
124  * @brief Get whether a given genlist item is selected or not.
125  *
126  * @param[in] obj The object.
127  *
128  * @return The selected state ($true selected, @c false not selected).
129  *
130  * @ingroup Elm_Genlist_Item_Group
131  */
132 EOAPI Eina_Bool elm_obj_genlist_item_selected_get(const Eo *obj);
133 
134 /**
135  * @brief Sets the expanded state of an item.
136  *
137  * This function flags the item of type #ELM_GENLIST_ITEM_TREE as expanded or
138  * not.
139  *
140  * The theme will respond to this change visually, and a signal "expanded" or
141  * "contracted" will be sent from the genlist with a pointer to the item that
142  * has been expanded/contracted.
143  *
144  * Calling this function won't show or hide any child of this item (if it is a
145  * parent). You must manually delete and create them on the callbacks of the
146  * "expanded" or "contracted" signals.
147  *
148  * @param[in] obj The object.
149  * @param[in] expanded The expanded state ($true expanded, @c false not
150  * expanded).
151  *
152  * @ingroup Elm_Genlist_Item_Group
153  */
154 EOAPI void elm_obj_genlist_item_expanded_set(Eo *obj, Eina_Bool expanded);
155 
156 /**
157  * @brief Get the expanded state of an item
158  *
159  * This gets the expanded state of an item.
160  *
161  * @param[in] obj The object.
162  *
163  * @return The expanded state ($true expanded, @c false not expanded).
164  *
165  * @ingroup Elm_Genlist_Item_Group
166  */
167 EOAPI Eina_Bool elm_obj_genlist_item_expanded_get(const Eo *obj);
168 
169 /**
170  * @brief Get the depth of expanded item.
171  *
172  * @param[in] obj The object.
173  *
174  * @return The depth of expanded item.
175  *
176  * @ingroup Elm_Genlist_Item_Group
177  */
178 EOAPI int elm_obj_genlist_item_expanded_depth_get(const Eo *obj);
179 
180 /**
181  * @brief Get the Genlist Item class for the given Genlist Item.
182  *
183  * This returns the Genlist_Item_Class for the given item. It can be used to
184  * examine the function pointers and item_style.
185  *
186  * @param[in] obj The object.
187  *
188  * @return Genlist Item class for the given item.
189  *
190  * @ingroup Elm_Genlist_Item_Group
191  */
192 EOAPI const Elm_Genlist_Item_Class *elm_obj_genlist_item_class_get(const Eo *obj);
193 
194 /**
195  * @brief Get the index of the item. It is only valid once displayed.
196  *
197  * The index start from 1.
198  *
199  * @param[in] obj The object.
200  *
201  * @return The position inside the list of item.
202  *
203  * @ingroup Elm_Genlist_Item_Group
204  */
205 EOAPI int elm_obj_genlist_item_index_get(const Eo *obj);
206 
207 /**
208  * @brief Get the item's decorate mode.
209  *
210  * This function just returns the name of the item's decorate mode.
211  *
212  * @param[in] obj The object.
213  *
214  * @return Name of the item's decorate mode.
215  *
216  * @ingroup Elm_Genlist_Item_Group
217  */
218 EOAPI const char *elm_obj_genlist_item_decorate_mode_get(const Eo *obj);
219 
220 /**
221  * @brief Set the flip state of a given genlist item.
222  *
223  * This function sets the flip state of a given genlist item. Flip mode
224  * overrides current item object. It can be used for on-the-fly item replace.
225  * Flip mode can be used with/without decorate mode.
226  *
227  * @param[in] obj The object.
228  * @param[in] flip The flip mode.
229  *
230  * @ingroup Elm_Genlist_Item_Group
231  */
232 EOAPI void elm_obj_genlist_item_flip_set(Eo *obj, Eina_Bool flip);
233 
234 /**
235  * @brief Get the flip state of a given genlist item.
236  *
237  * This function returns the flip state of a given genlist item. If the
238  * parameter is invalid, it returns @c false.
239  *
240  * @param[in] obj The object.
241  *
242  * @return The flip mode.
243  *
244  * @ingroup Elm_Genlist_Item_Group
245  */
246 EOAPI Eina_Bool elm_obj_genlist_item_flip_get(const Eo *obj);
247 
248 /**
249  * @brief Set the genlist item's select mode.
250  *
251  * ELM_OBJECT_SELECT_MODE_DEFAULT means that the item will only call their
252  * selection func and callback when first becoming selected. Any further clicks
253  * will do nothing, unless you set always select mode.
254  *
255  * ELM_OBJECT_SELECT_MODE_ALWAYS means that even if selected, every click will
256  * make the selected callbacks be called.
257  *
258  * ELM_OBJECT_SELECT_MODE_NONE will turn off the ability to select the item
259  * entirely and they will neither appear selected nor call selected callback
260  * functions.
261  *
262  * ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY will apply no-finger-size rule with
263  * ELM_OBJECT_SELECT_MODE_NONE. No-finger-size rule makes an item can be
264  * smaller than lower limit. Clickable objects should be bigger than human
265  * touch point device (your finger) for some touch or small screen devices. So
266  * it is enabled, the item can be shrink than predefined finger-size value. And
267  * the item will be updated.
268  *
269  * @param[in] obj The object.
270  * @param[in] mode The selected mode.
271  *
272  * @ingroup Elm_Genlist_Item_Group
273  */
274 EOAPI void elm_obj_genlist_item_select_mode_set(Eo *obj, Elm_Object_Select_Mode mode);
275 
276 /**
277  * @brief Get the genlist item's select mode.
278  *
279  * It's ELM_OBJECT_SELECT_MODE_MAX on failure.
280  *
281  * @param[in] obj The object.
282  *
283  * @return The selected mode.
284  *
285  * @ingroup Elm_Genlist_Item_Group
286  */
287 EOAPI Elm_Object_Select_Mode elm_obj_genlist_item_select_mode_get(const Eo *obj);
288 
289 /**
290  * @brief Get the Item's type.
291  *
292  * This function returns the item's type. Normally the item's type. If it
293  * failed, return value is ELM_GENLIST_ITEM_MAX.
294  *
295  * @param[in] obj The object.
296  *
297  * @return Item type.
298  *
299  * @ingroup Elm_Genlist_Item_Group
300  */
301 EOAPI Elm_Genlist_Item_Type elm_obj_genlist_item_type_get(const Eo *obj);
302 
303 /**
304  * @brief Set whether a given genlist item is pinned or not
305  *
306  * This sets a genlist item as pinned so that it will be always available in
307  * the viewport available for user interaction. Group items cannot be pinned.
308  * Also when a new item is pinned, the current pinned item will get unpinned.
309  * Item pinning cannot be done in reorder mode too.
310  *
311  * @param[in] obj The object.
312  * @param[in] pin The item pin state state ($true pin item, @c false unpin
313  * item).
314  *
315  * @ingroup Elm_Genlist_Item_Group
316  */
317 EOAPI void elm_obj_genlist_item_pin_set(Eo *obj, Eina_Bool pin);
318 
319 /**
320  * @brief Get whether a given genlist item is pinned or not.
321  *
322  * @param[in] obj The object.
323  *
324  * @return The item pin state state ($true pin item, @c false unpin item).
325  *
326  * @ingroup Elm_Genlist_Item_Group
327  */
328 EOAPI Eina_Bool elm_obj_genlist_item_pin_get(const Eo *obj);
329 
330 /**
331  * @brief Get the number of subitems of a given item.
332  *
333  * This returns the number of subitems that an item possesses.
334  *
335  * @param[in] obj The object.
336  *
337  * @return The number of subitems, 0 on error.
338  *
339  * @since 1.9
340  *
341  * @ingroup Elm_Genlist_Item_Group
342  */
343 EOAPI unsigned int elm_obj_genlist_item_subitems_count(Eo *obj);
344 
345 /**
346  * @brief Remove all sub-items (children) of the given item.
347  *
348  * This removes all items that are children (and their descendants) of the
349  * given item @c it.
350  * @param[in] obj The object.
351  *
352  * @ingroup Elm_Genlist_Item_Group
353  */
354 EOAPI void elm_obj_genlist_item_subitems_clear(Eo *obj);
355 
356 /** Promote an item to the top of the list.
357  *
358  * @ingroup Elm_Genlist_Item_Group
359  */
360 EOAPI void elm_obj_genlist_item_promote(Eo *obj);
361 
362 /** Demote an item to the end of the list.
363  *
364  * @ingroup Elm_Genlist_Item_Group
365  */
366 EOAPI void elm_obj_genlist_item_demote(Eo *obj);
367 
368 /**
369  * @brief Show the portion of a genlist's internal list containing a given
370  * item, immediately.
371  *
372  * This causes genlist to jump to the given item @c it and show it (by jumping
373  * to that position), if it is not fully visible.
374  *
375  * @param[in] obj The object.
376  * @param[in] type The position to bring in, the given item to. @ref
377  * Elm_Genlist_Item_Scrollto_Type.
378  *
379  * @ingroup Elm_Genlist_Item_Group
380  */
381 EOAPI void elm_obj_genlist_item_show(Eo *obj, Elm_Genlist_Item_Scrollto_Type type);
382 
383 /**
384  * @brief Animatedly bring in, to the visible area of a genlist, a given item
385  * on it.
386  *
387  * This causes genlist to jump to the given item @c it and show it (by
388  * animatedly scrolling), if it is not fully visible. This may use animation
389  * and take a some time to do so.
390  *
391  * @param[in] obj The object.
392  * @param[in] type The position to bring in, the given item to. @ref
393  * Elm_Genlist_Item_Scrollto_Type.
394  *
395  * @ingroup Elm_Genlist_Item_Group
396  */
397 EOAPI void elm_obj_genlist_item_bring_in(Eo *obj, Elm_Genlist_Item_Scrollto_Type type);
398 
399 /**
400  * @brief Unset all contents fetched by the item class.
401  *
402  * This instructs genlist to release references to contents in the item,
403  * meaning that they will no longer be managed by genlist and are floating
404  * "orphans" that can be re-used elsewhere if the user wants to.
405  *
406  * @param[in] obj The object.
407  * @param[out] l The contents list to return.
408  *
409  * @ingroup Elm_Genlist_Item_Group
410  */
411 EOAPI void elm_obj_genlist_item_all_contents_unset(Eo *obj, Eina_List **l);
412 
413 /**
414  * @brief Update all the contents of an item.
415  *
416  * This updates an item by calling all the item class functions again to get
417  * the contents, texts and states. Use this when the original item data has
418  * changed and the changes are desired to be reflected.
419  *
420  * Use elm_genlist_realized_items_update() to update all already realized
421  * items.
422  *
423  * @note This also updates internal genlist item object (edje_object as of
424  * now). So when this is called between mouse down and mouse up, mouse up event
425  * will be ignored because edje_object is deleted and created again by this
426  * API. If you want to avoid this, please use @ref
427  * elm_genlist_item_fields_update.
428  * @param[in] obj The object.
429  *
430  * @ingroup Elm_Genlist_Item_Group
431  */
432 EOAPI void elm_obj_genlist_item_update(Eo *obj);
433 
434 /**
435  * @brief Update the part of an item.
436  *
437  * This updates an item's part by calling item's fetching functions again to
438  * get the contents, texts and states. Use this when the original item data has
439  * changed and the changes are desired to be reflected. Second part argument is
440  * used for globbing to match '*', '?', and '.' It can be used at updating
441  * multi fields.
442  *
443  * Use @ref elm_genlist_realized_items_update to update an item's all property.
444  *
445  * @param[in] obj The object.
446  * @param[in] parts The name of item's part.
447  * @param[in] itf The type of item's part type.
448  *
449  * @ingroup Elm_Genlist_Item_Group
450  */
451 EOAPI void elm_obj_genlist_item_fields_update(Eo *obj, const char *parts, Elm_Genlist_Item_Field_Type itf);
452 
453 /**
454  * @brief Update the item class of an item.
455  *
456  * This sets another class of the item, changing the way that it is displayed.
457  * After changing the item class @ref elm_obj_genlist_item_update is called on
458  * the item @c it.
459  *
460  * @param[in] obj The object.
461  * @param[in] itc The item class for the item.
462  *
463  * @ingroup Elm_Genlist_Item_Group
464  */
465 EOAPI void elm_obj_genlist_item_class_update(Eo *obj, const Elm_Genlist_Item_Class *itc);
466 
467 /**
468  * @brief Activate a genlist mode on an item.
469  *
470  * A genlist mode is a different way of selecting an item. Once a mode is
471  * activated on an item, any other selected item is immediately unselected.
472  * This feature provides an easy way of implementing a new kind of animation
473  * for selecting an item, without having to entirely rewrite the item style
474  * theme. However, the elm_genlist_selected_* API can't be used to get what
475  * item is activate for a mode.
476  *
477  * The current item style will still be used, but applying a genlist mode to an
478  * item will select it using a different kind of animation.
479  *
480  * The current active item for a mode can be found by @ref
481  * elm_genlist_decorated_item_get.
482  *
483  * Only one mode can be active at any time, and for only one item. Genlist
484  * handles deactivating other items when one item is activated. A mode is
485  * defined in the genlist theme (edc), and more modes can easily be added. A
486  * mode style and the genlist item style are different things. They can be
487  * combined to provide a default style to the item, with some kind of animation
488  * for that item when the mode is activated.
489  *
490  * When a mode is activated on an item, a new view for that item is created.
491  * The theme of this mode defines the animation that will be used to transit
492  * the item from the old view to the new view. This second (new) view will be
493  * active for that item while the mode is active on the item, and will be
494  * destroyed after the mode is totally deactivated from that item.
495  *
496  * @param[in] obj The object.
497  * @param[in] decorate_it_type Mode name.
498  * @param[in] decorate_it_set Boolean to define set or unset mode.
499  *
500  * @ingroup Elm_Genlist_Item_Group
501  */
502 EOAPI void elm_obj_genlist_item_decorate_mode_set(Eo *obj, const char *decorate_it_type, Eina_Bool decorate_it_set);
503 
504 #endif
505