efl/src/lib/elementary/elm_toolbar_item.eo

330 lines
13 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]]
}
struct 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().
]]
2016-10-27 07:45:19 -07:00
label: string; [[Item label]]
icon_str: string; [[Item icon string]]
icon: Efl.Canvas.Object; [[Item icon]]
func: Evas_Smart_Cb ; [[Item callback function]]
data: const(void_ptr); [[Item data]]
}
class Elm.Toolbar_Item extends Elm.Widget.Item implements Efl.Ui.Focus.Object, Efl.Ui.Legacy
2014-09-27 22:15:56 -07:00
{
[[Elementary toolbar item class]]
legacy_prefix: elm_toolbar_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 {
get {
[[Get the item before this one in the widget's list of items.
See also @.next.
]]
}
values {
item: Elm.Widget.Item; [[The item before the object in its parent's
list. If there is no previous item or in case
of error, $null is returned.]]
}
}
@property next {
get {
[[Get the item after this one in the widget's list of items.
See also @.prev.
]]
}
values {
item: Elm.Widget.Item; [[The item after the object in its parent's
list. If there is no next item or in case
of error, $null is returned.]]
}
}
@property selected {
[[Indicates whether this item is currently selected.]]
get {
[[Get the selected state of this item.]]
}
set {
[[Set the selected state of $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 retrieved
with @Elm.Toolbar.selected_item.get.
Selected items will be highlighted.
]]
}
values {
selected: bool; [[The selection state.]]
}
}
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 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
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 {
icon: string; [[A string with icon name or the
2015-08-11 07:27:06 -07:00
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 {
obj: Efl.Canvas.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 {
obj: Efl.Canvas.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; [[$true if the item is a separator, $false otherwise]]
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 {
menu: Efl.Canvas.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.
]]
return: bool; [[$true on success, $false otherwise]]
2014-09-27 22:15:56 -07:00
}
values {
state: ptr(Elm.Toolbar_Item_State) @nullable; [[Item state]]
2014-09-27 22:15:56 -07:00
}
}
/* init { FIXME
params {
Evas_Smart_Cb func;
const(void_ptr) data;
2014-09-27 22:15:56 -07:00
}
}*/
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 {
@in img: const(void_ptr); [[The binary data that will be used as an image.]]
2016-04-19 08:31:43 -07:00
@in size: size; [[The size of binary data $img.]]
@in format: string; [[Optional format of $img to pass to the image loader.]]
@in key: string; [[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
}
return: bool; [[$true on success, $false otherwise]]
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 {
@in file: string; [[The file that contains the image.]]
@in key: string; [[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
}
return: bool; [[$true on success, $false otherwise]]
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.
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 {
@in icon: string; [[A string with icon name or the absolute path of an image file.]]
@in label: string; [[The label of the new state.]]
2015-08-11 07:27:06 -07:00
@in func: Evas_Smart_Cb @optional; [[The function to call when the item is clicked when this state is selected.]]
@in data: const(void_ptr) @optional; [[The data to associate with the state.]]
2014-09-27 22:15:56 -07:00
}
return: ptr(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 {
@in state: ptr(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: ptr(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: ptr(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 {
@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 {
@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 {
Efl.Object.constructor;
Efl.Object.invalidate;
Elm.Widget.Item.disable;
Elm.Widget.Item.disabled { set; }
2018-02-14 18:14:52 -08:00
Elm.Widget.Item.item_focus { get; set; }
Elm.Widget.Item.signal_emit;
Elm.Widget.Item.part_text { get; set; }
Elm.Widget.Item.part_content { get; set; }
Elm.Widget.Item.part_content_unset;
Efl.Ui.Focus.Object.focus_geometry { get; }
Efl.Ui.Focus.Object.focus { set; }
Efl.Ui.Focus.Object.focus_parent { get; }
Efl.Access.Object.i18n_name { get; }
Efl.Access.Object.state_set { get; }
2014-09-27 22:15:56 -07:00
}
}