summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_item.eo
blob: d84b919a37692eb4456cfcd550d0778488f58964 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
abstract @beta 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.
   ]]
   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;
         }
      }
   }
   implements {
      Efl.Object.constructor;
      Efl.Object.finalize;
      Efl.Object.destructor;
      Efl.Ui.Selectable.selected {get; set;}
      Efl.Ui.Widget.widget_input_event_handler;
   }
}