summaryrefslogtreecommitdiff
path: root/src/lib/elm_clock.eo
blob: b84b15a2286621fd374480566c06a9378cd8a1b3 (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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
enum Elm.Clock.Edit_Mode
{
   [[Identifiers for which clock digits should be editable, when a
     clock widget is in edition mode. Values may be OR-ed together to
     make a mask, naturally.

     See also @Elm.Clock.edit.set, @Elm.Clock.edit_mode.set.
   ]]

   legacy: elm_clock_edit;
   default = 0, [[Default value. Means that all digits are editable, when in edition mode.]]
   hour_decimal = 1 << 0, [[Decimal digit of hours value should be editable.]]
   hour_unit = 1 << 1, [[Unit digit of hours value should be editable.]]
   min_decimal = 1 << 2, [[Decimal digit of minutes value should be editable.]]
   min_unit = 1 << 3, [[Unit digit of minutes value should be editable.]]
   sec_decimal = 1 << 4, [[Decimal digit of seconds value should be editable.]]
   sec_unit = 1 << 5, [[Unit digit of seconds value should be editable.]]
   all = (1 << 6) - 1 [[All digits should be editable.]]
}

class Elm.Clock (Elm.Layout)
{
   eo_prefix: elm_obj_clock;
   methods {
      @property show_am_pm {
         set {
            [[Set if the given clock widget must show hours in military or
              am/pm mode

              This function sets if the clock must show hours in military or
              am/pm mode. In some countries like Brazil the military mode
              (00-24h-format) is used, in opposition to the USA, where the
              am/pm mode is more commonly used.

              See also @.show_am_pm.get.
            ]]
         }
         get {
            [[Get if the given clock widget shows hours in military or am/pm
              mode

              This function gets if the clock shows hours in military or am/pm
              mode.

              See also @.show_am_pm.set for more details.
            ]]
         }
         values {
            am_pm: bool; [[$true to put it in am/pm mode,
                           $false to military mode]]
         }
      }
      @property first_interval {
         set {
            [[Set the first interval on time updates for a user mouse button hold
              on clock widgets' time edition.

              This interval value is decreased while the user holds the
              mouse pointer either incrementing or decrementing a given the
              clock digit's value.

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

              The calculation for the next flip 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 flips is
              0.85 seconds.

              See also @.first_interval.get.
            ]]
         }
         get {
            [[Get the first interval on time updates for a user mouse button hold
              on clock widgets' time edition.

              See also @.first_interval.set for more details.
            ]]

         }
         values {
            interval: double; [[The first interval value in seconds]]
         }
      }
      @property show_seconds {
         set {
            [[Set if the given clock widget must show time with seconds or not

              This function sets if the given clock must show or not elapsed
              seconds. By default, they are not shown.

              See also @.show_seconds.get.
            ]]
         }
         get {
            [[Get whether the given clock widget is showing time with seconds
              or not

              This function gets whether $obj is showing or not the elapsed
              seconds.

              See also @.show_seconds.set.
            ]]
         }
         values {
            seconds: bool; [[$true to show seconds, $false otherwise.]]
         }
      }
      @property edit {
         set {
            [[Set whether a given clock widget is under edition mode or
              under (default) displaying-only mode.

              This function makes a clock's time to be editable or not by
              user interaction. When in edition mode, clocks stop
              ticking, until one brings them back to canonical mode. The
              @.edit_mode.set function will influence which digits
              of the clock will be editable.

              Note: am/pm sheets, if being shown, will always be editable
              under edition mode.

              See also @.edit.get.
            ]]
         }
         get {
            [[Get whether a given clock widget is under editing mode
              or under (default) displaying-only mode.

              This function retrieves whether the clock's time can be edited
              or not by user interaction.

              See also @.edit.set for more details
            ]]
         }
         values {
            edit: bool; [[$true to put it in edition, $false to
            put it back to "displaying only" mode]]
         }
      }
      @property pause {
         set {
            [[Set whether the given clock widget should be paused or not.

              This function pauses or starts the clock widget.

              See also @.pause.get.

              @since 1.9
            ]]
         }
         get {
            [[Get whether the given clock widget is paused.

              This function gets whether the clock is paused or not.

              See also @.pause.set.

              @since 1.9]]
         }
         values {
            paused: bool; [[$true to pause clock, $false otherwise]]
         }
      }
      @property time {
         set {
            [[Set a clock widget's time, programmatically

              This function updates the time that is showed by the clock
              widget.

              Values must be set within 0-23 for hours and
              0-59 for minutes and seconds, even if the clock
              is not in "military" mode.

              Warning: The behavior for values set out of those ranges is
              undefined.
            ]]
         }
         get {
            [[Get a clock widget's time values

              This function gets the time set for $obj, returning
              it on the variables passed as the arguments to function

              Note: Use $null pointers on the time values you're not
              interested in: they'll be ignored by the function.
            ]]
         }
         values {
            hrs: int; [[The hours to set]]
            min: int; [[The minutes to set]]
            sec: int; [[The seconds to set]]
         }
      }
      @property edit_mode {
         set {
            [[Set what digits of the given clock widget should be editable
              when in edition mode.

              See also @.edit_mode.get.
            ]]
         }
         get {
            [[Get what digits of the given clock widget should be
              editable when in edition mode.

              See also @.edit_mode.set for more details.
            ]]
         }
         values {
            digedit: Elm.Clock.Edit_Mode; [[Bit mask indicating the digits to be editable
            (values in #Elm_Clock_Edit_Mode).]]
         }
      }
   }
   implements {
      class.constructor;
      Eo.Base.constructor;
      Evas.Object_Smart.add;
      Evas.Object_Smart.del;
      Elm.Widget.focus_next_manager_is;
      Elm.Widget.focus_direction_manager_is;
      Elm.Widget.access;
      Elm.Widget.focus_next;
      Elm.Widget.theme_apply;
   }
   events {
      changed;
      language,changed;
   }

}