datetime: doc update.
[platform/upstream/elementary.git] / src / lib / elm_datetime.eo
1 enum Elm.Datetime.Field_Type
2 {
3    [[Identifies a Datetime field, The widget supports 6 fields : Year, month,
4      Date, Hour, Minute, AM/PM
5    ]]
6
7    legacy: elm_datetime;
8    year    = 0, [[Indicates Year field.]]
9    month   = 1, [[Indicates Month field.]]
10    date    = 2, [[Indicates Date field.]]
11    hour    = 3, [[Indicates Hour field.]]
12    minute  = 4, [[Indicates Minute field.]]
13    ampm    = 5, [[Indicates AM/PM field .]]
14 }
15
16 class Elm.Datetime (Elm.Layout)
17 {
18    eo_prefix: elm_obj_datetime;
19    methods {
20       @property format {
21          set {
22             [[Set the datetime format. Format is a combination of allowed
23               Libc date format specifiers like: "%b %d, %Y %I : %M %p".
24
25               Maximum allowed format length is 64 chars.
26
27               Format can include separators for each individual datetime
28               field except for AM/PM field.
29
30               Each separator can be a maximum of 6 UTF-8 bytes.
31               Space is also taken as a separator.
32
33               These specifiers can be arranged in any order and the widget
34               will display the fields accordingly.
35
36               Default format is taken as per the system locale settings.
37
38               \@if MOBILE \@since_tizen 2.3
39               \@elseif WEARABLE \@since_tizen 2.3.1
40               \@endif
41             ]]
42             /* FIXME-doc
43             Following are the allowed set of format specifiers for each datetime field.
44
45             @b %%Y : The year as a decimal number including the century.
46
47             @b %%y : The year as a decimal number without a century (range 00 to 99).
48
49             @b %%m : The month as a decimal number (range 01 to 12).
50
51             @b %%b : The abbreviated month name according to the current locale.
52
53             @b %%B : The full month name according to the current locale.
54
55             @b %%h : The abbreviated month name according to the current locale(same as %%b).
56
57             @b %%d : The day of the month as a decimal number (range 01 to 31).
58
59             @b %%e : The day of the month as a decimal number (range 1 to 31). single
60             digits are preceded by a blank.
61
62             @b %%I : The hour as a decimal number using a 12-hour clock (range 01 to 12).
63
64             @b %%H : The hour as a decimal number using a 24-hour clock (range 00 to 23).
65
66             @b %%k : The hour (24-hour clock) as a decimal number (range 0 to 23). single
67             digits are preceded by a blank.
68
69             @b %%l : The hour (12-hour clock) as a decimal number (range 1 to 12); single
70             digits are preceded by a blank.
71
72             @b %%M : The minute as a decimal number (range 00 to 59).
73
74             @b %%p : Either 'AM' or 'PM' according to the given time value, or the
75             corresponding strings for the current locale. Noon is treated as 'PM'
76             and midnight as 'AM'.
77
78             @b %%P : Like %p but in lower case: 'am' or 'pm' or a corresponding string for
79             the current locale.
80
81             @b %%c : The preferred date and time representation for the current locale.
82
83             @b %%x : The preferred date representation for the current locale without the time.
84
85             @b %%X : The preferred time representation for the current locale without the date.
86
87             @b %%r : The complete calendar time using the AM/PM format of the current locale.
88
89             @b %%R : The hour and minute in decimal numbers using the format %H:%M.
90
91             @b %%T : The time of day in decimal numbers using the format %H:%M:%S.
92
93             @b %%D : The date using the format %%m/%%d/%%y.
94
95             @b %%F : The date using the format %%Y-%%m-%%d.
96             */
97          }
98          get {
99             [[Get the datetime format.
100
101               \@if MOBILE \@since_tizen 2.3
102               \@elseif WEARABLE \@since_tizen 2.3.1
103               \@endif
104             ]]
105          }
106          values {
107             fmt: const(char)* @nullable; [[The datetime format.]]
108          }
109       }
110       field_limit_set {
111          [[Set the field limits of a field.
112
113            Limits can be set to individual fields, independently, except
114            for AM/PM field. Any field can display the values only in between
115            these minimum and maximum limits unless the corresponding time
116            value is restricted from MinTime to MaxTime. That is, min/max
117            field limits always works under the limitations of mintime/maxtime.
118
119            There is no provision to set the limits of AM/PM field.
120
121            \@if MOBILE \@since_tizen 2.3
122            \@elseif WEARABLE \@since_tizen 2.3.1
123            \@endif
124          ]]
125          params {
126             @in fieldtype: Elm.Datetime.Field_Type; [[Type of the field. #ELM_DATETIME_YEAR etc.]]
127             @in min: int; [[Reference to field's minimum value.]]
128             @in max: int; [[Reference to field's maximum value.]]
129          }
130       }
131       field_limit_get @const {
132          [[ Get the field limits of a field.
133
134            Limits can be set to individual fields, independently, except
135            for AM/PM field. Any field can display the values only in between
136            these minimum and maximum limits unless the corresponding time
137            value is restricted from MinTime to MaxTime. That is, min/max
138            field limits always works under the limitations of mintime/maxtime.
139
140            There is no provision to set the limits of AM/PM field.
141
142            \@if MOBILE \@since_tizen 2.3
143            \@elseif WEARABLE \@since_tizen 2.3.1
144            \@endif
145          ]]
146          params {
147             @in fieldtype: Elm.Datetime.Field_Type; [[Type of the field. #ELM_DATETIME_YEAR etc.]]
148             @out min: int; [[Reference to field's minimum value.]]
149             @out max: int; [[Reference to field's maximum value.]]
150          }
151       }
152       value_min_set {
153          [[Set the lower boundary of a field.
154
155            Year: years since 1900. Negative value represents year below 1900
156            (year value -30 represents 1870). Year default range is from 70
157            to 137.
158
159            Month: default value range is from 0 to 11.
160
161            Date: default value range is from 1 to 31 according to the month
162            value.
163
164            Hour: default value will be in terms of 24 hr format (0~23)
165
166            Minute: default value range is from 0 to 59.
167
168            \@if MOBILE \@since_tizen 2.3
169            \@elseif WEARABLE \@since_tizen 2.3.1
170            \@endif
171          ]]
172
173          return: bool; [[$true if minimum value is accepted.]]
174          params {
175             @in mintime: const(Elm_Datetime_Time)*; [[Time structure containing the minimum time value.]]
176          }
177       }
178       value_min_get @const {
179          [[Get the lower boundary of a field.
180
181            Year: years since 1900. Negative value represents year below 1900
182            (year value -30 represents 1870). Year default range is from 70
183            to 137.
184
185            Month: default value range is from 0 to 11.
186
187            Date: default value range is from 1 to 31 according to the month
188            value.
189
190            Hour: default value will be in terms of 24 hr format (0~23)
191
192            Minute: default value range is from 0 to 59.
193
194            \@if MOBILE \@since_tizen 2.3
195            \@elseif WEARABLE \@since_tizen 2.3.1
196            \@endif
197          ]]
198          return: bool; [[$true if minimum value is successfully returned.]]
199          params {
200             @inout mintime: Elm_Datetime_Time; [[Time structure.]]
201          }
202       }
203       value_set {
204          [[Set the current value of a Datetime object.
205
206            Year: years since 1900. Negative value represents year below 1900
207            (year value -30 represents 1870). Year default range is from 70
208            to 137.
209
210            Month: default value range is from 0 to 11.
211
212            Date: default value range is from 1 to 31 according to the month
213            value.
214
215            Hour: default value will be in terms of 24 hr format (0~23)
216
217            Minute: default value range is from 0 to 59.
218
219            \@if MOBILE \@since_tizen 2.3
220            \@elseif WEARABLE \@since_tizen 2.3.1
221            \@endif
222          ]]
223          return: bool; [[$true if current time is set successfully.]]
224          params {
225             @in newtime: const(Elm_Datetime_Time)*; [[Time structure filled with values to be set.]]
226          }
227       }
228       value_get @const {
229          [[Get the current value of a Datetime object.
230
231            Year: years since 1900. Negative value represents year below 1900
232            (year value -30 represents 1870). Year default range is from 70
233            to 137.
234
235            Month: default value range is from 0 to 11.
236
237            Date: default value range is from 1 to 31 according to the month
238            value.
239
240            Hour: default value will be in terms of 24 hr format (0~23)
241
242            Minute: default value range is from 0 to 59.
243
244            \@if MOBILE \@since_tizen 2.3
245            \@elseif WEARABLE \@since_tizen 2.3.1
246            \@endif
247          ]]
248          return: bool; [[$true if current time is returned successfully.]]
249          params {
250             @inout currtime: Elm_Datetime_Time; [[Time structure.]]
251          }
252       }
253       field_visible_set {
254          [[Set a field to be visible or not.
255
256            Setting this API to $true does not ensure that the field is
257            visible, apart from this, the field's format must be present
258            in Datetime overall format.  If a field's visibility is set
259            to $false then it won't appear even though its format is
260            present in overall format. So if and only if this API is
261            set true and the corresponding field's format is present
262            in Datetime format, the field is visible.
263
264            By default the field visibility is set to $true.
265
266            \@if MOBILE \@since_tizen 2.3
267            \@elseif WEARABLE \@since_tizen 2.3.1
268            \@endif
269          ]]
270          params {
271             @in fieldtype: Elm.Datetime.Field_Type; [[Type of the field. #ELM_DATETIME_YEAR etc.]]
272             @in visible: bool; [[$true field can be visible, $false otherwise.]]
273          }
274       }
275       field_visible_get @const {
276          [[Get a field to be visible or not.
277
278             \@if MOBILE \@since_tizen 2.3
279             \@elseif WEARABLE \@since_tizen 2.3.1
280             \@endif
281           ]]
282          return: bool; [[$true, if field to be visible. $false otherwise.]]
283          params {
284             @in fieldtype: Elm.Datetime.Field_Type; [[Type of the field. #ELM_DATETIME_YEAR etc.]]
285          }
286       }
287       value_max_set {
288          [[Set the upper boundary of a field.
289
290            Year: years since 1900. Negative value represents year below 1900
291            (year value -30 represents 1870). Year default range is from 70
292            to 137.
293
294            Month: default value range is from 0 to 11.
295
296            Date: default value range is from 1 to 31 according to the month
297            value.
298
299            Hour: default value will be in terms of 24 hr format (0~23)
300
301            Minute: default value range is from 0 to 59.
302
303            \@if MOBILE \@since_tizen 2.3
304            \@elseif WEARABLE \@since_tizen 2.3.1
305            \@endif
306          ]]
307          return: bool; [[$true if maximum value is accepted.]]
308          params {
309             @in maxtime: const(Elm_Datetime_Time)*; [[Time structure containing the maximum time value.]]
310          }
311       }
312       value_max_get @const {
313          [[Get the upper boundary of a field.
314
315            Year: years since 1900. Negative value represents year below 1900
316            (year value -30 represents 1870). Year default range is from 70
317            to 137.
318
319            Month: default value range is from 0 to 11.
320
321            Date: default value range is from 1 to 31 according to the month
322            value.
323
324            Hour: default value will be in terms of 24 hr format (0~23)
325
326            Minute: default value range is from 0 to 59.
327
328            \@if MOBILE \@since_tizen 2.3
329            \@elseif WEARABLE \@since_tizen 2.3.1
330            \@endif
331          ]]
332          return: bool; [[$true if maximum value is returned successfully.]]
333          params {
334             @inout maxtime: Elm_Datetime_Time; [[Time structure containing the maximum time value.]]
335          }
336       }
337    }
338    implements {
339       class.constructor;
340       Eo.Base.constructor;
341       Evas.Object_Smart.add;
342       Evas.Object_Smart.del;
343       Elm.Widget.theme_apply;
344       Elm.Widget.focus_next_manager_is;
345       Elm.Widget.focus_next;
346       Elm.Widget.disable;
347       Elm.Widget.on_focus;
348       Elm.Widget.translate;
349       Elm.Layout.sizing_eval;
350       //TIZEN_ONLY(20170807): Apply UI Mirror for Tizen 4.0 UX
351       Elm.Widget.mirrored;
352       //
353    }
354    events {
355       changed;
356       language,changed;
357       access,changed;
358    }
359
360 }