Merge remote-tracking branch 'remotes/origin/upstream'
[framework/uifw/elementary.git] / src / lib / elm_toolbar.h
1 /**
2  * @defgroup Toolbar Toolbar
3  * @ingroup Elementary
4  *
5  * @image html img/widget/toolbar/preview-00.png
6  * @image latex img/widget/toolbar/preview-00.eps width=\textwidth
7  *
8  * @image html img/toolbar.png
9  * @image latex img/toolbar.eps width=\textwidth
10  *
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.
14  *
15  * Only one item can be selected at a time.
16  *
17  * Items can have multiple states, or show menus when selected by the user.
18  *
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
22  *
23  * Available styles for it:
24  * - @c "default"
25  * - @c "transparent" - no background or shadow, just show the content
26  *
27  * Default text parts of the toolbar items that you can use for are:
28  * @li "default" - label of the toolbar item
29  *
30  * Supported elm_object_item common APIs.
31  * @li elm_object_item_disabled_set
32  * @li elm_object_item_disabled_get
33  * @li elm_object_item_part_text_set
34  * @li elm_object_item_part_text_get
35  *
36  * List of examples:
37  * @li @ref toolbar_example_01
38  * @li @ref toolbar_example_02
39  * @li @ref toolbar_example_03
40  */
41
42 /**
43  * @addtogroup Toolbar
44  * @{
45  */
46
47 /**
48  * @enum _Elm_Toolbar_Shrink_Mode
49  * @typedef Elm_Toolbar_Shrink_Mode
50  *
51 <<<<<<< HEAD
52  * Set toolbar's items display behavior, it can be scrollabel,
53 =======
54  * Set toolbar's items display behavior, it can be scrollable,
55 >>>>>>> remotes/origin/upstream
56  * show a menu with exceeding items, or simply hide them.
57  *
58  * @note Default value is #ELM_TOOLBAR_SHRINK_MENU. It reads value
59  * from elm config.
60  *
61 <<<<<<< HEAD
62  * Values <b> don't </b> work as bitmask, only one can be choosen.
63 =======
64  * Values <b> don't </b> work as bitmask, only one can be chosen.
65 >>>>>>> remotes/origin/upstream
66  *
67  * @see elm_toolbar_shrink_mode_set()
68  * @see elm_toolbar_shrink_mode_get()
69  *
70  * @ingroup Toolbar
71  */
72 typedef enum
73 {
74 <<<<<<< HEAD
75    ELM_TOOLBAR_SHRINK_NONE, /**< Set toolbar minimun size to fit all the items. */
76 =======
77    ELM_TOOLBAR_SHRINK_NONE, /**< Set toolbar minimum size to fit all the items. */
78 >>>>>>> remotes/origin/upstream
79    ELM_TOOLBAR_SHRINK_HIDE, /**< Hide exceeding items. */
80    ELM_TOOLBAR_SHRINK_SCROLL, /**< Allow accessing exceeding items through a scroller. */
81    ELM_TOOLBAR_SHRINK_MENU, /**< Inserts a button to pop up a menu with exceeding items. */
82    ELM_TOOLBAR_SHRINK_EXPAND, /**< Expand all items according the size of the toolbar. */
83    ELM_TOOLBAR_SHRINK_LAST /**< Indicates error if returned by elm_toolbar_shrink_mode_get() */
84 } Elm_Toolbar_Shrink_Mode;
85
86 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(). */
87
88 /**
89  * Add a new toolbar widget to the given parent Elementary
90  * (container) object.
91  *
92  * @param parent The parent object.
93  * @return a new toolbar widget handle or @c NULL, on errors.
94  *
95  * This function inserts a new toolbar widget on the canvas.
96  *
97  * @ingroup Toolbar
98  */
99 EAPI Evas_Object                 *elm_toolbar_add(Evas_Object *parent);
100
101 /**
102  * Set the icon size, in pixels, to be used by toolbar items.
103  *
104  * @param obj The toolbar object
105  * @param icon_size The icon size in pixels
106  *
107  * @note Default value is @c 32. It reads value from elm config.
108  *
109  * @see elm_toolbar_icon_size_get()
110  *
111  * @ingroup Toolbar
112  */
113 EAPI void                         elm_toolbar_icon_size_set(Evas_Object *obj, int icon_size);
114
115 /**
116  * Get the icon size, in pixels, to be used by toolbar items.
117  *
118  * @param obj The toolbar object.
119  * @return The icon size in pixels.
120  *
121  * @see elm_toolbar_icon_size_set() for details.
122  *
123  * @ingroup Toolbar
124  */
125 EAPI int                          elm_toolbar_icon_size_get(const Evas_Object *obj);
126
127 /**
128  * Sets icon lookup order, for toolbar items' icons.
129  *
130  * @param obj The toolbar object.
131  * @param order The icon lookup order.
132  *
133  * Icons added before calling this function will not be affected.
134  * The default lookup order is #ELM_ICON_LOOKUP_THEME_FDO.
135  *
136  * @see elm_toolbar_icon_order_lookup_get()
137  *
138  * @ingroup Toolbar
139  */
140 EAPI void                         elm_toolbar_icon_order_lookup_set(Evas_Object *obj, Elm_Icon_Lookup_Order order);
141
142 /**
143  * Gets the icon lookup order.
144  *
145  * @param obj The toolbar object.
146  * @return The icon lookup order.
147  *
148  * @see elm_toolbar_icon_order_lookup_set() for details.
149  *
150  * @ingroup Toolbar
151  */
152 EAPI Elm_Icon_Lookup_Order        elm_toolbar_icon_order_lookup_get(const Evas_Object *obj);
153
154 /**
155 <<<<<<< HEAD
156  * Set whether the toolbar should always have an item selected.
157  *
158  * @param obj The toolbar object.
159  * @param wrap @c EINA_TRUE to enable always-select mode or @c EINA_FALSE to
160  * disable it.
161  *
162  * This will cause the toolbar to always have an item selected, and clicking
163  * the selected item will not cause a selected event to be emitted. Enabling this mode
164  * will immediately select the first toolbar item.
165  *
166  * Always-selected is disabled by default.
167  *
168  * @see elm_toolbar_always_select_mode_get().
169  *
170  * @ingroup Toolbar
171  */
172 EAPI void                         elm_toolbar_always_select_mode_set(Evas_Object *obj, Eina_Bool always_select);
173
174 /**
175  * Get whether the toolbar should always have an item selected.
176  *
177  * @param obj The toolbar object.
178  * @return @c EINA_TRUE means an item will always be selected, @c EINA_FALSE indicates
179  * that it is possible to have no items selected. If @p obj is @c NULL, @c EINA_FALSE is returned.
180  *
181  * @see elm_toolbar_always_select_mode_set() for details.
182  *
183  * @ingroup Toolbar
184  */
185 EAPI Eina_Bool                    elm_toolbar_always_select_mode_get(const Evas_Object *obj);
186
187 /**
188  * Set whether the toolbar items' should be selected by the user or not.
189  *
190  * @param obj The toolbar object.
191  * @param wrap @c EINA_TRUE to disable selection or @c EINA_FALSE to
192  * enable it.
193  *
194  * This will turn off the ability to select items entirely and they will
195  * neither appear selected nor emit selected signals. The clicked
196  * callback function will still be called.
197  *
198  * Selection is enabled by default.
199  *
200  * @see elm_toolbar_no_select_mode_get().
201  *
202  * @ingroup Toolbar
203  */
204 EAPI void                         elm_toolbar_no_select_mode_set(Evas_Object *obj, Eina_Bool no_select);
205
206 /**
207  * Set whether the toolbar items' should be selected by the user or not.
208  *
209  * @param obj The toolbar object.
210  * @return @c EINA_TRUE means items can be selected. @c EINA_FALSE indicates
211  * they can't. If @p obj is @c NULL, @c EINA_FALSE is returned.
212  *
213  * @see elm_toolbar_no_select_mode_set() for details.
214  *
215  * @ingroup Toolbar
216  */
217 EAPI Eina_Bool                    elm_toolbar_no_select_mode_get(const Evas_Object *obj);
218
219 /**
220 =======
221 >>>>>>> remotes/origin/upstream
222  * Append item to the toolbar.
223  *
224  * @param obj The toolbar object.
225  * @param icon A string with icon name or the absolute path of an image file.
226  * @param label The label of the item.
227  * @param func The function to call when the item is clicked.
228  * @param data The data to associate with the item for related callbacks.
229  * @return The created item or @c NULL upon failure.
230  *
231  * A new item will be created and appended to the toolbar, i.e., will
232  * be set as @b last item.
233  *
234  * Items created with this method can be deleted with
235  * elm_object_item_del().
236  *
237  * Associated @p data can be properly freed when item is deleted if a
238  * callback function is set with elm_object_item_del_cb_set().
239  *
240 <<<<<<< HEAD
241  * If a function is passed as argument, it will be called everytime this item
242 =======
243  * If a function is passed as argument, it will be called every time this item
244 >>>>>>> remotes/origin/upstream
245  * is selected, i.e., the user clicks over an unselected item.
246  * If such function isn't needed, just passing
247  * @c NULL as @p func is enough. The same should be done for @p data.
248  *
249  * Toolbar will load icon image from fdo or current theme.
250  * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
251  * If an absolute path is provided it will load it direct from a file.
252  *
253  * @see elm_toolbar_item_icon_set()
254  * @see elm_object_item_del()
255  *
256  * @ingroup Toolbar
257  */
258 EAPI Elm_Object_Item             *elm_toolbar_item_append(Evas_Object *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data);
259
260 /**
261  * Prepend item to the toolbar.
262  *
263  * @param obj The toolbar object.
264  * @param icon A string with icon name or the absolute path of an image file.
265  * @param label The label of the item.
266  * @param func The function to call when the item is clicked.
267  * @param data The data to associate with the item for related callbacks.
268  * @return The created item or @c NULL upon failure.
269  *
270  * A new item will be created and prepended to the toolbar, i.e., will
271  * be set as @b first item.
272  *
273  * Items created with this method can be deleted with
274  * elm_object_item_del().
275  *
276  * Associated @p data can be properly freed when item is deleted if a
277  * callback function is set with elm_object_item_del_cb_set().
278  *
279 <<<<<<< HEAD
280  * If a function is passed as argument, it will be called everytime this item
281 =======
282  * If a function is passed as argument, it will be called every time this item
283 >>>>>>> remotes/origin/upstream
284  * is selected, i.e., the user clicks over an unselected item.
285  * If such function isn't needed, just passing
286  * @c NULL as @p func is enough. The same should be done for @p data.
287  *
288  * Toolbar will load icon image from fdo or current theme.
289  * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
290  * If an absolute path is provided it will load it direct from a file.
291  *
292  * @see elm_toolbar_item_icon_set()
293  * @see elm_object_item_del()
294  *
295  * @ingroup Toolbar
296  */
297 EAPI Elm_Object_Item             *elm_toolbar_item_prepend(Evas_Object *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data);
298
299 /**
300  * Insert a new item into the toolbar object before item @p before.
301  *
302  * @param obj The toolbar object.
303  * @param before The toolbar item to insert before.
304  * @param icon A string with icon name or the absolute path of an image file.
305  * @param label The label of the item.
306  * @param func The function to call when the item is clicked.
307  * @param data The data to associate with the item for related callbacks.
308  * @return The created item or @c NULL upon failure.
309  *
310  * A new item will be created and added to the toolbar. Its position in
311  * this toolbar will be just before item @p before.
312  *
313  * Items created with this method can be deleted with
314  * elm_object_item_del().
315  *
316  * Associated @p data can be properly freed when item is deleted if a
317  * callback function is set with elm_object_item_del_cb_set().
318  *
319 <<<<<<< HEAD
320  * If a function is passed as argument, it will be called everytime this item
321 =======
322  * If a function is passed as argument, it will be called every time this item
323 >>>>>>> remotes/origin/upstream
324  * is selected, i.e., the user clicks over an unselected item.
325  * If such function isn't needed, just passing
326  * @c NULL as @p func is enough. The same should be done for @p data.
327  *
328  * Toolbar will load icon image from fdo or current theme.
329  * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
330  * If an absolute path is provided it will load it direct from a file.
331  *
332  * @see elm_toolbar_item_icon_set()
333  * @see elm_object_item_del()
334  *
335  * @ingroup Toolbar
336  */
337 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);
338
339 /**
340  * Insert a new item into the toolbar object after item @p after.
341  *
342  * @param obj The toolbar object.
343  * @param after The toolbar item to insert after.
344  * @param icon A string with icon name or the absolute path of an image file.
345  * @param label The label of the item.
346  * @param func The function to call when the item is clicked.
347  * @param data The data to associate with the item for related callbacks.
348  * @return The created item or @c NULL upon failure.
349  *
350  * A new item will be created and added to the toolbar. Its position in
351  * this toolbar will be just after item @p after.
352  *
353  * Items created with this method can be deleted with
354  * elm_object_item_del().
355  *
356  * Associated @p data can be properly freed when item is deleted if a
357  * callback function is set with elm_object_item_del_cb_set().
358  *
359 <<<<<<< HEAD
360  * If a function is passed as argument, it will be called everytime this item
361 =======
362  * If a function is passed as argument, it will be called every time this item
363 >>>>>>> remotes/origin/upstream
364  * is selected, i.e., the user clicks over an unselected item.
365  * If such function isn't needed, just passing
366  * @c NULL as @p func is enough. The same should be done for @p data.
367  *
368  * Toolbar will load icon image from fdo or current theme.
369  * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
370  * If an absolute path is provided it will load it direct from a file.
371  *
372  * @see elm_toolbar_item_icon_set()
373  * @see elm_object_item_del()
374  *
375  * @ingroup Toolbar
376  */
377 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);
378
379 /**
380  * Get the first item in the given toolbar widget's list of
381  * items.
382  *
383  * @param obj The toolbar object
384  * @return The first item or @c NULL, if it has no items (and on
385  * errors)
386  *
387  * @see elm_toolbar_item_append()
388  * @see elm_toolbar_last_item_get()
389  *
390  * @ingroup Toolbar
391  */
392 EAPI Elm_Object_Item             *elm_toolbar_first_item_get(const Evas_Object *obj);
393
394 /**
395  * Get the last item in the given toolbar widget's list of
396  * items.
397  *
398  * @param obj The toolbar object
399  * @return The last item or @c NULL, if it has no items (and on
400  * errors)
401  *
402  * @see elm_toolbar_item_prepend()
403  * @see elm_toolbar_first_item_get()
404  *
405  * @ingroup Toolbar
406  */
407 EAPI Elm_Object_Item             *elm_toolbar_last_item_get(const Evas_Object *obj);
408
409 /**
410  * Get the item after @p item in toolbar.
411  *
412  * @param it The toolbar item.
413  * @return The item after @p item, or @c NULL if none or on failure.
414  *
415  * @note If it is the last item, @c NULL will be returned.
416  *
417  * @see elm_toolbar_item_append()
418  *
419  * @ingroup Toolbar
420  */
421 EAPI Elm_Object_Item             *elm_toolbar_item_next_get(const Elm_Object_Item *it);
422
423 /**
424  * Get the item before @p item in toolbar.
425  *
426 <<<<<<< HEAD
427  * @param item The toolbar item.
428 =======
429  * @param it The toolbar item.
430 >>>>>>> remotes/origin/upstream
431  * @return The item before @p item, or @c NULL if none or on failure.
432  *
433  * @note If it is the first item, @c NULL will be returned.
434  *
435  * @see elm_toolbar_item_prepend()
436  *
437  * @ingroup Toolbar
438  */
439 EAPI Elm_Object_Item             *elm_toolbar_item_prev_get(const Elm_Object_Item *it);
440
441 /**
442  * Set the priority of a toolbar item.
443  *
444  * @param it The toolbar item.
445  * @param priority The item priority. The default is zero.
446  *
447  * This is used only when the toolbar shrink mode is set to
448  * #ELM_TOOLBAR_SHRINK_MENU or #ELM_TOOLBAR_SHRINK_HIDE.
449  * When space is less than required, items with low priority
450  * will be removed from the toolbar and added to a dynamically-created menu,
451  * while items with higher priority will remain on the toolbar,
452  * with the same order they were added.
453  *
454  * @see elm_toolbar_item_priority_get()
455  *
456  * @ingroup Toolbar
457  */
458 EAPI void                         elm_toolbar_item_priority_set(Elm_Object_Item *it, int priority);
459
460 /**
461  * Get the priority of a toolbar item.
462  *
463  * @param it The toolbar item.
464  * @return The @p item priority, or @c 0 on failure.
465  *
466  * @see elm_toolbar_item_priority_set() for details.
467  *
468  * @ingroup Toolbar
469  */
470 EAPI int                          elm_toolbar_item_priority_get(const Elm_Object_Item *it);
471
472 /**
473  * Returns a pointer to a toolbar item by its label.
474  *
475  * @param obj The toolbar object.
476  * @param label The label of the item to find.
477  *
478  * @return The pointer to the toolbar item matching @p label or @c NULL
479  * on failure.
480  *
481  * @ingroup Toolbar
482  */
483 EAPI Elm_Object_Item             *elm_toolbar_item_find_by_label(const Evas_Object *obj, const char *label);
484
485 /*
486  * Get whether the @p item is selected or not.
487  *
488  * @param it The toolbar item.
489  * @return @c EINA_TRUE means item is selected. @c EINA_FALSE indicates
490  * it's not. If @p obj is @c NULL, @c EINA_FALSE is returned.
491  *
492  * @see elm_toolbar_selected_item_set() for details.
493  * @see elm_toolbar_item_selected_get()
494  *
495  * @ingroup Toolbar
496  */
497 EAPI Eina_Bool                    elm_toolbar_item_selected_get(const Elm_Object_Item *it);
498
499 /**
500  * Set the selected state of an item.
501  *
502  * @param it The toolbar item
503  * @param selected The selected state
504  *
505  * This sets the selected state of the given item @p it.
506  * @c EINA_TRUE for selected, @c EINA_FALSE for not selected.
507  *
508 <<<<<<< HEAD
509  * If a new item is selected the previosly selected will be unselected.
510  * Previoulsy selected item can be get with function
511 =======
512  * If a new item is selected the previously selected will be unselected.
513  * Previously selected item can be get with function
514 >>>>>>> remotes/origin/upstream
515  * elm_toolbar_selected_item_get().
516  *
517  * Selected items will be highlighted.
518  *
519  * @see elm_toolbar_item_selected_get()
520  * @see elm_toolbar_selected_item_get()
521  *
522  * @ingroup Toolbar
523  */
524 EAPI void                         elm_toolbar_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
525
526 /**
527  * Get the selected item.
528  *
529  * @param obj The toolbar object.
530  * @return The selected toolbar item.
531  *
532  * The selected item can be unselected with function
533  * elm_toolbar_item_selected_set().
534  *
535  * The selected item always will be highlighted on toolbar.
536  *
537  * @see elm_toolbar_selected_items_get()
538  *
539  * @ingroup Toolbar
540  */
541 EAPI Elm_Object_Item             *elm_toolbar_selected_item_get(const Evas_Object *obj);
542
543 /**
544  * Set the icon associated with @p item.
545  *
546 <<<<<<< HEAD
547  * @param obj The parent of this item.
548 =======
549 >>>>>>> remotes/origin/upstream
550  * @param it The toolbar item.
551  * @param icon A string with icon name or the absolute path of an image file.
552  *
553  * Toolbar will load icon image from fdo or current theme.
554  * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
555  * If an absolute path is provided it will load it direct from a file.
556  *
557  * @see elm_toolbar_icon_order_lookup_set()
558  * @see elm_toolbar_icon_order_lookup_get()
559  *
560  * @ingroup Toolbar
561  */
562 EAPI void                         elm_toolbar_item_icon_set(Elm_Object_Item *it, const char *icon);
563
564 /**
565  * Get the string used to set the icon of @p item.
566  *
567  * @param it The toolbar item.
568  * @return The string associated with the icon object.
569  *
570  * @see elm_toolbar_item_icon_set() for details.
571  *
572  * @ingroup Toolbar
573  */
574 EAPI const char                  *elm_toolbar_item_icon_get(const Elm_Object_Item *it);
575
576 /**
577  * Get the object of @p item.
578  *
579  * @param it The toolbar item.
580  * @return The object
581  *
582  * @ingroup Toolbar
583  */
584 EAPI Evas_Object                 *elm_toolbar_item_object_get(const Elm_Object_Item *it);
585
586 /**
587  * Get the icon object of @p item.
588  *
589  * @param it The toolbar item.
590  * @return The icon object
591  *
592  * @see elm_toolbar_item_icon_set(), elm_toolbar_item_icon_file_set(),
593  * or elm_toolbar_item_icon_memfile_set() for details.
594  *
595  * @ingroup Toolbar
596  */
597 EAPI Evas_Object                 *elm_toolbar_item_icon_object_get(Elm_Object_Item *it);
598
599 /**
600  * Set the icon associated with @p item to an image in a binary buffer.
601  *
602  * @param it The toolbar item.
603  * @param img The binary data that will be used as an image
604  * @param size The size of binary data @p img
605  * @param format Optional format of @p img to pass to the image loader
606  * @param key Optional key of @p img to pass to the image loader (eg. if @p img is an edje file)
607  *
608  * @return (@c EINA_TRUE = success, @c EINA_FALSE = error)
609  *
610  * @note The icon image set by this function can be changed by
611  * elm_toolbar_item_icon_set().
612  *
613  * @ingroup Toolbar
614  */
615 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);
616
617 /**
618  * Set the icon associated with @p item to an image in a binary buffer.
619  *
620  * @param it The toolbar item.
621  * @param file The file that contains the image
622  * @param key Optional key of @p img to pass to the image loader (eg. if @p img is an edje file)
623  *
624  * @return (@c EINA_TRUE = success, @c EINA_FALSE = error)
625  *
626  * @note The icon image set by this function can be changed by
627  * elm_toolbar_item_icon_set().
628  *
629  * @ingroup Toolbar
630  */
631 EAPI Eina_Bool                    elm_toolbar_item_icon_file_set(Elm_Object_Item *it, const char *file, const char *key);
632
633 /**
634  * Set or unset item as a separator.
635  *
636  * @param it The toolbar item.
637 <<<<<<< HEAD
638  * @param setting @c EINA_TRUE to set item @p item as separator or
639 =======
640  * @param separator @c EINA_TRUE to set item @p item as separator or
641 >>>>>>> remotes/origin/upstream
642  * @c EINA_FALSE to unset, i.e., item will be used as a regular item.
643  *
644  * Items aren't set as separator by default.
645  *
646  * If set as separator it will display separator theme, so won't display
647  * icons or label.
648  *
649  * @see elm_toolbar_item_separator_get()
650  *
651  * @ingroup Toolbar
652  */
653 EAPI void                         elm_toolbar_item_separator_set(Elm_Object_Item *it, Eina_Bool separator);
654
655 /**
656  * Get a value whether item is a separator or not.
657  *
658  * @param it The toolbar item.
659  * @return @c EINA_TRUE means item @p it is a separator. @c EINA_FALSE
660  * indicates it's not. If @p it is @c NULL, @c EINA_FALSE is returned.
661  *
662  * @see elm_toolbar_item_separator_set() for details.
663  *
664  * @ingroup Toolbar
665  */
666 EAPI Eina_Bool                    elm_toolbar_item_separator_get(const Elm_Object_Item *it);
667
668 /**
669  * Set the shrink state of toolbar @p obj.
670  *
671  * @param obj The toolbar object.
672  * @param shrink_mode Toolbar's items display behavior.
673  *
674  * The toolbar won't scroll if #ELM_TOOLBAR_SHRINK_NONE,
675 <<<<<<< HEAD
676  * but will enforce a minimun size so all the items will fit, won't scroll
677 =======
678  * but will enforce a minimum size so all the items will fit, won't scroll
679 >>>>>>> remotes/origin/upstream
680  * and won't show the items that don't fit if #ELM_TOOLBAR_SHRINK_HIDE,
681  * will scroll if #ELM_TOOLBAR_SHRINK_SCROLL, and will create a button to
682  * pop up excess elements with #ELM_TOOLBAR_SHRINK_MENU.
683  *
684  * @ingroup Toolbar
685  */
686 EAPI void                         elm_toolbar_shrink_mode_set(Evas_Object *obj, Elm_Toolbar_Shrink_Mode shrink_mode);
687
688 /**
689  * Get the shrink mode of toolbar @p obj.
690  *
691  * @param obj The toolbar object.
692  * @return Toolbar's items display behavior.
693  *
694  * @see elm_toolbar_shrink_mode_set() for details.
695  *
696  * @ingroup Toolbar
697  */
698 EAPI Elm_Toolbar_Shrink_Mode      elm_toolbar_shrink_mode_get(const Evas_Object *obj);
699
700 /**
701  * Enable/disable homogeneous mode.
702  *
703  * @param obj The toolbar object
704  * @param homogeneous Assume the items within the toolbar are of the
705  * same size (EINA_TRUE = on, EINA_FALSE = off). Default is @c EINA_FALSE.
706  *
707  * This will enable the homogeneous mode where items are of the same size.
708  * @see elm_toolbar_homogeneous_get()
709  *
710  * @ingroup Toolbar
711  */
712 EAPI void                         elm_toolbar_homogeneous_set(Evas_Object *obj, Eina_Bool homogeneous);
713
714 /**
715  * Get whether the homogeneous mode is enabled.
716  *
717  * @param obj The toolbar object.
718  * @return Assume the items within the toolbar are of the same height
719  * and width (EINA_TRUE = on, EINA_FALSE = off).
720  *
721  * @see elm_toolbar_homogeneous_set()
722  *
723  * @ingroup Toolbar
724  */
725 EAPI Eina_Bool                    elm_toolbar_homogeneous_get(const Evas_Object *obj);
726
727 /**
728  * Set the parent object of the toolbar items' menus.
729  *
730  * @param obj The toolbar object.
731  * @param parent The parent of the menu objects.
732  *
733  * Each item can be set as item menu, with elm_toolbar_item_menu_set().
734  *
735  * For more details about setting the parent for toolbar menus, see
736  * elm_menu_parent_set().
737  *
738  * @see elm_menu_parent_set() for details.
739  * @see elm_toolbar_item_menu_set() for details.
740  *
741  * @ingroup Toolbar
742  */
743 EAPI void                         elm_toolbar_menu_parent_set(Evas_Object *obj, Evas_Object *parent);
744
745 /**
746  * Get the parent object of the toolbar items' menus.
747  *
748  * @param obj The toolbar object.
749  * @return The parent of the menu objects.
750  *
751  * @see elm_toolbar_menu_parent_set() for details.
752  *
753  * @ingroup Toolbar
754  */
755 EAPI Evas_Object                 *elm_toolbar_menu_parent_get(const Evas_Object *obj);
756
757 /**
758  * Set the alignment of the items.
759  *
760  * @param obj The toolbar object.
761  * @param align The new alignment, a float between <tt> 0.0 </tt>
762  * and <tt> 1.0 </tt>.
763  *
764  * Alignment of toolbar items, from <tt> 0.0 </tt> to indicates to align
765  * left, to <tt> 1.0 </tt>, to align to right. <tt> 0.5 </tt> centralize
766  * items.
767  *
768  * Centered items by default.
769  *
770  * @see elm_toolbar_align_get()
771  *
772  * @ingroup Toolbar
773  */
774 EAPI void                         elm_toolbar_align_set(Evas_Object *obj, double align);
775
776 /**
777  * Get the alignment of the items.
778  *
779  * @param obj The toolbar object.
780  * @return toolbar items alignment, a float between <tt> 0.0 </tt> and
781  * <tt> 1.0 </tt>.
782  *
783  * @see elm_toolbar_align_set() for details.
784  *
785  * @ingroup Toolbar
786  */
787 EAPI double                       elm_toolbar_align_get(const Evas_Object *obj);
788
789 /**
790  * Set whether the toolbar item opens a menu.
791  *
792  * @param it The toolbar item.
793  * @param menu If @c EINA_TRUE, @p item will opens a menu when selected.
794  *
795  * A toolbar item can be set to be a menu, using this function.
796  *
797  * Once it is set to be a menu, it can be manipulated through the
798  * menu-like function elm_toolbar_menu_parent_set() and the other
799  * elm_menu functions, using the Evas_Object @c menu returned by
800  * elm_toolbar_item_menu_get().
801  *
802  * So, items to be displayed in this item's menu should be added with
803  * elm_menu_item_add().
804  *
805  * The following code exemplifies the most basic usage:
806  * @code
807  * tb = elm_toolbar_add(win)
808  * item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
809  * elm_toolbar_item_menu_set(item, EINA_TRUE);
810  * elm_toolbar_menu_parent_set(tb, win);
811  * menu = elm_toolbar_item_menu_get(item);
812  * elm_menu_item_add(menu, NULL, "edit-cut", "Cut", NULL, NULL);
813  * menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Copy", NULL,
814  * NULL);
815  * @endcode
816  *
817  * @see elm_toolbar_item_menu_get()
818  *
819  * @ingroup Toolbar
820  */
821 EAPI void                         elm_toolbar_item_menu_set(Elm_Object_Item *it, Eina_Bool menu);
822
823 /**
824  * Get toolbar item's menu.
825  *
826  * @param it The toolbar item.
827  * @return Item's menu object or @c NULL on failure.
828  *
829  * If @p item wasn't set as menu item with elm_toolbar_item_menu_set(),
830  * this function will set it.
831  *
832  * @see elm_toolbar_item_menu_set() for details.
833  *
834  * @ingroup Toolbar
835  */
836 EAPI Evas_Object                 *elm_toolbar_item_menu_get(const Elm_Object_Item *it);
837
838 /**
839  * Add a new state to @p item.
840  *
841  * @param it The toolbar item.
842  * @param icon A string with icon name or the absolute path of an image file.
843  * @param label The label of the new state.
844  * @param func The function to call when the item is clicked when this
845  * state is selected.
846  * @param data The data to associate with the state.
847  * @return The toolbar item state, or @c NULL upon failure.
848  *
849  * Toolbar will load icon image from fdo or current theme.
850  * This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
851  * If an absolute path is provided it will load it direct from a file.
852  *
853  * States created with this function can be removed with
854  * elm_toolbar_item_state_del().
855  *
856  * @see elm_toolbar_item_state_del()
857  * @see elm_toolbar_item_state_sel()
858  * @see elm_toolbar_item_state_get()
859  *
860  * @ingroup Toolbar
861  */
862 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);
863
864 /**
865 <<<<<<< HEAD
866  * Delete a previoulsy added state to @p item.
867 =======
868  * Delete a previously added state to @p item.
869 >>>>>>> remotes/origin/upstream
870  *
871  * @param it The toolbar item.
872  * @param state The state to be deleted.
873  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
874  *
875  * @see elm_toolbar_item_state_add()
876  */
877 EAPI Eina_Bool                    elm_toolbar_item_state_del(Elm_Object_Item *it, Elm_Toolbar_Item_State *state);
878
879 /**
880  * Set @p state as the current state of @p it.
881  *
882  * @param it The toolbar item.
883  * @param state The state to use.
884  * @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
885  *
886  * If @p state is @c NULL, it won't select any state and the default item's
887  * icon and label will be used. It's the same behaviour than
888 <<<<<<< HEAD
889  * elm_toolbar_item_state_unser().
890 =======
891  * elm_toolbar_item_state_unset().
892 >>>>>>> remotes/origin/upstream
893  *
894  * @see elm_toolbar_item_state_unset()
895  *
896  * @ingroup Toolbar
897  */
898 EAPI Eina_Bool                    elm_toolbar_item_state_set(Elm_Object_Item *it, Elm_Toolbar_Item_State *state);
899
900 /**
901  * Unset the state of @p it.
902  *
903  * @param it The toolbar item.
904  *
905  * The default icon and label from this item will be displayed.
906  *
907  * @see elm_toolbar_item_state_set() for more details.
908  *
909  * @ingroup Toolbar
910  */
911 EAPI void                         elm_toolbar_item_state_unset(Elm_Object_Item *it);
912
913 /**
914  * Get the current state of @p it.
915  *
916  * @param it The toolbar item.
917  * @return The selected state or @c NULL if none is selected or on failure.
918  *
919  * @see elm_toolbar_item_state_set() for details.
920  * @see elm_toolbar_item_state_unset()
921  * @see elm_toolbar_item_state_add()
922  *
923  * @ingroup Toolbar
924  */
925 EAPI Elm_Toolbar_Item_State      *elm_toolbar_item_state_get(const Elm_Object_Item *it);
926
927 /**
928  * Get the state after selected state in toolbar's @p item.
929  *
930  * @param it The toolbar item to change state.
931  * @return The state after current state, or @c NULL on failure.
932  *
933  * If last state is selected, this function will return first state.
934  *
935  * @see elm_toolbar_item_state_set()
936  * @see elm_toolbar_item_state_add()
937  *
938  * @ingroup Toolbar
939  */
940 EAPI Elm_Toolbar_Item_State      *elm_toolbar_item_state_next(Elm_Object_Item *it);
941
942 /**
943  * Get the state before selected state in toolbar's @p item.
944  *
945  * @param it The toolbar item to change state.
946  * @return The state before current state, or @c NULL on failure.
947  *
948  * If first state is selected, this function will return last state.
949  *
950  * @see elm_toolbar_item_state_set()
951  * @see elm_toolbar_item_state_add()
952  *
953  * @ingroup Toolbar
954  */
955 EAPI Elm_Toolbar_Item_State      *elm_toolbar_item_state_prev(Elm_Object_Item *it);
956
957
958 /**
959  * Change a toolbar's orientation
960  * @param obj The toolbar object
961  * @param horizontal If @c EINA_TRUE, the toolbar is horizontal
962  * By default, a toolbar will be horizontal. Use this function to create a vertical toolbar.
963  * @ingroup Toolbar
964  */
965 EAPI void                         elm_toolbar_horizontal_set(Evas_Object *obj, Eina_Bool horizontal);
966
967 /**
968  * Get a toolbar's orientation
969  * @param obj The toolbar object
970  * @return If @c EINA_TRUE, the toolbar is horizontal
971  * By default, a toolbar will be horizontal. Use this function to determine whether a toolbar is vertical.
972  * @ingroup Toolbar
973  */
974 EAPI Eina_Bool                    elm_toolbar_horizontal_get(const Evas_Object *obj);
975
976 /**
977  * Get the number of items in a toolbar
978  * @param obj The toolbar object
979  * @return The number of items in @p obj toolbar
980  * @ingroup Toolbar
981  */
982 EAPI unsigned int                 elm_toolbar_items_count(const Evas_Object *obj);
983 <<<<<<< HEAD
984 =======
985
986 /**
987  * Set the toolbar select mode.
988  *
989  * @param obj The toolbar object
990  * @param mode The select mode
991  *
992  * elm_toolbar_select_mode_set() changes item select mode in the toolbar widget.
993  * - ELM_OBJECT_SELECT_MODE_DEFAULT : Items will only call their selection func and
994  *      callback when first becoming selected. Any further clicks will
995  *      do nothing, unless you set always select mode.
996  * - ELM_OBJECT_SELECT_MODE_ALWAYS :  This means that, even if selected,
997  *      every click will make the selected callbacks be called.
998  * - ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select items
999  *      entirely and they will neither appear selected nor call selected
1000  *      callback functions.
1001  *
1002  * @see elm_toolbar_select_mode_get()
1003  *
1004  * @ingroup Toolbar
1005  */
1006 EAPI void
1007 elm_toolbar_select_mode_set(Evas_Object *obj, Elm_Object_Select_Mode mode);
1008
1009 /**
1010  * Get the toolbar select mode.
1011  *
1012  * @param obj The toolbar object
1013  * @return The select mode
1014  * (If getting mode is failed, it returns ELM_OBJECT_SELECT_MODE_MAX)
1015  *
1016  * @see elm_toolbar_select_mode_set()
1017  *
1018  * @ingroup Toolbar
1019  */
1020 EAPI Elm_Object_Select_Mode
1021 elm_toolbar_select_mode_get(const Evas_Object *obj);
1022
1023 >>>>>>> remotes/origin/upstream
1024 /**
1025  * @}
1026  */