Merge remote-tracking branch 'remotes/origin/upstream'
[framework/uifw/elementary.git] / src / lib / elm_object_item.h
1 <<<<<<< HEAD
2 =======
3 typedef void (*Elm_Object_Item_Smart_Cb) (void *data, Elm_Object_Item *it, void *event_info);
4
5 >>>>>>> remotes/origin/upstream
6 /**
7  * Get the widget object's handle which contains a given item
8  *
9  * @param it The Elementary object item
10  * @return The widget object
11  *
12  * @note This returns the widget object itself that an item belongs to.
13  * @note Every elm_object_item supports this API
14  * @ingroup General
15  */
16 EAPI Evas_Object                 *elm_object_item_widget_get(const Elm_Object_Item *it);
17
18 /**
19  * Set a content of an object item
20  *
21  * @param it The Elementary object item
22  * @param part The content part name to set (NULL for the default content)
23  * @param content The new content of the object item
24  *
25  * @note Elementary object items may have many contents
26  *
27  * @ingroup General
28  */
29 EAPI void                         elm_object_item_part_content_set(Elm_Object_Item *it, const char *part, Evas_Object *content);
30
31 #define elm_object_item_content_set(it, content) elm_object_item_part_content_set((it), NULL, (content))
32
33 /**
34  * Get a content of an object item
35  *
36  * @param it The Elementary object item
37  * @param part The content part name to unset (NULL for the default content)
38  * @return content of the object item or NULL for any error
39  *
40  * @note Elementary object items may have many contents
41  *
42  * @ingroup General
43  */
44 EAPI Evas_Object                 *elm_object_item_part_content_get(const Elm_Object_Item *it, const char *part);
45
46 #define elm_object_item_content_get(it) elm_object_item_part_content_get((it), NULL)
47
48 /**
49  * Unset a content of an object item
50  *
51  * @param it The Elementary object item
52  * @param part The content part name to unset (NULL for the default content)
53  *
54  * @note Elementary object items may have many contents
55  *
56  * @ingroup General
57  */
58 EAPI Evas_Object                 *elm_object_item_part_content_unset(Elm_Object_Item *it, const char *part);
59
60 #define elm_object_item_content_unset(it) elm_object_item_part_content_unset((it), NULL)
61
62 /**
63  * Set a label of an object item
64  *
65  * @param it The Elementary object item
66  * @param part The text part name to set (NULL for the default label)
67  * @param label The new text of the label
68  *
69  * @note Elementary object items may have many labels
70  *
71  * @ingroup General
72  */
73 EAPI void                         elm_object_item_part_text_set(Elm_Object_Item *it, const char *part, const char *label);
74
75 #define elm_object_item_text_set(it, label) elm_object_item_part_text_set((it), NULL, (label))
76
77 /**
78  * Get a label of an object item
79  *
80  * @param it The Elementary object item
81  * @param part The text part name to get (NULL for the default label)
82  * @return text of the label or NULL for any error
83  *
84  * @note Elementary object items may have many labels
85  *
86  * @ingroup General
87  */
88 EAPI const char                  *elm_object_item_part_text_get(const Elm_Object_Item *it, const char *part);
89
90 #define elm_object_item_text_get(it) elm_object_item_part_text_get((it), NULL)
91
92 /**
93  * Set the text to read out when in accessibility mode
94  *
95  * @param it The object item which is to be described
96  * @param txt The text that describes the widget to people with poor or no vision
97  *
98  * @ingroup General
99  */
100 EAPI void                         elm_object_item_access_info_set(Elm_Object_Item *it, const char *txt);
101
102 /**
103  * Get the data associated with an object item
104  * @param it The Elementary object item
105  * @return The data associated with @p it
106  *
107  * @note Every elm_object_item supports this API
108  * @ingroup General
109  */
110 EAPI void                        *elm_object_item_data_get(const Elm_Object_Item *it);
111
112 /**
113  * Set the data associated with an object item
114  * @param it The Elementary object item
115  * @param data The data to be associated with @p it
116  *
117  * @note Every elm_object_item supports this API
118  * @ingroup General
119  */
120 EAPI void                         elm_object_item_data_set(Elm_Object_Item *it, void *data);
121
122 /**
123  * Send a signal to the edje object of the widget item.
124  *
125  * This function sends a signal to the edje object of the obj item. An
126  * edje program can respond to a signal by specifying matching
127  * 'signal' and 'source' fields.
128  *
129  * @param it The Elementary object item
130  * @param emission The signal's name.
131  * @param source The signal's source.
132  * @ingroup General
133  */
134 EAPI void                         elm_object_item_signal_emit(Elm_Object_Item *it, const char *emission, const char *source);
135
136 /**
137  * Set the disabled state of an widget item.
138  *
139 <<<<<<< HEAD
140  * @param obj The Elementary object item
141 =======
142  * @param it The Elementary object item
143 >>>>>>> remotes/origin/upstream
144  * @param disabled The state to put in in: @c EINA_TRUE for
145  *        disabled, @c EINA_FALSE for enabled
146  *
147  * Elementary object item can be @b disabled, in which state they won't
148  * receive input and, in general, will be themed differently from
149  * their normal state, usually greyed out. Useful for contexts
150  * where you don't want your users to interact with some of the
151  * parts of you interface.
152  *
153  * This sets the state for the widget item, either disabling it or
154  * enabling it back.
155  *
156  * @ingroup Styles
157  */
158 EAPI void                         elm_object_item_disabled_set(Elm_Object_Item *it, Eina_Bool disabled);
159
160 /**
161  * Get the disabled state of an widget item.
162  *
163 <<<<<<< HEAD
164  * @param obj The Elementary object
165 =======
166  * @param it The Elementary object item
167 >>>>>>> remotes/origin/upstream
168  * @return @c EINA_TRUE, if the widget item is disabled, @c EINA_FALSE
169  *            if it's enabled (or on errors)
170  *
171  * This gets the state of the widget, which might be enabled or disabled.
172  *
173  * @ingroup Styles
174  */
175 EAPI Eina_Bool                    elm_object_item_disabled_get(const Elm_Object_Item *it);
176
177 /**
178  * @brief Set the function to be called when an item from the widget is
179  * freed.
180  *
181  * @param it The item to set the callback on
182 <<<<<<< HEAD
183  * @param func The function called
184 =======
185  * @param del_cb The function called
186 >>>>>>> remotes/origin/upstream
187  *
188  * That function will receive these parameters:
189  * @li void * item data
190  * @li Evas_Object * widget object
191  * @li Elm_Object_Item * widget item
192  *
193  * @note Every elm_object_item supports this API
194  *
195  * @see elm_object_item_del()
196  * @ingroup General
197  */
198 EAPI void                         elm_object_item_del_cb_set(Elm_Object_Item *it, Evas_Smart_Cb del_cb);
199
200 /**
201  * Delete the given item.
202  *
203  * @param it The item to be deleted.
204  *
205  * @ingroup General
206  */
207 EAPI void                       elm_object_item_del(Elm_Object_Item *it);
208
209 /**
210  * Set the text to be shown in a given object item's tooltips.
211  *
212 <<<<<<< HEAD
213  * @param item Target item.
214 =======
215  * @param it Target item.
216 >>>>>>> remotes/origin/upstream
217  * @param text The text to set in the content.
218  *
219  * Setup the text as tooltip to object. The item can have only one tooltip,
220  * so any previous tooltip data - set with this function or
221  * elm_object_item_tooltip_content_cb_set() - is removed.
222  *
223  * @see elm_object_tooltip_text_set() for more details.
224  *
225  * @ingroup General
226  */
227 <<<<<<< HEAD
228 EAPI void                         elm_object_item_tooltip_text_set(Elm_Object_Item *item, const char *text);
229
230 /**
231  * @brief Disable size restrictions on an object's tooltip
232  * @param item The tooltip's anchor object
233  * @param disable If EINA_TRUE, size restrictions are disabled
234  * @return EINA_FALSE on failure, EINA_TRUE on success
235  *
236  * This function allows a tooltip to expand beyond its parant window's canvas.
237  * It will instead be limited only by the size of the display.
238  */
239 EAPI Eina_Bool                    elm_object_item_tooltip_window_mode_set(Elm_Object_Item *item, Eina_Bool disable);
240
241 /**
242  * @brief Retrieve size restriction state of an object's tooltip
243  * @param obj The tooltip's anchor object
244  * @return If EINA_TRUE, size restrictions are disabled
245  *
246  * This function returns whether a tooltip is allowed to expand beyond
247  * its parant window's canvas.
248  * It will instead be limited only by the size of the display.
249  */
250 EAPI Eina_Bool                    elm_object_item_tooltip_window_mode_get(const Elm_Object_Item *item);
251 =======
252 EAPI void                         elm_object_item_tooltip_text_set(Elm_Object_Item *it, const char *text);
253
254 /**
255  * @brief Disable size restrictions on an object's tooltip
256  * @param it The tooltip's anchor object
257  * @param disable If EINA_TRUE, size restrictions are disabled
258  * @return EINA_FALSE on failure, EINA_TRUE on success
259  *
260  * This function allows a tooltip to expand beyond its parent window's canvas.
261  * It will instead be limited only by the size of the display.
262  */
263 EAPI Eina_Bool                    elm_object_item_tooltip_window_mode_set(Elm_Object_Item *it, Eina_Bool disable);
264
265 /**
266  * @brief Retrieve size restriction state of an object's tooltip
267  * @param it The tooltip's anchor object
268  * @return If EINA_TRUE, size restrictions are disabled
269  *
270  * This function returns whether a tooltip is allowed to expand beyond
271  * its parent window's canvas.
272  * It will instead be limited only by the size of the display.
273  */
274 EAPI Eina_Bool                    elm_object_item_tooltip_window_mode_get(const Elm_Object_Item *it);
275 >>>>>>> remotes/origin/upstream
276
277 /**
278  * Set the content to be shown in the tooltip item.
279  *
280  * Setup the tooltip to item. The item can have only one tooltip,
281  * so any previous tooltip data is removed. @p func(with @p data) will
282  * be called every time that need show the tooltip and it should
283  * return a valid Evas_Object. This object is then managed fully by
284  * tooltip system and is deleted when the tooltip is gone.
285  *
286 <<<<<<< HEAD
287  * @param item the object item being attached a tooltip.
288 =======
289  * @param it the object item being attached a tooltip.
290 >>>>>>> remotes/origin/upstream
291  * @param func the function used to create the tooltip contents.
292  * @param data what to provide to @a func as callback data/context.
293  * @param del_cb called when data is not needed anymore, either when
294  *        another callback replaces @a func, the tooltip is unset with
295  *        elm_object_item_tooltip_unset() or the owner @a item
296  *        dies. This callback receives as the first parameter the
297  *        given @a data, and @c event_info is the item.
298  *
299  * @see elm_object_tooltip_content_cb_set() for more details.
300  *
301  * @ingroup General
302  */
303 <<<<<<< HEAD
304 EAPI void                         elm_object_item_tooltip_content_cb_set(Elm_Object_Item *item, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb);
305 =======
306 EAPI void                         elm_object_item_tooltip_content_cb_set(Elm_Object_Item *it, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb);
307 >>>>>>> remotes/origin/upstream
308
309 /**
310  * Unset tooltip from item.
311  *
312 <<<<<<< HEAD
313  * @param item object item to remove previously set tooltip.
314 =======
315  * @param it object item to remove previously set tooltip.
316 >>>>>>> remotes/origin/upstream
317  *
318  * Remove tooltip from item. The callback provided as del_cb to
319  * elm_object_item_tooltip_content_cb_set() will be called to notify
320  * it is not used anymore.
321  *
322  * @see elm_object_tooltip_unset() for more details.
323  * @see elm_object_item_tooltip_content_cb_set()
324  *
325  * @ingroup General
326  */
327 <<<<<<< HEAD
328 EAPI void                         elm_object_item_tooltip_unset(Elm_Object_Item *item);
329 =======
330 EAPI void                         elm_object_item_tooltip_unset(Elm_Object_Item *it);
331 >>>>>>> remotes/origin/upstream
332
333 /**
334  * Sets a different style for this item tooltip.
335  *
336  * @note before you set a style you should define a tooltip with
337  *       elm_object_item_tooltip_content_cb_set() or
338  *       elm_object_item_tooltip_text_set()
339  *
340 <<<<<<< HEAD
341  * @param item object item with tooltip already set.
342 =======
343  * @param it object item with tooltip already set.
344 >>>>>>> remotes/origin/upstream
345  * @param style the theme style to use (default, transparent, ...)
346  *
347  * @see elm_object_tooltip_style_set() for more details.
348  *
349  * @ingroup General
350  */
351 <<<<<<< HEAD
352 EAPI void                         elm_object_item_tooltip_style_set(Elm_Object_Item *item, const char *style);
353 =======
354 EAPI void                         elm_object_item_tooltip_style_set(Elm_Object_Item *it, const char *style);
355 >>>>>>> remotes/origin/upstream
356
357 /**
358  * Get the style for this item tooltip.
359  *
360 <<<<<<< HEAD
361  * @param item object item with tooltip already set.
362 =======
363  * @param it object item with tooltip already set.
364 >>>>>>> remotes/origin/upstream
365  * @return style the theme style in use, defaults to "default". If the
366  *         object does not have a tooltip set, then NULL is returned.
367  *
368  * @see elm_object_tooltip_style_get() for more details.
369  * @see elm_object_item_tooltip_style_set()
370  *
371  * @ingroup General
372  */
373 <<<<<<< HEAD
374 EAPI const char                  *elm_object_item_tooltip_style_get(const Elm_Object_Item *item);
375
376  
377 =======
378 EAPI const char                  *elm_object_item_tooltip_style_get(const Elm_Object_Item *it);
379
380 >>>>>>> remotes/origin/upstream
381 /**
382   * Set the type of mouse pointer/cursor decoration to be shown,
383   * when the mouse pointer is over the given item
384   *
385 <<<<<<< HEAD
386   * @param ite, item to customize cursor on
387 =======
388   * @param it item to customize cursor on
389 >>>>>>> remotes/origin/upstream
390   * @param cursor the cursor type's name
391   *
392   * This function works analogously as elm_object_cursor_set(), but
393   * here the cursor's changing area is restricted to the item's
394   * area, and not the whole widget's. Note that that item cursors
395   * have precedence over widget cursors, so that a mouse over an
396   * item with custom cursor set will always show @b that cursor.
397   *
398   * If this function is called twice for an object, a previously set
399   * cursor will be unset on the second call.
400   *
401   * @see elm_object_cursor_set()
402   * @see elm_object_item_cursor_get()
403   * @see elm_object_item_cursor_unset()
404   *
405   * @ingroup General
406   */
407 <<<<<<< HEAD
408 EAPI void                         elm_object_item_cursor_set(Elm_Object_Item *item, const char *cursor);
409 =======
410 EAPI void                         elm_object_item_cursor_set(Elm_Object_Item *it, const char *cursor);
411 >>>>>>> remotes/origin/upstream
412
413 /*
414  * Get the type of mouse pointer/cursor decoration set to be shown,
415  * when the mouse pointer is over the given item
416  *
417 <<<<<<< HEAD
418  * @param item item with custom cursor set
419 =======
420  * @param it item with custom cursor set
421 >>>>>>> remotes/origin/upstream
422  * @return the cursor type's name or @c NULL, if no custom cursors
423  * were set to @p item (and on errors)
424  *
425  * @see elm_object_cursor_get()
426  * @see elm_object_item_cursor_set()
427  * @see elm_object_item_cursor_unset()
428  *
429  * @ingroup General
430  */
431 <<<<<<< HEAD
432 EAPI const char                  *elm_object_item_cursor_get(const Elm_Object_Item *item);
433 =======
434 EAPI const char                  *elm_object_item_cursor_get(const Elm_Object_Item *it);
435 >>>>>>> remotes/origin/upstream
436
437 /**
438  * Unset any custom mouse pointer/cursor decoration set to be
439  * shown, when the mouse pointer is over the given
440  * item, thus making it show the @b default cursor again.
441  *
442 <<<<<<< HEAD
443  * @param item the item
444 =======
445  * @param it the item
446 >>>>>>> remotes/origin/upstream
447  *
448  * Use this call to undo any custom settings on this item's cursor
449  * decoration, bringing it back to defaults (no custom style set).
450  *
451  * @see elm_object_cursor_unset()
452  * @see elm_object_item_cursor_set()
453  *
454  * @ingroup General
455  */
456 <<<<<<< HEAD
457 EAPI void                         elm_object_item_cursor_unset(Elm_Object_Item *item);
458 =======
459 EAPI void                         elm_object_item_cursor_unset(Elm_Object_Item *it);
460 >>>>>>> remotes/origin/upstream
461
462 /**
463  * Set a different @b style for a given custom cursor set for an
464  * item.
465  *
466 <<<<<<< HEAD
467  * @param item item with custom cursor set
468 =======
469  * @param it item with custom cursor set
470 >>>>>>> remotes/origin/upstream
471  * @param style the <b>theme style</b> to use (e.g. @c "default",
472  * @c "transparent", etc)
473  *
474  * This function only makes sense when one is using custom mouse
475  * cursor decorations <b>defined in a theme file</b>, which can have,
476  * given a cursor name/type, <b>alternate styles</b> on it. It
477  * works analogously as elm_object_cursor_style_set(), but here
478 <<<<<<< HEAD
479  * applyed only to item objects.
480  *
481  * @warning Before you set a cursor style you should have definen a
482 =======
483  * applies only to item objects.
484  *
485  * @warning Before you set a cursor style you should have defined a
486 >>>>>>> remotes/origin/upstream
487  *       custom cursor previously on the item, with
488  *       elm_object_item_cursor_set()
489  *
490  * @see elm_object_item_cursor_engine_only_set()
491  * @see elm_object_item_cursor_style_get()
492  *
493  * @ingroup General
494  */
495 <<<<<<< HEAD
496 EAPI void                         elm_object_item_cursor_style_set(Elm_Object_Item *item, const char *style);
497 =======
498 EAPI void                         elm_object_item_cursor_style_set(Elm_Object_Item *it, const char *style);
499 >>>>>>> remotes/origin/upstream
500
501 /**
502  * Get the current @b style set for a given item's custom
503  * cursor
504  *
505 <<<<<<< HEAD
506  * @param item item with custom cursor set.
507 =======
508  * @param it item with custom cursor set.
509 >>>>>>> remotes/origin/upstream
510  * @return style the cursor style in use. If the object does not
511  *         have a cursor set, then @c NULL is returned.
512  *
513  * @see elm_object_item_cursor_style_set() for more details
514  *
515  * @ingroup General
516  */
517 <<<<<<< HEAD
518 EAPI const char                  *elm_object_item_cursor_style_get(const Elm_Object_Item *item);
519 =======
520 EAPI const char                  *elm_object_item_cursor_style_get(const Elm_Object_Item *it);
521 >>>>>>> remotes/origin/upstream
522
523 /**
524  * Set if the (custom)cursor for a given item should be
525  * searched in its theme, also, or should only rely on the
526  * rendering engine.
527  *
528 <<<<<<< HEAD
529  * @param item item with custom (custom) cursor already set on
530 =======
531  * @param it item with custom (custom) cursor already set on
532 >>>>>>> remotes/origin/upstream
533  * @param engine_only Use @c EINA_TRUE to have cursors looked for
534  * only on those provided by the rendering engine, @c EINA_FALSE to
535  * have them searched on the widget's theme, as well.
536  *
537  * @note This call is of use only if you've set a custom cursor
538  * for items, with elm_object_item_cursor_set().
539  *
540  * @note By default, cursors will only be looked for between those
541  * provided by the rendering engine.
542  *
543  * @ingroup General
544  */
545 <<<<<<< HEAD
546 EAPI void                         elm_object_item_cursor_engine_only_set(Elm_Object_Item *item, Eina_Bool engine_only);
547 =======
548 EAPI void                         elm_object_item_cursor_engine_only_set(Elm_Object_Item *it, Eina_Bool engine_only);
549 >>>>>>> remotes/origin/upstream
550
551 /**
552  * Get if the (custom) cursor for a given item is being
553  * searched in its theme, also, or is only relying on the rendering
554  * engine.
555  *
556 <<<<<<< HEAD
557  * @param item an item
558 =======
559  * @param it an object item
560 >>>>>>> remotes/origin/upstream
561  * @return @c EINA_TRUE, if cursors are being looked for only on
562  * those provided by the rendering engine, @c EINA_FALSE if they
563  * are being searched on the widget's theme, as well.
564  *
565  * @see elm_object_item_cursor_engine_only_set(), for more details
566  *
567  * @ingroup General
568  */
569 <<<<<<< HEAD
570 EAPI Eina_Bool                    elm_object_item_cursor_engine_only_get(const Elm_Object_Item *item);
571     
572 =======
573 EAPI Eina_Bool                    elm_object_item_cursor_engine_only_get(const Elm_Object_Item *it);
574
575 /**
576  * Add (register) a callback function to the smart event specified by @p event
577  * on the elm_object_item @p it.
578  *
579  * @param it an object item
580  * @param event the event's name string
581  * @param func the callback function
582  * @param data user data to be passed to the callback function
583  *
584  * Smart callbacks look very similar to Evas Smart callbacks, but are
585  * implemented as elementary object item's custom ones.
586  *
587  * This function adds a function callback to an elementary object item  when the
588  * event named @p event occurs in it. The function is @p func.
589  *
590  * A smart callback function must have the Elm_Object_Item_Smart_Cb prototype
591  * definition. The first parameter (@p data) in this definition will be a user
592  * specific data. The second parameter @p it is a handle to the object item on 
593  * which event occurred. The third parameter, @p event_info, is a pointer to
594  * data which is totally dependent on the elementary object item's
595  * implementation and semantic for the given event.
596  *
597  * @see elm_object_item_smart_callback_del()
598  *
599  * @ingroup General
600  */
601 //Don't use this APIs
602 //EAPI void                         elm_object_item_smart_callback_add(Elm_Object_Item *it, const char *event, Elm_Object_Item_Smart_Cb func, const void *data);
603
604 /**
605  * Delete (unregister) a callback function from the smart event specified by @p
606  * event on the elementary object item @p it.
607  *
608  * @param it an object item
609  * @param event the event's name string
610  * @param func the callback function
611  * @return data user data.
612  *
613  * This function removes <b>the first</b> added smart callback on the item @p it
614  * matching the event name @p event and the registered function pointer @p func.
615  * If the removal is successful it will also return the data pointer that was
616  * passed to elm_object_item_smart_callback_add() (that will be the same as the
617  * parameter) when the callback(s) was(were) added to the item. If not
618  * successful @c NULL will be returned.
619  *
620  * @see elm_object_item_smart_callback_add()
621  *
622  * @ingroup General
623  */
624 //Don't use this APIs
625 //EAPI void                        *elm_object_item_smart_callback_del(Elm_Object_Item *it, const char *event, Elm_Object_Item_Smart_Cb func);
626 >>>>>>> remotes/origin/upstream