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