elementary - updated doc.
[framework/uifw/elementary.git] / src / lib / elm_toolbar.h
1 /**
2  * @defgroup Toolbar Toolbar
3  * @ingroup Elementary
4  *
5  * @image html img/widget/toolbar/preview-00.png
6  * @image latex img/widget/toolbar/preview-00.eps width=\textwidth
7  *
8  * @image html img/toolbar.png
9  * @image latex img/toolbar.eps width=\textwidth
10  *
11  * A toolbar is a widget that displays a list of items inside
12  * a box. It can be scrollable, show a menu with items that don't fit
13  * to toolbar size or even crop them.
14  *
15  * Only one item can be selected at a time.
16  *
17  * Items can have multiple states, or show menus when selected by the user.
18  *
19  * Smart callbacks one can listen to:
20  * - "clicked" - when the user clicks on a toolbar item and becomes selected.
21  * - "language,changed" - when the program language changes
22  *
23  * Available styles for it:
24  * - @c "default"
25  * - @c "transparent" - no background or shadow, just show the content
26  *
27  * Default text parts of the toolbar items that you can use for are:
28  * @li "default" - label of the toolbar item
29  *
30  * Supported elm_object_item common APIs.
31  * @li elm_object_item_disabled_set
32  * @li elm_object_item_disabled_get
33  * @li elm_object_item_part_text_set
34  * @li elm_object_item_part_text_get
35  *
36  * List of examples:
37  * @li @ref toolbar_example_01
38  * @li @ref toolbar_example_02
39  * @li @ref toolbar_example_03
40  */
41
42 /**
43  * @addtogroup Toolbar
44  * @{
45  */
46
47 /**
48  * @enum _Elm_Toolbar_Shrink_Mode
49  * @typedef Elm_Toolbar_Shrink_Mode
50  *
51  * Set toolbar's items display behavior, it can be scrollabel,
52  * show a menu with exceeding items, or simply hide them.
53  *
54  * @note Default value is #ELM_TOOLBAR_SHRINK_MENU. It reads value
55  * from elm config.
56  *
57  * Values <b> don't </b> work as bitmask, only one can be choosen.
58  *
59  * @see elm_toolbar_shrink_mode_set()
60  * @see elm_toolbar_shrink_mode_get()
61  *
62  * @ingroup Toolbar
63  */
64 typedef enum
65 {
66    ELM_TOOLBAR_SHRINK_NONE, /**< Set toolbar minimun size to fit all the items. */
67    ELM_TOOLBAR_SHRINK_HIDE, /**< Hide exceeding items. */
68    ELM_TOOLBAR_SHRINK_SCROLL, /**< Allow accessing exceeding items through a scroller. */
69    ELM_TOOLBAR_SHRINK_MENU, /**< Inserts a button to pop up a menu with exceeding items. */
70    ELM_TOOLBAR_SHRINK_LAST /**< Indicates error if returned by elm_toolbar_shrink_mode_get() */
71 } Elm_Toolbar_Shrink_Mode;
72
73 typedef struct _Elm_Toolbar_Item_State Elm_Toolbar_Item_State;    /**< State of a Elm_Toolbar_Item. Can be created with elm_toolbar_item_state_add() and removed with elm_toolbar_item_state_del(). */
74
75 /**
76  * Add a new toolbar widget to the given parent Elementary
77  * (container) object.
78  *
79  * @param parent The parent object.
80  * @return a new toolbar widget handle or @c NULL, on errors.
81  *
82  * This function inserts a new toolbar widget on the canvas.
83  *
84  * @ingroup Toolbar
85  */
86 EAPI Evas_Object                 *elm_toolbar_add(Evas_Object *parent);
87
88 /**
89  * Set the icon size, in pixels, to be used by toolbar items.
90  *
91  * @param obj The toolbar object
92  * @param icon_size The icon size in pixels
93  *
94  * @note Default value is @c 32. It reads value from elm config.
95  *
96  * @see elm_toolbar_icon_size_get()
97  *
98  * @ingroup Toolbar
99  */
100 EAPI void                         elm_toolbar_icon_size_set(Evas_Object *obj, int icon_size);
101
102 /**
103  * Get the icon size, in pixels, to be used by toolbar items.
104  *
105  * @param obj The toolbar object.
106  * @return The icon size in pixels.
107  *
108  * @see elm_toolbar_icon_size_set() for details.
109  *
110  * @ingroup Toolbar
111  */
112 EAPI int                          elm_toolbar_icon_size_get(const Evas_Object *obj);
113
114 /**
115  * Sets icon lookup order, for toolbar items' icons.
116  *
117  * @param obj The toolbar object.
118  * @param order The icon lookup order.
119  *
120  * Icons added before calling this function will not be affected.
121  * The default lookup order is #ELM_ICON_LOOKUP_THEME_FDO.
122  *
123  * @see elm_toolbar_icon_order_lookup_get()
124  *
125  * @ingroup Toolbar
126  */
127 EAPI void                         elm_toolbar_icon_order_lookup_set(Evas_Object *obj, Elm_Icon_Lookup_Order order);
128
129 /**
130  * Gets the icon lookup order.
131  *
132  * @param obj The toolbar object.
133  * @return The icon lookup order.
134  *
135  * @see elm_toolbar_icon_order_lookup_set() for details.
136  *
137  * @ingroup Toolbar
138  */
139 EAPI Elm_Icon_Lookup_Order        elm_toolbar_icon_order_lookup_get(const Evas_Object *obj);
140
141 /**
142  * Set whether the toolbar should always have an item selected.
143  *
144  * @param obj The toolbar object.
145  * @param wrap @c EINA_TRUE to enable always-select mode or @c EINA_FALSE to
146  * disable it.
147  *
148  * This will cause the toolbar to always have an item selected, and clicking
149  * the selected item will not cause a selected event to be emitted. Enabling this mode
150  * will immediately select the first toolbar item.
151  *
152  * Always-selected is disabled by default.
153  *
154  * @see elm_toolbar_always_select_mode_get().
155  *
156  * @ingroup Toolbar
157  */
158 EAPI void                         elm_toolbar_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select);
159
160 /**
161  * Get whether the toolbar should always have an item selected.
162  *
163  * @param obj The toolbar object.
164  * @return @c EINA_TRUE means an item will always be selected, @c EINA_FALSE indicates
165  * that it is possible to have no items selected. If @p obj is @c NULL, @c EINA_FALSE is returned.
166  *
167  * @see elm_toolbar_always_select_mode_set() for details.
168  *
169  * @ingroup Toolbar
170  */
171 EAPI Eina_Bool                    elm_toolbar_always_select_mode_get(const Evas_Object *obj);
172
173 /**
174  * Set whether the toolbar items' should be selected by the user or not.
175  *
176  * @param obj The toolbar object.
177  * @param wrap @c EINA_TRUE to disable selection or @c EINA_FALSE to
178  * enable it.
179  *
180  * This will turn off the ability to select items entirely and they will
181  * neither appear selected nor emit selected signals. The clicked
182  * callback function will still be called.
183  *
184  * Selection is enabled by default.
185  *
186  * @see elm_toolbar_no_select_mode_get().
187  *
188  * @ingroup Toolbar
189  */
190 EAPI void                         elm_toolbar_no_select_mode_set(Evas_Object *obj, Eina_Bool no_select);
191
192 /**
193  * Set whether the toolbar items' should be selected by the user or not.
194  *
195  * @param obj The toolbar object.
196  * @return @c EINA_TRUE means items can be selected. @c EINA_FALSE indicates
197  * they can't. If @p obj is @c NULL, @c EINA_FALSE is returned.
198  *
199  * @see elm_toolbar_no_select_mode_set() for details.
200  *
201  * @ingroup Toolbar
202  */
203 EAPI Eina_Bool                    elm_toolbar_no_select_mode_get(const Evas_Object *obj);
204
205 /**
206  * Append item to the toolbar.
207  *
208  * @param obj The toolbar object.
209  * @param icon A string with icon name or the absolute path of an image file.
210  * @param label The label of the item.
211  * @param func The function to call when the item is clicked.
212  * @param data The data to associate with the item for related callbacks.
213  * @return The created item or @c NULL upon failure.
214  *
215  * A new item will be created and appended to the toolbar, i.e., will
216  * be set as @b last item.
217  *
218  * Items created with this method can be deleted with
219  * elm_toolbar_item_del().
220  *
221  * Associated @p data can be properly freed when item is deleted if a
222  * callback function is set with elm_object_item_del_cb_set().
223  *
224  * If a function is passed as argument, it will be called everytime this item
225  * is selected, i.e., the user clicks over an unselected item.
226  * If such function isn't needed, just passing
227  * @c NULL as @p func is enough. The same should be done for @p data.
228  *
229  * Toolbar will load icon image from fdo or current theme.
230  * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
231  * If an absolute path is provided it will load it direct from a file.
232  *
233  * @see elm_toolbar_item_icon_set()
234  * @see elm_toolbar_item_del()
235  *
236  * @ingroup Toolbar
237  */
238 EAPI Elm_Object_Item             *elm_toolbar_item_append(Evas_Object *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data);
239
240 /**
241  * Prepend item to the toolbar.
242  *
243  * @param obj The toolbar object.
244  * @param icon A string with icon name or the absolute path of an image file.
245  * @param label The label of the item.
246  * @param func The function to call when the item is clicked.
247  * @param data The data to associate with the item for related callbacks.
248  * @return The created item or @c NULL upon failure.
249  *
250  * A new item will be created and prepended to the toolbar, i.e., will
251  * be set as @b first item.
252  *
253  * Items created with this method can be deleted with
254  * elm_toolbar_item_del().
255  *
256  * Associated @p data can be properly freed when item is deleted if a
257  * callback function is set with elm_object_item_del_cb_set().
258  *
259  * If a function is passed as argument, it will be called everytime this item
260  * is selected, i.e., the user clicks over an unselected item.
261  * If such function isn't needed, just passing
262  * @c NULL as @p func is enough. The same should be done for @p data.
263  *
264  * Toolbar will load icon image from fdo or current theme.
265  * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
266  * If an absolute path is provided it will load it direct from a file.
267  *
268  * @see elm_toolbar_item_icon_set()
269  * @see elm_toolbar_item_del()
270  *
271  * @ingroup Toolbar
272  */
273 EAPI Elm_Object_Item             *elm_toolbar_item_prepend(Evas_Object *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data);
274
275 /**
276  * Insert a new item into the toolbar object before item @p before.
277  *
278  * @param obj The toolbar object.
279  * @param before The toolbar item to insert before.
280  * @param icon A string with icon name or the absolute path of an image file.
281  * @param label The label of the item.
282  * @param func The function to call when the item is clicked.
283  * @param data The data to associate with the item for related callbacks.
284  * @return The created item or @c NULL upon failure.
285  *
286  * A new item will be created and added to the toolbar. Its position in
287  * this toolbar will be just before item @p before.
288  *
289  * Items created with this method can be deleted with
290  * elm_toolbar_item_del().
291  *
292  * Associated @p data can be properly freed when item is deleted if a
293  * callback function is set with elm_object_item_del_cb_set().
294  *
295  * If a function is passed as argument, it will be called everytime this item
296  * is selected, i.e., the user clicks over an unselected item.
297  * If such function isn't needed, just passing
298  * @c NULL as @p func is enough. The same should be done for @p data.
299  *
300  * Toolbar will load icon image from fdo or current theme.
301  * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
302  * If an absolute path is provided it will load it direct from a file.
303  *
304  * @see elm_toolbar_item_icon_set()
305  * @see elm_toolbar_item_del()
306  *
307  * @ingroup Toolbar
308  */
309 EAPI Elm_Object_Item             *elm_toolbar_item_insert_before(Evas_Object *obj, Elm_Object_Item *before, const char *icon, const char *label, Evas_Smart_Cb func, const void *data);
310
311 /**
312  * Insert a new item into the toolbar object after item @p after.
313  *
314  * @param obj The toolbar object.
315  * @param after The toolbar item to insert after.
316  * @param icon A string with icon name or the absolute path of an image file.
317  * @param label The label of the item.
318  * @param func The function to call when the item is clicked.
319  * @param data The data to associate with the item for related callbacks.
320  * @return The created item or @c NULL upon failure.
321  *
322  * A new item will be created and added to the toolbar. Its position in
323  * this toolbar will be just after item @p after.
324  *
325  * Items created with this method can be deleted with
326  * elm_toolbar_item_del().
327  *
328  * Associated @p data can be properly freed when item is deleted if a
329  * callback function is set with elm_object_item_del_cb_set().
330  *
331  * If a function is passed as argument, it will be called everytime this item
332  * is selected, i.e., the user clicks over an unselected item.
333  * If such function isn't needed, just passing
334  * @c NULL as @p func is enough. The same should be done for @p data.
335  *
336  * Toolbar will load icon image from fdo or current theme.
337  * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
338  * If an absolute path is provided it will load it direct from a file.
339  *
340  * @see elm_toolbar_item_icon_set()
341  * @see elm_toolbar_item_del()
342  *
343  * @ingroup Toolbar
344  */
345 EAPI Elm_Object_Item             *elm_toolbar_item_insert_after(Evas_Object *obj, Elm_Object_Item *after, const char *icon, const char *label, Evas_Smart_Cb func, const void *data);
346
347 /**
348  * Get the first item in the given toolbar widget's list of
349  * items.
350  *
351  * @param obj The toolbar object
352  * @return The first item or @c NULL, if it has no items (and on
353  * errors)
354  *
355  * @see elm_toolbar_item_append()
356  * @see elm_toolbar_last_item_get()
357  *
358  * @ingroup Toolbar
359  */
360 EAPI Elm_Object_Item             *elm_toolbar_first_item_get(const Evas_Object *obj);
361
362 /**
363  * Get the last item in the given toolbar widget's list of
364  * items.
365  *
366  * @param obj The toolbar object
367  * @return The last item or @c NULL, if it has no items (and on
368  * errors)
369  *
370  * @see elm_toolbar_item_prepend()
371  * @see elm_toolbar_first_item_get()
372  *
373  * @ingroup Toolbar
374  */
375 EAPI Elm_Object_Item             *elm_toolbar_last_item_get(const Evas_Object *obj);
376
377 /**
378  * Get the item after @p item in toolbar.
379  *
380  * @param it The toolbar item.
381  * @return The item after @p item, or @c NULL if none or on failure.
382  *
383  * @note If it is the last item, @c NULL will be returned.
384  *
385  * @see elm_toolbar_item_append()
386  *
387  * @ingroup Toolbar
388  */
389 EAPI Elm_Object_Item             *elm_toolbar_item_next_get(const Elm_Object_Item *it);
390
391 /**
392  * Get the item before @p item in toolbar.
393  *
394  * @param item The toolbar item.
395  * @return The item before @p item, or @c NULL if none or on failure.
396  *
397  * @note If it is the first item, @c NULL will be returned.
398  *
399  * @see elm_toolbar_item_prepend()
400  *
401  * @ingroup Toolbar
402  */
403 EAPI Elm_Object_Item             *elm_toolbar_item_prev_get(const Elm_Object_Item *it);
404
405 /**
406  * Set the priority of a toolbar item.
407  *
408  * @param it The toolbar item.
409  * @param priority The item priority. The default is zero.
410  *
411  * This is used only when the toolbar shrink mode is set to
412  * #ELM_TOOLBAR_SHRINK_MENU or #ELM_TOOLBAR_SHRINK_HIDE.
413  * When space is less than required, items with low priority
414  * will be removed from the toolbar and added to a dynamically-created menu,
415  * while items with higher priority will remain on the toolbar,
416  * with the same order they were added.
417  *
418  * @see elm_toolbar_item_priority_get()
419  *
420  * @ingroup Toolbar
421  */
422 EAPI void                         elm_toolbar_item_priority_set(Elm_Object_Item *it, int priority);
423
424 /**
425  * Get the priority of a toolbar item.
426  *
427  * @param it The toolbar item.
428  * @return The @p item priority, or @c 0 on failure.
429  *
430  * @see elm_toolbar_item_priority_set() for details.
431  *
432  * @ingroup Toolbar
433  */
434 EAPI int                          elm_toolbar_item_priority_get(const Elm_Object_Item *it);
435
436 /**
437  * Returns a pointer to a toolbar item by its label.
438  *
439  * @param obj The toolbar object.
440  * @param label The label of the item to find.
441  *
442  * @return The pointer to the toolbar item matching @p label or @c NULL
443  * on failure.
444  *
445  * @ingroup Toolbar
446  */
447 EAPI Elm_Object_Item             *elm_toolbar_item_find_by_label(const Evas_Object *obj, const char *label);
448
449 /*
450  * Get whether the @p item is selected or not.
451  *
452  * @param it The toolbar item.
453  * @return @c EINA_TRUE means item is selected. @c EINA_FALSE indicates
454  * it's not. If @p obj is @c NULL, @c EINA_FALSE is returned.
455  *
456  * @see elm_toolbar_selected_item_set() for details.
457  * @see elm_toolbar_item_selected_get()
458  *
459  * @ingroup Toolbar
460  */
461 EAPI Eina_Bool                    elm_toolbar_item_selected_get(const Elm_Object_Item *it);
462
463 /**
464  * Set the selected state of an item.
465  *
466  * @param it The toolbar item
467  * @param selected The selected state
468  *
469  * This sets the selected state of the given item @p it.
470  * @c EINA_TRUE for selected, @c EINA_FALSE for not selected.
471  *
472  * If a new item is selected the previosly selected will be unselected.
473  * Previoulsy selected item can be get with function
474  * elm_toolbar_selected_item_get().
475  *
476  * Selected items will be highlighted.
477  *
478  * @see elm_toolbar_item_selected_get()
479  * @see elm_toolbar_selected_item_get()
480  *
481  * @ingroup Toolbar
482  */
483 EAPI void                         elm_toolbar_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
484
485 /**
486  * Get the selected item.
487  *
488  * @param obj The toolbar object.
489  * @return The selected toolbar item.
490  *
491  * The selected item can be unselected with function
492  * elm_toolbar_item_selected_set().
493  *
494  * The selected item always will be highlighted on toolbar.
495  *
496  * @see elm_toolbar_selected_items_get()
497  *
498  * @ingroup Toolbar
499  */
500 EAPI Elm_Object_Item             *elm_toolbar_selected_item_get(const Evas_Object *obj);
501
502 /**
503  * Set the icon associated with @p item.
504  *
505  * @param obj The parent of this item.
506  * @param it The toolbar item.
507  * @param icon A string with icon name or the absolute path of an image file.
508  *
509  * Toolbar will load icon image from fdo or current theme.
510  * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
511  * If an absolute path is provided it will load it direct from a file.
512  *
513  * @see elm_toolbar_icon_order_lookup_set()
514  * @see elm_toolbar_icon_order_lookup_get()
515  *
516  * @ingroup Toolbar
517  */
518 EAPI void                         elm_toolbar_item_icon_set(Elm_Object_Item *it, const char *icon);
519
520 /**
521  * Get the string used to set the icon of @p item.
522  *
523  * @param it The toolbar item.
524  * @return The string associated with the icon object.
525  *
526  * @see elm_toolbar_item_icon_set() for details.
527  *
528  * @ingroup Toolbar
529  */
530 EAPI const char                  *elm_toolbar_item_icon_get(const Elm_Object_Item *it);
531
532 /**
533  * Get the object of @p item.
534  *
535  * @param it The toolbar item.
536  * @return The object
537  *
538  * @ingroup Toolbar
539  */
540 EAPI Evas_Object                 *elm_toolbar_item_object_get(const Elm_Object_Item *it);
541
542 /**
543  * Get the icon object of @p item.
544  *
545  * @param it The toolbar item.
546  * @return The icon object
547  *
548  * @see elm_toolbar_item_icon_set(), elm_toolbar_item_icon_file_set(),
549  * or elm_toolbar_item_icon_memfile_set() for details.
550  *
551  * @ingroup Toolbar
552  */
553 EAPI Evas_Object                 *elm_toolbar_item_icon_object_get(Elm_Object_Item *it);
554
555 /**
556  * Set the icon associated with @p item to an image in a binary buffer.
557  *
558  * @param it The toolbar item.
559  * @param img The binary data that will be used as an image
560  * @param size The size of binary data @p img
561  * @param format Optional format of @p img to pass to the image loader
562  * @param key Optional key of @p img to pass to the image loader (eg. if @p img is an edje file)
563  *
564  * @return (@c EINA_TRUE = success, @c EINA_FALSE = error)
565  *
566  * @note The icon image set by this function can be changed by
567  * elm_toolbar_item_icon_set().
568  *
569  * @ingroup Toolbar
570  */
571 EAPI Eina_Bool                    elm_toolbar_item_icon_memfile_set(Elm_Object_Item *it, const void *img, size_t size, const char *format, const char *key);
572
573 /**
574  * Set the icon associated with @p item to an image in a binary buffer.
575  *
576  * @param it The toolbar item.
577  * @param file The file that contains the image
578  * @param key Optional key of @p img to pass to the image loader (eg. if @p img is an edje file)
579  *
580  * @return (@c EINA_TRUE = success, @c EINA_FALSE = error)
581  *
582  * @note The icon image set by this function can be changed by
583  * elm_toolbar_item_icon_set().
584  *
585  * @ingroup Toolbar
586  */
587 EAPI Eina_Bool                    elm_toolbar_item_icon_file_set(Elm_Object_Item *it, const char *file, const char *key);
588
589 /**
590  * Delete them item from the toolbar.
591  *
592  * @param it The item of toolbar to be deleted.
593  *
594  * @see elm_toolbar_item_append()
595  *
596  * @ingroup Toolbar
597  */
598 EAPI void                         elm_toolbar_item_del(Elm_Object_Item *it);
599
600
601 /**
602  * Set or unset item as a separator.
603  *
604  * @param it The toolbar item.
605  * @param setting @c EINA_TRUE to set item @p item as separator or
606  * @c EINA_FALSE to unset, i.e., item will be used as a regular item.
607  *
608  * Items aren't set as separator by default.
609  *
610  * If set as separator it will display separator theme, so won't display
611  * icons or label.
612  *
613  * @see elm_toolbar_item_separator_get()
614  *
615  * @ingroup Toolbar
616  */
617 EAPI void                         elm_toolbar_item_separator_set(Elm_Object_Item *it, Eina_Bool separator);
618
619 /**
620  * Get a value whether item is a separator or not.
621  *
622  * @param it The toolbar item.
623  * @return @c EINA_TRUE means item @p it is a separator. @c EINA_FALSE
624  * indicates it's not. If @p it is @c NULL, @c EINA_FALSE is returned.
625  *
626  * @see elm_toolbar_item_separator_set() for details.
627  *
628  * @ingroup Toolbar
629  */
630 EAPI Eina_Bool                    elm_toolbar_item_separator_get(const Elm_Object_Item *it);
631
632 /**
633  * Set the shrink state of toolbar @p obj.
634  *
635  * @param obj The toolbar object.
636  * @param shrink_mode Toolbar's items display behavior.
637  *
638  * The toolbar won't scroll if #ELM_TOOLBAR_SHRINK_NONE,
639  * but will enforce a minimun size so all the items will fit, won't scroll
640  * and won't show the items that don't fit if #ELM_TOOLBAR_SHRINK_HIDE,
641  * will scroll if #ELM_TOOLBAR_SHRINK_SCROLL, and will create a button to
642  * pop up excess elements with #ELM_TOOLBAR_SHRINK_MENU.
643  *
644  * @ingroup Toolbar
645  */
646 EAPI void                         elm_toolbar_shrink_mode_set(Evas_Object *obj, Elm_Toolbar_Shrink_Mode shrink_mode);
647
648 /**
649  * Get the shrink mode of toolbar @p obj.
650  *
651  * @param obj The toolbar object.
652  * @return Toolbar's items display behavior.
653  *
654  * @see elm_toolbar_shrink_mode_set() for details.
655  *
656  * @ingroup Toolbar
657  */
658 EAPI Elm_Toolbar_Shrink_Mode      elm_toolbar_shrink_mode_get(const Evas_Object *obj);
659
660 /**
661  * Enable/disable homogeneous mode.
662  *
663  * @param obj The toolbar object
664  * @param homogeneous Assume the items within the toolbar are of the
665  * same size (EINA_TRUE = on, EINA_FALSE = off). Default is @c EINA_FALSE.
666  *
667  * This will enable the homogeneous mode where items are of the same size.
668  * @see elm_toolbar_homogeneous_get()
669  *
670  * @ingroup Toolbar
671  */
672 EAPI void                         elm_toolbar_homogeneous_set(Evas_Object *obj, Eina_Bool homogeneous);
673
674 /**
675  * Get whether the homogeneous mode is enabled.
676  *
677  * @param obj The toolbar object.
678  * @return Assume the items within the toolbar are of the same height
679  * and width (EINA_TRUE = on, EINA_FALSE = off).
680  *
681  * @see elm_toolbar_homogeneous_set()
682  *
683  * @ingroup Toolbar
684  */
685 EAPI Eina_Bool                    elm_toolbar_homogeneous_get(const Evas_Object *obj);
686
687 /**
688  * Set the parent object of the toolbar items' menus.
689  *
690  * @param obj The toolbar object.
691  * @param parent The parent of the menu objects.
692  *
693  * Each item can be set as item menu, with elm_toolbar_item_menu_set().
694  *
695  * For more details about setting the parent for toolbar menus, see
696  * elm_menu_parent_set().
697  *
698  * @see elm_menu_parent_set() for details.
699  * @see elm_toolbar_item_menu_set() for details.
700  *
701  * @ingroup Toolbar
702  */
703 EAPI void                         elm_toolbar_menu_parent_set(Evas_Object *obj, Evas_Object *parent);
704
705 /**
706  * Get the parent object of the toolbar items' menus.
707  *
708  * @param obj The toolbar object.
709  * @return The parent of the menu objects.
710  *
711  * @see elm_toolbar_menu_parent_set() for details.
712  *
713  * @ingroup Toolbar
714  */
715 EAPI Evas_Object                 *elm_toolbar_menu_parent_get(const Evas_Object *obj);
716
717 /**
718  * Set the alignment of the items.
719  *
720  * @param obj The toolbar object.
721  * @param align The new alignment, a float between <tt> 0.0 </tt>
722  * and <tt> 1.0 </tt>.
723  *
724  * Alignment of toolbar items, from <tt> 0.0 </tt> to indicates to align
725  * left, to <tt> 1.0 </tt>, to align to right. <tt> 0.5 </tt> centralize
726  * items.
727  *
728  * Centered items by default.
729  *
730  * @see elm_toolbar_align_get()
731  *
732  * @ingroup Toolbar
733  */
734 EAPI void                         elm_toolbar_align_set(Evas_Object *obj, double align);
735
736 /**
737  * Get the alignment of the items.
738  *
739  * @param obj The toolbar object.
740  * @return toolbar items alignment, a float between <tt> 0.0 </tt> and
741  * <tt> 1.0 </tt>.
742  *
743  * @see elm_toolbar_align_set() for details.
744  *
745  * @ingroup Toolbar
746  */
747 EAPI double                       elm_toolbar_align_get(const Evas_Object *obj);
748
749 /**
750  * Set whether the toolbar item opens a menu.
751  *
752  * @param it The toolbar item.
753  * @param menu If @c EINA_TRUE, @p item will opens a menu when selected.
754  *
755  * A toolbar item can be set to be a menu, using this function.
756  *
757  * Once it is set to be a menu, it can be manipulated through the
758  * menu-like function elm_toolbar_menu_parent_set() and the other
759  * elm_menu functions, using the Evas_Object @c menu returned by
760  * elm_toolbar_item_menu_get().
761  *
762  * So, items to be displayed in this item's menu should be added with
763  * elm_menu_item_add().
764  *
765  * The following code exemplifies the most basic usage:
766  * @code
767  * tb = elm_toolbar_add(win)
768  * item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
769  * elm_toolbar_item_menu_set(item, EINA_TRUE);
770  * elm_toolbar_menu_parent_set(tb, win);
771  * menu = elm_toolbar_item_menu_get(item);
772  * elm_menu_item_add(menu, NULL, "edit-cut", "Cut", NULL, NULL);
773  * menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Copy", NULL,
774  * NULL);
775  * @endcode
776  *
777  * @see elm_toolbar_item_menu_get()
778  *
779  * @ingroup Toolbar
780  */
781 EAPI void                         elm_toolbar_item_menu_set(Elm_Object_Item *it, Eina_Bool menu);
782
783 /**
784  * Get toolbar item's menu.
785  *
786  * @param it The toolbar item.
787  * @return Item's menu object or @c NULL on failure.
788  *
789  * If @p item wasn't set as menu item with elm_toolbar_item_menu_set(),
790  * this function will set it.
791  *
792  * @see elm_toolbar_item_menu_set() for details.
793  *
794  * @ingroup Toolbar
795  */
796 EAPI Evas_Object                 *elm_toolbar_item_menu_get(const Elm_Object_Item *it);
797
798 /**
799  * Add a new state to @p item.
800  *
801  * @param it The toolbar item.
802  * @param icon A string with icon name or the absolute path of an image file.
803  * @param label The label of the new state.
804  * @param func The function to call when the item is clicked when this
805  * state is selected.
806  * @param data The data to associate with the state.
807  * @return The toolbar item state, or @c NULL upon failure.
808  *
809  * Toolbar will load icon image from fdo or current theme.
810  * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
811  * If an absolute path is provided it will load it direct from a file.
812  *
813  * States created with this function can be removed with
814  * elm_toolbar_item_state_del().
815  *
816  * @see elm_toolbar_item_state_del()
817  * @see elm_toolbar_item_state_sel()
818  * @see elm_toolbar_item_state_get()
819  *
820  * @ingroup Toolbar
821  */
822 EAPI Elm_Toolbar_Item_State      *elm_toolbar_item_state_add(Elm_Object_Item *it, const char *icon, const char *label, Evas_Smart_Cb func, const void *data);
823
824 /**
825  * Delete a previoulsy added state to @p item.
826  *
827  * @param it The toolbar item.
828  * @param state The state to be deleted.
829  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
830  *
831  * @see elm_toolbar_item_state_add()
832  */
833 EAPI Eina_Bool                    elm_toolbar_item_state_del(Elm_Object_Item *it, Elm_Toolbar_Item_State *state);
834
835 /**
836  * Set @p state as the current state of @p it.
837  *
838  * @param it The toolbar item.
839  * @param state The state to use.
840  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
841  *
842  * If @p state is @c NULL, it won't select any state and the default item's
843  * icon and label will be used. It's the same behaviour than
844  * elm_toolbar_item_state_unser().
845  *
846  * @see elm_toolbar_item_state_unset()
847  *
848  * @ingroup Toolbar
849  */
850 EAPI Eina_Bool                    elm_toolbar_item_state_set(Elm_Object_Item *it, Elm_Toolbar_Item_State *state);
851
852 /**
853  * Unset the state of @p it.
854  *
855  * @param it The toolbar item.
856  *
857  * The default icon and label from this item will be displayed.
858  *
859  * @see elm_toolbar_item_state_set() for more details.
860  *
861  * @ingroup Toolbar
862  */
863 EAPI void                         elm_toolbar_item_state_unset(Elm_Object_Item *it);
864
865 /**
866  * Get the current state of @p it.
867  *
868  * @param it The toolbar item.
869  * @return The selected state or @c NULL if none is selected or on failure.
870  *
871  * @see elm_toolbar_item_state_set() for details.
872  * @see elm_toolbar_item_state_unset()
873  * @see elm_toolbar_item_state_add()
874  *
875  * @ingroup Toolbar
876  */
877 EAPI Elm_Toolbar_Item_State      *elm_toolbar_item_state_get(const Elm_Object_Item *it);
878
879 /**
880  * Get the state after selected state in toolbar's @p item.
881  *
882  * @param it The toolbar item to change state.
883  * @return The state after current state, or @c NULL on failure.
884  *
885  * If last state is selected, this function will return first state.
886  *
887  * @see elm_toolbar_item_state_set()
888  * @see elm_toolbar_item_state_add()
889  *
890  * @ingroup Toolbar
891  */
892 EAPI Elm_Toolbar_Item_State      *elm_toolbar_item_state_next(Elm_Object_Item *it);
893
894 /**
895  * Get the state before selected state in toolbar's @p item.
896  *
897  * @param it The toolbar item to change state.
898  * @return The state before current state, or @c NULL on failure.
899  *
900  * If first state is selected, this function will return last state.
901  *
902  * @see elm_toolbar_item_state_set()
903  * @see elm_toolbar_item_state_add()
904  *
905  * @ingroup Toolbar
906  */
907 EAPI Elm_Toolbar_Item_State      *elm_toolbar_item_state_prev(Elm_Object_Item *it);
908
909 /**
910  * Set the text to be shown in a given toolbar item's tooltips.
911  *
912  * @param it toolbar item.
913  * @param text The text to set in the content.
914  *
915  * Setup the text as tooltip to object. The item can have only one tooltip,
916  * so any previous tooltip data - set with this function or
917  * elm_toolbar_item_tooltip_content_cb_set() - is removed.
918  *
919  * @see elm_object_tooltip_text_set() for more details.
920  *
921  * @ingroup Toolbar
922  */
923 EAPI void                         elm_toolbar_item_tooltip_text_set(Elm_Object_Item *it, const char *text);
924
925 /**
926  * Set the content to be shown in the tooltip item.
927  *
928  * Setup the tooltip to item. The item can have only one tooltip,
929  * so any previous tooltip data is removed. @p func(with @p data) will
930  * be called every time that need show the tooltip and it should
931  * return a valid Evas_Object. This object is then managed fully by
932  * tooltip system and is deleted when the tooltip is gone.
933  *
934  * @param it the toolbar item being attached a tooltip.
935  * @param func the function used to create the tooltip contents.
936  * @param data what to provide to @a func as callback data/context.
937  * @param del_cb called when data is not needed anymore, either when
938  *        another callback replaces @a func, the tooltip is unset with
939  *        elm_toolbar_item_tooltip_unset() or the owner @a item
940  *        dies. This callback receives as the first parameter the
941  *        given @a data, and @c event_info is the item.
942  *
943  * @see elm_object_tooltip_content_cb_set() for more details.
944  *
945  * @ingroup Toolbar
946  */
947 EAPI void                         elm_toolbar_item_tooltip_content_cb_set(Elm_Object_Item *it, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb);
948
949 /**
950  * Unset tooltip from item.
951  *
952  * @param it toolbar item to remove previously set tooltip.
953  *
954  * Remove tooltip from item. The callback provided as del_cb to
955  * elm_toolbar_item_tooltip_content_cb_set() will be called to notify
956  * it is not used anymore.
957  *
958  * @see elm_object_tooltip_unset() for more details.
959  * @see elm_toolbar_item_tooltip_content_cb_set()
960  *
961  * @ingroup Toolbar
962  */
963 EAPI void                         elm_toolbar_item_tooltip_unset(Elm_Object_Item *it);
964
965 /**
966  * Sets a different style for this item tooltip.
967  *
968  * @note before you set a style you should define a tooltip with
969  *       elm_toolbar_item_tooltip_content_cb_set() or
970  *       elm_toolbar_item_tooltip_text_set()
971  *
972  * @param it toolbar item with tooltip already set.
973  * @param style the theme style to use (default, transparent, ...)
974  *
975  * @see elm_object_tooltip_style_set() for more details.
976  *
977  * @ingroup Toolbar
978  */
979 EAPI void                         elm_toolbar_item_tooltip_style_set(Elm_Object_Item *it, const char *style);
980
981 /**
982  * Get the style for this item tooltip.
983  *
984  * @param it toolbar item with tooltip already set.
985  * @return style the theme style in use, defaults to "default". If the
986  *         object does not have a tooltip set, then NULL is returned.
987  *
988  * @see elm_object_tooltip_style_get() for more details.
989  * @see elm_toolbar_item_tooltip_style_set()
990  *
991  * @ingroup Toolbar
992  */
993 EAPI const char                  *elm_toolbar_item_tooltip_style_get(const Elm_Object_Item *it);
994
995 /**
996  * Set the type of mouse pointer/cursor decoration to be shown,
997  * when the mouse pointer is over the given toolbar widget item
998  *
999  * @param it toolbar item to customize cursor on
1000  * @param cursor the cursor type's name
1001  *
1002  * This function works analogously as elm_object_cursor_set(), but
1003  * here the cursor's changing area is restricted to the item's
1004  * area, and not the whole widget's. Note that that item cursors
1005  * have precedence over widget cursors, so that a mouse over an
1006  * item with custom cursor set will always show @b that cursor.
1007  *
1008  * If this function is called twice for an object, a previously set
1009  * cursor will be unset on the second call.
1010  *
1011  * @see elm_object_cursor_set()
1012  * @see elm_toolbar_item_cursor_get()
1013  * @see elm_toolbar_item_cursor_unset()
1014  *
1015  * @ingroup Toolbar
1016  */
1017 EAPI void                         elm_toolbar_item_cursor_set(Elm_Object_Item *it, const char *cursor);
1018
1019 /*
1020  * Get the type of mouse pointer/cursor decoration set to be shown,
1021  * when the mouse pointer is over the given toolbar widget item
1022  *
1023  * @param it toolbar item with custom cursor set
1024  * @return the cursor type's name or @c NULL, if no custom cursors
1025  * were set to @p item (and on errors)
1026  *
1027  * @see elm_object_cursor_get()
1028  * @see elm_toolbar_item_cursor_set()
1029  * @see elm_toolbar_item_cursor_unset()
1030  *
1031  * @ingroup Toolbar
1032  */
1033 EAPI const char                  *elm_toolbar_item_cursor_get(const Elm_Object_Item *it);
1034
1035 /**
1036  * Unset any custom mouse pointer/cursor decoration set to be
1037  * shown, when the mouse pointer is over the given toolbar widget
1038  * item, thus making it show the @b default cursor again.
1039  *
1040  * @param it a toolbar item
1041  *
1042  * Use this call to undo any custom settings on this item's cursor
1043  * decoration, bringing it back to defaults (no custom style set).
1044  *
1045  * @see elm_object_cursor_unset()
1046  * @see elm_toolbar_item_cursor_set()
1047  *
1048  * @ingroup Toolbar
1049  */
1050 EAPI void                         elm_toolbar_item_cursor_unset(Elm_Object_Item *it);
1051
1052 /**
1053  * Set a different @b style for a given custom cursor set for a
1054  * toolbar item.
1055  *
1056  * @param it toolbar item with custom cursor set
1057  * @param style the <b>theme style</b> to use (e.g. @c "default",
1058  * @c "transparent", etc)
1059  *
1060  * This function only makes sense when one is using custom mouse
1061  * cursor decorations <b>defined in a theme file</b>, which can have,
1062  * given a cursor name/type, <b>alternate styles</b> on it. It
1063  * works analogously as elm_object_cursor_style_set(), but here
1064  * applyed only to toolbar item objects.
1065  *
1066  * @warning Before you set a cursor style you should have definen a
1067  *       custom cursor previously on the item, with
1068  *       elm_toolbar_item_cursor_set()
1069  *
1070  * @see elm_toolbar_item_cursor_engine_only_set()
1071  * @see elm_toolbar_item_cursor_style_get()
1072  *
1073  * @ingroup Toolbar
1074  */
1075 EAPI void                         elm_toolbar_item_cursor_style_set(Elm_Object_Item *it, const char *style);
1076
1077 /**
1078  * Get the current @b style set for a given toolbar item's custom
1079  * cursor
1080  *
1081  * @param it toolbar item with custom cursor set.
1082  * @return style the cursor style in use. If the object does not
1083  *         have a cursor set, then @c NULL is returned.
1084  *
1085  * @see elm_toolbar_item_cursor_style_set() for more details
1086  *
1087  * @ingroup Toolbar
1088  */
1089 EAPI const char                  *elm_toolbar_item_cursor_style_get(const Elm_Object_Item *it);
1090
1091 /**
1092  * Set if the (custom)cursor for a given toolbar item should be
1093  * searched in its theme, also, or should only rely on the
1094  * rendering engine.
1095  *
1096  * @param it item with custom (custom) cursor already set on
1097  * @param engine_only Use @c EINA_TRUE to have cursors looked for
1098  * only on those provided by the rendering engine, @c EINA_FALSE to
1099  * have them searched on the widget's theme, as well.
1100  *
1101  * @note This call is of use only if you've set a custom cursor
1102  * for toolbar items, with elm_toolbar_item_cursor_set().
1103  *
1104  * @note By default, cursors will only be looked for between those
1105  * provided by the rendering engine.
1106  *
1107  * @ingroup Toolbar
1108  */
1109 EAPI void                         elm_toolbar_item_cursor_engine_only_set(Elm_Object_Item *it, Eina_Bool engine_only);
1110
1111 /**
1112  * Get if the (custom) cursor for a given toolbar item is being
1113  * searched in its theme, also, or is only relying on the rendering
1114  * engine.
1115  *
1116  * @param it a toolbar item
1117  * @return @c EINA_TRUE, if cursors are being looked for only on
1118  * those provided by the rendering engine, @c EINA_FALSE if they
1119  * are being searched on the widget's theme, as well.
1120  *
1121  * @see elm_toolbar_item_cursor_engine_only_set(), for more details
1122  *
1123  * @ingroup Toolbar
1124  */
1125 EAPI Eina_Bool                    elm_toolbar_item_cursor_engine_only_get(const Elm_Object_Item *it);
1126
1127 /**
1128  * Change a toolbar's orientation
1129  * @param obj The toolbar object
1130  * @param horizontal If @c EINA_TRUE, the toolbar is horizontal
1131  * By default, a toolbar will be horizontal. Use this function to create a vertical toolbar.
1132  * @ingroup Toolbar
1133  */
1134 EAPI void                         elm_toolbar_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
1135
1136 /**
1137  * Get a toolbar's orientation
1138  * @param obj The toolbar object
1139  * @return If @c EINA_TRUE, the toolbar is horizontal
1140  * By default, a toolbar will be horizontal. Use this function to determine whether a toolbar is vertical.
1141  * @ingroup Toolbar
1142  */
1143 EAPI Eina_Bool                    elm_toolbar_horizontal_get(const Evas_Object *obj);
1144
1145 /**
1146  * Get the number of items in a toolbar
1147  * @param obj The toolbar object
1148  * @return The number of items in @p obj toolbar
1149  * @ingroup Toolbar
1150  */
1151 EAPI unsigned int                 elm_toolbar_items_count(const Evas_Object *obj);
1152 /**
1153  * @}
1154  */