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