efl/src/lib/elementary/efl_ui_item.eo

80 lines
3.1 KiB
Plaintext

abstract Efl.Ui.Item extends Efl.Ui.Layout_Base implements Efl.Ui.Selectable, Efl.Input.Clickable
{
[[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.
@Efl.Ui.Item provides user interaction through the @Efl.Input.Clickable mixin.
Items can be pressed, long-pressed, etc, and appropriate events are generated.
@Efl.Ui.Item also implements the @Efl.Ui.Selectable interface, meaning that "selected" and
"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",
@[Efl.Ui.Selectable.selected,changed] (true) -> "efl,state,selected",
@[Efl.Ui.Selectable.selected,changed] (false) -> "efl,state,unselected".
Item grouping inside containers is handled through the @Efl.Ui.Group_Item class.
@since 1.23
]]
methods {
@property index {
[[The index of this item inside its container.
The container must be set through the @Efl.Ui.Item.container property.]]
get {}
values {
index : int; [[The index where to find this item in its @.container.]]
}
}
@property container {
[[The container this object is part of.
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.
]]
values {
container : Efl.Ui.Widget; [[The container this item is in.]]
}
}
@property item_parent {
[[The parent of the item.
This property expresses a tree structure of items. If the parent is $NULL the item is added to
the root level of the content. The item parent can only be set once.
When the object is invalidated, the item parent is set to $NULL and still cannot be reset.
]]
values {
parent : Efl.Ui.Item;
}
}
@property calc_locked {
[[If the item has its calc locked it will not trigger @Efl.Canvas.Group.group_need_recalculate.set done.
This is done automatically by @Efl.Ui.Widget_Factory, but you can use this information to meaningfully set the hint when items are not @.calc_locked.
]]
set {}
get {}
values {
locked: bool; [[If set to $true, no more @Efl.Canvas.Group.group_need_recalculate.set]]
}
}
}
implements {
Efl.Object.constructor;
Efl.Object.finalize;
Efl.Object.destructor;
Efl.Ui.Selectable.selected {get; set;}
Efl.Ui.Widget.widget_input_event_handler;
Efl.Canvas.Group.group_need_recalculate { set; }
}
}