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