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_text_set
33 * @li elm_object_item_part_text_set
34 * @li elm_object_item_text_get
35 * @li elm_object_item_part_text_get
38 * @li @ref toolbar_example_01
39 * @li @ref toolbar_example_02
40 * @li @ref toolbar_example_03
49 * @enum _Elm_Toolbar_Shrink_Mode
50 * @typedef Elm_Toolbar_Shrink_Mode
52 * Set toolbar's items display behavior, it can be scrollabel,
53 * show a menu with exceeding items, or simply hide them.
55 * @note Default value is #ELM_TOOLBAR_SHRINK_MENU. It reads value
58 * Values <b> don't </b> work as bitmask, only one can be choosen.
60 * @see elm_toolbar_shrink_mode_set()
61 * @see elm_toolbar_shrink_mode_get()
67 ELM_TOOLBAR_SHRINK_NONE, /**< Set toolbar minimun size to fit all the items. */
68 ELM_TOOLBAR_SHRINK_HIDE, /**< Hide exceeding items. */
69 ELM_TOOLBAR_SHRINK_SCROLL, /**< Allow accessing exceeding items through a scroller. */
70 ELM_TOOLBAR_SHRINK_MENU, /**< Inserts a button to pop up a menu with exceeding items. */
71 ELM_TOOLBAR_SHRINK_LAST /**< Indicates error if returned by elm_toolbar_shrink_mode_get() */
72 } Elm_Toolbar_Shrink_Mode;
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(). */
77 * Add a new toolbar widget to the given parent Elementary
80 * @param parent The parent object.
81 * @return a new toolbar widget handle or @c NULL, on errors.
83 * This function inserts a new toolbar widget on the canvas.
87 EAPI Evas_Object *elm_toolbar_add(Evas_Object *parent);
90 * Set the icon size, in pixels, to be used by toolbar items.
92 * @param obj The toolbar object
93 * @param icon_size The icon size in pixels
95 * @note Default value is @c 32. It reads value from elm config.
97 * @see elm_toolbar_icon_size_get()
101 EAPI void elm_toolbar_icon_size_set(Evas_Object *obj, int icon_size);
104 * Get the icon size, in pixels, to be used by toolbar items.
106 * @param obj The toolbar object.
107 * @return The icon size in pixels.
109 * @see elm_toolbar_icon_size_set() for details.
113 EAPI int elm_toolbar_icon_size_get(const Evas_Object *obj);
116 * Sets icon lookup order, for toolbar items' icons.
118 * @param obj The toolbar object.
119 * @param order The icon lookup order.
121 * Icons added before calling this function will not be affected.
122 * The default lookup order is #ELM_ICON_LOOKUP_THEME_FDO.
124 * @see elm_toolbar_icon_order_lookup_get()
128 EAPI void elm_toolbar_icon_order_lookup_set(Evas_Object *obj, Elm_Icon_Lookup_Order order);
131 * Gets the icon lookup order.
133 * @param obj The toolbar object.
134 * @return The icon lookup order.
136 * @see elm_toolbar_icon_order_lookup_set() for details.
140 EAPI Elm_Icon_Lookup_Order elm_toolbar_icon_order_lookup_get(const Evas_Object *obj);
143 * Set whether the toolbar should always have an item selected.
145 * @param obj The toolbar object.
146 * @param wrap @c EINA_TRUE to enable always-select mode or @c EINA_FALSE to
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.
153 * Always-selected is disabled by default.
155 * @see elm_toolbar_always_select_mode_get().
159 EAPI void elm_toolbar_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select);
162 * Get whether the toolbar should always have an item selected.
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.
168 * @see elm_toolbar_always_select_mode_set() for details.
172 EAPI Eina_Bool elm_toolbar_always_select_mode_get(const Evas_Object *obj);
175 * Set whether the toolbar items' should be selected by the user or not.
177 * @param obj The toolbar object.
178 * @param wrap @c EINA_TRUE to disable selection or @c EINA_FALSE to
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.
185 * Selection is enabled by default.
187 * @see elm_toolbar_no_select_mode_get().
191 EAPI void elm_toolbar_no_select_mode_set(Evas_Object *obj, Eina_Bool no_select);
194 * Set whether the toolbar items' should be selected by the user or not.
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.
200 * @see elm_toolbar_no_select_mode_set() for details.
204 EAPI Eina_Bool elm_toolbar_no_select_mode_get(const Evas_Object *obj);
207 * Append item to the toolbar.
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.
216 * A new item will be created and appended to the toolbar, i.e., will
217 * be set as @b last item.
219 * Items created with this method can be deleted with
220 * elm_toolbar_item_del().
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().
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.
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.
234 * @see elm_toolbar_item_icon_set()
235 * @see elm_toolbar_item_del()
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);
242 * Prepend item to the toolbar.
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.
251 * A new item will be created and prepended to the toolbar, i.e., will
252 * be set as @b first item.
254 * Items created with this method can be deleted with
255 * elm_toolbar_item_del().
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().
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.
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.
269 * @see elm_toolbar_item_icon_set()
270 * @see elm_toolbar_item_del()
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);
277 * Insert a new item into the toolbar object before item @p before.
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.
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.
290 * Items created with this method can be deleted with
291 * elm_toolbar_item_del().
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().
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.
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.
305 * @see elm_toolbar_item_icon_set()
306 * @see elm_toolbar_item_del()
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);
313 * Insert a new item into the toolbar object after item @p after.
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.
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.
326 * Items created with this method can be deleted with
327 * elm_toolbar_item_del().
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().
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.
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.
341 * @see elm_toolbar_item_icon_set()
342 * @see elm_toolbar_item_del()
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);
349 * Get the first item in the given toolbar widget's list of
352 * @param obj The toolbar object
353 * @return The first item or @c NULL, if it has no items (and on
356 * @see elm_toolbar_item_append()
357 * @see elm_toolbar_last_item_get()
361 EAPI Elm_Object_Item *elm_toolbar_first_item_get(const Evas_Object *obj);
364 * Get the last item in the given toolbar widget's list of
367 * @param obj The toolbar object
368 * @return The last item or @c NULL, if it has no items (and on
371 * @see elm_toolbar_item_prepend()
372 * @see elm_toolbar_first_item_get()
376 EAPI Elm_Object_Item *elm_toolbar_last_item_get(const Evas_Object *obj);
379 * Get the item after @p item in toolbar.
381 * @param it The toolbar item.
382 * @return The item after @p item, or @c NULL if none or on failure.
384 * @note If it is the last item, @c NULL will be returned.
386 * @see elm_toolbar_item_append()
390 EAPI Elm_Object_Item *elm_toolbar_item_next_get(const Elm_Object_Item *it);
393 * Get the item before @p item in toolbar.
395 * @param item The toolbar item.
396 * @return The item before @p item, or @c NULL if none or on failure.
398 * @note If it is the first item, @c NULL will be returned.
400 * @see elm_toolbar_item_prepend()
404 EAPI Elm_Object_Item *elm_toolbar_item_prev_get(const Elm_Object_Item *it);
407 * Set the priority of a toolbar item.
409 * @param it The toolbar item.
410 * @param priority The item priority. The default is zero.
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.
419 * @see elm_toolbar_item_priority_get()
423 EAPI void elm_toolbar_item_priority_set(Elm_Object_Item *it, int priority);
426 * Get the priority of a toolbar item.
428 * @param it The toolbar item.
429 * @return The @p item priority, or @c 0 on failure.
431 * @see elm_toolbar_item_priority_set() for details.
435 EAPI int elm_toolbar_item_priority_get(const Elm_Object_Item *it);
438 * Returns a pointer to a toolbar item by its label.
440 * @param obj The toolbar object.
441 * @param label The label of the item to find.
443 * @return The pointer to the toolbar item matching @p label or @c NULL
448 EAPI Elm_Object_Item *elm_toolbar_item_find_by_label(const Evas_Object *obj, const char *label);
451 * Get whether the @p item is selected or not.
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.
457 * @see elm_toolbar_selected_item_set() for details.
458 * @see elm_toolbar_item_selected_get()
462 EAPI Eina_Bool elm_toolbar_item_selected_get(const Elm_Object_Item *it);
465 * Set the selected state of an item.
467 * @param it The toolbar item
468 * @param selected The selected state
470 * This sets the selected state of the given item @p it.
471 * @c EINA_TRUE for selected, @c EINA_FALSE for not selected.
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().
477 * Selected items will be highlighted.
479 * @see elm_toolbar_item_selected_get()
480 * @see elm_toolbar_selected_item_get()
484 EAPI void elm_toolbar_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
487 * Get the selected item.
489 * @param obj The toolbar object.
490 * @return The selected toolbar item.
492 * The selected item can be unselected with function
493 * elm_toolbar_item_selected_set().
495 * The selected item always will be highlighted on toolbar.
497 * @see elm_toolbar_selected_items_get()
501 EAPI Elm_Object_Item *elm_toolbar_selected_item_get(const Evas_Object *obj);
504 * Set the icon associated with @p item.
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.
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.
514 * @see elm_toolbar_icon_order_lookup_set()
515 * @see elm_toolbar_icon_order_lookup_get()
519 EAPI void elm_toolbar_item_icon_set(Elm_Object_Item *it, const char *icon);
522 * Get the string used to set the icon of @p item.
524 * @param it The toolbar item.
525 * @return The string associated with the icon object.
527 * @see elm_toolbar_item_icon_set() for details.
531 EAPI const char *elm_toolbar_item_icon_get(const Elm_Object_Item *it);
534 * Get the object of @p item.
536 * @param it The toolbar item.
541 EAPI Evas_Object *elm_toolbar_item_object_get(const Elm_Object_Item *it);
544 * Get the icon object of @p item.
546 * @param it The toolbar item.
547 * @return The icon object
549 * @see elm_toolbar_item_icon_set(), elm_toolbar_item_icon_file_set(),
550 * or elm_toolbar_item_icon_memfile_set() for details.
554 EAPI Evas_Object *elm_toolbar_item_icon_object_get(Elm_Object_Item *it);
557 * Set the icon associated with @p item to an image in a binary buffer.
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)
565 * @return (@c EINA_TRUE = success, @c EINA_FALSE = error)
567 * @note The icon image set by this function can be changed by
568 * elm_toolbar_item_icon_set().
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);
575 * Set the icon associated with @p item to an image in a binary buffer.
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)
581 * @return (@c EINA_TRUE = success, @c EINA_FALSE = error)
583 * @note The icon image set by this function can be changed by
584 * elm_toolbar_item_icon_set().
588 EAPI Eina_Bool elm_toolbar_item_icon_file_set(Elm_Object_Item *it, const char *file, const char *key);
591 * Delete them item from the toolbar.
593 * @param it The item of toolbar to be deleted.
595 * @see elm_toolbar_item_append()
599 EAPI void elm_toolbar_item_del(Elm_Object_Item *it);
603 * Set or unset item as a separator.
605 * @param it The toolbar item.
606 * @param setting @c EINA_TRUE to set item @p item as separator or
607 * @c EINA_FALSE to unset, i.e., item will be used as a regular item.
609 * Items aren't set as separator by default.
611 * If set as separator it will display separator theme, so won't display
614 * @see elm_toolbar_item_separator_get()
618 EAPI void elm_toolbar_item_separator_set(Elm_Object_Item *it, Eina_Bool separator);
621 * Get a value whether item is a separator or not.
623 * @param it The toolbar item.
624 * @return @c EINA_TRUE means item @p it is a separator. @c EINA_FALSE
625 * indicates it's not. If @p it is @c NULL, @c EINA_FALSE is returned.
627 * @see elm_toolbar_item_separator_set() for details.
631 EAPI Eina_Bool elm_toolbar_item_separator_get(const Elm_Object_Item *it);
634 * Set the shrink state of toolbar @p obj.
636 * @param obj The toolbar object.
637 * @param shrink_mode Toolbar's items display behavior.
639 * The toolbar won't scroll if #ELM_TOOLBAR_SHRINK_NONE,
640 * but will enforce a minimun size so all the items will fit, won't scroll
641 * and won't show the items that don't fit if #ELM_TOOLBAR_SHRINK_HIDE,
642 * will scroll if #ELM_TOOLBAR_SHRINK_SCROLL, and will create a button to
643 * pop up excess elements with #ELM_TOOLBAR_SHRINK_MENU.
647 EAPI void elm_toolbar_shrink_mode_set(Evas_Object *obj, Elm_Toolbar_Shrink_Mode shrink_mode);
650 * Get the shrink mode of toolbar @p obj.
652 * @param obj The toolbar object.
653 * @return Toolbar's items display behavior.
655 * @see elm_toolbar_shrink_mode_set() for details.
659 EAPI Elm_Toolbar_Shrink_Mode elm_toolbar_shrink_mode_get(const Evas_Object *obj);
662 * Enable/disable homogeneous mode.
664 * @param obj The toolbar object
665 * @param homogeneous Assume the items within the toolbar are of the
666 * same size (EINA_TRUE = on, EINA_FALSE = off). Default is @c EINA_FALSE.
668 * This will enable the homogeneous mode where items are of the same size.
669 * @see elm_toolbar_homogeneous_get()
673 EAPI void elm_toolbar_homogeneous_set(Evas_Object *obj, Eina_Bool homogeneous);
676 * Get whether the homogeneous mode is enabled.
678 * @param obj The toolbar object.
679 * @return Assume the items within the toolbar are of the same height
680 * and width (EINA_TRUE = on, EINA_FALSE = off).
682 * @see elm_toolbar_homogeneous_set()
686 EAPI Eina_Bool elm_toolbar_homogeneous_get(const Evas_Object *obj);
689 * Set the parent object of the toolbar items' menus.
691 * @param obj The toolbar object.
692 * @param parent The parent of the menu objects.
694 * Each item can be set as item menu, with elm_toolbar_item_menu_set().
696 * For more details about setting the parent for toolbar menus, see
697 * elm_menu_parent_set().
699 * @see elm_menu_parent_set() for details.
700 * @see elm_toolbar_item_menu_set() for details.
704 EAPI void elm_toolbar_menu_parent_set(Evas_Object *obj, Evas_Object *parent);
707 * Get the parent object of the toolbar items' menus.
709 * @param obj The toolbar object.
710 * @return The parent of the menu objects.
712 * @see elm_toolbar_menu_parent_set() for details.
716 EAPI Evas_Object *elm_toolbar_menu_parent_get(const Evas_Object *obj);
719 * Set the alignment of the items.
721 * @param obj The toolbar object.
722 * @param align The new alignment, a float between <tt> 0.0 </tt>
723 * and <tt> 1.0 </tt>.
725 * Alignment of toolbar items, from <tt> 0.0 </tt> to indicates to align
726 * left, to <tt> 1.0 </tt>, to align to right. <tt> 0.5 </tt> centralize
729 * Centered items by default.
731 * @see elm_toolbar_align_get()
735 EAPI void elm_toolbar_align_set(Evas_Object *obj, double align);
738 * Get the alignment of the items.
740 * @param obj The toolbar object.
741 * @return toolbar items alignment, a float between <tt> 0.0 </tt> and
744 * @see elm_toolbar_align_set() for details.
748 EAPI double elm_toolbar_align_get(const Evas_Object *obj);
751 * Set whether the toolbar item opens a menu.
753 * @param it The toolbar item.
754 * @param menu If @c EINA_TRUE, @p item will opens a menu when selected.
756 * A toolbar item can be set to be a menu, using this function.
758 * Once it is set to be a menu, it can be manipulated through the
759 * menu-like function elm_toolbar_menu_parent_set() and the other
760 * elm_menu functions, using the Evas_Object @c menu returned by
761 * elm_toolbar_item_menu_get().
763 * So, items to be displayed in this item's menu should be added with
764 * elm_menu_item_add().
766 * The following code exemplifies the most basic usage:
768 * tb = elm_toolbar_add(win)
769 * item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
770 * elm_toolbar_item_menu_set(item, EINA_TRUE);
771 * elm_toolbar_menu_parent_set(tb, win);
772 * menu = elm_toolbar_item_menu_get(item);
773 * elm_menu_item_add(menu, NULL, "edit-cut", "Cut", NULL, NULL);
774 * menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Copy", NULL,
778 * @see elm_toolbar_item_menu_get()
782 EAPI void elm_toolbar_item_menu_set(Elm_Object_Item *it, Eina_Bool menu);
785 * Get toolbar item's menu.
787 * @param it The toolbar item.
788 * @return Item's menu object or @c NULL on failure.
790 * If @p item wasn't set as menu item with elm_toolbar_item_menu_set(),
791 * this function will set it.
793 * @see elm_toolbar_item_menu_set() for details.
797 EAPI Evas_Object *elm_toolbar_item_menu_get(const Elm_Object_Item *it);
800 * Add a new state to @p item.
802 * @param it The toolbar item.
803 * @param icon A string with icon name or the absolute path of an image file.
804 * @param label The label of the new state.
805 * @param func The function to call when the item is clicked when this
807 * @param data The data to associate with the state.
808 * @return The toolbar item state, or @c NULL upon failure.
810 * Toolbar will load icon image from fdo or current theme.
811 * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
812 * If an absolute path is provided it will load it direct from a file.
814 * States created with this function can be removed with
815 * elm_toolbar_item_state_del().
817 * @see elm_toolbar_item_state_del()
818 * @see elm_toolbar_item_state_sel()
819 * @see elm_toolbar_item_state_get()
823 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);
826 * Delete a previoulsy added state to @p item.
828 * @param it The toolbar item.
829 * @param state The state to be deleted.
830 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
832 * @see elm_toolbar_item_state_add()
834 EAPI Eina_Bool elm_toolbar_item_state_del(Elm_Object_Item *it, Elm_Toolbar_Item_State *state);
837 * Set @p state as the current state of @p it.
839 * @param it The toolbar item.
840 * @param state The state to use.
841 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
843 * If @p state is @c NULL, it won't select any state and the default item's
844 * icon and label will be used. It's the same behaviour than
845 * elm_toolbar_item_state_unser().
847 * @see elm_toolbar_item_state_unset()
851 EAPI Eina_Bool elm_toolbar_item_state_set(Elm_Object_Item *it, Elm_Toolbar_Item_State *state);
854 * Unset the state of @p it.
856 * @param it The toolbar item.
858 * The default icon and label from this item will be displayed.
860 * @see elm_toolbar_item_state_set() for more details.
864 EAPI void elm_toolbar_item_state_unset(Elm_Object_Item *it);
867 * Get the current state of @p it.
869 * @param it The toolbar item.
870 * @return The selected state or @c NULL if none is selected or on failure.
872 * @see elm_toolbar_item_state_set() for details.
873 * @see elm_toolbar_item_state_unset()
874 * @see elm_toolbar_item_state_add()
878 EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_get(const Elm_Object_Item *it);
881 * Get the state after selected state in toolbar's @p item.
883 * @param it The toolbar item to change state.
884 * @return The state after current state, or @c NULL on failure.
886 * If last state is selected, this function will return first state.
888 * @see elm_toolbar_item_state_set()
889 * @see elm_toolbar_item_state_add()
893 EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_next(Elm_Object_Item *it);
896 * Get the state before selected state in toolbar's @p item.
898 * @param it The toolbar item to change state.
899 * @return The state before current state, or @c NULL on failure.
901 * If first state is selected, this function will return last state.
903 * @see elm_toolbar_item_state_set()
904 * @see elm_toolbar_item_state_add()
908 EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_prev(Elm_Object_Item *it);
911 * Set the text to be shown in a given toolbar item's tooltips.
913 * @param it toolbar item.
914 * @param text The text to set in the content.
916 * Setup the text as tooltip to object. The item can have only one tooltip,
917 * so any previous tooltip data - set with this function or
918 * elm_toolbar_item_tooltip_content_cb_set() - is removed.
920 * @see elm_object_tooltip_text_set() for more details.
924 EAPI void elm_toolbar_item_tooltip_text_set(Elm_Object_Item *it, const char *text);
927 * Set the content to be shown in the tooltip item.
929 * Setup the tooltip to item. The item can have only one tooltip,
930 * so any previous tooltip data is removed. @p func(with @p data) will
931 * be called every time that need show the tooltip and it should
932 * return a valid Evas_Object. This object is then managed fully by
933 * tooltip system and is deleted when the tooltip is gone.
935 * @param it the toolbar item being attached a tooltip.
936 * @param func the function used to create the tooltip contents.
937 * @param data what to provide to @a func as callback data/context.
938 * @param del_cb called when data is not needed anymore, either when
939 * another callback replaces @a func, the tooltip is unset with
940 * elm_toolbar_item_tooltip_unset() or the owner @a item
941 * dies. This callback receives as the first parameter the
942 * given @a data, and @c event_info is the item.
944 * @see elm_object_tooltip_content_cb_set() for more details.
948 EAPI void elm_toolbar_item_tooltip_content_cb_set(Elm_Object_Item *it, Elm_Tooltip_Item_Content_Cb func, const void *data, Evas_Smart_Cb del_cb);
951 * Unset tooltip from item.
953 * @param it toolbar item to remove previously set tooltip.
955 * Remove tooltip from item. The callback provided as del_cb to
956 * elm_toolbar_item_tooltip_content_cb_set() will be called to notify
957 * it is not used anymore.
959 * @see elm_object_tooltip_unset() for more details.
960 * @see elm_toolbar_item_tooltip_content_cb_set()
964 EAPI void elm_toolbar_item_tooltip_unset(Elm_Object_Item *it);
967 * Sets a different style for this item tooltip.
969 * @note before you set a style you should define a tooltip with
970 * elm_toolbar_item_tooltip_content_cb_set() or
971 * elm_toolbar_item_tooltip_text_set()
973 * @param it toolbar item with tooltip already set.
974 * @param style the theme style to use (default, transparent, ...)
976 * @see elm_object_tooltip_style_set() for more details.
980 EAPI void elm_toolbar_item_tooltip_style_set(Elm_Object_Item *it, const char *style);
983 * Get the style for this item tooltip.
985 * @param it toolbar item with tooltip already set.
986 * @return style the theme style in use, defaults to "default". If the
987 * object does not have a tooltip set, then NULL is returned.
989 * @see elm_object_tooltip_style_get() for more details.
990 * @see elm_toolbar_item_tooltip_style_set()
994 EAPI const char *elm_toolbar_item_tooltip_style_get(const Elm_Object_Item *it);
997 * Set the type of mouse pointer/cursor decoration to be shown,
998 * when the mouse pointer is over the given toolbar widget item
1000 * @param it toolbar item to customize cursor on
1001 * @param cursor the cursor type's name
1003 * This function works analogously as elm_object_cursor_set(), but
1004 * here the cursor's changing area is restricted to the item's
1005 * area, and not the whole widget's. Note that that item cursors
1006 * have precedence over widget cursors, so that a mouse over an
1007 * item with custom cursor set will always show @b that cursor.
1009 * If this function is called twice for an object, a previously set
1010 * cursor will be unset on the second call.
1012 * @see elm_object_cursor_set()
1013 * @see elm_toolbar_item_cursor_get()
1014 * @see elm_toolbar_item_cursor_unset()
1018 EAPI void elm_toolbar_item_cursor_set(Elm_Object_Item *it, const char *cursor);
1021 * Get the type of mouse pointer/cursor decoration set to be shown,
1022 * when the mouse pointer is over the given toolbar widget item
1024 * @param it toolbar item with custom cursor set
1025 * @return the cursor type's name or @c NULL, if no custom cursors
1026 * were set to @p item (and on errors)
1028 * @see elm_object_cursor_get()
1029 * @see elm_toolbar_item_cursor_set()
1030 * @see elm_toolbar_item_cursor_unset()
1034 EAPI const char *elm_toolbar_item_cursor_get(const Elm_Object_Item *it);
1037 * Unset any custom mouse pointer/cursor decoration set to be
1038 * shown, when the mouse pointer is over the given toolbar widget
1039 * item, thus making it show the @b default cursor again.
1041 * @param it a toolbar item
1043 * Use this call to undo any custom settings on this item's cursor
1044 * decoration, bringing it back to defaults (no custom style set).
1046 * @see elm_object_cursor_unset()
1047 * @see elm_toolbar_item_cursor_set()
1051 EAPI void elm_toolbar_item_cursor_unset(Elm_Object_Item *it);
1054 * Set a different @b style for a given custom cursor set for a
1057 * @param it toolbar item with custom cursor set
1058 * @param style the <b>theme style</b> to use (e.g. @c "default",
1059 * @c "transparent", etc)
1061 * This function only makes sense when one is using custom mouse
1062 * cursor decorations <b>defined in a theme file</b>, which can have,
1063 * given a cursor name/type, <b>alternate styles</b> on it. It
1064 * works analogously as elm_object_cursor_style_set(), but here
1065 * applyed only to toolbar item objects.
1067 * @warning Before you set a cursor style you should have definen a
1068 * custom cursor previously on the item, with
1069 * elm_toolbar_item_cursor_set()
1071 * @see elm_toolbar_item_cursor_engine_only_set()
1072 * @see elm_toolbar_item_cursor_style_get()
1076 EAPI void elm_toolbar_item_cursor_style_set(Elm_Object_Item *it, const char *style);
1079 * Get the current @b style set for a given toolbar item's custom
1082 * @param it toolbar item with custom cursor set.
1083 * @return style the cursor style in use. If the object does not
1084 * have a cursor set, then @c NULL is returned.
1086 * @see elm_toolbar_item_cursor_style_set() for more details
1090 EAPI const char *elm_toolbar_item_cursor_style_get(const Elm_Object_Item *it);
1093 * Set if the (custom)cursor for a given toolbar item should be
1094 * searched in its theme, also, or should only rely on the
1097 * @param it item with custom (custom) cursor already set on
1098 * @param engine_only Use @c EINA_TRUE to have cursors looked for
1099 * only on those provided by the rendering engine, @c EINA_FALSE to
1100 * have them searched on the widget's theme, as well.
1102 * @note This call is of use only if you've set a custom cursor
1103 * for toolbar items, with elm_toolbar_item_cursor_set().
1105 * @note By default, cursors will only be looked for between those
1106 * provided by the rendering engine.
1110 EAPI void elm_toolbar_item_cursor_engine_only_set(Elm_Object_Item *it, Eina_Bool engine_only);
1113 * Get if the (custom) cursor for a given toolbar item is being
1114 * searched in its theme, also, or is only relying on the rendering
1117 * @param it a toolbar item
1118 * @return @c EINA_TRUE, if cursors are being looked for only on
1119 * those provided by the rendering engine, @c EINA_FALSE if they
1120 * are being searched on the widget's theme, as well.
1122 * @see elm_toolbar_item_cursor_engine_only_set(), for more details
1126 EAPI Eina_Bool elm_toolbar_item_cursor_engine_only_get(const Elm_Object_Item *it);
1129 * Change a toolbar's orientation
1130 * @param obj The toolbar object
1131 * @param horizontal If @c EINA_TRUE, the toolbar is horizontal
1132 * By default, a toolbar will be horizontal. Use this function to create a vertical toolbar.
1135 EAPI void elm_toolbar_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
1138 * Get a toolbar's orientation
1139 * @param obj The toolbar object
1140 * @return If @c EINA_TRUE, the toolbar is horizontal
1141 * By default, a toolbar will be horizontal. Use this function to determine whether a toolbar is vertical.
1144 EAPI Eina_Bool elm_toolbar_horizontal_get(const Evas_Object *obj);
1147 * Get the number of items in a toolbar
1148 * @param obj The toolbar object
1149 * @return The number of items in @p obj toolbar
1152 EAPI unsigned int elm_toolbar_items_count(const Evas_Object *obj);