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