enum Elm.Toolbar_Item.Scrollto_Type
{
   [[Defines where to position the item in the toolbar.]]
   legacy: elm_toolbar_item_scrollto;

   none = 0, [[no scrollto]]
   in = (1 << 0), [[to the nearest viewport]]
   first = (1 << 1), [[to the first of viewport]]
   middle = (1 << 2), [[to the middle of viewport]]
   last = (1 << 3) [[to the last of viewport]]
}

class Elm.Toolbar_Item(Elm.Widget_Item)
{
      eo_prefix: elm_obj_toolbar_item;
      methods {
           @property prev {
                get {
                     [[\@MOBILE_ONLY

                       Get the item before $item in toolbar.

                       Note: If it is the first item, $null will be returned.

                       \@if MOBILE \@since_tizen 2.3
                       \@endif
                     ]]
                }
                values {
                     item: Elm.Widget_Item *; [[The item before $item, or $null
                                                if none or on failure.]]
                }
           }
           @property next {
                get {
                     [[\@MOBILE_ONLY

                       Get the item after $item in toolbar.

                       Note: If it is the last item, $null will be returned.

                       \@if MOBILE \@since_tizen 2.3
                       \@endif
                     ]]
                }
                values {
                     item: Elm.Widget_Item *; [[The item after $item, or $null
                                                if none or on failure.]]
                }
           }
           @property priority {
                get {
                     [[\@MOBILE_ONLY

                       Get the priority of a toolbar item.

                       \@if MOBILE \@since_tizen 2.3
                       \@endif
                     ]]
                }
                set {
                     [[\@MOBILE_ONLY

                       Set the priority of a toolbar item.

                       This is used only when the toolbar shrink mode is set
                       to #ELM_TOOLBAR_SHRINK_MENU or #ELM_TOOLBAR_SHRINK_HIDE.
                       When space is less than required, items with low priority
                       will be removed from the toolbar and added to a
                       dynamically-created menu, while items with higher
                       priority will remain on the toolbar, with the same
                       order they were added.

                       \@if MOBILE \@since_tizen 2.3
                       \@endif
                     ]]
                }
                values {
                     priority: int; [[The $item priority. The default is zero
                                      for set and 0 is returned on failure.]]
                }
           }
           @property selected {
                get {
                     [[\@MOBILE_ONLY

                       Get whether the $item is selected or not.

                       \@if MOBILE \@since_tizen 2.3
                       \@endif
                     ]]
                }
                set {
                     [[\@MOBILE_ONLY

                       Set the selected state of an item.

                       This sets the selected state of the given item $it.
                       $true for selected, $false for not selected.

                       If a new item is selected the previously selected will
                       be unselected. Previously selected item can be get with
                       function @Elm.Toolbar.selected_item.get.

                       Selected items will be highlighted.

                       \@if MOBILE \@since_tizen 2.3
                       \@endif
                     ]]
                }
                values {
                     selected: bool; [[The selected state.]]
                }
           }
           @property icon {
                get {
                     [[\@MOBILE_ONLY

                       Get the string used to set the icon of $item.

                       \@if MOBILE \@since_tizen 2.3
                       \@endif
                     ]]
                }
                set {
                     [[\@MOBILE_ONLY

                       Set the icon associated with $item.

                       Toolbar will load icon image from fdo or current theme.
                       This behavior can be set by
                       @Elm.Toolbar.icon_order_lookup.set function.
                       If an absolute path is provided it will load it direct
                       from a file.

                       Note: This function does not accept relative icon path.

                       \@if MOBILE \@since_tizen 2.3
                       \@endif
                     ]]
                }
                values {
                     icon: const(char)*; [[A string with icon name or the
                                           absolute path of an image file.]]
                }
           }
           @property object {
                get {
                     [[\@MOBILE_ONLY

                       Get the real Evas(Edje) object created to implement the
                       view of a given toolbar $item.

                       \@if MOBILE \@since_tizen 2.3
                       \@endif
                     ]]
                }
                values {
                     obj: Evas.Object *; [[The base Edje object associated with $it.]]
                }
           }
           @property icon_object {
                get {
                     [[\@MOBILE_ONLY

                       Get the icon object of $item.

                       See also @.icon.set, @.icon_file_set, @.icon_memfile_set.

                       \@if MOBILE \@since_tizen 2.3
                       \@endif
                     ]]
                }
                values {
                     obj: Evas.Object *; [[The icon object.]]
                }
           }
           @property separator {
                get {
                     [[\@MOBILE_ONLY

                       Get a value whether item is a separator or not.

                       \@if MOBILE \@since_tizen 2.3
                       \@endif
                     ]]
                }
                set {
                     [[\@MOBILE_ONLY

                       Set or unset item as a separator.

                       Items aren't set as separator by default.

                       If set as separator it will display separator theme, so
                       won't display icons or label.

                       \@if MOBILE \@since_tizen 2.3
                       \@endif
                     ]]
                }
                values {
                     separator: bool;
                }
           }
           @property menu {
                get @internal {
                     [[Get toolbar item's menu.

                       If $item wasn't set as menu item with @.menu_set,
                       this function will set it.
                     ]]
                }
                values {
                     menu: Evas.Object *; [[Item's menu object or $null on failure.]]
                }
           }
           @property state {
                get {
                     [[\@MOBILE_ONLY

                       Get the current state of $it.

                       \@if MOBILE \@since_tizen 2.3
                       \@endif
                     ]]
                }
                set {
                     [[\@MOBILE_ONLY

                       Set $state as the current state of $it.

                       If $state is $NULL, it won't select any state and the
                       default item's icon and label will be used. It's the
                       behavior as \@ref elm_toolbar_item_state_unset.

                       \@if MOBILE \@since_tizen 2.3
                       \@endif
                     ]]
                     return: bool;
                }
                values {
                     state: Elm_Toolbar_Item_State * @nullable;
                }
           }
           /*      init { FIXME
                   params {
                   Evas_Smart_Cb func;
                   const(void)* data;
                   }
                   }*/
           icon_memfile_set {
                [[\@MOBILE_ONLY

                  Set the icon associated with $item to an image in a binary buffer.

                  Note: The icon image set by this function can be changed by
                  @.icon.set.

                  \@if MOBILE \@since_tizen 2.3
                  \@endif
                ]]
                params {
                     @in img: const (void) *; [[The binary data that will be used as an image.]]
                     @in size: size_t; [[The size of binary data $img.]]
                     @in format: const (char) *; [[Optional format of $img to pass to the image loader.]]
                     @in key: const (char) *; [[Optional key of $img to pass to the image loader (eg. if $img is an edje file).]]
                }
                return: bool;
           }
           icon_file_set {
                [[\@MOBILE_ONLY

                  Set the icon associated with $item to an image in a binary buffer.

                  Note: The icon image set by this function can be changed by
                  elm_toolbar_item_icon_set().

                  \@if MOBILE \@since_tizen 2.3
                  \@endif
                ]]
                params {
                     @in file: const (char) *; [[The file that contains the image.]]
                     @in key: const (char) *; [[Optional key of $img to pass to the image loader (eg. if $img is an edje file).]]
                }
                return: bool;
           }
           state_add {
                [[\@MOBILE_ONLY

                  Add a new state to $item.

                  Toolbar will load icon image from fdo or current theme.
                  This behavior can be set by @Elm.Toolbar.icon_order_lookup.set
                  function. If an absolute path is provided it will load it
                  direct from a file.

                  States created with this function can be removed with
                  @.state_del.

                  \@if MOBILE \@since_tizen 2.3
                  \@endif
                ]]
                params {
                     @in icon: const (char) *; [[A string with icon name or the absolute path of an image file.]]
                     @in label: const (char) *; [[The label of the new state.]]
                     @in func: Evas_Smart_Cb @optional; [[The function to call when the item is clicked when this state is selected.]]
                     @in data: const (void) * @optional; [[The data to associate with the state.]]
                }
                return: Elm_Toolbar_Item_State *; [[The toolbar item state, or $null upon failure.]]
           }
           state_del {
                [[\@MOBILE_ONLY

                  Delete a previously added state to $item.

                  \@if MOBILE \@since_tizen 2.3
                  \@endif
                ]]
                params {
                     @in state: Elm_Toolbar_Item_State *; [[The state to be deleted.]]
                }
                return: bool; [[$true on success or $false on failure.]]
           }
           state_next {
                [[\@MOBILE_ONLY

                  Get the state after selected state in toolbar's $item.

                  If last state is selected, this function will return first
                  state.

                  \@if MOBILE \@since_tizen 2.3
                  \@endif
                ]]
                return: Elm_Toolbar_Item_State *; [[The state after current state, or $null on failure.]]
           }
           state_prev {
                [[\@MOBILE_ONLY

                  Get the state before selected state in toolbar's $item.

                  If first state is selected, this function will return last
                  state.

                  \@if MOBILE \@since_tizen 2.3
                  \@endif
                ]]
                return: Elm_Toolbar_Item_State *; [[The state before current state, or $null on failure.]]
           }
           show {
                [[\@MOBILE_ONLY

                  Show a specific item, when the toolbar can be scrolled.

                  \@if MOBILE \@since_tizen 2.3
                  \@endif

                  @since 1.8
                ]]
                params {
                     @in scrollto: Elm.Toolbar_Item.Scrollto_Type; [[The position the item should appear at.]]
                }
           }
           bring_in {
                [[\@MOBILE_ONLY

                  Show a specific item with scroll animation, when the toolbar
                  can be scrolled.

                  \@if MOBILE \@since_tizen 2.3
                  \@endif

                  @since 1.8
                ]]
                params {
                     @in scrollto: Elm.Toolbar_Item.Scrollto_Type; [[The position the item should appear at.]]
                }
           }
           menu_set @internal {
                [[Set whether the toolbar item opens a menu.

                  A toolbar item can be set to be a menu, using this function.

                  Once it is set to be a menu, it can be manipulated through the
                  menu-like function @Elm.Toolbar.menu_parent.set and the
                  other elm_menu functions, using the Evas_Object $menu returned
                  by @.menu.get.

                  So, items to be displayed in this item's menu should be added
                  with \@ref elm_menu_item_add.
                ]]
                /* FIXME-doc
                 The following code exemplifies the most basic usage:
                 @code
                 tb = elm_toolbar_add(win)
                 item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
                 elm_toolbar_item_menu_set(item, true);
                 elm_toolbar_menu_parent_set(tb, win);
                 menu = elm_toolbar_item_menu_get(item);
                 elm_menu_item_add(menu, NULL, "edit-cut", "Cut", NULL, NULL);
                 menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Copy", NULL,
                 NULL);
                 @endcode
                */
                params {
                     @in menu: bool; [[If $true, $item will opens a menu when selected.]]
                }
           }
      }
      implements {
           Eo.Base.constructor;
           Eo.Base.destructor;
           Elm.Widget_Item.disable;
           Elm.Widget_Item.focus.set;
           Elm.Widget_Item.focus.get;
           Elm.Widget_Item.part_text.get;
           Elm.Widget_Item.part_text.set;
           Elm.Widget_Item.part_content.get;
           Elm.Widget_Item.part_content.set;
           Elm.Widget_Item.part_content_unset;
           Elm_Interface_Atspi_Accessible.name.get;
           Elm_Interface_Atspi_Accessible.state_set.get;
           Elm_Interface_Atspi_Component.highlight_grab;
           Elm_Interface_Atspi_Component.highlight_clear;
      }
}
