ab2d8ca03cfbdad4d7261a16e22978d15d73b394
[framework/uifw/elementary.git] / src / lib / elm_gengrid.h
1    // XXX: elm_gengrid - make sure api's match 1:1 with genlist api's
2    // for eventual move to back-end of gengrid == genlist (in grid mode)
3    /**
4     * @defgroup Gengrid Gengrid (Generic grid)
5     *
6     * This widget aims to position objects in a grid layout while
7     * actually creating and rendering only the visible ones, using the
8     * same idea as the @ref Genlist "genlist": the user defines a @b
9     * class for each item, specifying functions that will be called at
10     * object creation, deletion, etc. When those items are selected by
11     * the user, a callback function is issued. Users may interact with
12     * a gengrid via the mouse (by clicking on items to select them and
13     * clicking on the grid's viewport and swiping to pan the whole
14     * view) or via the keyboard, navigating through item with the
15     * arrow keys.
16     *
17     * @section Gengrid_Layouts Gengrid layouts
18     *
19     * Gengrid may layout its items in one of two possible layouts:
20     * - horizontal or
21     * - vertical.
22     *
23     * When in "horizontal mode", items will be placed in @b columns,
24     * from top to bottom and, when the space for a column is filled,
25     * another one is started on the right, thus expanding the grid
26     * horizontally, making for horizontal scrolling. When in "vertical
27     * mode" , though, items will be placed in @b rows, from left to
28     * right and, when the space for a row is filled, another one is
29     * started below, thus expanding the grid vertically (and making
30     * for vertical scrolling).
31     *
32     * @section Gengrid_Items Gengrid items
33     *
34     * An item in a gengrid can have 0 or more texts (they can be
35     * regular text or textblock Evas objects - that's up to the style
36     * to determine), 0 or more contents (which are simply objects
37     * swallowed into the gengrid item's theming Edje object) and 0 or
38     * more <b>boolean states</b>, which have the behavior left to the
39     * user to define. The Edje part names for each of these properties
40     * will be looked up, in the theme file for the gengrid, under the
41     * Edje (string) data items named @c "texts", @c "contents" and @c
42     * "states", respectively. For each of those properties, if more
43     * than one part is provided, they must have names listed separated
44     * by spaces in the data fields. For the default gengrid item
45     * theme, we have @b one text part (@c "elm.text"), @b two content 
46     * parts (@c "elm.swalllow.icon" and @c "elm.swallow.end") and @b
47     * no state parts.
48     *
49     * A gengrid item may be at one of several styles. Elementary
50     * provides one by default - "default", but this can be extended by
51     * system or application custom themes/overlays/extensions (see
52     * @ref Theme "themes" for more details).
53     *
54     * @section Gengrid_Item_Class Gengrid item classes
55     *
56     * In order to have the ability to add and delete items on the fly,
57     * gengrid implements a class (callback) system where the
58     * application provides a structure with information about that
59     * type of item (gengrid may contain multiple different items with
60     * different classes, states and styles). Gengrid will call the
61     * functions in this struct (methods) when an item is "realized"
62     * (i.e., created dynamically, while the user is scrolling the
63     * grid). All objects will simply be deleted when no longer needed
64     * with evas_object_del(). The #Elm_GenGrid_Item_Class structure
65     * contains the following members:
66     * - @c item_style - This is a constant string and simply defines
67     * the name of the item style. It @b must be specified and the
68     * default should be @c "default".
69     * - @c func.text_get - This function is called when an item
70     * object is actually created. The @c data parameter will point to
71     * the same data passed to elm_gengrid_item_append() and related
72     * item creation functions. The @c obj parameter is the gengrid
73     * object itself, while the @c part one is the name string of one
74     * of the existing text parts in the Edje group implementing the
75     * item's theme. This function @b must return a strdup'()ed string,
76     * as the caller will free() it when done. See
77     * #Elm_Gengrid_Item_Text_Get_Cb.
78     * - @c func.content_get - This function is called when an item object
79     * is actually created. The @c data parameter will point to the
80     * same data passed to elm_gengrid_item_append() and related item
81     * creation functions. The @c obj parameter is the gengrid object
82     * itself, while the @c part one is the name string of one of the
83     * existing (content) swallow parts in the Edje group implementing the
84     * item's theme. It must return @c NULL, when no content is desired,
85     * or a valid object handle, otherwise. The object will be deleted
86     * by the gengrid on its deletion or when the item is "unrealized".
87     * See #Elm_Gengrid_Item_Content_Get_Cb.
88     * - @c func.state_get - This function is called when an item
89     * object is actually created. The @c data parameter will point to
90     * the same data passed to elm_gengrid_item_append() and related
91     * item creation functions. The @c obj parameter is the gengrid
92     * object itself, while the @c part one is the name string of one
93     * of the state parts in the Edje group implementing the item's
94     * theme. Return @c EINA_FALSE for false/off or @c EINA_TRUE for
95     * true/on. Gengrids will emit a signal to its theming Edje object
96     * with @c "elm,state,XXX,active" and @c "elm" as "emission" and
97     * "source" arguments, respectively, when the state is true (the
98     * default is false), where @c XXX is the name of the (state) part.
99     * See #Elm_Gengrid_Item_State_Get_Cb.
100     * - @c func.del - This is called when elm_gengrid_item_del() is
101     * called on an item or elm_gengrid_clear() is called on the
102     * gengrid. This is intended for use when gengrid items are
103     * deleted, so any data attached to the item (e.g. its data
104     * parameter on creation) can be deleted. See #Elm_Gengrid_Item_Del_Cb.
105     *
106     * @section Gengrid_Usage_Hints Usage hints
107     *
108     * If the user wants to have multiple items selected at the same
109     * time, elm_gengrid_multi_select_set() will permit it. If the
110     * gengrid is single-selection only (the default), then
111     * elm_gengrid_select_item_get() will return the selected item or
112     * @c NULL, if none is selected. If the gengrid is under
113     * multi-selection, then elm_gengrid_selected_items_get() will
114     * return a list (that is only valid as long as no items are
115     * modified (added, deleted, selected or unselected) of child items
116     * on a gengrid.
117     *
118     * If an item changes (internal (boolean) state, text or content
119     * changes), then use elm_gengrid_item_update() to have gengrid
120     * update the item with the new state. A gengrid will re-"realize"
121     * the item, thus calling the functions in the
122     * #Elm_Gengrid_Item_Class set for that item.
123     *
124     * To programmatically (un)select an item, use
125     * elm_gengrid_item_selected_set(). To get its selected state use
126     * elm_gengrid_item_selected_get(). To make an item disabled
127     * (unable to be selected and appear differently) use
128     * elm_gengrid_item_disabled_set() to set this and
129     * elm_gengrid_item_disabled_get() to get the disabled state.
130     *
131     * Grid cells will only have their selection smart callbacks called
132     * when firstly getting selected. Any further clicks will do
133     * nothing, unless you enable the "always select mode", with
134     * elm_gengrid_always_select_mode_set(), thus making every click to
135     * issue selection callbacks. elm_gengrid_no_select_mode_set() will
136     * turn off the ability to select items entirely in the widget and
137     * they will neither appear selected nor call the selection smart
138     * callbacks.
139     *
140     * Remember that you can create new styles and add your own theme
141     * augmentation per application with elm_theme_extension_add(). If
142     * you absolutely must have a specific style that overrides any
143     * theme the user or system sets up you can use
144     * elm_theme_overlay_add() to add such a file.
145     *
146     * @section Gengrid_Smart_Events Gengrid smart events
147     *
148     * Smart events that you can add callbacks for are:
149     * - @c "activated" - The user has double-clicked or pressed
150     *   (enter|return|spacebar) on an item. The @c event_info parameter
151     *   is the gengrid item that was activated.
152     * - @c "clicked,double" - The user has double-clicked an item.
153     *   The @c event_info parameter is the gengrid item that was double-clicked.
154     * - @c "longpressed" - This is called when the item is pressed for a certain
155     *   amount of time. By default it's 1 second.
156     * - @c "selected" - The user has made an item selected. The
157     *   @c event_info parameter is the gengrid item that was selected.
158     * - @c "unselected" - The user has made an item unselected. The
159     *   @c event_info parameter is the gengrid item that was unselected.
160     * - @c "realized" - This is called when the item in the gengrid
161     *   has its implementing Evas object instantiated, de facto. @c
162     *   event_info is the gengrid item that was created. The object
163     *   may be deleted at any time, so it is highly advised to the
164     *   caller @b not to use the object pointer returned from
165     *   elm_gengrid_item_object_get(), because it may point to freed
166     *   objects.
167     * - @c "unrealized" - This is called when the implementing Evas
168     *   object for this item is deleted. @c event_info is the gengrid
169     *   item that was deleted.
170     * - @c "changed" - Called when an item is added, removed, resized
171     *   or moved and when the gengrid is resized or gets "horizontal"
172     *   property changes.
173     * - @c "scroll,anim,start" - This is called when scrolling animation has
174     *   started.
175     * - @c "scroll,anim,stop" - This is called when scrolling animation has
176     *   stopped.
177     * - @c "drag,start,up" - Called when the item in the gengrid has
178     *   been dragged (not scrolled) up.
179     * - @c "drag,start,down" - Called when the item in the gengrid has
180     *   been dragged (not scrolled) down.
181     * - @c "drag,start,left" - Called when the item in the gengrid has
182     *   been dragged (not scrolled) left.
183     * - @c "drag,start,right" - Called when the item in the gengrid has
184     *   been dragged (not scrolled) right.
185     * - @c "drag,stop" - Called when the item in the gengrid has
186     *   stopped being dragged.
187     * - @c "drag" - Called when the item in the gengrid is being
188     *   dragged.
189     * - @c "scroll" - called when the content has been scrolled
190     *   (moved).
191     * - @c "scroll,drag,start" - called when dragging the content has
192     *   started.
193     * - @c "scroll,drag,stop" - called when dragging the content has
194     *   stopped.
195     * - @c "edge,top" - This is called when the gengrid is scrolled until
196     *   the top edge.
197     * - @c "edge,bottom" - This is called when the gengrid is scrolled
198     *   until the bottom edge.
199     * - @c "edge,left" - This is called when the gengrid is scrolled
200     *   until the left edge.
201     * - @c "edge,right" - This is called when the gengrid is scrolled
202     *   until the right edge.
203     *
204     * List of gengrid examples:
205     * @li @ref gengrid_example
206     */
207
208    /**
209     * @addtogroup Gengrid
210     * @{
211     */
212
213    typedef struct _Elm_Gengrid_Item_Class Elm_Gengrid_Item_Class; /**< Gengrid item class definition structs */
214    #define Elm_Gengrid_Item_Class Elm_Gen_Item_Class
215    typedef struct _Elm_Gengrid_Item Elm_Gengrid_Item; /**< Gengrid item handles */
216    #define Elm_Gengrid_Item Elm_Gen_Item /**< Item of Elm_Genlist. Sub-type of Elm_Widget_Item */
217    typedef struct _Elm_Gengrid_Item_Class_Func Elm_Gengrid_Item_Class_Func; /**< Class functions for gengrid item classes. */
218
219    /**
220     * Text fetching class function for Elm_Gen_Item_Class.
221     * @param data The data passed in the item creation function
222     * @param obj The base widget object
223     * @param part The part name of the swallow
224     * @return The allocated (NOT stringshared) string to set as the text 
225     */
226    typedef char        *(*Elm_Gengrid_Item_Text_Get_Cb) (void *data, Evas_Object *obj, const char *part);
227
228    /**
229     * Content (swallowed object) fetching class function for Elm_Gen_Item_Class.
230     * @param data The data passed in the item creation function
231     * @param obj The base widget object
232     * @param part The part name of the swallow
233     * @return The content object to swallow
234     */
235    typedef Evas_Object *(*Elm_Gengrid_Item_Content_Get_Cb)  (void *data, Evas_Object *obj, const char *part);
236
237    /**
238     * State fetching class function for Elm_Gen_Item_Class.
239     * @param data The data passed in the item creation function
240     * @param obj The base widget object
241     * @param part The part name of the swallow
242     * @return The hell if I know
243     */
244    typedef Eina_Bool    (*Elm_Gengrid_Item_State_Get_Cb) (void *data, Evas_Object *obj, const char *part);
245
246    /**
247     * Deletion class function for Elm_Gen_Item_Class.
248     * @param data The data passed in the item creation function
249     * @param obj The base widget object
250     */
251    typedef void         (*Elm_Gengrid_Item_Del_Cb)      (void *data, Evas_Object *obj);
252
253    /**
254     * @struct _Elm_Gengrid_Item_Class
255     *
256     * Gengrid item class definition. See @ref Gengrid_Item_Class for
257     * field details.
258     */
259    struct _Elm_Gengrid_Item_Class
260      {
261         const char             *item_style;
262         struct _Elm_Gengrid_Item_Class_Func
263           {
264              Elm_Gengrid_Item_Text_Get_Cb    text_get; /**< Text fetching class function for gengrid item classes.*/
265              Elm_Gengrid_Item_Content_Get_Cb content_get; /**< Content fetching class function for gengrid item classes. */
266              Elm_Gengrid_Item_State_Get_Cb   state_get; /**< State fetching class function for gengrid item classes. */
267              Elm_Gengrid_Item_Del_Cb         del; /**< Deletion class function for gengrid item classes. */
268           } func;
269      }; /**< #Elm_Gengrid_Item_Class member definitions */
270    #define Elm_Gengrid_Item_Class_Func Elm_Gen_Item_Class_Func
271
272    /**
273     * Add a new gengrid widget to the given parent Elementary
274     * (container) object
275     *
276     * @param parent The parent object
277     * @return a new gengrid widget handle or @c NULL, on errors
278     *
279     * This function inserts a new gengrid widget on the canvas.
280     *
281     * @see elm_gengrid_item_size_set()
282     * @see elm_gengrid_group_item_size_set()
283     * @see elm_gengrid_horizontal_set()
284     * @see elm_gengrid_item_append()
285     * @see elm_gengrid_item_del()
286     * @see elm_gengrid_clear()
287     *
288     * @ingroup Gengrid
289     */
290    EAPI Evas_Object       *elm_gengrid_add(Evas_Object *parent) EINA_ARG_NONNULL(1);
291
292    /**
293     * Set the size for the items of a given gengrid widget
294     *
295     * @param obj The gengrid object.
296     * @param w The items' width.
297     * @param h The items' height;
298     *
299     * A gengrid, after creation, has still no information on the size
300     * to give to each of its cells. So, you most probably will end up
301     * with squares one @ref Fingers "finger" wide, the default
302     * size. Use this function to force a custom size for you items,
303     * making them as big as you wish.
304     *
305     * @see elm_gengrid_item_size_get()
306     *
307     * @ingroup Gengrid
308     */
309    EAPI void               elm_gengrid_item_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
310
311    /**
312     * Get the size set for the items of a given gengrid widget
313     *
314     * @param obj The gengrid object.
315     * @param w Pointer to a variable where to store the items' width.
316     * @param h Pointer to a variable where to store the items' height.
317     *
318     * @note Use @c NULL pointers on the size values you're not
319     * interested in: they'll be ignored by the function.
320     *
321     * @see elm_gengrid_item_size_get() for more details
322     *
323     * @ingroup Gengrid
324     */
325    EAPI void               elm_gengrid_item_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
326
327    /**
328     * Set the size for the group items of a given gengrid widget
329     *
330     * @param obj The gengrid object.
331     * @param w The group items' width.
332     * @param h The group items' height;
333     *
334     * A gengrid, after creation, has still no information on the size
335     * to give to each of its cells. So, you most probably will end up
336     * with squares one @ref Fingers "finger" wide, the default
337     * size. Use this function to force a custom size for you group items,
338     * making them as big as you wish.
339     *
340     * @see elm_gengrid_group_item_size_get()
341     *
342     * @ingroup Gengrid
343     */
344    EAPI void               elm_gengrid_group_item_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
345
346    /**
347     * Get the size set for the group items of a given gengrid widget
348     *
349     * @param obj The gengrid object.
350     * @param w Pointer to a variable where to store the group items' width.
351     * @param h Pointer to a variable where to store the group items' height.
352     *
353     * @note Use @c NULL pointers on the size values you're not
354     * interested in: they'll be ignored by the function.
355     *
356     * @see elm_gengrid_group_item_size_get() for more details
357     *
358     * @ingroup Gengrid
359     */
360    EAPI void               elm_gengrid_group_item_size_get(const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
361
362    /**
363     * Set the items grid's alignment within a given gengrid widget
364     *
365     * @param obj The gengrid object.
366     * @param align_x Alignment in the horizontal axis (0 <= align_x <= 1).
367     * @param align_y Alignment in the vertical axis (0 <= align_y <= 1).
368     *
369     * This sets the alignment of the whole grid of items of a gengrid
370     * within its given viewport. By default, those values are both
371     * 0.5, meaning that the gengrid will have its items grid placed
372     * exactly in the middle of its viewport.
373     *
374     * @note If given alignment values are out of the cited ranges,
375     * they'll be changed to the nearest boundary values on the valid
376     * ranges.
377     *
378     * @see elm_gengrid_align_get()
379     *
380     * @ingroup Gengrid
381     */
382    EAPI void               elm_gengrid_align_set(Evas_Object *obj, double align_x, double align_y) EINA_ARG_NONNULL(1);
383
384    /**
385     * Get the items grid's alignment values within a given gengrid
386     * widget
387     *
388     * @param obj The gengrid object.
389     * @param align_x Pointer to a variable where to store the
390     * horizontal alignment.
391     * @param align_y Pointer to a variable where to store the vertical
392     * alignment.
393     *
394     * @note Use @c NULL pointers on the alignment values you're not
395     * interested in: they'll be ignored by the function.
396     *
397     * @see elm_gengrid_align_set() for more details
398     *
399     * @ingroup Gengrid
400     */
401    EAPI void               elm_gengrid_align_get(const Evas_Object *obj, double *align_x, double *align_y) EINA_ARG_NONNULL(1);
402
403    /**
404     * Set whether a given gengrid widget is or not able have items
405     * @b reordered
406     *
407     * @param obj The gengrid object
408     * @param reorder_mode Use @c EINA_TRUE to turn reoderding on,
409     * @c EINA_FALSE to turn it off
410     *
411     * If a gengrid is set to allow reordering, a click held for more
412     * than 0.5 over a given item will highlight it specially,
413     * signalling the gengrid has entered the reordering state. From
414     * that time on, the user will be able to, while still holding the
415     * mouse button down, move the item freely in the gengrid's
416     * viewport, replacing to said item to the locations it goes to.
417     * The replacements will be animated and, whenever the user
418     * releases the mouse button, the item being replaced gets a new
419     * definitive place in the grid.
420     *
421     * @see elm_gengrid_reorder_mode_get()
422     *
423     * @ingroup Gengrid
424     */
425    EAPI void               elm_gengrid_reorder_mode_set(Evas_Object *obj, Eina_Bool reorder_mode) EINA_ARG_NONNULL(1);
426
427    /**
428     * Get whether a given gengrid widget is or not able have items
429     * @b reordered
430     *
431     * @param obj The gengrid object
432     * @return @c EINA_TRUE, if reoderding is on, @c EINA_FALSE if it's
433     * off
434     *
435     * @see elm_gengrid_reorder_mode_set() for more details
436     *
437     * @ingroup Gengrid
438     */
439    EAPI Eina_Bool          elm_gengrid_reorder_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
440
441    /**
442     * Append a new item in a given gengrid widget.
443     *
444     * @param obj The gengrid object.
445     * @param gic The item class for the item.
446     * @param data The item data.
447     * @param func Convenience function called when the item is
448     * selected.
449     * @param func_data Data to be passed to @p func.
450     * @return A handle to the item added or @c NULL, on errors.
451     *
452     * This adds an item to the beginning of the gengrid.
453     *
454     * @see elm_gengrid_item_prepend()
455     * @see elm_gengrid_item_insert_before()
456     * @see elm_gengrid_item_insert_after()
457     * @see elm_gengrid_item_del()
458     *
459     * @ingroup Gengrid
460     */
461    EAPI Elm_Gengrid_Item  *elm_gengrid_item_append(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, const void *data, Evas_Smart_Cb func, const void *func_data) EINA_ARG_NONNULL(1);
462
463    /**
464     * Prepend a new item in a given gengrid widget.
465     *
466     * @param obj The gengrid object.
467     * @param gic The item class for the item.
468     * @param data The item data.
469     * @param func Convenience function called when the item is
470     * selected.
471     * @param func_data Data to be passed to @p func.
472     * @return A handle to the item added or @c NULL, on errors.
473     *
474     * This adds an item to the end of the gengrid.
475     *
476     * @see elm_gengrid_item_append()
477     * @see elm_gengrid_item_insert_before()
478     * @see elm_gengrid_item_insert_after()
479     * @see elm_gengrid_item_del()
480     *
481     * @ingroup Gengrid
482     */
483    EAPI Elm_Gengrid_Item  *elm_gengrid_item_prepend(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, const void *data, Evas_Smart_Cb func, const void *func_data) EINA_ARG_NONNULL(1);
484
485    /**
486     * Insert an item before another in a gengrid widget
487     *
488     * @param obj The gengrid object.
489     * @param gic The item class for the item.
490     * @param data The item data.
491     * @param relative The item to place this new one before.
492     * @param func Convenience function called when the item is
493     * selected.
494     * @param func_data Data to be passed to @p func.
495     * @return A handle to the item added or @c NULL, on errors.
496     *
497     * This inserts an item before another in the gengrid.
498     *
499     * @see elm_gengrid_item_append()
500     * @see elm_gengrid_item_prepend()
501     * @see elm_gengrid_item_insert_after()
502     * @see elm_gengrid_item_del()
503     *
504     * @ingroup Gengrid
505     */
506    EAPI Elm_Gengrid_Item  *elm_gengrid_item_insert_before(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, const void *data, Elm_Gengrid_Item *relative, Evas_Smart_Cb func, const void *func_data) EINA_ARG_NONNULL(1);
507
508    /**
509     * Insert an item after another in a gengrid widget
510     *
511     * @param obj The gengrid object.
512     * @param gic The item class for the item.
513     * @param data The item data.
514     * @param relative The item to place this new one after.
515     * @param func Convenience function called when the item is
516     * selected.
517     * @param func_data Data to be passed to @p func.
518     * @return A handle to the item added or @c NULL, on errors.
519     *
520     * This inserts an item after another in the gengrid.
521     *
522     * @see elm_gengrid_item_append()
523     * @see elm_gengrid_item_prepend()
524     * @see elm_gengrid_item_insert_after()
525     * @see elm_gengrid_item_del()
526     *
527     * @ingroup Gengrid
528     */
529    EAPI Elm_Gengrid_Item  *elm_gengrid_item_insert_after(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, const void *data, Elm_Gengrid_Item *relative, Evas_Smart_Cb func, const void *func_data) EINA_ARG_NONNULL(1);
530
531    /**
532     * Insert an item in a gengrid widget using a user-defined sort function.
533     *
534     * @param obj The gengrid object.
535     * @param gic The item class for the item.
536     * @param data The item data.
537     * @param comp User defined comparison function that defines the sort order based on
538     * Elm_Gen_Item and its data param.
539     * @param func Convenience function called when the item is selected.
540     * @param func_data Data to be passed to @p func.
541     * @return A handle to the item added or @c NULL, on errors.
542     *
543     * This inserts an item in the gengrid based on user defined comparison function.
544     *
545     * @see elm_gengrid_item_append()
546     * @see elm_gengrid_item_prepend()
547     * @see elm_gengrid_item_insert_after()
548     * @see elm_gengrid_item_del()
549     * @see elm_gengrid_item_direct_sorted_insert()
550     *
551     * @ingroup Gengrid
552     */
553    EAPI Elm_Gengrid_Item  *elm_gengrid_item_sorted_insert(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, const void *data, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data) EINA_ARG_NONNULL(1);
554
555    /**
556     * Insert an item in a gengrid widget using a user-defined sort function.
557     *
558     * @param obj The gengrid object.
559     * @param gic The item class for the item.
560     * @param data The item data.
561     * @param comp User defined comparison function that defines the sort order based on
562     * Elm_Gen_Item.
563     * @param func Convenience function called when the item is selected.
564     * @param func_data Data to be passed to @p func.
565     * @return A handle to the item added or @c NULL, on errors.
566     *
567     * This inserts an item in the gengrid based on user defined comparison function.
568     *
569     * @see elm_gengrid_item_append()
570     * @see elm_gengrid_item_prepend()
571     * @see elm_gengrid_item_insert_after()
572     * @see elm_gengrid_item_del()
573     * @see elm_gengrid_item_sorted_insert()
574     *
575     * @ingroup Gengrid
576     */
577    EAPI Elm_Gengrid_Item  *elm_gengrid_item_direct_sorted_insert(Evas_Object *obj, const Elm_Gengrid_Item_Class *gic, const void *data, Eina_Compare_Cb comp, Evas_Smart_Cb func, const void *func_data);
578
579    /**
580     * Set whether items on a given gengrid widget are to get their
581     * selection callbacks issued for @b every subsequent selection
582     * click on them or just for the first click.
583     *
584     * @param obj The gengrid object
585     * @param always_select @c EINA_TRUE to make items "always
586     * selected", @c EINA_FALSE, otherwise
587     *
588     * By default, grid items will only call their selection callback
589     * function when firstly getting selected, any subsequent further
590     * clicks will do nothing. With this call, you make those
591     * subsequent clicks also to issue the selection callbacks.
592     *
593     * @note <b>Double clicks</b> will @b always be reported on items.
594     *
595     * @see elm_gengrid_always_select_mode_get()
596     *
597     * @ingroup Gengrid
598     */
599    EAPI void               elm_gengrid_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select) EINA_ARG_NONNULL(1);
600
601    /**
602     * Get whether items on a given gengrid widget have their selection
603     * callbacks issued for @b every subsequent selection click on them
604     * or just for the first click.
605     *
606     * @param obj The gengrid object.
607     * @return @c EINA_TRUE if the gengrid items are "always selected",
608     * @c EINA_FALSE, otherwise
609     *
610     * @see elm_gengrid_always_select_mode_set() for more details
611     *
612     * @ingroup Gengrid
613     */
614    EAPI Eina_Bool          elm_gengrid_always_select_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
615
616    /**
617     * Set whether items on a given gengrid widget can be selected or not.
618     *
619     * @param obj The gengrid object
620     * @param no_select @c EINA_TRUE to make items selectable,
621     * @c EINA_FALSE otherwise
622     *
623     * This will make items in @p obj selectable or not. In the latter
624     * case, any user interaction on the gengrid items will neither make
625     * them appear selected nor them call their selection callback
626     * functions.
627     *
628     * @see elm_gengrid_no_select_mode_get()
629     *
630     * @ingroup Gengrid
631     */
632    EAPI void               elm_gengrid_no_select_mode_set(Evas_Object *obj, Eina_Bool no_select) EINA_ARG_NONNULL(1);
633
634    /**
635     * Get whether items on a given gengrid widget can be selected or
636     * not.
637     *
638     * @param obj The gengrid object
639     * @return @c EINA_TRUE, if items are selectable, @c EINA_FALSE
640     * otherwise
641     *
642     * @see elm_gengrid_no_select_mode_set() for more details
643     *
644     * @ingroup Gengrid
645     */
646    EAPI Eina_Bool          elm_gengrid_no_select_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
647
648    /**
649     * Enable or disable multi-selection in a given gengrid widget
650     *
651     * @param obj The gengrid object.
652     * @param multi @c EINA_TRUE, to enable multi-selection,
653     * @c EINA_FALSE to disable it.
654     *
655     * Multi-selection is the ability to have @b more than one
656     * item selected, on a given gengrid, simultaneously. When it is
657     * enabled, a sequence of clicks on different items will make them
658     * all selected, progressively. A click on an already selected item
659     * will unselect it. If interacting via the keyboard,
660     * multi-selection is enabled while holding the "Shift" key.
661     *
662     * @note By default, multi-selection is @b disabled on gengrids
663     *
664     * @see elm_gengrid_multi_select_get()
665     *
666     * @ingroup Gengrid
667     */
668    EAPI void               elm_gengrid_multi_select_set(Evas_Object *obj, Eina_Bool multi) EINA_ARG_NONNULL(1);
669
670    /**
671     * Get whether multi-selection is enabled or disabled for a given
672     * gengrid widget
673     *
674     * @param obj The gengrid object.
675     * @return @c EINA_TRUE, if multi-selection is enabled, @c
676     * EINA_FALSE otherwise
677     *
678     * @see elm_gengrid_multi_select_set() for more details
679     *
680     * @ingroup Gengrid
681     */
682    EAPI Eina_Bool          elm_gengrid_multi_select_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
683
684    /**
685     * Enable or disable bouncing effect for a given gengrid widget
686     *
687     * @param obj The gengrid object
688     * @param h_bounce @c EINA_TRUE, to enable @b horizontal bouncing,
689     * @c EINA_FALSE to disable it
690     * @param v_bounce @c EINA_TRUE, to enable @b vertical bouncing,
691     * @c EINA_FALSE to disable it
692     *
693     * The bouncing effect occurs whenever one reaches the gengrid's
694     * edge's while panning it -- it will scroll past its limits a
695     * little bit and return to the edge again, in a animated for,
696     * automatically.
697     *
698     * @note By default, gengrids have bouncing enabled on both axis
699     *
700     * @see elm_gengrid_bounce_get()
701     *
702     * @ingroup Gengrid
703     */
704    EAPI void               elm_gengrid_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce) EINA_ARG_NONNULL(1);
705
706    /**
707     * Get whether bouncing effects are enabled or disabled, for a
708     * given gengrid widget, on each axis
709     *
710     * @param obj The gengrid object
711     * @param h_bounce Pointer to a variable where to store the
712     * horizontal bouncing flag.
713     * @param v_bounce Pointer to a variable where to store the
714     * vertical bouncing flag.
715     *
716     * @see elm_gengrid_bounce_set() for more details
717     *
718     * @ingroup Gengrid
719     */
720    EAPI void               elm_gengrid_bounce_get(const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce) EINA_ARG_NONNULL(1);
721
722    /**
723     * Set a given gengrid widget's scrolling page size, relative to
724     * its viewport size.
725     *
726     * @param obj The gengrid object
727     * @param h_pagerel The horizontal page (relative) size
728     * @param v_pagerel The vertical page (relative) size
729     *
730     * The gengrid's scroller is capable of binding scrolling by the
731     * user to "pages". It means that, while scrolling and, specially
732     * after releasing the mouse button, the grid will @b snap to the
733     * nearest displaying page's area. When page sizes are set, the
734     * grid's continuous content area is split into (equal) page sized
735     * pieces.
736     *
737     * This function sets the size of a page <b>relatively to the
738     * viewport dimensions</b> of the gengrid, for each axis. A value
739     * @c 1.0 means "the exact viewport's size", in that axis, while @c
740     * 0.0 turns paging off in that axis. Likewise, @c 0.5 means "half
741     * a viewport". Sane usable values are, than, between @c 0.0 and @c
742     * 1.0. Values beyond those will make it behave behave
743     * inconsistently. If you only want one axis to snap to pages, use
744     * the value @c 0.0 for the other one.
745     *
746     * There is a function setting page size values in @b absolute
747     * values, too -- elm_gengrid_page_size_set(). Naturally, its use
748     * is mutually exclusive to this one.
749     *
750     * @see elm_gengrid_page_relative_get()
751     *
752     * @ingroup Gengrid
753     */
754    EAPI void               elm_gengrid_page_relative_set(Evas_Object *obj, double h_pagerel, double v_pagerel) EINA_ARG_NONNULL(1);
755
756    /**
757     * Get a given gengrid widget's scrolling page size, relative to
758     * its viewport size.
759     *
760     * @param obj The gengrid object
761     * @param h_pagerel Pointer to a variable where to store the
762     * horizontal page (relative) size
763     * @param v_pagerel Pointer to a variable where to store the
764     * vertical page (relative) size
765     *
766     * @see elm_gengrid_page_relative_set() for more details
767     *
768     * @ingroup Gengrid
769     */
770    EAPI void               elm_gengrid_page_relative_get(const Evas_Object *obj, double *h_pagerel, double *v_pagerel) EINA_ARG_NONNULL(1);
771
772    /**
773     * Set a given gengrid widget's scrolling page size
774     *
775     * @param obj The gengrid object
776     * @param h_pagerel The horizontal page size, in pixels
777     * @param v_pagerel The vertical page size, in pixels
778     *
779     * The gengrid's scroller is capable of binding scrolling by the
780     * user to "pages". It means that, while scrolling and, specially
781     * after releasing the mouse button, the grid will @b snap to the
782     * nearest displaying page's area. When page sizes are set, the
783     * grid's continuous content area is split into (equal) page sized
784     * pieces.
785     *
786     * This function sets the size of a page of the gengrid, in pixels,
787     * for each axis. Sane usable values are, between @c 0 and the
788     * dimensions of @p obj, for each axis. Values beyond those will
789     * make it behave behave inconsistently. If you only want one axis
790     * to snap to pages, use the value @c 0 for the other one.
791     *
792     * There is a function setting page size values in @b relative
793     * values, too -- elm_gengrid_page_relative_set(). Naturally, its
794     * use is mutually exclusive to this one.
795     *
796     * @ingroup Gengrid
797     */
798    EAPI void               elm_gengrid_page_size_set(Evas_Object *obj, Evas_Coord h_pagesize, Evas_Coord v_pagesize) EINA_ARG_NONNULL(1);
799
800    /**
801     * @brief Get gengrid current page number.
802     *
803     * @param obj The gengrid object
804     * @param h_pagenumber The horizontal page number
805     * @param v_pagenumber The vertical page number
806     *
807     * The page number starts from 0. 0 is the first page.
808     * Current page means the page which meet the top-left of the viewport.
809     * If there are two or more pages in the viewport, it returns the number of page
810     * which meet the top-left of the viewport.
811     *
812     * @see elm_gengrid_last_page_get()
813     * @see elm_gengrid_page_show()
814     * @see elm_gengrid_page_brint_in()
815     */
816    EAPI void         elm_gengrid_current_page_get(const Evas_Object *obj, int *h_pagenumber, int *v_pagenumber) EINA_ARG_NONNULL(1);
817
818    /**
819     * @brief Get scroll last page number.
820     *
821     * @param obj The gengrid object
822     * @param h_pagenumber The horizontal page number
823     * @param v_pagenumber The vertical page number
824     *
825     * The page number starts from 0. 0 is the first page.
826     * This returns the last page number among the pages.
827     *
828     * @see elm_gengrid_current_page_get()
829     * @see elm_gengrid_page_show()
830     * @see elm_gengrid_page_brint_in()
831     */
832    EAPI void         elm_gengrid_last_page_get(const Evas_Object *obj, int *h_pagenumber, int *v_pagenumber) EINA_ARG_NONNULL(1);
833
834    /**
835     * Show a specific virtual region within the gengrid content object by page number.
836     *
837     * @param obj The gengrid object
838     * @param h_pagenumber The horizontal page number
839     * @param v_pagenumber The vertical page number
840     *
841     * 0, 0 of the indicated page is located at the top-left of the viewport.
842     * This will jump to the page directly without animation.
843     *
844     * Example of usage:
845     *
846     * @code
847     * sc = elm_gengrid_add(win);
848     * elm_gengrid_content_set(sc, content);
849     * elm_gengrid_page_relative_set(sc, 1, 0);
850     * elm_gengrid_current_page_get(sc, &h_page, &v_page);
851     * elm_gengrid_page_show(sc, h_page + 1, v_page);
852     * @endcode
853     *
854     * @see elm_gengrid_page_bring_in()
855     */
856    EAPI void         elm_gengrid_page_show(const Evas_Object *obj, int h_pagenumber, int v_pagenumber) EINA_ARG_NONNULL(1);
857
858    /**
859     * Show a specific virtual region within the gengrid content object by page number.
860     *
861     * @param obj The gengrid object
862     * @param h_pagenumber The horizontal page number
863     * @param v_pagenumber The vertical page number
864     *
865     * 0, 0 of the indicated page is located at the top-left of the viewport.
866     * This will slide to the page with animation.
867     *
868     * Example of usage:
869     *
870     * @code
871     * sc = elm_gengrid_add(win);
872     * elm_gengrid_content_set(sc, content);
873     * elm_gengrid_page_relative_set(sc, 1, 0);
874     * elm_gengrid_last_page_get(sc, &h_page, &v_page);
875     * elm_gengrid_page_bring_in(sc, h_page, v_page);
876     * @endcode
877     *
878     * @see elm_gengrid_page_show()
879     */
880     EAPI void         elm_gengrid_page_bring_in(const Evas_Object *obj, int h_pagenumber, int v_pagenumber) EINA_ARG_NONNULL(1);
881
882    /**
883     * Set the direction in which a given gengrid widget will expand while
884     * placing its items.
885     *
886     * @param obj The gengrid object.
887     * @param setting @c EINA_TRUE to make the gengrid expand
888     * horizontally, @c EINA_FALSE to expand vertically.
889     *
890     * When in "horizontal mode" (@c EINA_TRUE), items will be placed
891     * in @b columns, from top to bottom and, when the space for a
892     * column is filled, another one is started on the right, thus
893     * expanding the grid horizontally. When in "vertical mode"
894     * (@c EINA_FALSE), though, items will be placed in @b rows, from left
895     * to right and, when the space for a row is filled, another one is
896     * started below, thus expanding the grid vertically.
897     *
898     * @see elm_gengrid_horizontal_get()
899     *
900     * @ingroup Gengrid
901     */
902    EAPI void               elm_gengrid_horizontal_set(Evas_Object *obj, Eina_Bool setting) EINA_ARG_NONNULL(1);
903
904    /**
905     * Get for what direction a given gengrid widget will expand while
906     * placing its items.
907     *
908     * @param obj The gengrid object.
909     * @return @c EINA_TRUE, if @p obj is set to expand horizontally,
910     * @c EINA_FALSE if it's set to expand vertically.
911     *
912     * @see elm_gengrid_horizontal_set() for more detais
913     *
914     * @ingroup Gengrid
915     */
916    EAPI Eina_Bool          elm_gengrid_horizontal_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
917
918    /**
919     * Get the first item in a given gengrid widget
920     *
921     * @param obj The gengrid object
922     * @return The first item's handle or @c NULL, if there are no
923     * items in @p obj (and on errors)
924     *
925     * This returns the first item in the @p obj's internal list of
926     * items.
927     *
928     * @see elm_gengrid_last_item_get()
929     *
930     * @ingroup Gengrid
931     */
932    EAPI Elm_Gengrid_Item  *elm_gengrid_first_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
933
934    /**
935     * Get the last item in a given gengrid widget
936     *
937     * @param obj The gengrid object
938     * @return The last item's handle or @c NULL, if there are no
939     * items in @p obj (and on errors)
940     *
941     * This returns the last item in the @p obj's internal list of
942     * items.
943     *
944     * @see elm_gengrid_first_item_get()
945     *
946     * @ingroup Gengrid
947     */
948    EAPI Elm_Gengrid_Item  *elm_gengrid_last_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
949
950    /**
951     * Get the @b next item in a gengrid widget's internal list of items,
952     * given a handle to one of those items.
953     *
954     * @param item The gengrid item to fetch next from
955     * @return The item after @p item, or @c NULL if there's none (and
956     * on errors)
957     *
958     * This returns the item placed after the @p item, on the container
959     * gengrid.
960     *
961     * @see elm_gengrid_item_prev_get()
962     *
963     * @ingroup Gengrid
964     */
965    EAPI Elm_Gengrid_Item  *elm_gengrid_item_next_get(const Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1);
966
967    /**
968     * Get the @b previous item in a gengrid widget's internal list of items,
969     * given a handle to one of those items.
970     *
971     * @param item The gengrid item to fetch previous from
972     * @return The item before @p item, or @c NULL if there's none (and
973     * on errors)
974     *
975     * This returns the item placed before the @p item, on the container
976     * gengrid.
977     *
978     * @see elm_gengrid_item_next_get()
979     *
980     * @ingroup Gengrid
981     */
982    EAPI Elm_Gengrid_Item  *elm_gengrid_item_prev_get(const Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1);
983
984    /**
985     * Get the gengrid object's handle which contains a given gengrid
986     * item
987     *
988     * @param item The item to fetch the container from
989     * @return The gengrid (parent) object
990     *
991     * This returns the gengrid object itself that an item belongs to.
992     *
993     * @ingroup Gengrid
994     */
995    EAPI Evas_Object       *elm_gengrid_item_gengrid_get(const Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1);
996
997    /**
998     * Remove a gengrid item from its parent, deleting it.
999     *
1000     * @param item The item to be removed.
1001     * @return @c EINA_TRUE on success or @c EINA_FALSE, otherwise.
1002     *
1003     * @see elm_gengrid_clear(), to remove all items in a gengrid at
1004     * once.
1005     *
1006     * @ingroup Gengrid
1007     */
1008    EAPI void               elm_gengrid_item_del(Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1);
1009
1010    /**
1011     * Update the contents of a given gengrid item
1012     *
1013     * @param item The gengrid item
1014     *
1015     * This updates an item by calling all the item class functions
1016     * again to get the contents, texts and states. Use this when the
1017     * original item data has changed and you want the changes to be
1018     * reflected.
1019     *
1020     * @ingroup Gengrid
1021     */
1022    EAPI void               elm_gengrid_item_update(Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1);
1023
1024    /**
1025     * Get the Gengrid Item class for the given Gengrid Item.
1026     *
1027     * @param item The gengrid item
1028     *
1029     * This returns the Gengrid_Item_Class for the given item. It can be used to examine
1030     * the function pointers and item_style.
1031     *
1032     * @ingroup Gengrid
1033     */
1034    EAPI const Elm_Gengrid_Item_Class *elm_gengrid_item_item_class_get(const Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1);
1035
1036    /**
1037     * Get the Gengrid Item class for the given Gengrid Item.
1038     *
1039     * This sets the Gengrid_Item_Class for the given item. It can be used to examine
1040     * the function pointers and item_style.
1041     *
1042     * @param item The gengrid item
1043     * @param gic The gengrid item class describing the function pointers and the item style.
1044     *
1045     * @ingroup Gengrid
1046     */
1047    EAPI void               elm_gengrid_item_item_class_set(Elm_Gengrid_Item *item, const Elm_Gengrid_Item_Class *gic) EINA_ARG_NONNULL(1, 2);
1048
1049    /**
1050     * Return the data associated to a given gengrid item
1051     *
1052     * @param item The gengrid item.
1053     * @return the data associated with this item.
1054     *
1055     * This returns the @c data value passed on the
1056     * elm_gengrid_item_append() and related item addition calls.
1057     *
1058     * @see elm_gengrid_item_append()
1059     * @see elm_gengrid_item_data_set()
1060     *
1061     * @ingroup Gengrid
1062     */
1063    EAPI void              *elm_gengrid_item_data_get(const Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1);
1064
1065    /**
1066     * Set the data associated with a given gengrid item
1067     *
1068     * @param item The gengrid item
1069     * @param data The data pointer to set on it
1070     *
1071     * This @b overrides the @c data value passed on the
1072     * elm_gengrid_item_append() and related item addition calls. This
1073     * function @b won't call elm_gengrid_item_update() automatically,
1074     * so you'd issue it afterwards if you want to have the item
1075     * updated to reflect the new data.
1076     *
1077     * @see elm_gengrid_item_data_get()
1078     * @see elm_gengrid_item_update()
1079     *
1080     * @ingroup Gengrid
1081     */
1082    EAPI void               elm_gengrid_item_data_set(Elm_Gengrid_Item *item, const void *data) EINA_ARG_NONNULL(1);
1083
1084    /**
1085     * Get a given gengrid item's position, relative to the whole
1086     * gengrid's grid area.
1087     *
1088     * @param item The Gengrid item.
1089     * @param x Pointer to variable to store the item's <b>row number</b>.
1090     * @param y Pointer to variable to store the item's <b>column number</b>.
1091     *
1092     * This returns the "logical" position of the item within the
1093     * gengrid. For example, @c (0, 1) would stand for first row,
1094     * second column.
1095     *
1096     * @ingroup Gengrid
1097     */
1098    EAPI void               elm_gengrid_item_pos_get(const Elm_Gengrid_Item *item, unsigned int *x, unsigned int *y) EINA_ARG_NONNULL(1);
1099
1100    /**
1101     * Set whether a given gengrid item is selected or not
1102     *
1103     * @param item The gengrid item
1104     * @param selected Use @c EINA_TRUE, to make it selected, @c
1105     * EINA_FALSE to make it unselected
1106     *
1107     * This sets the selected state of an item. If multi-selection is
1108     * not enabled on the containing gengrid and @p selected is @c
1109     * EINA_TRUE, any other previously selected items will get
1110     * unselected in favor of this new one.
1111     *
1112     * @see elm_gengrid_item_selected_get()
1113     *
1114     * @ingroup Gengrid
1115     */
1116    EAPI void elm_gengrid_item_selected_set(Elm_Gengrid_Item *item, Eina_Bool selected) EINA_ARG_NONNULL(1);
1117
1118    /**
1119     * Get whether a given gengrid item is selected or not
1120     *
1121     * @param item The gengrid item
1122     * @return @c EINA_TRUE, if it's selected, @c EINA_FALSE otherwise
1123     *
1124     * This API returns EINA_TRUE for all the items selected in multi-select mode as well.
1125     *
1126     * @see elm_gengrid_item_selected_set() for more details
1127     *
1128     * @ingroup Gengrid
1129     */
1130    EAPI Eina_Bool elm_gengrid_item_selected_get(const Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1);
1131
1132    /**
1133     * Get the real Evas object created to implement the view of a
1134     * given gengrid item
1135     *
1136     * @param item The gengrid item.
1137     * @return the Evas object implementing this item's view.
1138     *
1139     * This returns the actual Evas object used to implement the
1140     * specified gengrid item's view. This may be @c NULL, as it may
1141     * not have been created or may have been deleted, at any time, by
1142     * the gengrid. <b>Do not modify this object</b> (move, resize,
1143     * show, hide, etc.), as the gengrid is controlling it. This
1144     * function is for querying, emitting custom signals or hooking
1145     * lower level callbacks for events on that object. Do not delete
1146     * this object under any circumstances.
1147     *
1148     * @see elm_gengrid_item_data_get()
1149     *
1150     * @ingroup Gengrid
1151     */
1152    EAPI const Evas_Object *elm_gengrid_item_object_get(const Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1);
1153
1154    /**
1155     * Show the portion of a gengrid's internal grid containing a given
1156     * item, @b immediately.
1157     *
1158     * @param item The item to display
1159     *
1160     * This causes gengrid to @b redraw its viewport's contents to the
1161     * region contining the given @p item item, if it is not fully
1162     * visible.
1163     *
1164     * @see elm_gengrid_item_bring_in()
1165     *
1166     * @ingroup Gengrid
1167     */
1168    EAPI void               elm_gengrid_item_show(Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1);
1169
1170    /**
1171     * Animatedly bring in, to the visible area of a gengrid, a given
1172     * item on it.
1173     *
1174     * @param item The gengrid item to display
1175     *
1176     * This causes gengrid to jump to the given @p item and show
1177     * it (by scrolling), if it is not fully visible. This will use
1178     * animation to do so and take a period of time to complete.
1179     *
1180     * @see elm_gengrid_item_show()
1181     *
1182     * @ingroup Gengrid
1183     */
1184    EAPI void               elm_gengrid_item_bring_in(Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1);
1185
1186    /**
1187     * Set whether a given gengrid item is disabled or not.
1188     *
1189     * @param item The gengrid item
1190     * @param disabled Use @c EINA_TRUE, true disable it, @c EINA_FALSE
1191     * to enable it back.
1192     *
1193     * A disabled item cannot be selected or unselected. It will also
1194     * change its appearance, to signal the user it's disabled.
1195     *
1196     * @see elm_gengrid_item_disabled_get()
1197     *
1198     * @ingroup Gengrid
1199     */
1200    EAPI void               elm_gengrid_item_disabled_set(Elm_Gengrid_Item *item, Eina_Bool disabled) EINA_ARG_NONNULL(1);
1201
1202    /**
1203     * Get whether a given gengrid item is disabled or not.
1204     *
1205     * @param item The gengrid item
1206     * @return @c EINA_TRUE, if it's disabled, @c EINA_FALSE otherwise
1207     * (and on errors).
1208     *
1209     * @see elm_gengrid_item_disabled_set() for more details
1210     *
1211     * @ingroup Gengrid
1212     */
1213    EAPI Eina_Bool          elm_gengrid_item_disabled_get(const Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1);
1214
1215    /**
1216     * Set the text to be shown in a given gengrid item's tooltips.
1217     *
1218     * @param item The gengrid item
1219     * @param text The text to set in the content
1220     *
1221     * This call will setup the text to be used as tooltip to that item
1222     * (analogous to elm_object_tooltip_text_set(), but being item
1223     * tooltips with higher precedence than object tooltips). It can
1224     * have only one tooltip at a time, so any previous tooltip data
1225     * will get removed.
1226     *
1227     * @ingroup Gengrid
1228     */
1229    EAPI void               elm_gengrid_item_tooltip_text_set(Elm_Gengrid_Item *item, const char *text) EINA_ARG_NONNULL(1);
1230
1231    /**
1232     * Set the content to be shown in a given gengrid item's tooltip
1233     *
1234     * @param item The gengrid item.
1235     * @param func The function returning the tooltip contents.
1236     * @param data What to provide to @a func as callback data/context.
1237     * @param del_cb Called when data is not needed anymore, either when
1238     *        another callback replaces @p func, the tooltip is unset with
1239     *        elm_gengrid_item_tooltip_unset() or the owner @p item
1240     *        dies. This callback receives as its first parameter the
1241     *        given @p data, being @c event_info the item handle.
1242     *
1243     * This call will setup the tooltip's contents to @p item
1244     * (analogous to elm_object_tooltip_content_cb_set(), but being
1245     * item tooltips with higher precedence than object tooltips). It
1246     * can have only one tooltip at a time, so any previous tooltip
1247     * content will get removed. @p func (with @p data) will be called
1248     * every time Elementary needs to show the tooltip and it should
1249     * return a valid Evas object, which will be fully managed by the
1250     * tooltip system, getting deleted when the tooltip is gone.
1251     *
1252     * @ingroup Gengrid
1253     */
1254    EAPI void               elm_gengrid_item_tooltip_content_cb_set(Elm_Gengrid_Item *item, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb) EINA_ARG_NONNULL(1);
1255
1256    /**
1257     * Unset a tooltip from a given gengrid item
1258     *
1259     * @param item gengrid item to remove a previously set tooltip from.
1260     *
1261     * This call removes any tooltip set on @p item. The callback
1262     * provided as @c del_cb to
1263     * elm_gengrid_item_tooltip_content_cb_set() will be called to
1264     * notify it is not used anymore (and have resources cleaned, if
1265     * need be).
1266     *
1267     * @see elm_gengrid_item_tooltip_content_cb_set()
1268     *
1269     * @ingroup Gengrid
1270     */
1271    EAPI void               elm_gengrid_item_tooltip_unset(Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1);
1272
1273    /**
1274     * Set a different @b style for a given gengrid item's tooltip.
1275     *
1276     * @param item gengrid item with tooltip set
1277     * @param style the <b>theme style</b> to use on tooltips (e.g. @c
1278     * "default", @c "transparent", etc)
1279     *
1280     * Tooltips can have <b>alternate styles</b> to be displayed on,
1281     * which are defined by the theme set on Elementary. This function
1282     * works analogously as elm_object_tooltip_style_set(), but here
1283     * applied only to gengrid item objects. The default style for
1284     * tooltips is @c "default".
1285     *
1286     * @note before you set a style you should define a tooltip with
1287     *       elm_gengrid_item_tooltip_content_cb_set() or
1288     *       elm_gengrid_item_tooltip_text_set()
1289     *
1290     * @see elm_gengrid_item_tooltip_style_get()
1291     *
1292     * @ingroup Gengrid
1293     */
1294    EAPI void               elm_gengrid_item_tooltip_style_set(Elm_Gengrid_Item *item, const char *style) EINA_ARG_NONNULL(1);
1295
1296    /**
1297     * Get the style set a given gengrid item's tooltip.
1298     *
1299     * @param item gengrid item with tooltip already set on.
1300     * @return style the theme style in use, which defaults to
1301     *         "default". If the object does not have a tooltip set,
1302     *         then @c NULL is returned.
1303     *
1304     * @see elm_gengrid_item_tooltip_style_set() for more details
1305     *
1306     * @ingroup Gengrid
1307     */
1308    EAPI const char        *elm_gengrid_item_tooltip_style_get(const Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1);
1309
1310    /**
1311     * @brief Disable size restrictions on an object's tooltip
1312     * @param item The tooltip's anchor object
1313     * @param disable If EINA_TRUE, size restrictions are disabled
1314     * @return EINA_FALSE on failure, EINA_TRUE on success
1315     *
1316     * This function allows a tooltip to expand beyond its parant window's canvas.
1317     * It will instead be limited only by the size of the display.
1318     */
1319    EAPI Eina_Bool          elm_gengrid_item_tooltip_window_mode_set(Elm_Gengrid_Item *item, Eina_Bool disable);
1320
1321    /**
1322     * @brief Retrieve size restriction state of an object's tooltip
1323     * @param item The tooltip's anchor object
1324     * @return If EINA_TRUE, size restrictions are disabled
1325     *
1326     * This function returns whether a tooltip is allowed to expand beyond
1327     * its parant window's canvas.
1328     * It will instead be limited only by the size of the display.
1329     */
1330    EAPI Eina_Bool          elm_gengrid_item_tooltip_window_mode_get(const Elm_Gengrid_Item *item);
1331
1332    /**
1333     * Set the type of mouse pointer/cursor decoration to be shown,
1334     * when the mouse pointer is over the given gengrid widget item
1335     *
1336     * @param item gengrid item to customize cursor on
1337     * @param cursor the cursor type's name
1338     *
1339     * This function works analogously as elm_object_cursor_set(), but
1340     * here the cursor's changing area is restricted to the item's
1341     * area, and not the whole widget's. Note that that item cursors
1342     * have precedence over widget cursors, so that a mouse over @p
1343     * item will always show cursor @p type.
1344     *
1345     * If this function is called twice for an object, a previously set
1346     * cursor will be unset on the second call.
1347     *
1348     * @see elm_object_cursor_set()
1349     * @see elm_gengrid_item_cursor_get()
1350     * @see elm_gengrid_item_cursor_unset()
1351     *
1352     * @ingroup Gengrid
1353     */
1354    EAPI void               elm_gengrid_item_cursor_set(Elm_Gengrid_Item *item, const char *cursor) EINA_ARG_NONNULL(1);
1355
1356    /**
1357     * Get the type of mouse pointer/cursor decoration set to be shown,
1358     * when the mouse pointer is over the given gengrid widget item
1359     *
1360     * @param item gengrid item with custom cursor set
1361     * @return the cursor type's name or @c NULL, if no custom cursors
1362     * were set to @p item (and on errors)
1363     *
1364     * @see elm_object_cursor_get()
1365     * @see elm_gengrid_item_cursor_set() for more details
1366     * @see elm_gengrid_item_cursor_unset()
1367     *
1368     * @ingroup Gengrid
1369     */
1370    EAPI const char        *elm_gengrid_item_cursor_get(const Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1);
1371
1372    /**
1373     * Unset any custom mouse pointer/cursor decoration set to be
1374     * shown, when the mouse pointer is over the given gengrid widget
1375     * item, thus making it show the @b default cursor again.
1376     *
1377     * @param item a gengrid item
1378     *
1379     * Use this call to undo any custom settings on this item's cursor
1380     * decoration, bringing it back to defaults (no custom style set).
1381     *
1382     * @see elm_object_cursor_unset()
1383     * @see elm_gengrid_item_cursor_set() for more details
1384     *
1385     * @ingroup Gengrid
1386     */
1387    EAPI void               elm_gengrid_item_cursor_unset(Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1);
1388
1389    /**
1390     * Set a different @b style for a given custom cursor set for a
1391     * gengrid item.
1392     *
1393     * @param item gengrid item with custom cursor set
1394     * @param style the <b>theme style</b> to use (e.g. @c "default",
1395     * @c "transparent", etc)
1396     *
1397     * This function only makes sense when one is using custom mouse
1398     * cursor decorations <b>defined in a theme file</b> , which can
1399     * have, given a cursor name/type, <b>alternate styles</b> on
1400     * it. It works analogously as elm_object_cursor_style_set(), but
1401     * here applied only to gengrid item objects.
1402     *
1403     * @warning Before you set a cursor style you should have defined a
1404     *       custom cursor previously on the item, with
1405     *       elm_gengrid_item_cursor_set()
1406     *
1407     * @see elm_gengrid_item_cursor_engine_only_set()
1408     * @see elm_gengrid_item_cursor_style_get()
1409     *
1410     * @ingroup Gengrid
1411     */
1412    EAPI void               elm_gengrid_item_cursor_style_set(Elm_Gengrid_Item *item, const char *style) EINA_ARG_NONNULL(1);
1413
1414    /**
1415     * Get the current @b style set for a given gengrid item's custom
1416     * cursor
1417     *
1418     * @param item gengrid item with custom cursor set.
1419     * @return style the cursor style in use. If the object does not
1420     *         have a cursor set, then @c NULL is returned.
1421     *
1422     * @see elm_gengrid_item_cursor_style_set() for more details
1423     *
1424     * @ingroup Gengrid
1425     */
1426    EAPI const char        *elm_gengrid_item_cursor_style_get(const Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1);
1427
1428    /**
1429     * Set if the (custom) cursor for a given gengrid item should be
1430     * searched in its theme, also, or should only rely on the
1431     * rendering engine.
1432     *
1433     * @param item item with custom (custom) cursor already set on
1434     * @param engine_only Use @c EINA_TRUE to have cursors looked for
1435     * only on those provided by the rendering engine, @c EINA_FALSE to
1436     * have them searched on the widget's theme, as well.
1437     *
1438     * @note This call is of use only if you've set a custom cursor
1439     * for gengrid items, with elm_gengrid_item_cursor_set().
1440     *
1441     * @note By default, cursors will only be looked for between those
1442     * provided by the rendering engine.
1443     *
1444     * @ingroup Gengrid
1445     */
1446    EAPI void               elm_gengrid_item_cursor_engine_only_set(Elm_Gengrid_Item *item, Eina_Bool engine_only) EINA_ARG_NONNULL(1);
1447
1448    /**
1449     * Get if the (custom) cursor for a given gengrid item is being
1450     * searched in its theme, also, or is only relying on the rendering
1451     * engine.
1452     *
1453     * @param item a gengrid item
1454     * @return @c EINA_TRUE, if cursors are being looked for only on
1455     * those provided by the rendering engine, @c EINA_FALSE if they
1456     * are being searched on the widget's theme, as well.
1457     *
1458     * @see elm_gengrid_item_cursor_engine_only_set(), for more details
1459     *
1460     * @ingroup Gengrid
1461     */
1462    EAPI Eina_Bool          elm_gengrid_item_cursor_engine_only_get(const Elm_Gengrid_Item *item) EINA_ARG_NONNULL(1);
1463
1464    /**
1465     * Remove all items from a given gengrid widget
1466     *
1467     * @param obj The gengrid object.
1468     *
1469     * This removes (and deletes) all items in @p obj, leaving it
1470     * empty.
1471     *
1472     * @see elm_gengrid_item_del(), to remove just one item.
1473     *
1474     * @ingroup Gengrid
1475     */
1476    EAPI void elm_gengrid_clear(Evas_Object *obj) EINA_ARG_NONNULL(1);
1477
1478    /**
1479     * Get the selected item in a given gengrid widget
1480     *
1481     * @param obj The gengrid object.
1482     * @return The selected item's handleor @c NULL, if none is
1483     * selected at the moment (and on errors)
1484     *
1485     * This returns the selected item in @p obj. If multi selection is
1486     * enabled on @p obj (@see elm_gengrid_multi_select_set()), only
1487     * the first item in the list is selected, which might not be very
1488     * useful. For that case, see elm_gengrid_selected_items_get().
1489     *
1490     * @ingroup Gengrid
1491     */
1492    EAPI Elm_Gengrid_Item  *elm_gengrid_selected_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
1493
1494    /**
1495     * Get <b>a list</b> of selected items in a given gengrid
1496     *
1497     * @param obj The gengrid object.
1498     * @return The list of selected items or @c NULL, if none is
1499     * selected at the moment (and on errors)
1500     *
1501     * This returns a list of the selected items, in the order that
1502     * they appear in the grid. This list is only valid as long as no
1503     * more items are selected or unselected (or unselected implictly
1504     * by deletion). The list contains #Elm_Gengrid_Item pointers as
1505     * data, naturally.
1506     *
1507     * @see elm_gengrid_selected_item_get()
1508     *
1509     * @ingroup Gengrid
1510     */
1511    EAPI const Eina_List   *elm_gengrid_selected_items_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
1512
1513    /**
1514     * @}
1515     */
1516