summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_actionslider.eo
blob: d400723c6e49901b5586927bd0223a8fffffba82 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
enum Elm.Actionslider.Pos
{
  [[A position for indicators, magnets, and enabled items.]]
   legacy: elm_actionslider;

   none = 0, [[No position is set.]]
   left = 1 << 0, [[Left position.]]
   center = 1 << 1, [[Center position.]]
   right = 1 << 2, [[Right position.]]
   all = (1 << 3) - 1 [[All positions for left/center/right.]]
}

class Elm.Actionslider (Efl.Ui.Layout, Efl.Ui.Selectable)
{
   [[An actionslider is a switcher for 2 or 3 labels

   with customizable magnet properties. The user drags and releases
   the indicator, to choose a label. When the indicator is released,
   it will move to its nearest "enabled and magnetized" position.
   ]]

   legacy_prefix: elm_actionslider;
   eo_prefix: elm_obj_actionslider;
   event_prefix: elm_actionslider;
   methods {
      @property indicator_pos {
         [[Actionslider position indicator]]
         set {
         }
         get {
         }
         values {
            pos: Elm.Actionslider.Pos; [[The position of the indicator.]]
         }
      }
      @property magnet_pos {
         [[Actionslider magnet position.]]
         set {
            [[To make multiple positions magnets OR them together (e.g.
              ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT)
            ]]
         }
         get {
         }
         values {
            pos: Elm.Actionslider.Pos; [[Bit mask indicating the magnet positions.]]
         }
      }
      @property enabled_pos {
         [[Actionslider enabled position.]]
         set {
            [[To set multiple positions as enabled OR them together(e.g.
              ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT).

              Note: All the positions are enabled by default.
            ]]
         }
         get {
         }
         values {
            pos: Elm.Actionslider.Pos; [[Bit mask indicating the enabled positions.]]
         }
      }
      @property selected_label {
         get {
            [[Get actionslider selected label.]]
            return: string; [[Selected label]]
         }
      }
   }
   implements {
      class.constructor;
      Efl.Object.constructor;
      Elm.Widget.theme_apply;
      Efl.Part.part;
   }
   events {
      pos_changed; [[The position of the actionslider has changed]]
   }
}