efl/src/lib/elementary/efl_ui_item_position_manage...

97 lines
4.3 KiB
Plaintext

interface @beta Efl.Ui.Item_Position_Manager extends Efl.Ui.Layout_Orientable
{
[[
This abstracts the basic placement of items in a not defined form under a viewport.
The interface gets a defined set of elements that is meant to be displayed. The implementation provides a way to calculate the size that is required to display all items. Every time this absolut size of items is changed, content_size,changed is called.
]]
methods {
@property data_access {
[[This gives access to items to be managed. The manager reads this information and modifies the retrieved items' positions and sizes.
$obj_access gives access to the graphical entitites to manage. Some of them might be NULL, meaning they are not yet ready to be displayed. Their size in the $size_access array will be correct, though, so other entities can still be positioned correctly.
Typically, only entities inside the viewport will be retrieved.
$size_access gives access to the 2D sizes for the items to manage. All sizes will always be valid, and might change over time (indicated through the @.item_size_changed method).
The whole range might need to be traversed in order to calculate the position of all items in some arrangements.
]]
set {
}
values {
obj_access : accessor<Efl.Gfx.Entity>; [[The accessor for canvas obejcts, even if the id is valid, the returned object may be NULL]]
size_access : accessor<Eina.Size2D>; [[Accessor for the size, returned values are always valid, but might be changed / updated]]
size : int; [[valid size for accessors, 0 <= i < size]]
}
}
@property viewport {
[[This is the position and size of the viewport, where elements are displayed in.
Entities outside this viewport will not be shown.]]
set {
}
values {
viewport : Eina.Rect;
}
}
@property scroll_position {
[[Move the items relative to the viewport.
The items that are managed with this position manager might be bigger than the actual viewport.
The positioning of the layer where all items are on is described by these values.
0.0,0.0 means that layer is moved that the top left items are shown,
1.0,1.0 means, that the lower right items are shown.
]]
set {
}
values {
x : double; [[X position of the scroller, valid form 0 to 1.0]]
y : double; [[Y position of the scroller, valid form 0 to 1.0]]
}
}
position_single_item {
[[Return the position and size of item idx
This method returns the size and position of the item at $idx.
Even if the item is outside the viewport, the returned rectangle must be valid. The result can be used for scrolling calculations.
]]
params {
idx : int; [[The id for the item]]
}
return : Eina.Rect; [[Position and Size in canvas coordinations]]
}
item_added {
[[The new item $subobj has been added at the $added_index field.
The accessor provided through @.data_access will contain updated Entities.]]
params {
added_index : int;
subobj : Efl.Gfx.Entity;
}
}
item_removed {
[[The item $subobj previously at position $removed_index has been removed.
The accessor provided through @.data_access will contain updated Entities.
]]
params {
removed_index : int;
subobj : Efl.Gfx.Entity;
}
}
item_size_changed {
[[The size of the items from $start_id to $end_id have been changed.
The positioning and sizing of all items will be updated]]
params {
start_id : int; [[The first item that has a new size]]
end_id : int; [[The last item that has a new size]]
}
}
}
events {
content_size,changed : Eina.Size2D; [[Emitted when the aggregate size of all items has changed. This can be used to resize an enclosing Pan object.]]
content_min_size,changed : Eina.Size2D; [[Emitted when the minimum size of all items has changed. The minimum size is the size, that this position_manager needs at *least* to display a single item.]]
}
}