summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_item.eo
blob: a2a7ad71fd0fabac746342cbbd01d09796bbd0f4 (plain) (blame)
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
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.item,selected] -> "efl,state,selected",
       @[Efl.Ui.Selectable.item,unselected] -> "efl,state,unselected".
   ]]
   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 selected {
         [[Item selected state.

           The visual representation of the item will be adjusted accordingly to the new state.
           This property is also automatically modified in response to user actions.
         ]]
         values {
            select: bool; [[Whether this item is selected or not.]]
         }
      }
      @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.]]
         }
      }
   }
   implements {
      Efl.Object.constructor;
      Efl.Object.finalize;
      Efl.Object.destructor;
   }
}