efl/src/lib/elementary/elm_diskselector.eo

214 lines
7.5 KiB
Plaintext

class Elm.Diskselector (Efl.Ui.Widget, Elm.Interface_Scrollable,
Efl.Access.Widget.Action,
Efl.Ui.Clickable, Efl.Ui.Scrollable,
Efl.Ui.Selectable, Efl.Ui.Legacy)
{
[[Elementary diskselector class]]
legacy_prefix: elm_diskselector;
eo_prefix: elm_obj_diskselector;
event_prefix: elm_diskselector;
methods {
@property side_text_max_length {
set {
[[Set the side labels max length.
Length is the number of characters of items' label that will be
visible when it's set on side positions. It will just crop
the string after defined size. E.g.:
An item with label "January" would be displayed on side position as
"Jan" if max length is set to 3, or "Janu", if this property
is set to 4.
When it's selected, the entire label will be displayed, except for
width restrictions. In this case label will be cropped and "..."
will be concatenated.
Default side label max length is 3.
This property will be applied over all items, included before or
later this function call.
]]
}
get {
[[Get the side labels max length.
See also @.side_text_max_length.set for details.
]]
}
values {
len: int; [[The max length defined for side labels.]]
}
}
@property round_enabled {
set {
[[Enable or disable round mode.
Disabled by default. If round mode is enabled the items list will
work like a circular list, so when the user reaches the last item,
the first one will popup.
See also @.round_enabled.get.
]]
}
get {
[[Get a value whether round mode is enabled or not.
See also @.round_enabled.set for details.
]]
}
values {
enabled: bool; [[$true to enable round mode or $false to
disable it.]]
}
}
@property display_item_num {
set {
[[Set the number of items to be displayed.
Default value is 3, and also it's the minimum. If $num is less
than 3, it will be set to 3.
Also, it can be set on theme, using data item $display_item_num
on group "elm/diskselector/item/X", where X is style set.
]]
/* FIXME-doc
* E.g.:
* group { name: "elm/diskselector/item/X";
* data {
* item: "display_item_num" "5";
* }
*/
}
get {
[[Get the number of items in the diskselector object.]]
}
values {
num: int; [[The number of items the diskselector will display.]]
}
}
@property first_item {
get {
[[Get the first item of the diskselector.
The list of items follows append order. So it will return the first
item appended to the widget that wasn't deleted.
See also @.item_append,
@.items.get.
]]
return: Elm.Widget.Item; [[The first item, or $null if none.]]
}
}
@property items {
get {
[[Get a list of all the diskselector items.
See also @.item_append,
\@ref elm_object_item_del,
@.clear.
]]
return: const(list<Elm.Widget.Item>); [[A $list of diskselector items, or $ull on failure.]]
}
}
@property last_item {
get {
[[Get the last item of the diskselector.
The list of items follows append order. So it will return last first
item appended to the widget that wasn't deleted.
See also @.item_append,
@.items.get.
]]
return: Elm.Widget.Item; [[The last item, or $null if none.]]
}
}
@property selected_item {
get {
[[Get the selected item.
The selected item can be unselected with
@Elm.Diskselector.Item.selected.set, and the first item of
diskselector will be selected.
The selected item always will be centered on diskselector, with
full label displayed, i.e., max length set to side labels won't
apply on the selected item. More details on
@.side_text_max_length.set.
]]
return: Elm.Widget.Item; [[The selected diskselector item.]]
}
}
item_append {
[[Appends a new item to the diskselector object.
A new item will be created and appended to the diskselector, i.e., will
be set as last item. Also, if there is no selected item, it will
be selected. This will always happens for the first appended item.
If no icon is set, label will be centered on item position, otherwise
the icon will be placed at left of the label, that will be shifted
to the right.
Items created with this method can be deleted with
\@ref elm_object_item_del.
Associated $data can be properly freed when item is deleted if a
callback function is set with \@ref elm_object_item_del_cb_set.
If a function is passed as argument, it will be called every time this item
is selected, i.e., the user stops the diskselector with this
item on center position. If such function isn't needed, just passing
$null as $func is enough. The same should be done for $data.
See also \@ref elm_object_item_del,
@.clear,
\@ref elm_icon_add.
]]
/* FIXME-doc
* Simple example (with no function callback or data associated):
* @code
* disk = elm_diskselector_add(win);
* ic = elm_icon_add(win);
* elm_image_file_set(ic, "path/to/image", NULL);
* elm_icon_resizable_set(ic, true, true);
* elm_diskselector_item_append(disk, "label", ic, NULL, NULL);
* @endcode
*/
return: Elm.Widget.Item; [[New item]]
params {
@in label: string; [[The label of the diskselector item.]]
@in icon: Efl.Canvas.Object @optional; [[The icon object to use at left side of the item. An
icon can be any Evas object, but usually it is an icon created
with elm_icon_add(). ]]
@in func: Evas_Smart_Cb @optional; [[The function to call when the item is selected.]]
@in data: const(void_ptr) @optional; [[The data to associate with the item for related callbacks.]]
}
}
clear {
[[Remove all diskselector's items.
See also \@ref elm_object_item_del,
@.item_append.
]]
}
}
implements {
class.constructor;
Efl.Object.constructor;
Efl.Gfx.position { set; }
Efl.Gfx.size { set; }
Efl.Canvas.Group.group_member_add;
Efl.Ui.Widget.on_access_update;
Efl.Ui.Widget.theme_apply;
Efl.Ui.Focus.Object.on_focus_update;
Efl.Ui.Translatable.translation_update;
Efl.Ui.Widget.widget_sub_object_del;
Efl.Ui.Widget.widget_event;
Elm.Interface_Scrollable.policy { get; set; }
Efl.Access.Widget.Action.elm_actions { get; }
}
}