efl/legacy/elementary/src/lib/elm_toolbar_item.eo

311 lines
12 KiB
Plaintext
Raw Normal View History

enum Elm.Toolbar_Item.Scrollto_Type
{
2015-06-11 08:39:33 -07:00
[[Defines where to position the item in the toolbar.]]
legacy: elm_toolbar_item_scrollto;
2015-06-11 08:39:33 -07:00
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)
2014-09-27 22:15:56 -07:00
{
eo_prefix: elm_obj_toolbar_item;
2015-05-07 09:32:53 -07:00
methods {
@property prev {
2014-09-27 22:15:56 -07:00
get {
2015-08-11 07:27:06 -07:00
[[Get the item before $item in toolbar.
2014-09-27 22:15:56 -07:00
2015-08-11 07:27:06 -07:00
Note: If it is the first item, $null will be returned.
]]
2014-09-27 22:15:56 -07:00
}
values {
2015-08-11 07:27:06 -07:00
item: Elm.Widget_Item *; [[The item before $item, or $null
if none or on failure.]]
2014-09-27 22:15:56 -07:00
}
}
2015-05-07 09:32:53 -07:00
@property next {
2014-09-27 22:15:56 -07:00
get {
2015-08-11 07:27:06 -07:00
[[Get the item after $item in toolbar.
2014-09-27 22:15:56 -07:00
2015-08-11 07:27:06 -07:00
Note: If it is the last item, $null will be returned.
]]
2014-09-27 22:15:56 -07:00
}
values {
2015-08-11 07:27:06 -07:00
item: Elm.Widget_Item *; [[The item after $item, or $null
if none or on failure.]]
2014-09-27 22:15:56 -07:00
}
}
2015-05-07 09:32:53 -07:00
@property priority {
2014-09-27 22:15:56 -07:00
get {
2015-08-11 07:27:06 -07:00
[[Get the priority of a toolbar item.]]
2014-09-27 22:15:56 -07:00
}
set {
2015-08-11 07:27:06 -07:00
[[Set the priority of a toolbar item.
2014-09-27 22:15:56 -07:00
2015-08-11 07:27:06 -07:00
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.
]]
2014-09-27 22:15:56 -07:00
}
values {
2015-08-11 07:27:06 -07:00
priority: int; [[The $item priority. The default is zero
for set and 0 is returned on failure.]]
2014-09-27 22:15:56 -07:00
}
}
2015-05-07 09:32:53 -07:00
@property selected {
2014-09-27 22:15:56 -07:00
get {
2015-08-11 07:27:06 -07:00
[[Get whether the $item is selected or not.]]
2014-09-27 22:15:56 -07:00
}
set {
2015-08-11 07:27:06 -07:00
[[Set the selected state of an item.
2014-09-27 22:15:56 -07:00
2015-08-11 07:27:06 -07:00
This sets the selected state of the given item $it.
$true for selected, $false for not selected.
2014-09-27 22:15:56 -07:00
2015-08-11 07:27:06 -07:00
If a new item is selected the previously selected will
be unselected. Previously selected item can be get with
2015-09-24 06:22:22 -07:00
function @Elm.Toolbar.selected_item.get.
2014-09-27 22:15:56 -07:00
2015-08-11 07:27:06 -07:00
Selected items will be highlighted.
]]
2014-09-27 22:15:56 -07:00
}
values {
2015-08-11 07:27:06 -07:00
selected: bool; [[The selected state.]]
2014-09-27 22:15:56 -07:00
}
}
2015-05-07 09:32:53 -07:00
@property icon {
2014-09-27 22:15:56 -07:00
get {
2015-08-11 07:27:06 -07:00
[[Get the string used to set the icon of $item.]]
2014-09-27 22:15:56 -07:00
}
set {
2015-08-11 07:27:06 -07:00
[[Set the icon associated with $item.
2014-09-27 22:15:56 -07:00
2015-08-11 07:27:06 -07:00
Toolbar will load icon image from fdo or current theme.
This behavior can be set by
2015-09-24 06:22:22 -07:00
@Elm.Toolbar.icon_order_lookup.set function.
2015-08-11 07:27:06 -07:00
If an absolute path is provided it will load it direct
from a file.
2014-09-27 22:15:56 -07:00
2015-08-11 07:27:06 -07:00
Note: This function does not accept relative icon path.
]]
2014-09-27 22:15:56 -07:00
}
values {
2015-08-11 07:27:06 -07:00
icon: const(char)*; [[A string with icon name or the
absolute path of an image file.]]
2014-09-27 22:15:56 -07:00
}
}
2015-05-07 09:32:53 -07:00
@property object {
2014-09-27 22:15:56 -07:00
get {
2015-08-11 07:27:06 -07:00
[[Get the real Evas(Edje) object created to implement the
view of a given toolbar $item.
]]
2014-09-27 22:15:56 -07:00
}
values {
2015-08-11 07:27:06 -07:00
obj: Evas.Object *; [[The base Edje object associated with $it.]]
2014-09-27 22:15:56 -07:00
}
}
2015-05-07 09:32:53 -07:00
@property icon_object {
2014-09-27 22:15:56 -07:00
get {
2015-08-11 07:27:06 -07:00
[[Get the icon object of $item.
2014-09-27 22:15:56 -07:00
2015-08-11 07:27:06 -07:00
See also @.icon.set, @.icon_file_set, @.icon_memfile_set.
]]
2014-09-27 22:15:56 -07:00
}
values {
2015-08-11 07:27:06 -07:00
obj: Evas.Object *; [[The icon object.]]
2014-09-27 22:15:56 -07:00
}
}
2015-05-07 09:32:53 -07:00
@property separator {
2014-09-27 22:15:56 -07:00
get {
2015-08-11 07:27:06 -07:00
[[Get a value whether item is a separator or not.]]
2014-09-27 22:15:56 -07:00
}
set {
2015-08-11 07:27:06 -07:00
[[Set or unset item as a separator.
2014-09-27 22:15:56 -07:00
2015-08-11 07:27:06 -07:00
Items aren't set as separator by default.
2014-09-27 22:15:56 -07:00
2015-08-11 07:27:06 -07:00
If set as separator it will display separator theme, so
won't display icons or label.
]]
2014-09-27 22:15:56 -07:00
}
values {
separator: bool;
2014-09-27 22:15:56 -07:00
}
}
2015-05-07 09:32:53 -07:00
@property menu {
2014-09-27 22:15:56 -07:00
get {
2015-08-11 07:27:06 -07:00
[[Get toolbar item's menu.
2014-09-27 22:15:56 -07:00
2015-08-11 07:27:06 -07:00
If $item wasn't set as menu item with @.menu_set,
this function will set it.
]]
2014-09-27 22:15:56 -07:00
}
values {
2015-08-11 07:27:06 -07:00
menu: Evas.Object *; [[Item's menu object or $null on failure.]]
2014-09-27 22:15:56 -07:00
}
}
2015-05-07 09:32:53 -07:00
@property state {
2014-09-27 22:15:56 -07:00
get {
2015-08-11 07:27:06 -07:00
[[Get the current state of $it.]]
2014-09-27 22:15:56 -07:00
}
set {
2015-08-11 07:27:06 -07:00
[[Set $state as the current state of $it.
2014-09-27 22:15:56 -07:00
2015-08-11 07:27:06 -07:00
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.
]]
2014-09-27 22:15:56 -07:00
return: bool;
}
values {
state: Elm_Toolbar_Item_State * @nullable;
2014-09-27 22:15:56 -07:00
}
}
/* init { FIXME
params {
Evas_Smart_Cb func;
const(void)* data;
}
}*/
icon_memfile_set {
2015-08-11 07:27:06 -07:00
[[Set the icon associated with $item to an image in a binary buffer.
2014-09-27 22:15:56 -07:00
2015-08-11 07:27:06 -07:00
Note: The icon image set by this function can be changed by
@.icon.set.
]]
2014-09-27 22:15:56 -07:00
params {
2015-08-11 07:27:06 -07:00
@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).]]
2014-09-27 22:15:56 -07:00
}
2015-08-11 07:27:06 -07:00
return: bool;
2014-09-27 22:15:56 -07:00
}
icon_file_set {
2015-08-11 07:27:06 -07:00
[[Set the icon associated with $item to an image in a binary buffer.
2014-09-27 22:15:56 -07:00
2015-08-11 07:27:06 -07:00
Note: The icon image set by this function can be changed by
elm_toolbar_item_icon_set().
]]
2014-09-27 22:15:56 -07:00
params {
2015-08-11 07:27:06 -07:00
@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).]]
2014-09-27 22:15:56 -07:00
}
2015-08-11 07:27:06 -07:00
return: bool;
2014-09-27 22:15:56 -07:00
}
state_add {
2015-08-11 07:27:06 -07:00
[[Add a new state to $item.
2014-09-27 22:15:56 -07:00
2015-08-11 07:27:06 -07:00
Toolbar will load icon image from fdo or current theme.
2015-09-24 06:22:22 -07:00
This behavior can be set by @Elm.Toolbar.icon_order_lookup.set
2015-08-11 07:27:06 -07:00
function. If an absolute path is provided it will load it
direct from a file.
2014-09-27 22:15:56 -07:00
2015-08-11 07:27:06 -07:00
States created with this function can be removed with
@.state_del.
]]
2014-09-27 22:15:56 -07:00
params {
2015-08-11 07:27:06 -07:00
@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.]]
2014-09-27 22:15:56 -07:00
}
2015-08-11 07:27:06 -07:00
return: Elm_Toolbar_Item_State *; [[The toolbar item state, or $null upon failure.]]
2014-09-27 22:15:56 -07:00
}
state_del {
2015-08-11 07:27:06 -07:00
[[Delete a previously added state to $item.]]
2014-09-27 22:15:56 -07:00
params {
2015-08-11 07:27:06 -07:00
@in state: Elm_Toolbar_Item_State *; [[The state to be deleted.]]
2014-09-27 22:15:56 -07:00
}
2015-08-11 07:27:06 -07:00
return: bool; [[$true on success or $false on failure.]]
2014-09-27 22:15:56 -07:00
}
state_next {
2015-08-11 07:27:06 -07:00
[[Get the state after selected state in toolbar's $item.
2014-09-27 22:15:56 -07:00
2015-08-11 07:27:06 -07:00
If last state is selected, this function will return first
state.
]]
return: Elm_Toolbar_Item_State *; [[The state after current state, or $null on failure.]]
2014-09-27 22:15:56 -07:00
}
state_prev {
2015-08-11 07:27:06 -07:00
[[Get the state before selected state in toolbar's $item.
2014-09-27 22:15:56 -07:00
2015-08-11 07:27:06 -07:00
If first state is selected, this function will return last
state.
]]
return: Elm_Toolbar_Item_State *; [[The state before current state, or $null on failure.]]
2014-09-27 22:15:56 -07:00
}
show {
2015-08-11 07:27:06 -07:00
[[Show a specific item, when the toolbar can be scrolled.
2014-09-27 22:15:56 -07:00
2015-08-11 07:27:06 -07:00
@since 1.8
]]
2014-09-27 22:15:56 -07:00
params {
2015-08-11 07:27:06 -07:00
@in scrollto: Elm.Toolbar_Item.Scrollto_Type; [[The position the item should appear at.]]
2014-09-27 22:15:56 -07:00
}
}
bring_in {
2015-08-11 07:27:06 -07:00
[[Show a specific item with scroll animation, when the toolbar
can be scrolled.
2014-09-27 22:15:56 -07:00
2015-08-11 07:27:06 -07:00
@since 1.8
]]
2014-09-27 22:15:56 -07:00
params {
2015-08-11 07:27:06 -07:00
@in scrollto: Elm.Toolbar_Item.Scrollto_Type; [[The position the item should appear at.]]
2014-09-27 22:15:56 -07:00
}
}
menu_set {
2015-08-11 07:27:06 -07:00
[[Set whether the toolbar item opens a menu.
2014-09-27 22:15:56 -07:00
2015-08-11 07:27:06 -07:00
A toolbar item can be set to be a menu, using this function.
2014-09-27 22:15:56 -07:00
2015-08-11 07:27:06 -07:00
Once it is set to be a menu, it can be manipulated through the
2015-09-24 06:22:22 -07:00
menu-like function @Elm.Toolbar.menu_parent.set and the
2015-08-11 07:27:06 -07:00
other elm_menu functions, using the Evas_Object $menu returned
by @.menu.get.
2014-09-27 22:15:56 -07:00
2015-08-11 07:27:06 -07:00
So, items to be displayed in this item's menu should be added
with \@ref elm_menu_item_add.
]]
/* FIXME-doc
2014-09-27 22:15:56 -07:00
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);
2014-09-27 22:15:56 -07:00
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
2015-08-11 07:27:06 -07:00
*/
2014-09-27 22:15:56 -07:00
params {
2015-08-11 07:27:06 -07:00
@in menu: bool; [[If $true, $item will opens a menu when selected.]]
2014-09-27 22:15:56 -07:00
}
}
}
implements {
Eo.Base.constructor;
Eo.Base.destructor;
Elm.Widget_Item.disable;
Elm.Widget_Item.focus.set;
Elm.Widget_Item.focus.get;
Elm.Widget_Item.signal_emit;
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;
2014-09-27 22:15:56 -07:00
}
}