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