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()
65 typedef enum _Elm_Toolbar_Shrink_Mode
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) EINA_ARG_NONNULL(1);
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) EINA_ARG_NONNULL(1);
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) EINA_ARG_NONNULL(1);
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) EINA_ARG_NONNULL(1);
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) EINA_ARG_NONNULL(1);
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) EINA_ARG_NONNULL(1);
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) EINA_ARG_NONNULL(1);
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) EINA_ARG_NONNULL(1);
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) EINA_ARG_NONNULL(1);
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) EINA_ARG_NONNULL(1);
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) EINA_ARG_NONNULL(1);
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) EINA_ARG_NONNULL(1);
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) EINA_ARG_NONNULL(1);
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) EINA_ARG_NONNULL(1);
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) EINA_ARG_NONNULL(1);
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) EINA_ARG_NONNULL(1);
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) EINA_ARG_NONNULL(1);
411 * Get the toolbar object from an item.
413 * @param it The item.
414 * @return The toolbar object.
416 * This returns the toolbar object itself that an item belongs to.
418 * @deprecated use elm_object_item_object_get() instead.
421 EINA_DEPRECATED EAPI Evas_Object *elm_toolbar_item_toolbar_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
424 * Set the priority of a toolbar item.
426 * @param it The toolbar item.
427 * @param priority The item priority. The default is zero.
429 * This is used only when the toolbar shrink mode is set to
430 * #ELM_TOOLBAR_SHRINK_MENU or #ELM_TOOLBAR_SHRINK_HIDE.
431 * When space is less than required, items with low priority
432 * will be removed from the toolbar and added to a dynamically-created menu,
433 * while items with higher priority will remain on the toolbar,
434 * with the same order they were added.
436 * @see elm_toolbar_item_priority_get()
440 EAPI void elm_toolbar_item_priority_set(Elm_Object_Item *it, int priority) EINA_ARG_NONNULL(1);
443 * Get the priority of a toolbar item.
445 * @param it The toolbar item.
446 * @return The @p item priority, or @c 0 on failure.
448 * @see elm_toolbar_item_priority_set() for details.
452 EAPI int elm_toolbar_item_priority_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
455 * Get the label of item.
457 * @param it The item of toolbar.
458 * @return The label of item.
460 * The return value is a pointer to the label associated to @p item when
461 * it was created, with function elm_toolbar_item_append() or similar,
463 * with function elm_toolbar_item_label_set. If no label
464 * was passed as argument, it will return @c NULL.
466 * @see elm_toolbar_item_label_set() for more details.
467 * @see elm_toolbar_item_append()
469 * @deprecated use elm_object_item_text_get() instead.
472 EINA_DEPRECATED EAPI const char *elm_toolbar_item_label_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
475 * Set the label of item.
477 * @param it The item of toolbar.
478 * @param text The label of item.
480 * The label to be displayed by the item.
481 * Label will be placed at icons bottom (if set).
483 * If a label was passed as argument on item creation, with function
484 * elm_toolbar_item_append() or similar, it will be already
485 * displayed by the item.
487 * @see elm_toolbar_item_label_get()
488 * @see elm_toolbar_item_append()
490 * @deprecated use elm_object_item_text_set() instead
493 EINA_DEPRECATED EAPI void elm_toolbar_item_label_set(Elm_Object_Item *it, const char *label) EINA_ARG_NONNULL(1);
496 * Return the data associated with a given toolbar widget item.
498 * @param it The toolbar widget item handle.
499 * @return The data associated with @p item.
501 * @see elm_toolbar_item_data_set()
503 * @deprecated use elm_object_item_data_get() instead.
506 EINA_DEPRECATED EAPI void *elm_toolbar_item_data_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
509 * Set the data associated with a given toolbar widget item.
511 * @param it The toolbar widget item handle
512 * @param data The new data pointer to set to @p item.
514 * This sets new item data on @p item.
516 * @warning The old data pointer won't be touched by this function, so
517 * the user had better to free that old data himself/herself.
519 * @deprecated use elm_object_item_data_set() instead.
522 EINA_DEPRECATED EAPI void elm_toolbar_item_data_set(Elm_Object_Item *it, const void *data) EINA_ARG_NONNULL(1);
525 * Returns a pointer to a toolbar item by its label.
527 * @param obj The toolbar object.
528 * @param label The label of the item to find.
530 * @return The pointer to the toolbar item matching @p label or @c NULL
535 EAPI Elm_Object_Item *elm_toolbar_item_find_by_label(const Evas_Object *obj, const char *label) EINA_ARG_NONNULL(1);
538 * Get whether the @p item is selected or not.
540 * @param it The toolbar item.
541 * @return @c EINA_TRUE means item is selected. @c EINA_FALSE indicates
542 * it's not. If @p obj is @c NULL, @c EINA_FALSE is returned.
544 * @see elm_toolbar_selected_item_set() for details.
545 * @see elm_toolbar_item_selected_get()
549 EAPI Eina_Bool elm_toolbar_item_selected_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
552 * Set the selected state of an item.
554 * @param it The toolbar item
555 * @param selected The selected state
557 * This sets the selected state of the given item @p it.
558 * @c EINA_TRUE for selected, @c EINA_FALSE for not selected.
560 * If a new item is selected the previosly selected will be unselected.
561 * Previoulsy selected item can be get with function
562 * elm_toolbar_selected_item_get().
564 * Selected items will be highlighted.
566 * @see elm_toolbar_item_selected_get()
567 * @see elm_toolbar_selected_item_get()
571 EAPI void elm_toolbar_item_selected_set(Elm_Object_Item *it, Eina_Bool selected) EINA_ARG_NONNULL(1);
574 * Get the selected item.
576 * @param obj The toolbar object.
577 * @return The selected toolbar item.
579 * The selected item can be unselected with function
580 * elm_toolbar_item_selected_set().
582 * The selected item always will be highlighted on toolbar.
584 * @see elm_toolbar_selected_items_get()
588 EAPI Elm_Object_Item *elm_toolbar_selected_item_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
591 * Set the icon associated with @p item.
593 * @param obj The parent of this item.
594 * @param it The toolbar item.
595 * @param icon A string with icon name or the absolute path of an image file.
597 * Toolbar will load icon image from fdo or current theme.
598 * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
599 * If an absolute path is provided it will load it direct from a file.
601 * @see elm_toolbar_icon_order_lookup_set()
602 * @see elm_toolbar_icon_order_lookup_get()
606 EAPI void elm_toolbar_item_icon_set(Elm_Object_Item *it, const char *icon) EINA_ARG_NONNULL(1);
609 * Get the string used to set the icon of @p item.
611 * @param it The toolbar item.
612 * @return The string associated with the icon object.
614 * @see elm_toolbar_item_icon_set() for details.
618 EAPI const char *elm_toolbar_item_icon_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
621 * Get the object of @p item.
623 * @param it The toolbar item.
628 EAPI Evas_Object *elm_toolbar_item_object_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
631 * Get the icon object of @p item.
633 * @param it The toolbar item.
634 * @return The icon object
636 * @see elm_toolbar_item_icon_set(), elm_toolbar_item_icon_file_set(),
637 * or elm_toolbar_item_icon_memfile_set() for details.
641 EAPI Evas_Object *elm_toolbar_item_icon_object_get(Elm_Object_Item *it) EINA_ARG_NONNULL(1);
644 * Set the icon associated with @p item to an image in a binary buffer.
646 * @param it The toolbar item.
647 * @param img The binary data that will be used as an image
648 * @param size The size of binary data @p img
649 * @param format Optional format of @p img to pass to the image loader
650 * @param key Optional key of @p img to pass to the image loader (eg. if @p img is an edje file)
652 * @return (@c EINA_TRUE = success, @c EINA_FALSE = error)
654 * @note The icon image set by this function can be changed by
655 * elm_toolbar_item_icon_set().
659 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) EINA_ARG_NONNULL(1);
662 * Set the icon associated with @p item to an image in a binary buffer.
664 * @param it The toolbar item.
665 * @param file The file that contains the image
666 * @param key Optional key of @p img to pass to the image loader (eg. if @p img is an edje file)
668 * @return (@c EINA_TRUE = success, @c EINA_FALSE = error)
670 * @note The icon image set by this function can be changed by
671 * elm_toolbar_item_icon_set().
675 EAPI Eina_Bool elm_toolbar_item_icon_file_set(Elm_Object_Item *it, const char *file, const char *key) EINA_ARG_NONNULL(1);
678 * Delete them item from the toolbar.
680 * @param it The item of toolbar to be deleted.
682 * @see elm_toolbar_item_append()
683 * @see elm_toolbar_item_del_cb_set()
687 EAPI void elm_toolbar_item_del(Elm_Object_Item *it) EINA_ARG_NONNULL(1);
690 * Set the function called when a toolbar item is freed.
692 * @param it The item to set the callback on.
693 * @param func The function called.
695 * If there is a @p func, then it will be called prior item's memory release.
696 * That will be called with the following arguments:
698 * @li item's Evas object;
701 * This way, a data associated to a toolbar item could be properly freed.
705 EAPI void elm_toolbar_item_del_cb_set(Elm_Object_Item *it, Evas_Smart_Cb func) EINA_ARG_NONNULL(1);
708 * Get a value whether toolbar item is disabled or not.
710 * @param it The item.
711 * @return The disabled state.
713 * @see elm_toolbar_item_disabled_set() for more details.
715 * @deprecated use elm_object_item_disabled_get() instead.
718 EINA_DEPRECATED EAPI Eina_Bool elm_toolbar_item_disabled_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
721 * Sets the disabled/enabled state of a toolbar item.
723 * @param it The item.
724 * @param disabled The disabled state.
726 * A disabled item cannot be selected or unselected. It will also
727 * change its appearance (generally greyed out). This sets the
728 * disabled state (@c EINA_TRUE for disabled, @c EINA_FALSE for
731 * @deprecated use elm_object_item_disabled_set() instead.
734 EINA_DEPRECATED EAPI void elm_toolbar_item_disabled_set(Elm_Object_Item *it, Eina_Bool disabled) EINA_ARG_NONNULL(1);
737 * Set or unset item as a separator.
739 * @param it The toolbar item.
740 * @param setting @c EINA_TRUE to set item @p item as separator or
741 * @c EINA_FALSE to unset, i.e., item will be used as a regular item.
743 * Items aren't set as separator by default.
745 * If set as separator it will display separator theme, so won't display
748 * @see elm_toolbar_item_separator_get()
752 EAPI void elm_toolbar_item_separator_set(Elm_Object_Item *it, Eina_Bool separator) EINA_ARG_NONNULL(1);
755 * Get a value whether item is a separator or not.
757 * @param it The toolbar item.
758 * @return @c EINA_TRUE means item @p it is a separator. @c EINA_FALSE
759 * indicates it's not. If @p it is @c NULL, @c EINA_FALSE is returned.
761 * @see elm_toolbar_item_separator_set() for details.
765 EAPI Eina_Bool elm_toolbar_item_separator_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
768 * Set the shrink state of toolbar @p obj.
770 * @param obj The toolbar object.
771 * @param shrink_mode Toolbar's items display behavior.
773 * The toolbar won't scroll if #ELM_TOOLBAR_SHRINK_NONE,
774 * but will enforce a minimun size so all the items will fit, won't scroll
775 * and won't show the items that don't fit if #ELM_TOOLBAR_SHRINK_HIDE,
776 * will scroll if #ELM_TOOLBAR_SHRINK_SCROLL, and will create a button to
777 * pop up excess elements with #ELM_TOOLBAR_SHRINK_MENU.
781 EAPI void elm_toolbar_mode_shrink_set(Evas_Object *obj, Elm_Toolbar_Shrink_Mode shrink_mode) EINA_ARG_NONNULL(1);
784 * Get the shrink mode of toolbar @p obj.
786 * @param obj The toolbar object.
787 * @return Toolbar's items display behavior.
789 * @see elm_toolbar_mode_shrink_set() for details.
793 EAPI Elm_Toolbar_Shrink_Mode elm_toolbar_mode_shrink_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
796 * Enable/disable homogeneous mode.
798 * @param obj The toolbar object
799 * @param homogeneous Assume the items within the toolbar are of the
800 * same size (EINA_TRUE = on, EINA_FALSE = off). Default is @c EINA_FALSE.
802 * This will enable the homogeneous mode where items are of the same size.
803 * @see elm_toolbar_homogeneous_get()
807 EAPI void elm_toolbar_homogeneous_set(Evas_Object *obj, Eina_Bool homogeneous) EINA_ARG_NONNULL(1);
810 * Get whether the homogeneous mode is enabled.
812 * @param obj The toolbar object.
813 * @return Assume the items within the toolbar are of the same height
814 * and width (EINA_TRUE = on, EINA_FALSE = off).
816 * @see elm_toolbar_homogeneous_set()
820 EAPI Eina_Bool elm_toolbar_homogeneous_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
823 * Set the parent object of the toolbar items' menus.
825 * @param obj The toolbar object.
826 * @param parent The parent of the menu objects.
828 * Each item can be set as item menu, with elm_toolbar_item_menu_set().
830 * For more details about setting the parent for toolbar menus, see
831 * elm_menu_parent_set().
833 * @see elm_menu_parent_set() for details.
834 * @see elm_toolbar_item_menu_set() for details.
838 EAPI void elm_toolbar_menu_parent_set(Evas_Object *obj, Evas_Object *parent) EINA_ARG_NONNULL(1);
841 * Get the parent object of the toolbar items' menus.
843 * @param obj The toolbar object.
844 * @return The parent of the menu objects.
846 * @see elm_toolbar_menu_parent_set() for details.
850 EAPI Evas_Object *elm_toolbar_menu_parent_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
853 * Set the alignment of the items.
855 * @param obj The toolbar object.
856 * @param align The new alignment, a float between <tt> 0.0 </tt>
857 * and <tt> 1.0 </tt>.
859 * Alignment of toolbar items, from <tt> 0.0 </tt> to indicates to align
860 * left, to <tt> 1.0 </tt>, to align to right. <tt> 0.5 </tt> centralize
863 * Centered items by default.
865 * @see elm_toolbar_align_get()
869 EAPI void elm_toolbar_align_set(Evas_Object *obj, double align) EINA_ARG_NONNULL(1);
872 * Get the alignment of the items.
874 * @param obj The toolbar object.
875 * @return toolbar items alignment, a float between <tt> 0.0 </tt> and
878 * @see elm_toolbar_align_set() for details.
882 EAPI double elm_toolbar_align_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
885 * Set whether the toolbar item opens a menu.
887 * @param it The toolbar item.
888 * @param menu If @c EINA_TRUE, @p item will opens a menu when selected.
890 * A toolbar item can be set to be a menu, using this function.
892 * Once it is set to be a menu, it can be manipulated through the
893 * menu-like function elm_toolbar_menu_parent_set() and the other
894 * elm_menu functions, using the Evas_Object @c menu returned by
895 * elm_toolbar_item_menu_get().
897 * So, items to be displayed in this item's menu should be added with
898 * elm_menu_item_add().
900 * The following code exemplifies the most basic usage:
902 * tb = elm_toolbar_add(win)
903 * item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
904 * elm_toolbar_item_menu_set(item, EINA_TRUE);
905 * elm_toolbar_menu_parent_set(tb, win);
906 * menu = elm_toolbar_item_menu_get(item);
907 * elm_menu_item_add(menu, NULL, "edit-cut", "Cut", NULL, NULL);
908 * menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Copy", NULL,
912 * @see elm_toolbar_item_menu_get()
916 EAPI void elm_toolbar_item_menu_set(Elm_Object_Item *it, Eina_Bool menu) EINA_ARG_NONNULL(1);
919 * Get toolbar item's menu.
921 * @param it The toolbar item.
922 * @return Item's menu object or @c NULL on failure.
924 * If @p item wasn't set as menu item with elm_toolbar_item_menu_set(),
925 * this function will set it.
927 * @see elm_toolbar_item_menu_set() for details.
931 EAPI Evas_Object *elm_toolbar_item_menu_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
934 * Add a new state to @p item.
936 * @param it The toolbar item.
937 * @param icon A string with icon name or the absolute path of an image file.
938 * @param label The label of the new state.
939 * @param func The function to call when the item is clicked when this
941 * @param data The data to associate with the state.
942 * @return The toolbar item state, or @c NULL upon failure.
944 * Toolbar will load icon image from fdo or current theme.
945 * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
946 * If an absolute path is provided it will load it direct from a file.
948 * States created with this function can be removed with
949 * elm_toolbar_item_state_del().
951 * @see elm_toolbar_item_state_del()
952 * @see elm_toolbar_item_state_sel()
953 * @see elm_toolbar_item_state_get()
957 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) EINA_ARG_NONNULL(1);
960 * Delete a previoulsy added state to @p item.
962 * @param it The toolbar item.
963 * @param state The state to be deleted.
964 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
966 * @see elm_toolbar_item_state_add()
968 EAPI Eina_Bool elm_toolbar_item_state_del(Elm_Object_Item *it, Elm_Toolbar_Item_State *state) EINA_ARG_NONNULL(1);
971 * Set @p state as the current state of @p it.
973 * @param it The toolbar item.
974 * @param state The state to use.
975 * @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
977 * If @p state is @c NULL, it won't select any state and the default item's
978 * icon and label will be used. It's the same behaviour than
979 * elm_toolbar_item_state_unser().
981 * @see elm_toolbar_item_state_unset()
985 EAPI Eina_Bool elm_toolbar_item_state_set(Elm_Object_Item *it, Elm_Toolbar_Item_State *state) EINA_ARG_NONNULL(1);
988 * Unset the state of @p it.
990 * @param it The toolbar item.
992 * The default icon and label from this item will be displayed.
994 * @see elm_toolbar_item_state_set() for more details.
998 EAPI void elm_toolbar_item_state_unset(Elm_Object_Item *it) EINA_ARG_NONNULL(1);
1001 * Get the current state of @p it.
1003 * @param it The toolbar item.
1004 * @return The selected state or @c NULL if none is selected or on failure.
1006 * @see elm_toolbar_item_state_set() for details.
1007 * @see elm_toolbar_item_state_unset()
1008 * @see elm_toolbar_item_state_add()
1012 EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
1015 * Get the state after selected state in toolbar's @p item.
1017 * @param it The toolbar item to change state.
1018 * @return The state after current state, or @c NULL on failure.
1020 * If last state is selected, this function will return first state.
1022 * @see elm_toolbar_item_state_set()
1023 * @see elm_toolbar_item_state_add()
1027 EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_next(Elm_Object_Item *it) EINA_ARG_NONNULL(1);
1030 * Get the state before selected state in toolbar's @p item.
1032 * @param it The toolbar item to change state.
1033 * @return The state before current state, or @c NULL on failure.
1035 * If first state is selected, this function will return last state.
1037 * @see elm_toolbar_item_state_set()
1038 * @see elm_toolbar_item_state_add()
1042 EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_prev(Elm_Object_Item *it) EINA_ARG_NONNULL(1);
1045 * Set the text to be shown in a given toolbar item's tooltips.
1047 * @param it toolbar item.
1048 * @param text The text to set in the content.
1050 * Setup the text as tooltip to object. The item can have only one tooltip,
1051 * so any previous tooltip data - set with this function or
1052 * elm_toolbar_item_tooltip_content_cb_set() - is removed.
1054 * @see elm_object_tooltip_text_set() for more details.
1058 EAPI void elm_toolbar_item_tooltip_text_set(Elm_Object_Item *it, const char *text) EINA_ARG_NONNULL(1);
1061 * Set the content to be shown in the tooltip item.
1063 * Setup the tooltip to item. The item can have only one tooltip,
1064 * so any previous tooltip data is removed. @p func(with @p data) will
1065 * be called every time that need show the tooltip and it should
1066 * return a valid Evas_Object. This object is then managed fully by
1067 * tooltip system and is deleted when the tooltip is gone.
1069 * @param it the toolbar item being attached a tooltip.
1070 * @param func the function used to create the tooltip contents.
1071 * @param data what to provide to @a func as callback data/context.
1072 * @param del_cb called when data is not needed anymore, either when
1073 * another callback replaces @a func, the tooltip is unset with
1074 * elm_toolbar_item_tooltip_unset() or the owner @a item
1075 * dies. This callback receives as the first parameter the
1076 * given @a data, and @c event_info is the item.
1078 * @see elm_object_tooltip_content_cb_set() for more details.
1082 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) EINA_ARG_NONNULL(1);
1085 * Unset tooltip from item.
1087 * @param it toolbar item to remove previously set tooltip.
1089 * Remove tooltip from item. The callback provided as del_cb to
1090 * elm_toolbar_item_tooltip_content_cb_set() will be called to notify
1091 * it is not used anymore.
1093 * @see elm_object_tooltip_unset() for more details.
1094 * @see elm_toolbar_item_tooltip_content_cb_set()
1098 EAPI void elm_toolbar_item_tooltip_unset(Elm_Object_Item *it) EINA_ARG_NONNULL(1);
1101 * Sets a different style for this item tooltip.
1103 * @note before you set a style you should define a tooltip with
1104 * elm_toolbar_item_tooltip_content_cb_set() or
1105 * elm_toolbar_item_tooltip_text_set()
1107 * @param it toolbar item with tooltip already set.
1108 * @param style the theme style to use (default, transparent, ...)
1110 * @see elm_object_tooltip_style_set() for more details.
1114 EAPI void elm_toolbar_item_tooltip_style_set(Elm_Object_Item *it, const char *style) EINA_ARG_NONNULL(1);
1117 * Get the style for this item tooltip.
1119 * @param it toolbar item with tooltip already set.
1120 * @return style the theme style in use, defaults to "default". If the
1121 * object does not have a tooltip set, then NULL is returned.
1123 * @see elm_object_tooltip_style_get() for more details.
1124 * @see elm_toolbar_item_tooltip_style_set()
1128 EAPI const char *elm_toolbar_item_tooltip_style_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
1131 * Set the type of mouse pointer/cursor decoration to be shown,
1132 * when the mouse pointer is over the given toolbar widget item
1134 * @param it toolbar item to customize cursor on
1135 * @param cursor the cursor type's name
1137 * This function works analogously as elm_object_cursor_set(), but
1138 * here the cursor's changing area is restricted to the item's
1139 * area, and not the whole widget's. Note that that item cursors
1140 * have precedence over widget cursors, so that a mouse over an
1141 * item with custom cursor set will always show @b that cursor.
1143 * If this function is called twice for an object, a previously set
1144 * cursor will be unset on the second call.
1146 * @see elm_object_cursor_set()
1147 * @see elm_toolbar_item_cursor_get()
1148 * @see elm_toolbar_item_cursor_unset()
1152 EAPI void elm_toolbar_item_cursor_set(Elm_Object_Item *it, const char *cursor) EINA_ARG_NONNULL(1);
1155 * Get the type of mouse pointer/cursor decoration set to be shown,
1156 * when the mouse pointer is over the given toolbar widget item
1158 * @param it toolbar item with custom cursor set
1159 * @return the cursor type's name or @c NULL, if no custom cursors
1160 * were set to @p item (and on errors)
1162 * @see elm_object_cursor_get()
1163 * @see elm_toolbar_item_cursor_set()
1164 * @see elm_toolbar_item_cursor_unset()
1168 EAPI const char *elm_toolbar_item_cursor_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
1171 * Unset any custom mouse pointer/cursor decoration set to be
1172 * shown, when the mouse pointer is over the given toolbar widget
1173 * item, thus making it show the @b default cursor again.
1175 * @param it a toolbar item
1177 * Use this call to undo any custom settings on this item's cursor
1178 * decoration, bringing it back to defaults (no custom style set).
1180 * @see elm_object_cursor_unset()
1181 * @see elm_toolbar_item_cursor_set()
1185 EAPI void elm_toolbar_item_cursor_unset(Elm_Object_Item *it) EINA_ARG_NONNULL(1);
1188 * Set a different @b style for a given custom cursor set for a
1191 * @param it toolbar item with custom cursor set
1192 * @param style the <b>theme style</b> to use (e.g. @c "default",
1193 * @c "transparent", etc)
1195 * This function only makes sense when one is using custom mouse
1196 * cursor decorations <b>defined in a theme file</b>, which can have,
1197 * given a cursor name/type, <b>alternate styles</b> on it. It
1198 * works analogously as elm_object_cursor_style_set(), but here
1199 * applyed only to toolbar item objects.
1201 * @warning Before you set a cursor style you should have definen a
1202 * custom cursor previously on the item, with
1203 * elm_toolbar_item_cursor_set()
1205 * @see elm_toolbar_item_cursor_engine_only_set()
1206 * @see elm_toolbar_item_cursor_style_get()
1210 EAPI void elm_toolbar_item_cursor_style_set(Elm_Object_Item *it, const char *style) EINA_ARG_NONNULL(1);
1213 * Get the current @b style set for a given toolbar item's custom
1216 * @param it toolbar item with custom cursor set.
1217 * @return style the cursor style in use. If the object does not
1218 * have a cursor set, then @c NULL is returned.
1220 * @see elm_toolbar_item_cursor_style_set() for more details
1224 EAPI const char *elm_toolbar_item_cursor_style_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
1227 * Set if the (custom)cursor for a given toolbar item should be
1228 * searched in its theme, also, or should only rely on the
1231 * @param it item with custom (custom) cursor already set on
1232 * @param engine_only Use @c EINA_TRUE to have cursors looked for
1233 * only on those provided by the rendering engine, @c EINA_FALSE to
1234 * have them searched on the widget's theme, as well.
1236 * @note This call is of use only if you've set a custom cursor
1237 * for toolbar items, with elm_toolbar_item_cursor_set().
1239 * @note By default, cursors will only be looked for between those
1240 * provided by the rendering engine.
1244 EAPI void elm_toolbar_item_cursor_engine_only_set(Elm_Object_Item *it, Eina_Bool engine_only) EINA_ARG_NONNULL(1);
1247 * Get if the (custom) cursor for a given toolbar item is being
1248 * searched in its theme, also, or is only relying on the rendering
1251 * @param it a toolbar item
1252 * @return @c EINA_TRUE, if cursors are being looked for only on
1253 * those provided by the rendering engine, @c EINA_FALSE if they
1254 * are being searched on the widget's theme, as well.
1256 * @see elm_toolbar_item_cursor_engine_only_set(), for more details
1260 EAPI Eina_Bool elm_toolbar_item_cursor_engine_only_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
1263 * Change a toolbar's orientation
1264 * @param obj The toolbar object
1265 * @param vertical If @c EINA_TRUE, the toolbar is vertical
1266 * By default, a toolbar will be horizontal. Use this function to create a vertical toolbar.
1268 * @deprecated use elm_toolbar_horizontal_set() instead.
1270 EINA_DEPRECATED EAPI void elm_toolbar_orientation_set(Evas_Object *obj, Eina_Bool vertical) EINA_ARG_NONNULL(1);
1273 * Change a toolbar's orientation
1274 * @param obj The toolbar object
1275 * @param horizontal If @c EINA_TRUE, the toolbar is horizontal
1276 * By default, a toolbar will be horizontal. Use this function to create a vertical toolbar.
1279 EAPI void elm_toolbar_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) EINA_ARG_NONNULL(1);
1282 * Get a toolbar's orientation
1283 * @param obj The toolbar object
1284 * @return If @c EINA_TRUE, the toolbar is vertical
1285 * By default, a toolbar will be horizontal. Use this function to determine whether a toolbar is vertical.
1287 * @deprecated use elm_toolbar_horizontal_get() instead.
1289 EINA_DEPRECATED EAPI Eina_Bool elm_toolbar_orientation_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
1292 * Get a toolbar's orientation
1293 * @param obj The toolbar object
1294 * @return If @c EINA_TRUE, the toolbar is horizontal
1295 * By default, a toolbar will be horizontal. Use this function to determine whether a toolbar is vertical.
1298 EAPI Eina_Bool elm_toolbar_horizontal_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
1301 * Get the number of items in a toolbar
1302 * @param obj The toolbar object
1303 * @return The number of items in @p obj toolbar
1306 EAPI unsigned int elm_toolbar_items_count(const Evas_Object *obj) EINA_ARG_NONNULL(1) EINA_PURE;