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_mode_shrink_set()
61 * @see elm_toolbar_mode_shrink_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_toolbar_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()
236 * @see elm_toolbar_item_del_cb_set()
240 EAPI Elm_Object_Item *elm_toolbar_item_append(Evas_Object *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data);
243 * Prepend item to the toolbar.
245 * @param obj The toolbar object.
246 * @param icon A string with icon name or the absolute path of an image file.
247 * @param label The label of the item.
248 * @param func The function to call when the item is clicked.
249 * @param data The data to associate with the item for related callbacks.
250 * @return The created item or @c NULL upon failure.
252 * A new item will be created and prepended to the toolbar, i.e., will
253 * be set as @b first item.
255 * Items created with this method can be deleted with
256 * elm_toolbar_item_del().
258 * Associated @p data can be properly freed when item is deleted if a
259 * callback function is set with elm_toolbar_item_del_cb_set().
261 * If a function is passed as argument, it will be called everytime this item
262 * is selected, i.e., the user clicks over an unselected item.
263 * If such function isn't needed, just passing
264 * @c NULL as @p func is enough. The same should be done for @p data.
266 * Toolbar will load icon image from fdo or current theme.
267 * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
268 * If an absolute path is provided it will load it direct from a file.
270 * @see elm_toolbar_item_icon_set()
271 * @see elm_toolbar_item_del()
272 * @see elm_toolbar_item_del_cb_set()
276 EAPI Elm_Object_Item *elm_toolbar_item_prepend(Evas_Object *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data);
279 * Insert a new item into the toolbar object before item @p before.
281 * @param obj The toolbar object.
282 * @param before The toolbar item to insert before.
283 * @param icon A string with icon name or the absolute path of an image file.
284 * @param label The label of the item.
285 * @param func The function to call when the item is clicked.
286 * @param data The data to associate with the item for related callbacks.
287 * @return The created item or @c NULL upon failure.
289 * A new item will be created and added to the toolbar. Its position in
290 * this toolbar will be just before item @p before.
292 * Items created with this method can be deleted with
293 * elm_toolbar_item_del().
295 * Associated @p data can be properly freed when item is deleted if a
296 * callback function is set with elm_toolbar_item_del_cb_set().
298 * If a function is passed as argument, it will be called everytime this item
299 * is selected, i.e., the user clicks over an unselected item.
300 * If such function isn't needed, just passing
301 * @c NULL as @p func is enough. The same should be done for @p data.
303 * Toolbar will load icon image from fdo or current theme.
304 * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
305 * If an absolute path is provided it will load it direct from a file.
307 * @see elm_toolbar_item_icon_set()
308 * @see elm_toolbar_item_del()
309 * @see elm_toolbar_item_del_cb_set()
313 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);
316 * Insert a new item into the toolbar object after item @p after.
318 * @param obj The toolbar object.
319 * @param after The toolbar item to insert after.
320 * @param icon A string with icon name or the absolute path of an image file.
321 * @param label The label of the item.
322 * @param func The function to call when the item is clicked.
323 * @param data The data to associate with the item for related callbacks.
324 * @return The created item or @c NULL upon failure.
326 * A new item will be created and added to the toolbar. Its position in
327 * this toolbar will be just after item @p after.
329 * Items created with this method can be deleted with
330 * elm_toolbar_item_del().
332 * Associated @p data can be properly freed when item is deleted if a
333 * callback function is set with elm_toolbar_item_del_cb_set().
335 * If a function is passed as argument, it will be called everytime this item
336 * is selected, i.e., the user clicks over an unselected item.
337 * If such function isn't needed, just passing
338 * @c NULL as @p func is enough. The same should be done for @p data.
340 * Toolbar will load icon image from fdo or current theme.
341 * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
342 * If an absolute path is provided it will load it direct from a file.
344 * @see elm_toolbar_item_icon_set()
345 * @see elm_toolbar_item_del()
346 * @see elm_toolbar_item_del_cb_set()
350 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);
353 * Get the first item in the given toolbar widget's list of
356 * @param obj The toolbar object
357 * @return The first item or @c NULL, if it has no items (and on
360 * @see elm_toolbar_item_append()
361 * @see elm_toolbar_last_item_get()
365 EAPI Elm_Object_Item *elm_toolbar_first_item_get(const Evas_Object *obj);
368 * Get the last item in the given toolbar widget's list of
371 * @param obj The toolbar object
372 * @return The last item or @c NULL, if it has no items (and on
375 * @see elm_toolbar_item_prepend()
376 * @see elm_toolbar_first_item_get()
380 EAPI Elm_Object_Item *elm_toolbar_last_item_get(const Evas_Object *obj);
383 * Get the item after @p item in toolbar.
385 * @param it The toolbar item.
386 * @return The item after @p item, or @c NULL if none or on failure.
388 * @note If it is the last item, @c NULL will be returned.
390 * @see elm_toolbar_item_append()
394 EAPI Elm_Object_Item *elm_toolbar_item_next_get(const Elm_Object_Item *it);
397 * Get the item before @p item in toolbar.
399 * @param item The toolbar item.
400 * @return The item before @p item, or @c NULL if none or on failure.
402 * @note If it is the first item, @c NULL will be returned.
404 * @see elm_toolbar_item_prepend()
408 EAPI Elm_Object_Item *elm_toolbar_item_prev_get(const Elm_Object_Item *it);
411 * Set the priority of a toolbar item.
413 * @param it The toolbar item.
414 * @param priority The item priority. The default is zero.
416 * This is used only when the toolbar shrink mode is set to
417 * #ELM_TOOLBAR_SHRINK_MENU or #ELM_TOOLBAR_SHRINK_HIDE.
418 * When space is less than required, items with low priority
419 * will be removed from the toolbar and added to a dynamically-created menu,
420 * while items with higher priority will remain on the toolbar,
421 * with the same order they were added.
423 * @see elm_toolbar_item_priority_get()
427 EAPI void elm_toolbar_item_priority_set(Elm_Object_Item *it, int priority);
430 * Get the priority of a toolbar item.
432 * @param it The toolbar item.
433 * @return The @p item priority, or @c 0 on failure.
435 * @see elm_toolbar_item_priority_set() for details.
439 EAPI int elm_toolbar_item_priority_get(const Elm_Object_Item *it);
442 * Returns a pointer to a toolbar item by its label.
444 * @param obj The toolbar object.
445 * @param label The label of the item to find.
447 * @return The pointer to the toolbar item matching @p label or @c NULL
452 EAPI Elm_Object_Item *elm_toolbar_item_find_by_label(const Evas_Object *obj, const char *label);
455 * Get whether the @p item is selected or not.
457 * @param it The toolbar item.
458 * @return @c EINA_TRUE means item is selected. @c EINA_FALSE indicates
459 * it's not. If @p obj is @c NULL, @c EINA_FALSE is returned.
461 * @see elm_toolbar_selected_item_set() for details.
462 * @see elm_toolbar_item_selected_get()
466 EAPI Eina_Bool elm_toolbar_item_selected_get(const Elm_Object_Item *it);
469 * Set the selected state of an item.
471 * @param it The toolbar item
472 * @param selected The selected state
474 * This sets the selected state of the given item @p it.
475 * @c EINA_TRUE for selected, @c EINA_FALSE for not selected.
477 * If a new item is selected the previosly selected will be unselected.
478 * Previoulsy selected item can be get with function
479 * elm_toolbar_selected_item_get().
481 * Selected items will be highlighted.
483 * @see elm_toolbar_item_selected_get()
484 * @see elm_toolbar_selected_item_get()
488 EAPI void elm_toolbar_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
491 * Get the selected item.
493 * @param obj The toolbar object.
494 * @return The selected toolbar item.
496 * The selected item can be unselected with function
497 * elm_toolbar_item_selected_set().
499 * The selected item always will be highlighted on toolbar.
501 * @see elm_toolbar_selected_items_get()
505 EAPI Elm_Object_Item *elm_toolbar_selected_item_get(const Evas_Object *obj);
508 * Set the icon associated with @p item.
510 * @param obj The parent of this item.
511 * @param it The toolbar item.
512 * @param icon A string with icon name or the absolute path of an image file.
514 * Toolbar will load icon image from fdo or current theme.
515 * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
516 * If an absolute path is provided it will load it direct from a file.
518 * @see elm_toolbar_icon_order_lookup_set()
519 * @see elm_toolbar_icon_order_lookup_get()
523 EAPI void elm_toolbar_item_icon_set(Elm_Object_Item *it, const char *icon);
526 * Get the string used to set the icon of @p item.
528 * @param it The toolbar item.
529 * @return The string associated with the icon object.
531 * @see elm_toolbar_item_icon_set() for details.
535 EAPI const char *elm_toolbar_item_icon_get(const Elm_Object_Item *it);
538 * Get the object of @p item.
540 * @param it The toolbar item.
545 EAPI Evas_Object *elm_toolbar_item_object_get(const Elm_Object_Item *it);
548 * Get the icon object of @p item.
550 * @param it The toolbar item.
551 * @return The icon object
553 * @see elm_toolbar_item_icon_set(), elm_toolbar_item_icon_file_set(),
554 * or elm_toolbar_item_icon_memfile_set() for details.
558 EAPI Evas_Object *elm_toolbar_item_icon_object_get(Elm_Object_Item *it);
561 * Set the icon associated with @p item to an image in a binary buffer.
563 * @param it The toolbar item.
564 * @param img The binary data that will be used as an image
565 * @param size The size of binary data @p img
566 * @param format Optional format of @p img to pass to the image loader
567 * @param key Optional key of @p img to pass to the image loader (eg. if @p img is an edje file)
569 * @return (@c EINA_TRUE = success, @c EINA_FALSE = error)
571 * @note The icon image set by this function can be changed by
572 * elm_toolbar_item_icon_set().
576 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);
579 * Set the icon associated with @p item to an image in a binary buffer.
581 * @param it The toolbar item.
582 * @param file The file that contains the image
583 * @param key Optional key of @p img to pass to the image loader (eg. if @p img is an edje file)
585 * @return (@c EINA_TRUE = success, @c EINA_FALSE = error)
587 * @note The icon image set by this function can be changed by
588 * elm_toolbar_item_icon_set().
592 EAPI Eina_Bool elm_toolbar_item_icon_file_set(Elm_Object_Item *it, const char *file, const char *key);
595 * Delete them item from the toolbar.
597 * @param it The item of toolbar to be deleted.
599 * @see elm_toolbar_item_append()
600 * @see elm_toolbar_item_del_cb_set()
604 EAPI void elm_toolbar_item_del(Elm_Object_Item *it);
607 * Set the function called when a toolbar item is freed.
609 * @param it The item to set the callback on.
610 * @param func The function called.
612 * If there is a @p func, then it will be called prior item's memory release.
613 * That will be called with the following arguments:
615 * @li item's Evas object;
618 * This way, a data associated to a toolbar item could be properly freed.
622 EAPI void elm_toolbar_item_del_cb_set(Elm_Object_Item *it, Evas_Smart_Cb func);
625 * Set or unset item as a separator.
627 * @param it The toolbar item.
628 * @param setting @c EINA_TRUE to set item @p item as separator or
629 * @c EINA_FALSE to unset, i.e., item will be used as a regular item.
631 * Items aren't set as separator by default.
633 * If set as separator it will display separator theme, so won't display
636 * @see elm_toolbar_item_separator_get()
640 EAPI void elm_toolbar_item_separator_set(Elm_Object_Item *it, Eina_Bool separator);
643 * Get a value whether item is a separator or not.
645 * @param it The toolbar item.
646 * @return @c EINA_TRUE means item @p it is a separator. @c EINA_FALSE
647 * indicates it's not. If @p it is @c NULL, @c EINA_FALSE is returned.
649 * @see elm_toolbar_item_separator_set() for details.
653 EAPI Eina_Bool elm_toolbar_item_separator_get(const Elm_Object_Item *it);
656 * Set the shrink state of toolbar @p obj.
658 * @param obj The toolbar object.
659 * @param shrink_mode Toolbar's items display behavior.
661 * The toolbar won't scroll if #ELM_TOOLBAR_SHRINK_NONE,
662 * but will enforce a minimun size so all the items will fit, won't scroll
663 * and won't show the items that don't fit if #ELM_TOOLBAR_SHRINK_HIDE,
664 * will scroll if #ELM_TOOLBAR_SHRINK_SCROLL, and will create a button to
665 * pop up excess elements with #ELM_TOOLBAR_SHRINK_MENU.
669 EAPI void elm_toolbar_mode_shrink_set(Evas_Object *obj, Elm_Toolbar_Shrink_Mode shrink_mode);
672 * Get the shrink mode of toolbar @p obj.
674 * @param obj The toolbar object.
675 * @return Toolbar's items display behavior.
677 * @see elm_toolbar_mode_shrink_set() for details.
681 EAPI Elm_Toolbar_Shrink_Mode elm_toolbar_mode_shrink_get(const Evas_Object *obj);
684 * Enable/disable homogeneous mode.
686 * @param obj The toolbar object
687 * @param homogeneous Assume the items within the toolbar are of the
688 * same size (EINA_TRUE = on, EINA_FALSE = off). Default is @c EINA_FALSE.
690 * This will enable the homogeneous mode where items are of the same size.
691 * @see elm_toolbar_homogeneous_get()
695 EAPI void elm_toolbar_homogeneous_set(Evas_Object *obj, Eina_Bool homogeneous);
698 * Get whether the homogeneous mode is enabled.
700 * @param obj The toolbar object.
701 * @return Assume the items within the toolbar are of the same height
702 * and width (EINA_TRUE = on, EINA_FALSE = off).
704 * @see elm_toolbar_homogeneous_set()
708 EAPI Eina_Bool elm_toolbar_homogeneous_get(const Evas_Object *obj);
711 * Set the parent object of the toolbar items' menus.
713 * @param obj The toolbar object.
714 * @param parent The parent of the menu objects.
716 * Each item can be set as item menu, with elm_toolbar_item_menu_set().
718 * For more details about setting the parent for toolbar menus, see
719 * elm_menu_parent_set().
721 * @see elm_menu_parent_set() for details.
722 * @see elm_toolbar_item_menu_set() for details.
726 EAPI void elm_toolbar_menu_parent_set(Evas_Object *obj, Evas_Object *parent);
729 * Get the parent object of the toolbar items' menus.
731 * @param obj The toolbar object.
732 * @return The parent of the menu objects.
734 * @see elm_toolbar_menu_parent_set() for details.
738 EAPI Evas_Object *elm_toolbar_menu_parent_get(const Evas_Object *obj);
741 * Set the alignment of the items.
743 * @param obj The toolbar object.
744 * @param align The new alignment, a float between <tt> 0.0 </tt>
745 * and <tt> 1.0 </tt>.
747 * Alignment of toolbar items, from <tt> 0.0 </tt> to indicates to align
748 * left, to <tt> 1.0 </tt>, to align to right. <tt> 0.5 </tt> centralize
751 * Centered items by default.
753 * @see elm_toolbar_align_get()
757 EAPI void elm_toolbar_align_set(Evas_Object *obj, double align);
760 * Get the alignment of the items.
762 * @param obj The toolbar object.
763 * @return toolbar items alignment, a float between <tt> 0.0 </tt> and
766 * @see elm_toolbar_align_set() for details.
770 EAPI double elm_toolbar_align_get(const Evas_Object *obj);
773 * Set whether the toolbar item opens a menu.
775 * @param it The toolbar item.
776 * @param menu If @c EINA_TRUE, @p item will opens a menu when selected.
778 * A toolbar item can be set to be a menu, using this function.
780 * Once it is set to be a menu, it can be manipulated through the
781 * menu-like function elm_toolbar_menu_parent_set() and the other
782 * elm_menu functions, using the Evas_Object @c menu returned by
783 * elm_toolbar_item_menu_get().
785 * So, items to be displayed in this item's menu should be added with
786 * elm_menu_item_add().
788 * The following code exemplifies the most basic usage:
790 * tb = elm_toolbar_add(win)
791 * item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
792 * elm_toolbar_item_menu_set(item, EINA_TRUE);
793 * elm_toolbar_menu_parent_set(tb, win);
794 * menu = elm_toolbar_item_menu_get(item);
795 * elm_menu_item_add(menu, NULL, "edit-cut", "Cut", NULL, NULL);
796 * menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Copy", NULL,
800 * @see elm_toolbar_item_menu_get()
804 EAPI void elm_toolbar_item_menu_set(Elm_Object_Item *it, Eina_Bool menu);
807 * Get toolbar item's menu.
809 * @param it The toolbar item.
810 * @return Item's menu object or @c NULL on failure.
812 * If @p item wasn't set as menu item with elm_toolbar_item_menu_set(),
813 * this function will set it.
815 * @see elm_toolbar_item_menu_set() for details.
819 EAPI Evas_Object *elm_toolbar_item_menu_get(const Elm_Object_Item *it);
822 * Add a new state to @p item.
824 * @param it The toolbar item.
825 * @param icon A string with icon name or the absolute path of an image file.
826 * @param label The label of the new state.
827 * @param func The function to call when the item is clicked when this
829 * @param data The data to associate with the state.
830 * @return The toolbar item state, or @c NULL upon failure.
832 * Toolbar will load icon image from fdo or current theme.
833 * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
834 * If an absolute path is provided it will load it direct from a file.
836 * States created with this function can be removed with
837 * elm_toolbar_item_state_del().
839 * @see elm_toolbar_item_state_del()
840 * @see elm_toolbar_item_state_sel()
841 * @see elm_toolbar_item_state_get()
845 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);
848 * Delete a previoulsy added state to @p item.
850 * @param it The toolbar item.
851 * @param state The state to be deleted.
852 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
854 * @see elm_toolbar_item_state_add()
856 EAPI Eina_Bool elm_toolbar_item_state_del(Elm_Object_Item *it, Elm_Toolbar_Item_State *state);
859 * Set @p state as the current state of @p it.
861 * @param it The toolbar item.
862 * @param state The state to use.
863 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
865 * If @p state is @c NULL, it won't select any state and the default item's
866 * icon and label will be used. It's the same behaviour than
867 * elm_toolbar_item_state_unser().
869 * @see elm_toolbar_item_state_unset()
873 EAPI Eina_Bool elm_toolbar_item_state_set(Elm_Object_Item *it, Elm_Toolbar_Item_State *state);
876 * Unset the state of @p it.
878 * @param it The toolbar item.
880 * The default icon and label from this item will be displayed.
882 * @see elm_toolbar_item_state_set() for more details.
886 EAPI void elm_toolbar_item_state_unset(Elm_Object_Item *it);
889 * Get the current state of @p it.
891 * @param it The toolbar item.
892 * @return The selected state or @c NULL if none is selected or on failure.
894 * @see elm_toolbar_item_state_set() for details.
895 * @see elm_toolbar_item_state_unset()
896 * @see elm_toolbar_item_state_add()
900 EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_get(const Elm_Object_Item *it);
903 * Get the state after selected state in toolbar's @p item.
905 * @param it The toolbar item to change state.
906 * @return The state after current state, or @c NULL on failure.
908 * If last state is selected, this function will return first state.
910 * @see elm_toolbar_item_state_set()
911 * @see elm_toolbar_item_state_add()
915 EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_next(Elm_Object_Item *it);
918 * Get the state before selected state in toolbar's @p item.
920 * @param it The toolbar item to change state.
921 * @return The state before current state, or @c NULL on failure.
923 * If first state is selected, this function will return last state.
925 * @see elm_toolbar_item_state_set()
926 * @see elm_toolbar_item_state_add()
930 EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_prev(Elm_Object_Item *it);
933 * Set the text to be shown in a given toolbar item's tooltips.
935 * @param it toolbar item.
936 * @param text The text to set in the content.
938 * Setup the text as tooltip to object. The item can have only one tooltip,
939 * so any previous tooltip data - set with this function or
940 * elm_toolbar_item_tooltip_content_cb_set() - is removed.
942 * @see elm_object_tooltip_text_set() for more details.
946 EAPI void elm_toolbar_item_tooltip_text_set(Elm_Object_Item *it, const char *text);
949 * Set the content to be shown in the tooltip item.
951 * Setup the tooltip to item. The item can have only one tooltip,
952 * so any previous tooltip data is removed. @p func(with @p data) will
953 * be called every time that need show the tooltip and it should
954 * return a valid Evas_Object. This object is then managed fully by
955 * tooltip system and is deleted when the tooltip is gone.
957 * @param it the toolbar item being attached a tooltip.
958 * @param func the function used to create the tooltip contents.
959 * @param data what to provide to @a func as callback data/context.
960 * @param del_cb called when data is not needed anymore, either when
961 * another callback replaces @a func, the tooltip is unset with
962 * elm_toolbar_item_tooltip_unset() or the owner @a item
963 * dies. This callback receives as the first parameter the
964 * given @a data, and @c event_info is the item.
966 * @see elm_object_tooltip_content_cb_set() for more details.
970 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);
973 * Unset tooltip from item.
975 * @param it toolbar item to remove previously set tooltip.
977 * Remove tooltip from item. The callback provided as del_cb to
978 * elm_toolbar_item_tooltip_content_cb_set() will be called to notify
979 * it is not used anymore.
981 * @see elm_object_tooltip_unset() for more details.
982 * @see elm_toolbar_item_tooltip_content_cb_set()
986 EAPI void elm_toolbar_item_tooltip_unset(Elm_Object_Item *it);
989 * Sets a different style for this item tooltip.
991 * @note before you set a style you should define a tooltip with
992 * elm_toolbar_item_tooltip_content_cb_set() or
993 * elm_toolbar_item_tooltip_text_set()
995 * @param it toolbar item with tooltip already set.
996 * @param style the theme style to use (default, transparent, ...)
998 * @see elm_object_tooltip_style_set() for more details.
1002 EAPI void elm_toolbar_item_tooltip_style_set(Elm_Object_Item *it, const char *style);
1005 * Get the style for this item tooltip.
1007 * @param it toolbar item with tooltip already set.
1008 * @return style the theme style in use, defaults to "default". If the
1009 * object does not have a tooltip set, then NULL is returned.
1011 * @see elm_object_tooltip_style_get() for more details.
1012 * @see elm_toolbar_item_tooltip_style_set()
1016 EAPI const char *elm_toolbar_item_tooltip_style_get(const Elm_Object_Item *it);
1019 * Set the type of mouse pointer/cursor decoration to be shown,
1020 * when the mouse pointer is over the given toolbar widget item
1022 * @param it toolbar item to customize cursor on
1023 * @param cursor the cursor type's name
1025 * This function works analogously as elm_object_cursor_set(), but
1026 * here the cursor's changing area is restricted to the item's
1027 * area, and not the whole widget's. Note that that item cursors
1028 * have precedence over widget cursors, so that a mouse over an
1029 * item with custom cursor set will always show @b that cursor.
1031 * If this function is called twice for an object, a previously set
1032 * cursor will be unset on the second call.
1034 * @see elm_object_cursor_set()
1035 * @see elm_toolbar_item_cursor_get()
1036 * @see elm_toolbar_item_cursor_unset()
1040 EAPI void elm_toolbar_item_cursor_set(Elm_Object_Item *it, const char *cursor);
1043 * Get the type of mouse pointer/cursor decoration set to be shown,
1044 * when the mouse pointer is over the given toolbar widget item
1046 * @param it toolbar item with custom cursor set
1047 * @return the cursor type's name or @c NULL, if no custom cursors
1048 * were set to @p item (and on errors)
1050 * @see elm_object_cursor_get()
1051 * @see elm_toolbar_item_cursor_set()
1052 * @see elm_toolbar_item_cursor_unset()
1056 EAPI const char *elm_toolbar_item_cursor_get(const Elm_Object_Item *it);
1059 * Unset any custom mouse pointer/cursor decoration set to be
1060 * shown, when the mouse pointer is over the given toolbar widget
1061 * item, thus making it show the @b default cursor again.
1063 * @param it a toolbar item
1065 * Use this call to undo any custom settings on this item's cursor
1066 * decoration, bringing it back to defaults (no custom style set).
1068 * @see elm_object_cursor_unset()
1069 * @see elm_toolbar_item_cursor_set()
1073 EAPI void elm_toolbar_item_cursor_unset(Elm_Object_Item *it);
1076 * Set a different @b style for a given custom cursor set for a
1079 * @param it toolbar item with custom cursor set
1080 * @param style the <b>theme style</b> to use (e.g. @c "default",
1081 * @c "transparent", etc)
1083 * This function only makes sense when one is using custom mouse
1084 * cursor decorations <b>defined in a theme file</b>, which can have,
1085 * given a cursor name/type, <b>alternate styles</b> on it. It
1086 * works analogously as elm_object_cursor_style_set(), but here
1087 * applyed only to toolbar item objects.
1089 * @warning Before you set a cursor style you should have definen a
1090 * custom cursor previously on the item, with
1091 * elm_toolbar_item_cursor_set()
1093 * @see elm_toolbar_item_cursor_engine_only_set()
1094 * @see elm_toolbar_item_cursor_style_get()
1098 EAPI void elm_toolbar_item_cursor_style_set(Elm_Object_Item *it, const char *style);
1101 * Get the current @b style set for a given toolbar item's custom
1104 * @param it toolbar item with custom cursor set.
1105 * @return style the cursor style in use. If the object does not
1106 * have a cursor set, then @c NULL is returned.
1108 * @see elm_toolbar_item_cursor_style_set() for more details
1112 EAPI const char *elm_toolbar_item_cursor_style_get(const Elm_Object_Item *it);
1115 * Set if the (custom)cursor for a given toolbar item should be
1116 * searched in its theme, also, or should only rely on the
1119 * @param it item with custom (custom) cursor already set on
1120 * @param engine_only Use @c EINA_TRUE to have cursors looked for
1121 * only on those provided by the rendering engine, @c EINA_FALSE to
1122 * have them searched on the widget's theme, as well.
1124 * @note This call is of use only if you've set a custom cursor
1125 * for toolbar items, with elm_toolbar_item_cursor_set().
1127 * @note By default, cursors will only be looked for between those
1128 * provided by the rendering engine.
1132 EAPI void elm_toolbar_item_cursor_engine_only_set(Elm_Object_Item *it, Eina_Bool engine_only);
1135 * Get if the (custom) cursor for a given toolbar item is being
1136 * searched in its theme, also, or is only relying on the rendering
1139 * @param it a toolbar item
1140 * @return @c EINA_TRUE, if cursors are being looked for only on
1141 * those provided by the rendering engine, @c EINA_FALSE if they
1142 * are being searched on the widget's theme, as well.
1144 * @see elm_toolbar_item_cursor_engine_only_set(), for more details
1148 EAPI Eina_Bool elm_toolbar_item_cursor_engine_only_get(const Elm_Object_Item *it);
1151 * Change a toolbar's orientation
1152 * @param obj The toolbar object
1153 * @param horizontal If @c EINA_TRUE, the toolbar is horizontal
1154 * By default, a toolbar will be horizontal. Use this function to create a vertical toolbar.
1157 EAPI void elm_toolbar_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
1160 * Get a toolbar's orientation
1161 * @param obj The toolbar object
1162 * @return If @c EINA_TRUE, the toolbar is horizontal
1163 * By default, a toolbar will be horizontal. Use this function to determine whether a toolbar is vertical.
1166 EAPI Eina_Bool elm_toolbar_horizontal_get(const Evas_Object *obj);
1169 * Get the number of items in a toolbar
1170 * @param obj The toolbar object
1171 * @return The number of items in @p obj toolbar
1174 EAPI unsigned int elm_toolbar_items_count(const Evas_Object *obj);