2 * @defgroup Toolbar Toolbar
5 * @image html toolbar_inheritance_tree.png
6 * @image latex toolbar_inheritance_tree.eps
8 * @image html img/widget/toolbar/preview-00.png
9 * @image latex img/widget/toolbar/preview-00.eps width=\textwidth
11 * @image html img/toolbar.png
12 * @image latex img/toolbar.eps width=\textwidth
14 * A toolbar is a widget that displays a list of items inside
15 * a box. It can be scrollable, show a menu with items that don't fit
16 * to toolbar size or even crop them.
18 * Only one item can be selected at a time.
20 * Items can have multiple states, or show menus when selected by the user.
22 * This widget implements the @b @ref elm-scrollable-interface
23 * interface, so that all (non-deprecated) functions for the base
24 * @ref Scroller widget also work for toolbars (@since 1.8)
26 * Smart callbacks one can listen to:
27 * - @c "clicked" - when the user clicks on a toolbar item and becomes
29 * - @c "longpressed" - when the toolbar is pressed for a certain
31 * - @c "language,changed" - when the program language changes.
33 * Available styles for it:
35 * - @c "transparent" - no background or shadow, just show the content
37 * Default text parts of the toolbar items that you can use for are:
38 * @li "default" - label of the toolbar item
40 * Supported elm_object_item common APIs.
41 * @li @ref elm_object_item_disabled_set
42 * @li @ref elm_object_item_disabled_get
43 * @li @ref elm_object_item_part_text_set
44 * @li @ref elm_object_item_part_text_get
47 * @li @ref toolbar_example_01
48 * @li @ref toolbar_example_02
49 * @li @ref toolbar_example_03
58 * @enum Elm_Toolbar_Shrink_Mode
59 * @typedef Elm_Toolbar_Shrink_Mode
61 * Set toolbar's items display behavior, it can be scrollable,
62 * show a menu with exceeding items, or simply hide them.
64 * @note Default value is #ELM_TOOLBAR_SHRINK_MENU. It reads value
67 * Values <b> don't </b> work as bitmask, only one can be chosen.
69 * @see elm_toolbar_shrink_mode_set()
70 * @see elm_toolbar_shrink_mode_get()
76 ELM_TOOLBAR_SHRINK_NONE, /**< Set toolbar minimum size to fit all the items. */
77 ELM_TOOLBAR_SHRINK_HIDE, /**< Hide exceeding items. */
78 ELM_TOOLBAR_SHRINK_SCROLL, /**< Allow accessing exceeding items through a scroller. */
79 ELM_TOOLBAR_SHRINK_MENU, /**< Inserts a button to pop up a menu with exceeding items. */
80 ELM_TOOLBAR_SHRINK_EXPAND, /**< Expand all items according the size of the toolbar. */
81 ELM_TOOLBAR_SHRINK_LAST /**< Indicates error if returned by elm_toolbar_shrink_mode_get() */
82 } Elm_Toolbar_Shrink_Mode;
85 * Defines where to position the item in the toolbar.
91 ELM_TOOLBAR_ITEM_SCROLLTO_NONE = 0, /**< no scrollto */
92 ELM_TOOLBAR_ITEM_SCROLLTO_IN = (1 << 0), /**< to the nearest viewport */
93 ELM_TOOLBAR_ITEM_SCROLLTO_FIRST = (1 << 1), /**< to the first of viewport */
94 ELM_TOOLBAR_ITEM_SCROLLTO_MIDDLE = (1 << 2), /**< to the middle of viewport */
95 ELM_TOOLBAR_ITEM_SCROLLTO_LAST = (1 << 3) /**< to the last of viewport */
96 } Elm_Toolbar_Item_Scrollto_Type;
98 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(). */
101 * Add a new toolbar widget to the given parent Elementary
102 * (container) object.
104 * @param parent The parent object.
105 * @return a new toolbar widget handle or @c NULL, on errors.
107 * This function inserts a new toolbar widget on the canvas.
111 EAPI Evas_Object *elm_toolbar_add(Evas_Object *parent);
114 * Set the icon size, in pixels, to be used by toolbar items.
116 * @param obj The toolbar object
117 * @param icon_size The icon size in pixels
119 * @note Default value is @c 32. It reads value from elm config.
121 * @see elm_toolbar_icon_size_get()
125 EAPI void elm_toolbar_icon_size_set(Evas_Object *obj, int icon_size);
128 * Get the icon size, in pixels, to be used by toolbar items.
130 * @param obj The toolbar object.
131 * @return The icon size in pixels.
133 * @see elm_toolbar_icon_size_set() for details.
137 EAPI int elm_toolbar_icon_size_get(const Evas_Object *obj);
140 * Sets icon lookup order, for toolbar items' icons.
142 * @param obj The toolbar object.
143 * @param order The icon lookup order.
145 * Icons added before calling this function will not be affected.
146 * The default lookup order is #ELM_ICON_LOOKUP_THEME_FDO.
148 * @see elm_toolbar_icon_order_lookup_get()
152 EAPI void elm_toolbar_icon_order_lookup_set(Evas_Object *obj, Elm_Icon_Lookup_Order order);
155 * Gets the icon lookup order.
157 * @param obj The toolbar object.
158 * @return The icon lookup order.
160 * @see elm_toolbar_icon_order_lookup_set() for details.
164 EAPI Elm_Icon_Lookup_Order elm_toolbar_icon_order_lookup_get(const Evas_Object *obj);
167 * Append item to the toolbar.
169 * @param obj The toolbar object.
170 * @param icon A string with icon name or the absolute path of an image file.
171 * @param label The label of the item.
172 * @param func The function to call when the item is clicked.
173 * @param data The data to associate with the item for related callbacks.
174 * @return The created item or @c NULL upon failure.
176 * A new item will be created and appended to the toolbar, i.e., will
177 * be set as @b last item.
179 * Items created with this method can be deleted with
180 * elm_object_item_del().
182 * Associated @p data can be properly freed when item is deleted if a
183 * callback function is set with elm_object_item_del_cb_set().
185 * If a function is passed as argument, it will be called every time this item
186 * is selected, i.e., the user clicks over an unselected item.
187 * If such function isn't needed, just passing
188 * @c NULL as @p func is enough. The same should be done for @p data.
190 * Toolbar will load icon image from fdo or current theme.
191 * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
192 * If an absolute path is provided it will load it direct from a file.
194 * @see elm_toolbar_item_icon_set()
195 * @see elm_object_item_del()
199 EAPI Elm_Object_Item *elm_toolbar_item_append(Evas_Object *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data);
202 * Prepend item to the toolbar.
204 * @param obj The toolbar object.
205 * @param icon A string with icon name or the absolute path of an image file.
206 * @param label The label of the item.
207 * @param func The function to call when the item is clicked.
208 * @param data The data to associate with the item for related callbacks.
209 * @return The created item or @c NULL upon failure.
211 * A new item will be created and prepended to the toolbar, i.e., will
212 * be set as @b first item.
214 * Items created with this method can be deleted with
215 * elm_object_item_del().
217 * Associated @p data can be properly freed when item is deleted if a
218 * callback function is set with elm_object_item_del_cb_set().
220 * If a function is passed as argument, it will be called every time this item
221 * is selected, i.e., the user clicks over an unselected item.
222 * If such function isn't needed, just passing
223 * @c NULL as @p func is enough. The same should be done for @p data.
225 * Toolbar will load icon image from fdo or current theme.
226 * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
227 * If an absolute path is provided it will load it direct from a file.
229 * @see elm_toolbar_item_icon_set()
230 * @see elm_object_item_del()
234 EAPI Elm_Object_Item *elm_toolbar_item_prepend(Evas_Object *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data);
237 * Insert a new item into the toolbar object before item @p before.
239 * @param obj The toolbar object.
240 * @param before The toolbar item to insert before.
241 * @param icon A string with icon name or the absolute path of an image file.
242 * @param label The label of the item.
243 * @param func The function to call when the item is clicked.
244 * @param data The data to associate with the item for related callbacks.
245 * @return The created item or @c NULL upon failure.
247 * A new item will be created and added to the toolbar. Its position in
248 * this toolbar will be just before item @p before.
250 * Items created with this method can be deleted with
251 * elm_object_item_del().
253 * Associated @p data can be properly freed when item is deleted if a
254 * callback function is set with elm_object_item_del_cb_set().
256 * If a function is passed as argument, it will be called every time this item
257 * is selected, i.e., the user clicks over an unselected item.
258 * If such function isn't needed, just passing
259 * @c NULL as @p func is enough. The same should be done for @p data.
261 * Toolbar will load icon image from fdo or current theme.
262 * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
263 * If an absolute path is provided it will load it direct from a file.
265 * @see elm_toolbar_item_icon_set()
266 * @see elm_object_item_del()
270 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);
273 * Insert a new item into the toolbar object after item @p after.
275 * @param obj The toolbar object.
276 * @param after The toolbar item to insert after.
277 * @param icon A string with icon name or the absolute path of an image file.
278 * @param label The label of the item.
279 * @param func The function to call when the item is clicked.
280 * @param data The data to associate with the item for related callbacks.
281 * @return The created item or @c NULL upon failure.
283 * A new item will be created and added to the toolbar. Its position in
284 * this toolbar will be just after item @p after.
286 * Items created with this method can be deleted with
287 * elm_object_item_del().
289 * Associated @p data can be properly freed when item is deleted if a
290 * callback function is set with elm_object_item_del_cb_set().
292 * If a function is passed as argument, it will be called every time this item
293 * is selected, i.e., the user clicks over an unselected item.
294 * If such function isn't needed, just passing
295 * @c NULL as @p func is enough. The same should be done for @p data.
297 * Toolbar will load icon image from fdo or current theme.
298 * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
299 * If an absolute path is provided it will load it direct from a file.
301 * @see elm_toolbar_item_icon_set()
302 * @see elm_object_item_del()
306 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);
309 * Get the first item in the given toolbar widget's list of
312 * @param obj The toolbar object
313 * @return The first item or @c NULL, if it has no items (and on
316 * @see elm_toolbar_item_append()
317 * @see elm_toolbar_last_item_get()
321 EAPI Elm_Object_Item *elm_toolbar_first_item_get(const Evas_Object *obj);
324 * Get the last item in the given toolbar widget's list of
327 * @param obj The toolbar object
328 * @return The last item or @c NULL, if it has no items (and on
331 * @see elm_toolbar_item_prepend()
332 * @see elm_toolbar_first_item_get()
336 EAPI Elm_Object_Item *elm_toolbar_last_item_get(const Evas_Object *obj);
339 * Get the item after @p item in toolbar.
341 * @param it The toolbar item.
342 * @return The item after @p item, or @c NULL if none or on failure.
344 * @note If it is the last item, @c NULL will be returned.
346 * @see elm_toolbar_item_append()
350 EAPI Elm_Object_Item *elm_toolbar_item_next_get(const Elm_Object_Item *it);
353 * Get the item before @p item in toolbar.
355 * @param it The toolbar item.
356 * @return The item before @p item, or @c NULL if none or on failure.
358 * @note If it is the first item, @c NULL will be returned.
360 * @see elm_toolbar_item_prepend()
364 EAPI Elm_Object_Item *elm_toolbar_item_prev_get(const Elm_Object_Item *it);
367 * Set the priority of a toolbar item.
369 * @param it The toolbar item.
370 * @param priority The item priority. The default is zero.
372 * This is used only when the toolbar shrink mode is set
373 * to #ELM_TOOLBAR_SHRINK_MENU or #ELM_TOOLBAR_SHRINK_HIDE.
374 * When space is less than required, items with low priority
375 * will be removed from the toolbar and added to a dynamically-created menu,
376 * while items with higher priority will remain on the toolbar,
377 * with the same order they were added.
379 * @see elm_toolbar_item_priority_get()
383 EAPI void elm_toolbar_item_priority_set(Elm_Object_Item *it, int priority);
386 * Get the priority of a toolbar item.
388 * @param it The toolbar item.
389 * @return The @p item priority, or @c 0 on failure.
391 * @see elm_toolbar_item_priority_set() for details.
395 EAPI int elm_toolbar_item_priority_get(const Elm_Object_Item *it);
398 * Returns a pointer to a toolbar item by its label.
400 * @param obj The toolbar object.
401 * @param label The label of the item to find.
403 * @return The pointer to the toolbar item matching @p label or @c NULL
408 EAPI Elm_Object_Item *elm_toolbar_item_find_by_label(const Evas_Object *obj, const char *label);
411 * Get whether the @p item is selected or not.
413 * @param it The toolbar item.
414 * @return @c EINA_TRUE means item is selected. @c EINA_FALSE indicates
415 * it's not. If @p obj is @c NULL, @c EINA_FALSE is returned.
417 * @see elm_toolbar_selected_item_set() for details.
418 * @see elm_toolbar_item_selected_get()
422 EAPI Eina_Bool elm_toolbar_item_selected_get(const Elm_Object_Item *it);
425 * Set the selected state of an item.
427 * @param it The toolbar item
428 * @param selected The selected state
430 * This sets the selected state of the given item @p it.
431 * @c EINA_TRUE for selected, @c EINA_FALSE for not selected.
433 * If a new item is selected the previously selected will be unselected.
434 * Previously selected item can be get with function
435 * elm_toolbar_selected_item_get().
437 * Selected items will be highlighted.
439 * @see elm_toolbar_item_selected_get()
440 * @see elm_toolbar_selected_item_get()
444 EAPI void elm_toolbar_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
447 * Get the selected item.
449 * @param obj The toolbar object.
450 * @return The selected toolbar item.
452 * The selected item can be unselected with function
453 * elm_toolbar_item_selected_set().
455 * The selected item always will be highlighted on toolbar.
457 * @see elm_toolbar_selected_items_get()
461 EAPI Elm_Object_Item *elm_toolbar_selected_item_get(const Evas_Object *obj);
466 * @param obj The toolbar object.
467 * @return The toolbar more item.
469 * The more item can be changed with function
470 * elm_object_item_text_set() and elm_object_item_content_set.
474 EAPI Elm_Object_Item *elm_toolbar_more_item_get(const Evas_Object *obj);
477 * Set the icon associated with @p item.
479 * @param it The toolbar item.
480 * @param icon A string with icon name or the absolute path of an image file.
482 * Toolbar will load icon image from fdo or current theme.
483 * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
484 * If an absolute path is provided it will load it direct from a file.
486 * @see elm_toolbar_icon_order_lookup_set()
487 * @see elm_toolbar_icon_order_lookup_get()
491 EAPI void elm_toolbar_item_icon_set(Elm_Object_Item *it, const char *icon);
494 * Get the string used to set the icon of @p item.
496 * @param it The toolbar item.
497 * @return The string associated with the icon object.
499 * @see elm_toolbar_item_icon_set() for details.
503 EAPI const char *elm_toolbar_item_icon_get(const Elm_Object_Item *it);
506 * Get the object of @p item.
508 * @param it The toolbar item.
513 EAPI Evas_Object *elm_toolbar_item_object_get(const Elm_Object_Item *it);
516 * Get the icon object of @p item.
518 * @param it The toolbar item.
519 * @return The icon object
521 * @see elm_toolbar_item_icon_set(), elm_toolbar_item_icon_file_set(),
522 * or elm_toolbar_item_icon_memfile_set() for details.
526 EAPI Evas_Object *elm_toolbar_item_icon_object_get(Elm_Object_Item *it);
529 * Set the icon associated with @p item to an image in a binary buffer.
531 * @param it The toolbar item.
532 * @param img The binary data that will be used as an image
533 * @param size The size of binary data @p img
534 * @param format Optional format of @p img to pass to the image loader
535 * @param key Optional key of @p img to pass to the image loader (eg. if @p img is an edje file)
537 * @return (@c EINA_TRUE = success, @c EINA_FALSE = error)
539 * @note The icon image set by this function can be changed by
540 * elm_toolbar_item_icon_set().
544 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);
547 * Set the icon associated with @p item to an image in a binary buffer.
549 * @param it The toolbar item.
550 * @param file The file that contains the image
551 * @param key Optional key of @p img to pass to the image loader (eg. if @p img is an edje file)
553 * @return (@c EINA_TRUE = success, @c EINA_FALSE = error)
555 * @note The icon image set by this function can be changed by
556 * elm_toolbar_item_icon_set().
560 EAPI Eina_Bool elm_toolbar_item_icon_file_set(Elm_Object_Item *it, const char *file, const char *key);
563 * Set or unset item as a separator.
565 * @param it The toolbar item.
566 * @param separator @c EINA_TRUE to set item @p item as separator or
567 * @c EINA_FALSE to unset, i.e., item will be used as a regular item.
569 * Items aren't set as separator by default.
571 * If set as separator it will display separator theme, so won't display
574 * @see elm_toolbar_item_separator_get()
578 EAPI void elm_toolbar_item_separator_set(Elm_Object_Item *it, Eina_Bool separator);
581 * Get a value whether item is a separator or not.
583 * @param it The toolbar item.
584 * @return @c EINA_TRUE means item @p it is a separator. @c EINA_FALSE
585 * indicates it's not. If @p it is @c NULL, @c EINA_FALSE is returned.
587 * @see elm_toolbar_item_separator_set() for details.
591 EAPI Eina_Bool elm_toolbar_item_separator_get(const Elm_Object_Item *it);
594 * Set the item displaying mode of a given toolbar widget @p obj.
596 * @param obj The toolbar object handle
597 * @param shrink_mode Toolbar's items display behavior
599 * The toolbar won't scroll under #ELM_TOOLBAR_SHRINK_NONE mode, but
600 * it will enforce a minimum size, so that all the items will fit
601 * inside it. It won't scroll and won't show the items that don't fit
602 * under #ELM_TOOLBAR_SHRINK_HIDE mode. Finally, it'll scroll under
603 * #ELM_TOOLBAR_SHRINK_SCROLL mode, and it will create a button to
604 * aggregate items which didn't fit with the #ELM_TOOLBAR_SHRINK_MENU
607 * @warning This function's behavior will clash with those of
608 * elm_scroller_policy_set(), so use either one of them, but not both.
612 EAPI void elm_toolbar_shrink_mode_set(Evas_Object *obj, Elm_Toolbar_Shrink_Mode shrink_mode);
615 * Get the shrink mode of toolbar @p obj.
617 * @param obj The toolbar object.
618 * @return Toolbar's items display behavior.
620 * @see elm_toolbar_shrink_mode_set() for details.
624 EAPI Elm_Toolbar_Shrink_Mode elm_toolbar_shrink_mode_get(const Evas_Object *obj);
627 * Set the item's transverse expansion of a given toolbar widget @p obj.
629 * @param obj The toolbar object.
630 * @param transverse_expanded The transverse expansion of the item.
631 * (EINA_TRUE = on, EINA_FALSE = off, default = EINA_FALSE)
633 * This will expand the transverse length of the item according the transverse length of the toolbar.
634 * The default is what the transverse length of the item is set according its min value.
638 EAPI void elm_toolbar_transverse_expanded_set(Evas_Object *obj, Eina_Bool transverse_expanded);
641 * Get the transverse expansion of toolbar @p obj.
643 * @param obj The toolbar object.
644 * @return The transverse expansion of the item.
645 * (EINA_TRUE = on, EINA_FALSE = off, default = EINA_FALSE)
647 * @see elm_toolbar_transverse_expand_set() for details.
651 EAPI Eina_Bool elm_toolbar_transverse_expanded_get(const Evas_Object *obj);
654 * Enable/disable homogeneous mode.
656 * @param obj The toolbar object
657 * @param homogeneous Assume the items within the toolbar are of the
658 * same size (EINA_TRUE = on, EINA_FALSE = off). Default is @c EINA_FALSE.
660 * This will enable the homogeneous mode where items are of the same size.
661 * @see elm_toolbar_homogeneous_get()
665 EAPI void elm_toolbar_homogeneous_set(Evas_Object *obj, Eina_Bool homogeneous);
668 * Get whether the homogeneous mode is enabled.
670 * @param obj The toolbar object.
671 * @return Assume the items within the toolbar are of the same height
672 * and width (EINA_TRUE = on, EINA_FALSE = off).
674 * @see elm_toolbar_homogeneous_set()
678 EAPI Eina_Bool elm_toolbar_homogeneous_get(const Evas_Object *obj);
681 * Set the parent object of the toolbar items' menus.
683 * @param obj The toolbar object.
684 * @param parent The parent of the menu objects.
686 * Each item can be set as item menu, with elm_toolbar_item_menu_set().
688 * For more details about setting the parent for toolbar menus, see
689 * elm_menu_parent_set().
691 * @see elm_menu_parent_set() for details.
692 * @see elm_toolbar_item_menu_set() for details.
696 EAPI void elm_toolbar_menu_parent_set(Evas_Object *obj, Evas_Object *parent);
699 * Get the parent object of the toolbar items' menus.
701 * @param obj The toolbar object.
702 * @return The parent of the menu objects.
704 * @see elm_toolbar_menu_parent_set() for details.
708 EAPI Evas_Object *elm_toolbar_menu_parent_get(const Evas_Object *obj);
711 * Set the alignment of the items.
713 * @param obj The toolbar object.
714 * @param align The new alignment, a float between <tt> 0.0 </tt>
715 * and <tt> 1.0 </tt>.
717 * Alignment of toolbar items, from <tt> 0.0 </tt> to indicates to align
718 * left, to <tt> 1.0 </tt>, to align to right. <tt> 0.5 </tt> centralize
721 * Centered items by default.
723 * @see elm_toolbar_align_get()
727 EAPI void elm_toolbar_align_set(Evas_Object *obj, double align);
730 * Get the alignment of the items.
732 * @param obj The toolbar object.
733 * @return toolbar items alignment, a float between <tt> 0.0 </tt> and
736 * @see elm_toolbar_align_set() for details.
740 EAPI double elm_toolbar_align_get(const Evas_Object *obj);
743 * Set whether the toolbar item opens a menu.
745 * @param it The toolbar item.
746 * @param menu If @c EINA_TRUE, @p item will opens a menu when selected.
748 * A toolbar item can be set to be a menu, using this function.
750 * Once it is set to be a menu, it can be manipulated through the
751 * menu-like function elm_toolbar_menu_parent_set() and the other
752 * elm_menu functions, using the Evas_Object @c menu returned by
753 * elm_toolbar_item_menu_get().
755 * So, items to be displayed in this item's menu should be added with
756 * elm_menu_item_add().
758 * The following code exemplifies the most basic usage:
760 * tb = elm_toolbar_add(win)
761 * item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
762 * elm_toolbar_item_menu_set(item, EINA_TRUE);
763 * elm_toolbar_menu_parent_set(tb, win);
764 * menu = elm_toolbar_item_menu_get(item);
765 * elm_menu_item_add(menu, NULL, "edit-cut", "Cut", NULL, NULL);
766 * menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Copy", NULL,
770 * @see elm_toolbar_item_menu_get()
774 EAPI void elm_toolbar_item_menu_set(Elm_Object_Item *it, Eina_Bool menu);
777 * Get toolbar item's menu.
779 * @param it The toolbar item.
780 * @return Item's menu object or @c NULL on failure.
782 * If @p item wasn't set as menu item with elm_toolbar_item_menu_set(),
783 * this function will set it.
785 * @see elm_toolbar_item_menu_set() for details.
789 EAPI Evas_Object *elm_toolbar_item_menu_get(const Elm_Object_Item *it);
792 * Add a new state to @p item.
794 * @param it The toolbar item.
795 * @param icon A string with icon name or the absolute path of an image file.
796 * @param label The label of the new state.
797 * @param func The function to call when the item is clicked when this
799 * @param data The data to associate with the state.
800 * @return The toolbar item state, or @c NULL upon failure.
802 * Toolbar will load icon image from fdo or current theme.
803 * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
804 * If an absolute path is provided it will load it direct from a file.
806 * States created with this function can be removed with
807 * elm_toolbar_item_state_del().
809 * @see elm_toolbar_item_state_del()
810 * @see elm_toolbar_item_state_sel()
811 * @see elm_toolbar_item_state_get()
815 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);
818 * Delete a previously added state to @p item.
820 * @param it The toolbar item.
821 * @param state The state to be deleted.
822 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
824 * @see elm_toolbar_item_state_add()
826 EAPI Eina_Bool elm_toolbar_item_state_del(Elm_Object_Item *it, Elm_Toolbar_Item_State *state);
829 * Set @p state as the current state of @p it.
831 * @param it The toolbar item.
832 * @param state The state to use.
833 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
835 * If @p state is @c NULL, it won't select any state and the default item's
836 * icon and label will be used. It's the same behaviour than
837 * elm_toolbar_item_state_unset().
839 * @see elm_toolbar_item_state_unset()
843 EAPI Eina_Bool elm_toolbar_item_state_set(Elm_Object_Item *it, Elm_Toolbar_Item_State *state);
846 * Unset the state of @p it.
848 * @param it The toolbar item.
850 * The default icon and label from this item will be displayed.
852 * @see elm_toolbar_item_state_set() for more details.
856 EAPI void elm_toolbar_item_state_unset(Elm_Object_Item *it);
859 * Get the current state of @p it.
861 * @param it The toolbar item.
862 * @return The selected state or @c NULL if none is selected or on failure.
864 * @see elm_toolbar_item_state_set() for details.
865 * @see elm_toolbar_item_state_unset()
866 * @see elm_toolbar_item_state_add()
870 EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_get(const Elm_Object_Item *it);
873 * Get the state after selected state in toolbar's @p item.
875 * @param it The toolbar item to change state.
876 * @return The state after current state, or @c NULL on failure.
878 * If last state is selected, this function will return first state.
880 * @see elm_toolbar_item_state_set()
881 * @see elm_toolbar_item_state_add()
885 EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_next(Elm_Object_Item *it);
888 * Get the state before selected state in toolbar's @p item.
890 * @param it The toolbar item to change state.
891 * @return The state before current state, or @c NULL on failure.
893 * If first state is selected, this function will return last state.
895 * @see elm_toolbar_item_state_set()
896 * @see elm_toolbar_item_state_add()
900 EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_prev(Elm_Object_Item *it);
903 * Change a toolbar's orientation
904 * @param obj The toolbar object
905 * @param horizontal If @c EINA_TRUE, the toolbar is horizontal
906 * By default, a toolbar will be horizontal. Use this function to create a vertical toolbar.
909 EAPI void elm_toolbar_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
912 * Get a toolbar's orientation
913 * @param obj The toolbar object
914 * @return If @c EINA_TRUE, the toolbar is horizontal
915 * By default, a toolbar will be horizontal. Use this function to determine whether a toolbar is vertical.
918 EAPI Eina_Bool elm_toolbar_horizontal_get(const Evas_Object *obj);
921 * Get the number of items in a toolbar
922 * @param obj The toolbar object
923 * @return The number of items in @p obj toolbar
926 EAPI unsigned int elm_toolbar_items_count(const Evas_Object *obj);
929 * Set the standard priority of visible items in a toolbar
930 * @param obj The toolbar object
931 * @param priority The standard_priority of visible items
933 * If the priority of the item is up to standard priority, it is shown in basic panel.
934 * The other items are located in more menu or panel. The more menu or panel can be shown when the more item is clicked.
936 * @see elm_toolbar_standard_priority_get()
941 EAPI void elm_toolbar_standard_priority_set(Evas_Object *obj, int priority);
944 * Get the standard_priority of visible items in a toolbar
945 * @param obj The toolbar object
946 * @return The standard priority of items in @p obj toolbar
948 * @see elm_toolbar_standard_priority_set()
953 EAPI int elm_toolbar_standard_priority_get(const Evas_Object *obj);
956 * Set the toolbar select mode.
958 * @param obj The toolbar object
959 * @param mode The select mode
961 * elm_toolbar_select_mode_set() changes item select mode in the toolbar widget.
962 * - ELM_OBJECT_SELECT_MODE_DEFAULT : Items will only call their selection func and
963 * callback when first becoming selected. Any further clicks will
964 * do nothing, unless you set always select mode.
965 * - ELM_OBJECT_SELECT_MODE_ALWAYS : This means that, even if selected,
966 * every click will make the selected callbacks be called.
967 * - ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select items
968 * entirely and they will neither appear selected nor call selected
969 * callback functions.
971 * @see elm_toolbar_select_mode_get()
976 elm_toolbar_select_mode_set(Evas_Object *obj, Elm_Object_Select_Mode mode);
979 * Get the toolbar select mode.
981 * @param obj The toolbar object
982 * @return The select mode
983 * (If getting mode is failed, it returns ELM_OBJECT_SELECT_MODE_MAX)
985 * @see elm_toolbar_select_mode_set()
989 EAPI Elm_Object_Select_Mode
990 elm_toolbar_select_mode_get(const Evas_Object *obj);
995 * @param obj The toolbar object
996 * @param reorder_mode The reorder mode
997 * (EINA_TRUE = on, EINA_FALSE = off)
1001 EAPI void elm_toolbar_reorder_mode_set(Evas_Object *obj, Eina_Bool reorder_mode);
1004 * Get the reorder mode
1006 * @param obj The toolbar object
1007 * @return The reorder mode
1008 * (EINA_TRUE = on, EINA_FALSE = off)
1012 EAPI Eina_Bool elm_toolbar_reorder_mode_get(const Evas_Object *obj);
1015 * Show a specific item, when the toolbar can be scrolled.
1017 * @param it the toolbar item
1019 * see elm_toolbar_item_bring_in()
1024 EAPI void elm_toolbar_item_show(Elm_Object_Item *it, Elm_Toolbar_Item_Scrollto_Type type);
1027 * Show a specific item with scroll animation, when the toolbar can be scrolled.
1029 * @param it the toolbar item
1031 * see elm_toolbar_item_show()
1036 EAPI void elm_toolbar_item_bring_in(Elm_Object_Item *it, Elm_Toolbar_Item_Scrollto_Type type);