Add the ELM_TOOLBAR_SHRINK_EXPAND mode. The items be expanded according the size...
[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_EXPAND, /**< Expand all items according the size of the toolbar. */
71    ELM_TOOLBAR_SHRINK_LAST /**< Indicates error if returned by elm_toolbar_shrink_mode_get() */
72 } Elm_Toolbar_Shrink_Mode;
73
74 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(). */
75
76 /**
77  * Add a new toolbar widget to the given parent Elementary
78  * (container) object.
79  *
80  * @param parent The parent object.
81  * @return a new toolbar widget handle or @c NULL, on errors.
82  *
83  * This function inserts a new toolbar widget on the canvas.
84  *
85  * @ingroup Toolbar
86  */
87 EAPI Evas_Object                 *elm_toolbar_add(Evas_Object *parent);
88
89 /**
90  * Set the icon size, in pixels, to be used by toolbar items.
91  *
92  * @param obj The toolbar object
93  * @param icon_size The icon size in pixels
94  *
95  * @note Default value is @c 32. It reads value from elm config.
96  *
97  * @see elm_toolbar_icon_size_get()
98  *
99  * @ingroup Toolbar
100  */
101 EAPI void                         elm_toolbar_icon_size_set(Evas_Object *obj, int icon_size);
102
103 /**
104  * Get the icon size, in pixels, to be used by toolbar items.
105  *
106  * @param obj The toolbar object.
107  * @return The icon size in pixels.
108  *
109  * @see elm_toolbar_icon_size_set() for details.
110  *
111  * @ingroup Toolbar
112  */
113 EAPI int                          elm_toolbar_icon_size_get(const Evas_Object *obj);
114
115 /**
116  * Sets icon lookup order, for toolbar items' icons.
117  *
118  * @param obj The toolbar object.
119  * @param order The icon lookup order.
120  *
121  * Icons added before calling this function will not be affected.
122  * The default lookup order is #ELM_ICON_LOOKUP_THEME_FDO.
123  *
124  * @see elm_toolbar_icon_order_lookup_get()
125  *
126  * @ingroup Toolbar
127  */
128 EAPI void                         elm_toolbar_icon_order_lookup_set(Evas_Object *obj, Elm_Icon_Lookup_Order order);
129
130 /**
131  * Gets the icon lookup order.
132  *
133  * @param obj The toolbar object.
134  * @return The icon lookup order.
135  *
136  * @see elm_toolbar_icon_order_lookup_set() for details.
137  *
138  * @ingroup Toolbar
139  */
140 EAPI Elm_Icon_Lookup_Order        elm_toolbar_icon_order_lookup_get(const Evas_Object *obj);
141
142 /**
143  * Set whether the toolbar should always have an item selected.
144  *
145  * @param obj The toolbar object.
146  * @param wrap @c EINA_TRUE to enable always-select mode or @c EINA_FALSE to
147  * disable it.
148  *
149  * This will cause the toolbar to always have an item selected, and clicking
150  * the selected item will not cause a selected event to be emitted. Enabling this mode
151  * will immediately select the first toolbar item.
152  *
153  * Always-selected is disabled by default.
154  *
155  * @see elm_toolbar_always_select_mode_get().
156  *
157  * @ingroup Toolbar
158  */
159 EAPI void                         elm_toolbar_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select);
160
161 /**
162  * Get whether the toolbar should always have an item selected.
163  *
164  * @param obj The toolbar object.
165  * @return @c EINA_TRUE means an item will always be selected, @c EINA_FALSE indicates
166  * that it is possible to have no items selected. If @p obj is @c NULL, @c EINA_FALSE is returned.
167  *
168  * @see elm_toolbar_always_select_mode_set() for details.
169  *
170  * @ingroup Toolbar
171  */
172 EAPI Eina_Bool                    elm_toolbar_always_select_mode_get(const Evas_Object *obj);
173
174 /**
175  * Set whether the toolbar items' should be selected by the user or not.
176  *
177  * @param obj The toolbar object.
178  * @param wrap @c EINA_TRUE to disable selection or @c EINA_FALSE to
179  * enable it.
180  *
181  * This will turn off the ability to select items entirely and they will
182  * neither appear selected nor emit selected signals. The clicked
183  * callback function will still be called.
184  *
185  * Selection is enabled by default.
186  *
187  * @see elm_toolbar_no_select_mode_get().
188  *
189  * @ingroup Toolbar
190  */
191 EAPI void                         elm_toolbar_no_select_mode_set(Evas_Object *obj, Eina_Bool no_select);
192
193 /**
194  * Set whether the toolbar items' should be selected by the user or not.
195  *
196  * @param obj The toolbar object.
197  * @return @c EINA_TRUE means items can be selected. @c EINA_FALSE indicates
198  * they can't. If @p obj is @c NULL, @c EINA_FALSE is returned.
199  *
200  * @see elm_toolbar_no_select_mode_set() for details.
201  *
202  * @ingroup Toolbar
203  */
204 EAPI Eina_Bool                    elm_toolbar_no_select_mode_get(const Evas_Object *obj);
205
206 /**
207  * Append item to the toolbar.
208  *
209  * @param obj The toolbar object.
210  * @param icon A string with icon name or the absolute path of an image file.
211  * @param label The label of the item.
212  * @param func The function to call when the item is clicked.
213  * @param data The data to associate with the item for related callbacks.
214  * @return The created item or @c NULL upon failure.
215  *
216  * A new item will be created and appended to the toolbar, i.e., will
217  * be set as @b last item.
218  *
219  * Items created with this method can be deleted with
220  * elm_object_item_del().
221  *
222  * Associated @p data can be properly freed when item is deleted if a
223  * callback function is set with elm_object_item_del_cb_set().
224  *
225  * If a function is passed as argument, it will be called everytime this item
226  * is selected, i.e., the user clicks over an unselected item.
227  * If such function isn't needed, just passing
228  * @c NULL as @p func is enough. The same should be done for @p data.
229  *
230  * Toolbar will load icon image from fdo or current theme.
231  * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
232  * If an absolute path is provided it will load it direct from a file.
233  *
234  * @see elm_toolbar_item_icon_set()
235  * @see elm_object_item_del()
236  *
237  * @ingroup Toolbar
238  */
239 EAPI Elm_Object_Item             *elm_toolbar_item_append(Evas_Object *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data);
240
241 /**
242  * Prepend item to the toolbar.
243  *
244  * @param obj The toolbar object.
245  * @param icon A string with icon name or the absolute path of an image file.
246  * @param label The label of the item.
247  * @param func The function to call when the item is clicked.
248  * @param data The data to associate with the item for related callbacks.
249  * @return The created item or @c NULL upon failure.
250  *
251  * A new item will be created and prepended to the toolbar, i.e., will
252  * be set as @b first item.
253  *
254  * Items created with this method can be deleted with
255  * elm_object_item_del().
256  *
257  * Associated @p data can be properly freed when item is deleted if a
258  * callback function is set with elm_object_item_del_cb_set().
259  *
260  * If a function is passed as argument, it will be called everytime this item
261  * is selected, i.e., the user clicks over an unselected item.
262  * If such function isn't needed, just passing
263  * @c NULL as @p func is enough. The same should be done for @p data.
264  *
265  * Toolbar will load icon image from fdo or current theme.
266  * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
267  * If an absolute path is provided it will load it direct from a file.
268  *
269  * @see elm_toolbar_item_icon_set()
270  * @see elm_object_item_del()
271  *
272  * @ingroup Toolbar
273  */
274 EAPI Elm_Object_Item             *elm_toolbar_item_prepend(Evas_Object *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data);
275
276 /**
277  * Insert a new item into the toolbar object before item @p before.
278  *
279  * @param obj The toolbar object.
280  * @param before The toolbar item to insert before.
281  * @param icon A string with icon name or the absolute path of an image file.
282  * @param label The label of the item.
283  * @param func The function to call when the item is clicked.
284  * @param data The data to associate with the item for related callbacks.
285  * @return The created item or @c NULL upon failure.
286  *
287  * A new item will be created and added to the toolbar. Its position in
288  * this toolbar will be just before item @p before.
289  *
290  * Items created with this method can be deleted with
291  * elm_object_item_del().
292  *
293  * Associated @p data can be properly freed when item is deleted if a
294  * callback function is set with elm_object_item_del_cb_set().
295  *
296  * If a function is passed as argument, it will be called everytime this item
297  * is selected, i.e., the user clicks over an unselected item.
298  * If such function isn't needed, just passing
299  * @c NULL as @p func is enough. The same should be done for @p data.
300  *
301  * Toolbar will load icon image from fdo or current theme.
302  * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
303  * If an absolute path is provided it will load it direct from a file.
304  *
305  * @see elm_toolbar_item_icon_set()
306  * @see elm_object_item_del()
307  *
308  * @ingroup Toolbar
309  */
310 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);
311
312 /**
313  * Insert a new item into the toolbar object after item @p after.
314  *
315  * @param obj The toolbar object.
316  * @param after The toolbar item to insert after.
317  * @param icon A string with icon name or the absolute path of an image file.
318  * @param label The label of the item.
319  * @param func The function to call when the item is clicked.
320  * @param data The data to associate with the item for related callbacks.
321  * @return The created item or @c NULL upon failure.
322  *
323  * A new item will be created and added to the toolbar. Its position in
324  * this toolbar will be just after item @p after.
325  *
326  * Items created with this method can be deleted with
327  * elm_object_item_del().
328  *
329  * Associated @p data can be properly freed when item is deleted if a
330  * callback function is set with elm_object_item_del_cb_set().
331  *
332  * If a function is passed as argument, it will be called everytime this item
333  * is selected, i.e., the user clicks over an unselected item.
334  * If such function isn't needed, just passing
335  * @c NULL as @p func is enough. The same should be done for @p data.
336  *
337  * Toolbar will load icon image from fdo or current theme.
338  * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
339  * If an absolute path is provided it will load it direct from a file.
340  *
341  * @see elm_toolbar_item_icon_set()
342  * @see elm_object_item_del()
343  *
344  * @ingroup Toolbar
345  */
346 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);
347
348 /**
349  * Get the first item in the given toolbar widget's list of
350  * items.
351  *
352  * @param obj The toolbar object
353  * @return The first item or @c NULL, if it has no items (and on
354  * errors)
355  *
356  * @see elm_toolbar_item_append()
357  * @see elm_toolbar_last_item_get()
358  *
359  * @ingroup Toolbar
360  */
361 EAPI Elm_Object_Item             *elm_toolbar_first_item_get(const Evas_Object *obj);
362
363 /**
364  * Get the last item in the given toolbar widget's list of
365  * items.
366  *
367  * @param obj The toolbar object
368  * @return The last item or @c NULL, if it has no items (and on
369  * errors)
370  *
371  * @see elm_toolbar_item_prepend()
372  * @see elm_toolbar_first_item_get()
373  *
374  * @ingroup Toolbar
375  */
376 EAPI Elm_Object_Item             *elm_toolbar_last_item_get(const Evas_Object *obj);
377
378 /**
379  * Get the item after @p item in toolbar.
380  *
381  * @param it The toolbar item.
382  * @return The item after @p item, or @c NULL if none or on failure.
383  *
384  * @note If it is the last item, @c NULL will be returned.
385  *
386  * @see elm_toolbar_item_append()
387  *
388  * @ingroup Toolbar
389  */
390 EAPI Elm_Object_Item             *elm_toolbar_item_next_get(const Elm_Object_Item *it);
391
392 /**
393  * Get the item before @p item in toolbar.
394  *
395  * @param item The toolbar item.
396  * @return The item before @p item, or @c NULL if none or on failure.
397  *
398  * @note If it is the first item, @c NULL will be returned.
399  *
400  * @see elm_toolbar_item_prepend()
401  *
402  * @ingroup Toolbar
403  */
404 EAPI Elm_Object_Item             *elm_toolbar_item_prev_get(const Elm_Object_Item *it);
405
406 /**
407  * Set the priority of a toolbar item.
408  *
409  * @param it The toolbar item.
410  * @param priority The item priority. The default is zero.
411  *
412  * This is used only when the toolbar shrink mode is set to
413  * #ELM_TOOLBAR_SHRINK_MENU or #ELM_TOOLBAR_SHRINK_HIDE.
414  * When space is less than required, items with low priority
415  * will be removed from the toolbar and added to a dynamically-created menu,
416  * while items with higher priority will remain on the toolbar,
417  * with the same order they were added.
418  *
419  * @see elm_toolbar_item_priority_get()
420  *
421  * @ingroup Toolbar
422  */
423 EAPI void                         elm_toolbar_item_priority_set(Elm_Object_Item *it, int priority);
424
425 /**
426  * Get the priority of a toolbar item.
427  *
428  * @param it The toolbar item.
429  * @return The @p item priority, or @c 0 on failure.
430  *
431  * @see elm_toolbar_item_priority_set() for details.
432  *
433  * @ingroup Toolbar
434  */
435 EAPI int                          elm_toolbar_item_priority_get(const Elm_Object_Item *it);
436
437 /**
438  * Returns a pointer to a toolbar item by its label.
439  *
440  * @param obj The toolbar object.
441  * @param label The label of the item to find.
442  *
443  * @return The pointer to the toolbar item matching @p label or @c NULL
444  * on failure.
445  *
446  * @ingroup Toolbar
447  */
448 EAPI Elm_Object_Item             *elm_toolbar_item_find_by_label(const Evas_Object *obj, const char *label);
449
450 /*
451  * Get whether the @p item is selected or not.
452  *
453  * @param it The toolbar item.
454  * @return @c EINA_TRUE means item is selected. @c EINA_FALSE indicates
455  * it's not. If @p obj is @c NULL, @c EINA_FALSE is returned.
456  *
457  * @see elm_toolbar_selected_item_set() for details.
458  * @see elm_toolbar_item_selected_get()
459  *
460  * @ingroup Toolbar
461  */
462 EAPI Eina_Bool                    elm_toolbar_item_selected_get(const Elm_Object_Item *it);
463
464 /**
465  * Set the selected state of an item.
466  *
467  * @param it The toolbar item
468  * @param selected The selected state
469  *
470  * This sets the selected state of the given item @p it.
471  * @c EINA_TRUE for selected, @c EINA_FALSE for not selected.
472  *
473  * If a new item is selected the previosly selected will be unselected.
474  * Previoulsy selected item can be get with function
475  * elm_toolbar_selected_item_get().
476  *
477  * Selected items will be highlighted.
478  *
479  * @see elm_toolbar_item_selected_get()
480  * @see elm_toolbar_selected_item_get()
481  *
482  * @ingroup Toolbar
483  */
484 EAPI void                         elm_toolbar_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
485
486 /**
487  * Get the selected item.
488  *
489  * @param obj The toolbar object.
490  * @return The selected toolbar item.
491  *
492  * The selected item can be unselected with function
493  * elm_toolbar_item_selected_set().
494  *
495  * The selected item always will be highlighted on toolbar.
496  *
497  * @see elm_toolbar_selected_items_get()
498  *
499  * @ingroup Toolbar
500  */
501 EAPI Elm_Object_Item             *elm_toolbar_selected_item_get(const Evas_Object *obj);
502
503 /**
504  * Set the icon associated with @p item.
505  *
506  * @param obj The parent of this item.
507  * @param it The toolbar item.
508  * @param icon A string with icon name or the absolute path of an image file.
509  *
510  * Toolbar will load icon image from fdo or current theme.
511  * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
512  * If an absolute path is provided it will load it direct from a file.
513  *
514  * @see elm_toolbar_icon_order_lookup_set()
515  * @see elm_toolbar_icon_order_lookup_get()
516  *
517  * @ingroup Toolbar
518  */
519 EAPI void                         elm_toolbar_item_icon_set(Elm_Object_Item *it, const char *icon);
520
521 /**
522  * Get the string used to set the icon of @p item.
523  *
524  * @param it The toolbar item.
525  * @return The string associated with the icon object.
526  *
527  * @see elm_toolbar_item_icon_set() for details.
528  *
529  * @ingroup Toolbar
530  */
531 EAPI const char                  *elm_toolbar_item_icon_get(const Elm_Object_Item *it);
532
533 /**
534  * Get the object of @p item.
535  *
536  * @param it The toolbar item.
537  * @return The object
538  *
539  * @ingroup Toolbar
540  */
541 EAPI Evas_Object                 *elm_toolbar_item_object_get(const Elm_Object_Item *it);
542
543 /**
544  * Get the icon object of @p item.
545  *
546  * @param it The toolbar item.
547  * @return The icon object
548  *
549  * @see elm_toolbar_item_icon_set(), elm_toolbar_item_icon_file_set(),
550  * or elm_toolbar_item_icon_memfile_set() for details.
551  *
552  * @ingroup Toolbar
553  */
554 EAPI Evas_Object                 *elm_toolbar_item_icon_object_get(Elm_Object_Item *it);
555
556 /**
557  * Set the icon associated with @p item to an image in a binary buffer.
558  *
559  * @param it The toolbar item.
560  * @param img The binary data that will be used as an image
561  * @param size The size of binary data @p img
562  * @param format Optional format of @p img to pass to the image loader
563  * @param key Optional key of @p img to pass to the image loader (eg. if @p img is an edje file)
564  *
565  * @return (@c EINA_TRUE = success, @c EINA_FALSE = error)
566  *
567  * @note The icon image set by this function can be changed by
568  * elm_toolbar_item_icon_set().
569  *
570  * @ingroup Toolbar
571  */
572 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);
573
574 /**
575  * Set the icon associated with @p item to an image in a binary buffer.
576  *
577  * @param it The toolbar item.
578  * @param file The file that contains the image
579  * @param key Optional key of @p img to pass to the image loader (eg. if @p img is an edje file)
580  *
581  * @return (@c EINA_TRUE = success, @c EINA_FALSE = error)
582  *
583  * @note The icon image set by this function can be changed by
584  * elm_toolbar_item_icon_set().
585  *
586  * @ingroup Toolbar
587  */
588 EAPI Eina_Bool                    elm_toolbar_item_icon_file_set(Elm_Object_Item *it, const char *file, const char *key);
589
590 /**
591  * Set or unset item as a separator.
592  *
593  * @param it The toolbar item.
594  * @param setting @c EINA_TRUE to set item @p item as separator or
595  * @c EINA_FALSE to unset, i.e., item will be used as a regular item.
596  *
597  * Items aren't set as separator by default.
598  *
599  * If set as separator it will display separator theme, so won't display
600  * icons or label.
601  *
602  * @see elm_toolbar_item_separator_get()
603  *
604  * @ingroup Toolbar
605  */
606 EAPI void                         elm_toolbar_item_separator_set(Elm_Object_Item *it, Eina_Bool separator);
607
608 /**
609  * Get a value whether item is a separator or not.
610  *
611  * @param it The toolbar item.
612  * @return @c EINA_TRUE means item @p it is a separator. @c EINA_FALSE
613  * indicates it's not. If @p it is @c NULL, @c EINA_FALSE is returned.
614  *
615  * @see elm_toolbar_item_separator_set() for details.
616  *
617  * @ingroup Toolbar
618  */
619 EAPI Eina_Bool                    elm_toolbar_item_separator_get(const Elm_Object_Item *it);
620
621 /**
622  * Set the shrink state of toolbar @p obj.
623  *
624  * @param obj The toolbar object.
625  * @param shrink_mode Toolbar's items display behavior.
626  *
627  * The toolbar won't scroll if #ELM_TOOLBAR_SHRINK_NONE,
628  * but will enforce a minimun size so all the items will fit, won't scroll
629  * and won't show the items that don't fit if #ELM_TOOLBAR_SHRINK_HIDE,
630  * will scroll if #ELM_TOOLBAR_SHRINK_SCROLL, and will create a button to
631  * pop up excess elements with #ELM_TOOLBAR_SHRINK_MENU.
632  *
633  * @ingroup Toolbar
634  */
635 EAPI void                         elm_toolbar_shrink_mode_set(Evas_Object *obj, Elm_Toolbar_Shrink_Mode shrink_mode);
636
637 /**
638  * Get the shrink mode of toolbar @p obj.
639  *
640  * @param obj The toolbar object.
641  * @return Toolbar's items display behavior.
642  *
643  * @see elm_toolbar_shrink_mode_set() for details.
644  *
645  * @ingroup Toolbar
646  */
647 EAPI Elm_Toolbar_Shrink_Mode      elm_toolbar_shrink_mode_get(const Evas_Object *obj);
648
649 /**
650  * Enable/disable homogeneous mode.
651  *
652  * @param obj The toolbar object
653  * @param homogeneous Assume the items within the toolbar are of the
654  * same size (EINA_TRUE = on, EINA_FALSE = off). Default is @c EINA_FALSE.
655  *
656  * This will enable the homogeneous mode where items are of the same size.
657  * @see elm_toolbar_homogeneous_get()
658  *
659  * @ingroup Toolbar
660  */
661 EAPI void                         elm_toolbar_homogeneous_set(Evas_Object *obj, Eina_Bool homogeneous);
662
663 /**
664  * Get whether the homogeneous mode is enabled.
665  *
666  * @param obj The toolbar object.
667  * @return Assume the items within the toolbar are of the same height
668  * and width (EINA_TRUE = on, EINA_FALSE = off).
669  *
670  * @see elm_toolbar_homogeneous_set()
671  *
672  * @ingroup Toolbar
673  */
674 EAPI Eina_Bool                    elm_toolbar_homogeneous_get(const Evas_Object *obj);
675
676 /**
677  * Set the parent object of the toolbar items' menus.
678  *
679  * @param obj The toolbar object.
680  * @param parent The parent of the menu objects.
681  *
682  * Each item can be set as item menu, with elm_toolbar_item_menu_set().
683  *
684  * For more details about setting the parent for toolbar menus, see
685  * elm_menu_parent_set().
686  *
687  * @see elm_menu_parent_set() for details.
688  * @see elm_toolbar_item_menu_set() for details.
689  *
690  * @ingroup Toolbar
691  */
692 EAPI void                         elm_toolbar_menu_parent_set(Evas_Object *obj, Evas_Object *parent);
693
694 /**
695  * Get the parent object of the toolbar items' menus.
696  *
697  * @param obj The toolbar object.
698  * @return The parent of the menu objects.
699  *
700  * @see elm_toolbar_menu_parent_set() for details.
701  *
702  * @ingroup Toolbar
703  */
704 EAPI Evas_Object                 *elm_toolbar_menu_parent_get(const Evas_Object *obj);
705
706 /**
707  * Set the alignment of the items.
708  *
709  * @param obj The toolbar object.
710  * @param align The new alignment, a float between <tt> 0.0 </tt>
711  * and <tt> 1.0 </tt>.
712  *
713  * Alignment of toolbar items, from <tt> 0.0 </tt> to indicates to align
714  * left, to <tt> 1.0 </tt>, to align to right. <tt> 0.5 </tt> centralize
715  * items.
716  *
717  * Centered items by default.
718  *
719  * @see elm_toolbar_align_get()
720  *
721  * @ingroup Toolbar
722  */
723 EAPI void                         elm_toolbar_align_set(Evas_Object *obj, double align);
724
725 /**
726  * Get the alignment of the items.
727  *
728  * @param obj The toolbar object.
729  * @return toolbar items alignment, a float between <tt> 0.0 </tt> and
730  * <tt> 1.0 </tt>.
731  *
732  * @see elm_toolbar_align_set() for details.
733  *
734  * @ingroup Toolbar
735  */
736 EAPI double                       elm_toolbar_align_get(const Evas_Object *obj);
737
738 /**
739  * Set whether the toolbar item opens a menu.
740  *
741  * @param it The toolbar item.
742  * @param menu If @c EINA_TRUE, @p item will opens a menu when selected.
743  *
744  * A toolbar item can be set to be a menu, using this function.
745  *
746  * Once it is set to be a menu, it can be manipulated through the
747  * menu-like function elm_toolbar_menu_parent_set() and the other
748  * elm_menu functions, using the Evas_Object @c menu returned by
749  * elm_toolbar_item_menu_get().
750  *
751  * So, items to be displayed in this item's menu should be added with
752  * elm_menu_item_add().
753  *
754  * The following code exemplifies the most basic usage:
755  * @code
756  * tb = elm_toolbar_add(win)
757  * item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
758  * elm_toolbar_item_menu_set(item, EINA_TRUE);
759  * elm_toolbar_menu_parent_set(tb, win);
760  * menu = elm_toolbar_item_menu_get(item);
761  * elm_menu_item_add(menu, NULL, "edit-cut", "Cut", NULL, NULL);
762  * menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Copy", NULL,
763  * NULL);
764  * @endcode
765  *
766  * @see elm_toolbar_item_menu_get()
767  *
768  * @ingroup Toolbar
769  */
770 EAPI void                         elm_toolbar_item_menu_set(Elm_Object_Item *it, Eina_Bool menu);
771
772 /**
773  * Get toolbar item's menu.
774  *
775  * @param it The toolbar item.
776  * @return Item's menu object or @c NULL on failure.
777  *
778  * If @p item wasn't set as menu item with elm_toolbar_item_menu_set(),
779  * this function will set it.
780  *
781  * @see elm_toolbar_item_menu_set() for details.
782  *
783  * @ingroup Toolbar
784  */
785 EAPI Evas_Object                 *elm_toolbar_item_menu_get(const Elm_Object_Item *it);
786
787 /**
788  * Add a new state to @p item.
789  *
790  * @param it The toolbar item.
791  * @param icon A string with icon name or the absolute path of an image file.
792  * @param label The label of the new state.
793  * @param func The function to call when the item is clicked when this
794  * state is selected.
795  * @param data The data to associate with the state.
796  * @return The toolbar item state, or @c NULL upon failure.
797  *
798  * Toolbar will load icon image from fdo or current theme.
799  * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
800  * If an absolute path is provided it will load it direct from a file.
801  *
802  * States created with this function can be removed with
803  * elm_toolbar_item_state_del().
804  *
805  * @see elm_toolbar_item_state_del()
806  * @see elm_toolbar_item_state_sel()
807  * @see elm_toolbar_item_state_get()
808  *
809  * @ingroup Toolbar
810  */
811 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);
812
813 /**
814  * Delete a previoulsy added state to @p item.
815  *
816  * @param it The toolbar item.
817  * @param state The state to be deleted.
818  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
819  *
820  * @see elm_toolbar_item_state_add()
821  */
822 EAPI Eina_Bool                    elm_toolbar_item_state_del(Elm_Object_Item *it, Elm_Toolbar_Item_State *state);
823
824 /**
825  * Set @p state as the current state of @p it.
826  *
827  * @param it The toolbar item.
828  * @param state The state to use.
829  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
830  *
831  * If @p state is @c NULL, it won't select any state and the default item's
832  * icon and label will be used. It's the same behaviour than
833  * elm_toolbar_item_state_unser().
834  *
835  * @see elm_toolbar_item_state_unset()
836  *
837  * @ingroup Toolbar
838  */
839 EAPI Eina_Bool                    elm_toolbar_item_state_set(Elm_Object_Item *it, Elm_Toolbar_Item_State *state);
840
841 /**
842  * Unset the state of @p it.
843  *
844  * @param it The toolbar item.
845  *
846  * The default icon and label from this item will be displayed.
847  *
848  * @see elm_toolbar_item_state_set() for more details.
849  *
850  * @ingroup Toolbar
851  */
852 EAPI void                         elm_toolbar_item_state_unset(Elm_Object_Item *it);
853
854 /**
855  * Get the current state of @p it.
856  *
857  * @param it The toolbar item.
858  * @return The selected state or @c NULL if none is selected or on failure.
859  *
860  * @see elm_toolbar_item_state_set() for details.
861  * @see elm_toolbar_item_state_unset()
862  * @see elm_toolbar_item_state_add()
863  *
864  * @ingroup Toolbar
865  */
866 EAPI Elm_Toolbar_Item_State      *elm_toolbar_item_state_get(const Elm_Object_Item *it);
867
868 /**
869  * Get the state after selected state in toolbar's @p item.
870  *
871  * @param it The toolbar item to change state.
872  * @return The state after current state, or @c NULL on failure.
873  *
874  * If last state is selected, this function will return first state.
875  *
876  * @see elm_toolbar_item_state_set()
877  * @see elm_toolbar_item_state_add()
878  *
879  * @ingroup Toolbar
880  */
881 EAPI Elm_Toolbar_Item_State      *elm_toolbar_item_state_next(Elm_Object_Item *it);
882
883 /**
884  * Get the state before selected state in toolbar's @p item.
885  *
886  * @param it The toolbar item to change state.
887  * @return The state before current state, or @c NULL on failure.
888  *
889  * If first state is selected, this function will return last state.
890  *
891  * @see elm_toolbar_item_state_set()
892  * @see elm_toolbar_item_state_add()
893  *
894  * @ingroup Toolbar
895  */
896 EAPI Elm_Toolbar_Item_State      *elm_toolbar_item_state_prev(Elm_Object_Item *it);
897
898
899 /**
900  * Change a toolbar's orientation
901  * @param obj The toolbar object
902  * @param horizontal If @c EINA_TRUE, the toolbar is horizontal
903  * By default, a toolbar will be horizontal. Use this function to create a vertical toolbar.
904  * @ingroup Toolbar
905  */
906 EAPI void                         elm_toolbar_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
907
908 /**
909  * Get a toolbar's orientation
910  * @param obj The toolbar object
911  * @return If @c EINA_TRUE, the toolbar is horizontal
912  * By default, a toolbar will be horizontal. Use this function to determine whether a toolbar is vertical.
913  * @ingroup Toolbar
914  */
915 EAPI Eina_Bool                    elm_toolbar_horizontal_get(const Evas_Object *obj);
916
917 /**
918  * Get the number of items in a toolbar
919  * @param obj The toolbar object
920  * @return The number of items in @p obj toolbar
921  * @ingroup Toolbar
922  */
923 EAPI unsigned int                 elm_toolbar_items_count(const Evas_Object *obj);
924 /**
925  * @}
926  */