2019-08-05 10:07:29 -07:00
|
|
|
abstract @beta Efl.Ui.Item extends Efl.Ui.Layout_Base implements Efl.Ui.Selectable, Efl.Input.Clickable
|
2018-04-22 23:13:59 -07:00
|
|
|
{
|
2019-07-29 06:56:27 -07:00
|
|
|
[[Selectable Item abstraction.
|
|
|
|
|
|
|
|
This class serves as the basis to create widgets acting as selectable items inside containers
|
|
|
|
like @Efl.Ui.List or @Efl.Ui.Grid, for example.
|
2019-08-30 02:53:40 -07:00
|
|
|
|
2019-07-29 06:56:27 -07:00
|
|
|
@Efl.Ui.Item provides user interaction through the @Efl.Input.Clickable mixin.
|
|
|
|
Items can be pressed, long-pressed, etc, and appropriate events are generated.
|
2019-08-05 10:07:29 -07:00
|
|
|
@Efl.Ui.Item also implements the @Efl.Ui.Selectable interface, meaning that "selected" and
|
2019-07-29 06:56:27 -07:00
|
|
|
"unselected" events are automatically generated.
|
|
|
|
|
|
|
|
Classes inheriting from this one only need to deal with the visual representation of the widget.
|
|
|
|
See for example @Efl.Ui.Grid_Default_Item and @Efl.Ui.List_Default_Item.
|
|
|
|
|
|
|
|
Some events are converted to edje signals so the theme can react to them:
|
|
|
|
@[Efl.Input.Clickable.pressed] -> "efl,state,pressed",
|
|
|
|
@[Efl.Input.Clickable.unpressed] -> "efl,state,unpressed",
|
2019-08-05 10:07:29 -07:00
|
|
|
@[Efl.Ui.Selectable.selected,changed] (true) -> "efl,state,selected",
|
|
|
|
@[Efl.Ui.Selectable.selected,changed] (false) -> "efl,state,unselected".
|
2019-08-30 02:53:40 -07:00
|
|
|
|
|
|
|
Item grouping inside containers is handled through the @Efl.Ui.Group_Item class.
|
2019-07-29 06:56:27 -07:00
|
|
|
]]
|
2018-04-22 23:13:59 -07:00
|
|
|
methods {
|
|
|
|
@property index {
|
2019-07-29 06:56:27 -07:00
|
|
|
[[The index of this item inside its container.
|
|
|
|
|
|
|
|
The container must be set through the @Efl.Ui.Item.container property.]]
|
2018-04-22 23:13:59 -07:00
|
|
|
get {}
|
|
|
|
values {
|
2019-08-30 02:53:40 -07:00
|
|
|
index : int; [[The index where to find this item in its @.container.]]
|
2018-04-22 23:13:59 -07:00
|
|
|
}
|
|
|
|
}
|
2019-07-10 07:30:04 -07:00
|
|
|
@property container {
|
|
|
|
[[The container this object is part of.
|
|
|
|
|
2019-07-29 06:56:27 -07:00
|
|
|
You should never use this property directly, the container will set it when the
|
|
|
|
item is added.
|
|
|
|
Unsetting this while the item is packed inside a container does not remove the item
|
|
|
|
from the container.
|
2019-07-10 07:30:04 -07:00
|
|
|
]]
|
|
|
|
values {
|
|
|
|
container : Efl.Ui.Widget; [[The container this item is in.]]
|
|
|
|
}
|
|
|
|
}
|
2019-08-15 23:46:00 -07:00
|
|
|
@property item_parent {
|
|
|
|
[[The parent of the item.
|
|
|
|
|
2019-09-10 07:05:44 -07:00
|
|
|
This property expresses a tree structure of items. If the parent is $NULL the item is added to
|
2019-08-30 02:53:40 -07:00
|
|
|
the root level of the content. The item parent can only be set once.
|
2019-09-10 07:05:44 -07:00
|
|
|
When the object is invalidated, the item parent is set to $NULL and still cannot be reset.
|
2019-08-15 23:46:00 -07:00
|
|
|
]]
|
|
|
|
values {
|
|
|
|
parent : Efl.Ui.Item;
|
|
|
|
}
|
|
|
|
}
|
2018-04-22 23:13:59 -07:00
|
|
|
}
|
|
|
|
implements {
|
|
|
|
Efl.Object.constructor;
|
|
|
|
Efl.Object.finalize;
|
|
|
|
Efl.Object.destructor;
|
2019-08-05 10:07:29 -07:00
|
|
|
Efl.Ui.Selectable.selected {get; set;}
|
2019-08-23 03:03:24 -07:00
|
|
|
Efl.Ui.Widget.widget_input_event_handler;
|
2018-04-22 23:13:59 -07:00
|
|
|
}
|
|
|
|
}
|