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