aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/elementary/elm_spinner.eo
blob: c5d1add14c3553d0228ed02591001186e458a3e5 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
class Elm.Spinner (Efl.Ui.Layout.Object, Efl.Ui.Range, Efl.Ui.Focus.Composition,
                   Efl.Access.Value, Efl.Access.Widget.Action, Efl.Ui.Legacy)
{
   [[Elementary spinner class]]
   legacy_prefix: elm_spinner;
   eo_prefix: elm_obj_spinner;
   event_prefix: elm_spinner;
   methods {
      @property wrap {
         [[Control whether the spinner should wrap when it reaches its minimum or maximum value.

           Disabled by default. If disabled, when the user tries to increment the
           value,
           but displayed value plus step value is bigger than maximum value,
           the new value will be the maximum value.
           The same happens when the user tries to decrement it,
           but the value less step is less than minimum value. In this case,
           the new displayed value will be the minimum value.

           When wrap is enabled, when the user tries to increment the value,
           but displayed value plus step value is bigger than maximum value,
           the new value will be the minimum value. When the the user tries to
           decrement it, but the value less step is less than minimum value,
           the new displayed value will be the maximum value.

           E.g.:
           $min = 10
           $max = 50
           $step = 20
           $displayed = 20

           When the user decrement value (using left or bottom arrow), it will
           displays $50.]]
         set {
         }
         get {
         }
         values {
            wrap: bool; [[$true to enable wrap or $false to disable it.]]
         }
      }
      @property interval {
         [[Control the interval on time updates for an user mouse button hold on spinner widgets' arrows.

           This interval value is decreased while the user holds the
           mouse pointer either incrementing or decrementing spinner's value.

           This helps the user to get to a given value distant from the
           current one easier/faster, as it will start to change quicker and
           quicker on mouse button holds.

           The calculation for the next change interval value, starting from
           the one set with this call, is the previous interval divided by
           $1.05, so it decreases a little bit.

           The default starting interval value for automatic changes is
           $0.85 seconds.]]
         set {
         }
         get {
         }
         values {
           interval: double; [[The (first) interval value in seconds.]]
         }
      }
      @property round {
         [[Control the round value for rounding

           Sets the rounding value used for value rounding in the spinner.]]
         set {
         }
         get {
         }
         values {
            rnd: int; [[The rounding value]]
         }
      }
      @property editable {
         [[Control whether the spinner can be directly edited by the user or not.

           Spinner objects can have edition disabled, in which state they will
           be changed only by arrows.
           Useful for contexts
           where you don't want your users to interact with it writing the value.
           Specially
           when using special values, the user can see real value instead
           of special label on edition.

           It's enabled by default.]]
         set {
         }
         get {
         }
         values {
            editable: bool; [[$true to allow users to edit it or $false to don't allow users to edit it directly.]]
         }
      }
      @property base {
         [[Control the base for rounding

           Rounding works as follows:

           rounded_val = base + (double)(((value - base) / round) * round)

           Where rounded_val, value and base are doubles, and round is an integer.

           This means that things will be rounded to increments (or decrements) of
           "round" starting from value $base. The default base for rounding is 0.

           Example: round = 3, base = 2
           Values: ..., -2, 0, 2, 5, 8, 11, 14, ...

           Example: round = 2, base = 5.5
           Values: ..., -0.5, 1.5, 3.5, 5.5, 7.5, 9.5, 11.5, ...]]
         set {
         }
         get {
         }
         values {
            base: double; [[The base value]]
         }
      }
      @property label_format {
         [[Control the format string of the displayed label.

           If $NULL, this sets the format to "%.0f". If not it sets the format
           string for the label text. The label text is provided a floating point
           value, so the label text can display up to 1 floating point value.
           Note that this is optional.

           Use a format string such as "%1.2f meters" for example, and it will
           display values like: "3.14 meters" for a value equal to 3.14159.

           Default is "%0.f".]]
         set {
         }
         get {
         }
         values {
            fmt: string @nullable; [[The format string for the label display.]]
         }
      }
      special_value_add {
         [[Control special string to display in the place of the numerical value.

           It's useful for cases when a user should select an item that is
           better indicated by a label than a value. For example, weekdays or months.

           Note: If another label was previously set to $value, it will be replaced
           by the new label.]]

         /* FIXME-doc
         E.g.:
         @code
         sp = elm_spinner_add(win);
         elm_spinner_min_max_set(sp, 1, 3);
         elm_spinner_special_value_add(sp, 1, "January");
         elm_spinner_special_value_add(sp, 2, "February");
         elm_spinner_special_value_add(sp, 3, "March");
         evas_object_show(sp);
         @endcode
         */
         params {
            @in value: double; [[The value to be replaced.]]
            @in label: string; [[The label to be used.]]

         }
      }
   }
   implements {
      class.constructor;
      Efl.Object.constructor;
      Efl.Ui.Widget.theme_apply;
      Efl.Ui.Widget.on_access_update;
      Efl.Ui.Focus.Object.on_focus_update;
      Efl.Ui.Widget.widget_event;
      Efl.Ui.Range.range_min_max { get; set; }
      Efl.Ui.Range.range_step { get; set; }
      Efl.Ui.Range.range_value { get; set; }
      Efl.Access.Object.i18n_name { get; }
      Efl.Access.Value.value_and_text { get; set; }
      Efl.Access.Value.range { get; }
      Efl.Access.Value.increment { get; }
      Efl.Access.Widget.Action.elm_actions { get; }
   }
   events {
      /* FIXME: Colorselector puts Colorselector_Data here! */
      changed: void; [[Called when spinner changed]]
      delay,changed: void; [[Called when spinner delay changed]]
      spinner,drag,start: void; [[Called when spinner drag started]]
      spinner,drag,stop: void; [[Called when spinner drag stopped]]
      min,reached: void; [[Called when spinner value reached min]]
      max,reached: void; [[Called when spinner value reached max]]
   }
}