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