2 * @defgroup Toolbar Toolbar
5 * @image html img/widget/toolbar/preview-00.png
6 * @image latex img/widget/toolbar/preview-00.eps width=\textwidth
8 * @image html img/toolbar.png
9 * @image latex img/toolbar.eps width=\textwidth
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.
15 * Only one item can be selected at a time.
17 * Items can have multiple states, or show menus when selected by the user.
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
23 * Available styles for it:
25 * - @c "transparent" - no background or shadow, just show the content
27 * Default text parts of the toolbar items that you can use for are:
28 * @li "default" - label of the toolbar item
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
37 * @li @ref toolbar_example_01
38 * @li @ref toolbar_example_02
39 * @li @ref toolbar_example_03
48 * @enum _Elm_Toolbar_Shrink_Mode
49 * @typedef Elm_Toolbar_Shrink_Mode
51 * Set toolbar's items display behavior, it can be scrollable,
52 * show a menu with exceeding items, or simply hide them.
54 * @note Default value is #ELM_TOOLBAR_SHRINK_MENU. It reads value
57 * Values <b> don't </b> work as bitmask, only one can be chosen.
59 * @see elm_toolbar_shrink_mode_set()
60 * @see elm_toolbar_shrink_mode_get()
66 ELM_TOOLBAR_SHRINK_NONE, /**< Set toolbar minimum 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;
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(). */
76 * Add a new toolbar widget to the given parent Elementary
79 * @param parent The parent object.
80 * @return a new toolbar widget handle or @c NULL, on errors.
82 * This function inserts a new toolbar widget on the canvas.
86 EAPI Evas_Object *elm_toolbar_add(Evas_Object *parent);
89 * Set the icon size, in pixels, to be used by toolbar items.
91 * @param obj The toolbar object
92 * @param icon_size The icon size in pixels
94 * @note Default value is @c 32. It reads value from elm config.
96 * @see elm_toolbar_icon_size_get()
100 EAPI void elm_toolbar_icon_size_set(Evas_Object *obj, int icon_size);
103 * Get the icon size, in pixels, to be used by toolbar items.
105 * @param obj The toolbar object.
106 * @return The icon size in pixels.
108 * @see elm_toolbar_icon_size_set() for details.
112 EAPI int elm_toolbar_icon_size_get(const Evas_Object *obj);
115 * Sets icon lookup order, for toolbar items' icons.
117 * @param obj The toolbar object.
118 * @param order The icon lookup order.
120 * Icons added before calling this function will not be affected.
121 * The default lookup order is #ELM_ICON_LOOKUP_THEME_FDO.
123 * @see elm_toolbar_icon_order_lookup_get()
127 EAPI void elm_toolbar_icon_order_lookup_set(Evas_Object *obj, Elm_Icon_Lookup_Order order);
130 * Gets the icon lookup order.
132 * @param obj The toolbar object.
133 * @return The icon lookup order.
135 * @see elm_toolbar_icon_order_lookup_set() for details.
139 EAPI Elm_Icon_Lookup_Order elm_toolbar_icon_order_lookup_get(const Evas_Object *obj);
142 * Set whether the toolbar should always have an item selected.
144 * @param obj The toolbar object.
145 * @param always_select @c EINA_TRUE to enable always-select mode or @c EINA_FALSE to
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.
152 * Always-selected is disabled by default.
154 * @see elm_toolbar_always_select_mode_get().
158 EAPI void elm_toolbar_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select);
161 * Get whether the toolbar should always have an item selected.
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.
167 * @see elm_toolbar_always_select_mode_set() for details.
171 EAPI Eina_Bool elm_toolbar_always_select_mode_get(const Evas_Object *obj);
174 * Set whether the toolbar items' should be selected by the user or not.
176 * @param obj The toolbar object.
177 * @param no_select @c EINA_TRUE to disable selection or @c EINA_FALSE to
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.
184 * Selection is enabled by default.
186 * @see elm_toolbar_no_select_mode_get().
190 EAPI void elm_toolbar_no_select_mode_set(Evas_Object *obj, Eina_Bool no_select);
193 * Set whether the toolbar items' should be selected by the user or not.
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.
199 * @see elm_toolbar_no_select_mode_set() for details.
203 EAPI Eina_Bool elm_toolbar_no_select_mode_get(const Evas_Object *obj);
206 * Append item to the toolbar.
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.
215 * A new item will be created and appended to the toolbar, i.e., will
216 * be set as @b last item.
218 * Items created with this method can be deleted with
219 * elm_object_item_del().
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().
224 * If a function is passed as argument, it will be called every time 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.
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.
233 * @see elm_toolbar_item_icon_set()
234 * @see elm_object_item_del()
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);
241 * Prepend item to the toolbar.
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.
250 * A new item will be created and prepended to the toolbar, i.e., will
251 * be set as @b first item.
253 * Items created with this method can be deleted with
254 * elm_object_item_del().
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().
259 * If a function is passed as argument, it will be called every time 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.
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.
268 * @see elm_toolbar_item_icon_set()
269 * @see elm_object_item_del()
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);
276 * Insert a new item into the toolbar object before item @p before.
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.
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.
289 * Items created with this method can be deleted with
290 * elm_object_item_del().
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().
295 * If a function is passed as argument, it will be called every time 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.
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.
304 * @see elm_toolbar_item_icon_set()
305 * @see elm_object_item_del()
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);
312 * Insert a new item into the toolbar object after item @p after.
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.
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.
325 * Items created with this method can be deleted with
326 * elm_object_item_del().
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().
331 * If a function is passed as argument, it will be called every time 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.
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.
340 * @see elm_toolbar_item_icon_set()
341 * @see elm_object_item_del()
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);
348 * Get the first item in the given toolbar widget's list of
351 * @param obj The toolbar object
352 * @return The first item or @c NULL, if it has no items (and on
355 * @see elm_toolbar_item_append()
356 * @see elm_toolbar_last_item_get()
360 EAPI Elm_Object_Item *elm_toolbar_first_item_get(const Evas_Object *obj);
363 * Get the last item in the given toolbar widget's list of
366 * @param obj The toolbar object
367 * @return The last item or @c NULL, if it has no items (and on
370 * @see elm_toolbar_item_prepend()
371 * @see elm_toolbar_first_item_get()
375 EAPI Elm_Object_Item *elm_toolbar_last_item_get(const Evas_Object *obj);
378 * Get the item after @p item in toolbar.
380 * @param it The toolbar item.
381 * @return The item after @p item, or @c NULL if none or on failure.
383 * @note If it is the last item, @c NULL will be returned.
385 * @see elm_toolbar_item_append()
389 EAPI Elm_Object_Item *elm_toolbar_item_next_get(const Elm_Object_Item *it);
392 * Get the item before @p item in toolbar.
394 * @param it The toolbar item.
395 * @return The item before @p item, or @c NULL if none or on failure.
397 * @note If it is the first item, @c NULL will be returned.
399 * @see elm_toolbar_item_prepend()
403 EAPI Elm_Object_Item *elm_toolbar_item_prev_get(const Elm_Object_Item *it);
406 * Set the priority of a toolbar item.
408 * @param it The toolbar item.
409 * @param priority The item priority. The default is zero.
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.
418 * @see elm_toolbar_item_priority_get()
422 EAPI void elm_toolbar_item_priority_set(Elm_Object_Item *it, int priority);
425 * Get the priority of a toolbar item.
427 * @param it The toolbar item.
428 * @return The @p item priority, or @c 0 on failure.
430 * @see elm_toolbar_item_priority_set() for details.
434 EAPI int elm_toolbar_item_priority_get(const Elm_Object_Item *it);
437 * Returns a pointer to a toolbar item by its label.
439 * @param obj The toolbar object.
440 * @param label The label of the item to find.
442 * @return The pointer to the toolbar item matching @p label or @c NULL
447 EAPI Elm_Object_Item *elm_toolbar_item_find_by_label(const Evas_Object *obj, const char *label);
450 * Get whether the @p item is selected or not.
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.
456 * @see elm_toolbar_selected_item_set() for details.
457 * @see elm_toolbar_item_selected_get()
461 EAPI Eina_Bool elm_toolbar_item_selected_get(const Elm_Object_Item *it);
464 * Set the selected state of an item.
466 * @param it The toolbar item
467 * @param selected The selected state
469 * This sets the selected state of the given item @p it.
470 * @c EINA_TRUE for selected, @c EINA_FALSE for not selected.
472 * If a new item is selected the previously selected will be unselected.
473 * Previously selected item can be get with function
474 * elm_toolbar_selected_item_get().
476 * Selected items will be highlighted.
478 * @see elm_toolbar_item_selected_get()
479 * @see elm_toolbar_selected_item_get()
483 EAPI void elm_toolbar_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
486 * Get the selected item.
488 * @param obj The toolbar object.
489 * @return The selected toolbar item.
491 * The selected item can be unselected with function
492 * elm_toolbar_item_selected_set().
494 * The selected item always will be highlighted on toolbar.
496 * @see elm_toolbar_selected_items_get()
500 EAPI Elm_Object_Item *elm_toolbar_selected_item_get(const Evas_Object *obj);
503 * Set the icon associated with @p item.
505 * @param it The toolbar item.
506 * @param icon A string with icon name or the absolute path of an image file.
508 * Toolbar will load icon image from fdo or current theme.
509 * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
510 * If an absolute path is provided it will load it direct from a file.
512 * @see elm_toolbar_icon_order_lookup_set()
513 * @see elm_toolbar_icon_order_lookup_get()
517 EAPI void elm_toolbar_item_icon_set(Elm_Object_Item *it, const char *icon);
520 * Get the string used to set the icon of @p item.
522 * @param it The toolbar item.
523 * @return The string associated with the icon object.
525 * @see elm_toolbar_item_icon_set() for details.
529 EAPI const char *elm_toolbar_item_icon_get(const Elm_Object_Item *it);
532 * Get the object of @p item.
534 * @param it The toolbar item.
539 EAPI Evas_Object *elm_toolbar_item_object_get(const Elm_Object_Item *it);
542 * Get the icon object of @p item.
544 * @param it The toolbar item.
545 * @return The icon object
547 * @see elm_toolbar_item_icon_set(), elm_toolbar_item_icon_file_set(),
548 * or elm_toolbar_item_icon_memfile_set() for details.
552 EAPI Evas_Object *elm_toolbar_item_icon_object_get(Elm_Object_Item *it);
555 * Set the icon associated with @p item to an image in a binary buffer.
557 * @param it The toolbar item.
558 * @param img The binary data that will be used as an image
559 * @param size The size of binary data @p img
560 * @param format Optional format of @p img to pass to the image loader
561 * @param key Optional key of @p img to pass to the image loader (eg. if @p img is an edje file)
563 * @return (@c EINA_TRUE = success, @c EINA_FALSE = error)
565 * @note The icon image set by this function can be changed by
566 * elm_toolbar_item_icon_set().
570 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 * Set the icon associated with @p item to an image in a binary buffer.
575 * @param it The toolbar item.
576 * @param file The file that contains the image
577 * @param key Optional key of @p img to pass to the image loader (eg. if @p img is an edje file)
579 * @return (@c EINA_TRUE = success, @c EINA_FALSE = error)
581 * @note The icon image set by this function can be changed by
582 * elm_toolbar_item_icon_set().
586 EAPI Eina_Bool elm_toolbar_item_icon_file_set(Elm_Object_Item *it, const char *file, const char *key);
589 * Set or unset item as a separator.
591 * @param it The toolbar item.
592 * @param separator @c EINA_TRUE to set item @p item as separator or
593 * @c EINA_FALSE to unset, i.e., item will be used as a regular item.
595 * Items aren't set as separator by default.
597 * If set as separator it will display separator theme, so won't display
600 * @see elm_toolbar_item_separator_get()
604 EAPI void elm_toolbar_item_separator_set(Elm_Object_Item *it, Eina_Bool separator);
607 * Get a value whether item is a separator or not.
609 * @param it The toolbar item.
610 * @return @c EINA_TRUE means item @p it is a separator. @c EINA_FALSE
611 * indicates it's not. If @p it is @c NULL, @c EINA_FALSE is returned.
613 * @see elm_toolbar_item_separator_set() for details.
617 EAPI Eina_Bool elm_toolbar_item_separator_get(const Elm_Object_Item *it);
620 * Set the shrink state of toolbar @p obj.
622 * @param obj The toolbar object.
623 * @param shrink_mode Toolbar's items display behavior.
625 * The toolbar won't scroll if #ELM_TOOLBAR_SHRINK_NONE,
626 * but will enforce a minimum size so all the items will fit, won't scroll
627 * and won't show the items that don't fit if #ELM_TOOLBAR_SHRINK_HIDE,
628 * will scroll if #ELM_TOOLBAR_SHRINK_SCROLL, and will create a button to
629 * pop up excess elements with #ELM_TOOLBAR_SHRINK_MENU.
633 EAPI void elm_toolbar_shrink_mode_set(Evas_Object *obj, Elm_Toolbar_Shrink_Mode shrink_mode);
636 * Get the shrink mode of toolbar @p obj.
638 * @param obj The toolbar object.
639 * @return Toolbar's items display behavior.
641 * @see elm_toolbar_shrink_mode_set() for details.
645 EAPI Elm_Toolbar_Shrink_Mode elm_toolbar_shrink_mode_get(const Evas_Object *obj);
648 * Enable/disable homogeneous mode.
650 * @param obj The toolbar object
651 * @param homogeneous Assume the items within the toolbar are of the
652 * same size (EINA_TRUE = on, EINA_FALSE = off). Default is @c EINA_FALSE.
654 * This will enable the homogeneous mode where items are of the same size.
655 * @see elm_toolbar_homogeneous_get()
659 EAPI void elm_toolbar_homogeneous_set(Evas_Object *obj, Eina_Bool homogeneous);
662 * Get whether the homogeneous mode is enabled.
664 * @param obj The toolbar object.
665 * @return Assume the items within the toolbar are of the same height
666 * and width (EINA_TRUE = on, EINA_FALSE = off).
668 * @see elm_toolbar_homogeneous_set()
672 EAPI Eina_Bool elm_toolbar_homogeneous_get(const Evas_Object *obj);
675 * Set the parent object of the toolbar items' menus.
677 * @param obj The toolbar object.
678 * @param parent The parent of the menu objects.
680 * Each item can be set as item menu, with elm_toolbar_item_menu_set().
682 * For more details about setting the parent for toolbar menus, see
683 * elm_menu_parent_set().
685 * @see elm_menu_parent_set() for details.
686 * @see elm_toolbar_item_menu_set() for details.
690 EAPI void elm_toolbar_menu_parent_set(Evas_Object *obj, Evas_Object *parent);
693 * Get the parent object of the toolbar items' menus.
695 * @param obj The toolbar object.
696 * @return The parent of the menu objects.
698 * @see elm_toolbar_menu_parent_set() for details.
702 EAPI Evas_Object *elm_toolbar_menu_parent_get(const Evas_Object *obj);
705 * Set the alignment of the items.
707 * @param obj The toolbar object.
708 * @param align The new alignment, a float between <tt> 0.0 </tt>
709 * and <tt> 1.0 </tt>.
711 * Alignment of toolbar items, from <tt> 0.0 </tt> to indicates to align
712 * left, to <tt> 1.0 </tt>, to align to right. <tt> 0.5 </tt> centralize
715 * Centered items by default.
717 * @see elm_toolbar_align_get()
721 EAPI void elm_toolbar_align_set(Evas_Object *obj, double align);
724 * Get the alignment of the items.
726 * @param obj The toolbar object.
727 * @return toolbar items alignment, a float between <tt> 0.0 </tt> and
730 * @see elm_toolbar_align_set() for details.
734 EAPI double elm_toolbar_align_get(const Evas_Object *obj);
737 * Set whether the toolbar item opens a menu.
739 * @param it The toolbar item.
740 * @param menu If @c EINA_TRUE, @p item will opens a menu when selected.
742 * A toolbar item can be set to be a menu, using this function.
744 * Once it is set to be a menu, it can be manipulated through the
745 * menu-like function elm_toolbar_menu_parent_set() and the other
746 * elm_menu functions, using the Evas_Object @c menu returned by
747 * elm_toolbar_item_menu_get().
749 * So, items to be displayed in this item's menu should be added with
750 * elm_menu_item_add().
752 * The following code exemplifies the most basic usage:
754 * tb = elm_toolbar_add(win)
755 * item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
756 * elm_toolbar_item_menu_set(item, EINA_TRUE);
757 * elm_toolbar_menu_parent_set(tb, win);
758 * menu = elm_toolbar_item_menu_get(item);
759 * elm_menu_item_add(menu, NULL, "edit-cut", "Cut", NULL, NULL);
760 * menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Copy", NULL,
764 * @see elm_toolbar_item_menu_get()
768 EAPI void elm_toolbar_item_menu_set(Elm_Object_Item *it, Eina_Bool menu);
771 * Get toolbar item's menu.
773 * @param it The toolbar item.
774 * @return Item's menu object or @c NULL on failure.
776 * If @p item wasn't set as menu item with elm_toolbar_item_menu_set(),
777 * this function will set it.
779 * @see elm_toolbar_item_menu_set() for details.
783 EAPI Evas_Object *elm_toolbar_item_menu_get(const Elm_Object_Item *it);
786 * Add a new state to @p item.
788 * @param it The toolbar item.
789 * @param icon A string with icon name or the absolute path of an image file.
790 * @param label The label of the new state.
791 * @param func The function to call when the item is clicked when this
793 * @param data The data to associate with the state.
794 * @return The toolbar item state, or @c NULL upon failure.
796 * Toolbar will load icon image from fdo or current theme.
797 * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
798 * If an absolute path is provided it will load it direct from a file.
800 * States created with this function can be removed with
801 * elm_toolbar_item_state_del().
803 * @see elm_toolbar_item_state_del()
804 * @see elm_toolbar_item_state_sel()
805 * @see elm_toolbar_item_state_get()
809 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 * Delete a previously added state to @p item.
814 * @param it The toolbar item.
815 * @param state The state to be deleted.
816 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
818 * @see elm_toolbar_item_state_add()
820 EAPI Eina_Bool elm_toolbar_item_state_del(Elm_Object_Item *it, Elm_Toolbar_Item_State *state);
823 * Set @p state as the current state of @p it.
825 * @param it The toolbar item.
826 * @param state The state to use.
827 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
829 * If @p state is @c NULL, it won't select any state and the default item's
830 * icon and label will be used. It's the same behaviour than
831 * elm_toolbar_item_state_unset().
833 * @see elm_toolbar_item_state_unset()
837 EAPI Eina_Bool elm_toolbar_item_state_set(Elm_Object_Item *it, Elm_Toolbar_Item_State *state);
840 * Unset the state of @p it.
842 * @param it The toolbar item.
844 * The default icon and label from this item will be displayed.
846 * @see elm_toolbar_item_state_set() for more details.
850 EAPI void elm_toolbar_item_state_unset(Elm_Object_Item *it);
853 * Get the current state of @p it.
855 * @param it The toolbar item.
856 * @return The selected state or @c NULL if none is selected or on failure.
858 * @see elm_toolbar_item_state_set() for details.
859 * @see elm_toolbar_item_state_unset()
860 * @see elm_toolbar_item_state_add()
864 EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_get(const Elm_Object_Item *it);
867 * Get the state after selected state in toolbar's @p item.
869 * @param it The toolbar item to change state.
870 * @return The state after current state, or @c NULL on failure.
872 * If last state is selected, this function will return first state.
874 * @see elm_toolbar_item_state_set()
875 * @see elm_toolbar_item_state_add()
879 EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_next(Elm_Object_Item *it);
882 * Get the state before selected state in toolbar's @p item.
884 * @param it The toolbar item to change state.
885 * @return The state before current state, or @c NULL on failure.
887 * If first state is selected, this function will return last state.
889 * @see elm_toolbar_item_state_set()
890 * @see elm_toolbar_item_state_add()
894 EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_prev(Elm_Object_Item *it);
898 * Change a toolbar's orientation
899 * @param obj The toolbar object
900 * @param horizontal If @c EINA_TRUE, the toolbar is horizontal
901 * By default, a toolbar will be horizontal. Use this function to create a vertical toolbar.
904 EAPI void elm_toolbar_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
907 * Get a toolbar's orientation
908 * @param obj The toolbar object
909 * @return If @c EINA_TRUE, the toolbar is horizontal
910 * By default, a toolbar will be horizontal. Use this function to determine whether a toolbar is vertical.
913 EAPI Eina_Bool elm_toolbar_horizontal_get(const Evas_Object *obj);
916 * Get the number of items in a toolbar
917 * @param obj The toolbar object
918 * @return The number of items in @p obj toolbar
921 EAPI unsigned int elm_toolbar_items_count(const Evas_Object *obj);