1import efl_ui; 2 3struct @beta Efl.Ui.Position_Manager.Range_Update { 4 [[A structure containing the updated range of visible items in this position manger.]] 5 start_id : uint; [[The first item that is visible]] 6 end_id : uint; [[The last item that is visible]] 7} 8 9interface @beta Efl.Ui.Position_Manager.Entity extends Efl.Ui.Layout_Orientable 10{ 11 [[This abstracts the basic placement of items in a not-defined form under a viewport. 12 13 The interface gets a defined set of elements that is meant to be displayed. 14 The implementation provides a way to calculate the size that is required to display all items. 15 Every time this absolute size of items is changed, @[Efl.Ui.Position_Manager.Entity.content_size,changed] is 16 emitted. 17 ]] 18 methods { 19 version { 20 [[Returns the version of Data_Access that is used. 21 This object needs to implement the interface @Efl.Ui.Position_Manager.Data_Access_V1 if 1 is returned. 22 ]] 23 params { 24 max : int; [[The maximum version that is available from the data-provider.]] 25 } 26 return : int; [[The version that should be used here. 0 is an error.]] 27 } 28 @property viewport { 29 [[This is the position and size of the viewport, where elements are displayed in. 30 Entities outside this viewport will not be shown.]] 31 set { 32 33 } 34 values { 35 viewport : Eina.Rect; 36 } 37 } 38 @property scroll_position { 39 [[Move the items relative to the viewport. 40 41 The items that are managed with this position manager might be bigger than the actual viewport. 42 The positioning of the layer where all items are on is described by these values. 43 0.0,0.0 means that layer is moved that the top left items are shown, 44 1.0,1.0 means, that the lower right items are shown. 45 ]] 46 set { 47 48 } 49 values { 50 x : double; [[X position of the scroller, valid form 0 to 1.0]] 51 y : double; [[Y position of the scroller, valid form 0 to 1.0]] 52 } 53 } 54 position_single_item { 55 [[Return the position and size of item idx. 56 57 This method returns the size and position of the item at $idx. 58 Even if the item is outside the viewport, the returned rectangle must be valid. 59 The result can be used for scrolling calculations. 60 ]] 61 params { 62 idx : int; [[The id for the item]] 63 } 64 return : Eina.Rect; [[Position and Size in canvas coordinates.]] 65 } 66 item_added { 67 [[The new item $subobj has been added at the $added_index field. 68 69 The accessor provided through @Efl.Ui.Position_Manager.Data_Access_V1.data_access will contain updated 70 Entities.]] 71 params { 72 added_index : int; 73 subobj : Efl.Gfx.Entity; 74 } 75 } 76 item_removed { 77 [[The item $subobj previously at position $removed_index has been removed. 78 The accessor provided through @Efl.Ui.Position_Manager.Data_Access_V1.data_access will contain updated 79 Entities. 80 ]] 81 params { 82 removed_index : int; 83 subobj : Efl.Gfx.Entity; 84 } 85 } 86 item_size_changed { 87 [[The size of the items from $start_id to $end_id have been changed. 88 The positioning and sizing of all items will be updated]] 89 params { 90 start_id : int; [[The first item that has a new size]] 91 end_id : int; [[The last item that has a new size]] 92 } 93 } 94 entities_ready { 95 [[The items from $start_id to $end_id now have their entities ready 96 97 The position manager will reapply the geometry to the elements if they are visible. 98 ]] 99 params { 100 start_id : uint; [[The first item that is available]] 101 end_id : uint; [[The last item that is available]] 102 } 103 } 104 relative_item { 105 [[Translates the $current_id, into a new id which is oriented in the $direction of $current_id. 106 In case that there is no item, -1 is returned]] 107 params { 108 current_id : uint; [[The id where the direction is oriented at]] 109 direction : Efl.Ui.Focus.Direction; [[The direction where the new id is]] 110 @out index: uint; [[The relative item index after the translation has been applied.]] 111 } 112 return : bool; [[$true if there is a next item, $false otherwise.]] 113 } 114 } 115 events { 116 content_size,changed : Eina.Size2D; [[Emitted when the aggregate size of all items has changed. 117 This can be used to resize an enclosing Pan object.]] 118 content_min_size,changed : Eina.Size2D; [[Emitted when the minimum size of all items has changed. 119 The minimum size is the size that this position_manager needs 120 to display a single item.]] 121 visible_range,changed : Efl.Ui.Position_Manager.Range_Update; 122 } 123} 124