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