summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWoochan Lee <wc0917.lee@samsung.com>2018-04-13 13:43:34 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2018-04-13 13:55:55 +0900
commit5f320902b5a5bb837a1a17c19e10b1ef8a4a4d6a (patch)
tree0cd41f9a3ad984b58d5b5924de947f6d64ef5b08
parent4214311a76bfd27774186b0a93882689d8bdbd4b (diff)
Intrudoce Efl Ui Date, Time interface and picker.devs/jaehyun/efl_ui_datetime
Summary: Impelmentation on going. Reviewers: herb, Jaehyun_Cho, woohyun, SanghyeonLee Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D5871
-rw-r--r--data/elementary/themes/Makefile.am2
-rw-r--r--data/elementary/themes/default.edc2
-rw-r--r--data/elementary/themes/edc/efl/button.edc16
-rw-r--r--data/elementary/themes/edc/efl/datepicker.edc183
-rw-r--r--data/elementary/themes/edc/efl/spin_button.edc720
-rw-r--r--data/elementary/themes/edc/efl/timepicker.edc378
-rw-r--r--data/elementary/themes/edc/elm/button.edc24
-rw-r--r--data/elementary/themes/edc/elm/entry.edc1
-rw-r--r--src/Makefile_Efl.am4
-rw-r--r--src/Makefile_Elementary.am8
-rw-r--r--src/bin/elementary/Makefile.am2
-rw-r--r--src/bin/elementary/test.c4
-rw-r--r--src/bin/elementary/test_ui_datepicker.c37
-rw-r--r--src/bin/elementary/test_ui_timepicker.c36
-rw-r--r--src/lib/efl/CMakeLists.txt2
-rw-r--r--src/lib/efl/Efl.h3
-rw-r--r--src/lib/efl/interfaces/efl_interfaces_main.c2
-rw-r--r--src/lib/efl/interfaces/efl_ui_date.eo63
-rw-r--r--src/lib/efl/interfaces/efl_ui_datetime.c176
-rw-r--r--src/lib/efl/interfaces/efl_ui_datetime.eo38
-rw-r--r--src/lib/efl/interfaces/efl_ui_time.eo19
-rw-r--r--src/lib/elementary/Elementary.h2
-rw-r--r--src/lib/elementary/efl_ui_datepicker.c352
-rw-r--r--src/lib/elementary/efl_ui_datepicker.eo21
-rw-r--r--src/lib/elementary/efl_ui_datepicker_private.h22
-rw-r--r--src/lib/elementary/efl_ui_timepicker.c282
-rw-r--r--src/lib/elementary/efl_ui_timepicker.eo26
-rw-r--r--src/lib/elementary/efl_ui_timepicker_private.h21
28 files changed, 2186 insertions, 260 deletions
diff --git a/data/elementary/themes/Makefile.am b/data/elementary/themes/Makefile.am
index e91113c1cc..b98c48cf34 100644
--- a/data/elementary/themes/Makefile.am
+++ b/data/elementary/themes/Makefile.am
@@ -1034,6 +1034,8 @@ elementary/themes/edc/efl/scroller.edc \
1034elementary/themes/edc/efl/slider.edc \ 1034elementary/themes/edc/efl/slider.edc \
1035elementary/themes/edc/efl/spin.edc \ 1035elementary/themes/edc/efl/spin.edc \
1036elementary/themes/edc/efl/spin_button.edc \ 1036elementary/themes/edc/efl/spin_button.edc \
1037elementary/themes/edc/efl/datepicker.edc \
1038elementary/themes/edc/efl/timepicker.edc \
1037elementary/themes/edc/efl/text.edc \ 1039elementary/themes/edc/efl/text.edc \
1038elementary/themes/edc/efl/textpath.edc \ 1040elementary/themes/edc/efl/textpath.edc \
1039elementary/themes/edc/efl/tooltip.edc \ 1041elementary/themes/edc/efl/tooltip.edc \
diff --git a/data/elementary/themes/default.edc b/data/elementary/themes/default.edc
index 3b851409f5..cea6232ce6 100644
--- a/data/elementary/themes/default.edc
+++ b/data/elementary/themes/default.edc
@@ -189,6 +189,8 @@ collections {
189#include "edc/efl/border.edc" 189#include "edc/efl/border.edc"
190#include "edc/efl/spin.edc" 190#include "edc/efl/spin.edc"
191#include "edc/efl/spin_button.edc" 191#include "edc/efl/spin_button.edc"
192#include "edc/efl/datepicker.edc"
193#include "edc/efl/timepicker.edc"
192// XXX: min size calc problems - too wide! ... err ok on my 32bit box... eh? 194// XXX: min size calc problems - too wide! ... err ok on my 32bit box... eh?
193#include "edc/efl/cursor.edc" 195#include "edc/efl/cursor.edc"
194#include "edc/efl/pointer.edc" 196#include "edc/efl/pointer.edc"
diff --git a/data/elementary/themes/edc/efl/button.edc b/data/elementary/themes/edc/efl/button.edc
index 9853358e67..5ad13977c9 100644
--- a/data/elementary/themes/edc/efl/button.edc
+++ b/data/elementary/themes/edc/efl/button.edc
@@ -781,3 +781,19 @@ group { name: "efl/button:anchor";
781#undef MASK 781#undef MASK
782#undef DISABLE 782#undef DISABLE
783} 783}
784
785group { "efl/button:ampm";
786 inherit: "efl/button";
787 parts {
788 image { "base";
789 desc { "default";
790 min: 40 40;
791 max: 40 40;
792 }
793 desc { "pressed";
794 min: 40 40;
795 max: 40 40;
796 }
797 }
798 }
799}
diff --git a/data/elementary/themes/edc/efl/datepicker.edc b/data/elementary/themes/edc/efl/datepicker.edc
new file mode 100644
index 0000000000..2d88e580a3
--- /dev/null
+++ b/data/elementary/themes/edc/efl/datepicker.edc
@@ -0,0 +1,183 @@
1group { "efl/datepicker";
2 parts {
3 spacer { "base";
4 scale;
5 desc { "default";
6 min: 150 170;
7 }
8 }
9 rect { "base_bg";
10 scale;
11 desc { "default";
12 rel.to: "base";
13 color: 0 0 0 35;
14 }
15 }
16 spacer { "padding_bg_top";
17 scale;
18 desc { "default";
19 min: 0 10;
20 max: -1 10;
21 fixed: 0 1;
22 rel1 {
23 relative: 0.0 0.0;
24 to: "base_bg";
25 }
26 rel2 {
27 relative: 1.0 0.0;
28 to: "base_bg";
29 }
30 align: 0.5 0.0;
31 }
32 }
33 spacer { "padding_bg_bottom";
34 scale;
35 desc { "default";
36 min: 0 10;
37 max: -1 10;
38 fixed: 0 1;
39 rel1 {
40 relative: 0.0 1.0;
41 to: "base_bg";
42 }
43 rel2 {
44 relative: 1.0 1.0;
45 to: "base_bg";
46 }
47 align: 0.5 1.0;
48 }
49 }
50 spacer { "bg";
51 scale;
52 desc { "default";
53 min: 150 150;
54 max: 150 150;
55 rel1 {
56 relative: 0.0 1.0;
57 to: "padding_bg_top";
58 }
59 rel2 {
60 relative: 1.0 0.0;
61 to: "padding_bg_bottom";
62 }
63 }
64 }
65 spacer { "padding_left";
66 scale;
67 desc { "default";
68 min: 5 0;
69 max: 5 -1;
70 fixed: 1 0;
71 rel1 {
72 relative: 0.0 0.0;
73 to: "bg";
74 }
75 rel2 {
76 relative: 0.0 1.0;
77 to: "bg";
78 }
79 align: 0.0 0.0;
80 }
81 }
82 spacer { "padding_right";
83 scale;
84 desc { "default";
85 min: 5 0;
86 max: 5 -1;
87 fixed: 1 0;
88 rel2.to: "bg";
89 rel1 {
90 relative: 1.0 0.0;
91 to: "bg";
92 }
93 rel2 {
94 relative: 1.0 1.0;
95 to: "bg";
96 }
97 align: 1.0 1.0;
98 }
99 }
100 swallow { "field0";
101 mouse;
102 scale;
103 desc { "default";
104 fixed: 1 0;
105 min: 40 0;
106 rel1 {
107 relative: 1.0 0.0;
108 to: "padding_left";
109 }
110 rel2.to: "padding_left";
111 align: 0.0 0.5;
112 }
113 }
114 spacer { "padding_center1";
115 scale;
116 desc { "default";
117 fixed: 1 0;
118 min: 10 0;
119 max: 10 -1;
120 rel1 {
121 relative: 1.0 0.0;
122 to: "field0";
123 }
124 rel2.to: "field0";
125 align: 0.0 0.5;
126 }
127 }
128 swallow { "field1";
129 mouse;
130 scale;
131 desc { "default";
132 fixed: 1 0;
133 min: 40 0;
134 rel1 {
135 relative: 1.0 0.0;
136 to: "padding_center1";
137 }
138 rel2 {
139 relative: 0.0 1.0;
140 to_x: "padding_center2";
141 to_y: "padding_center1";
142 }
143 }
144 }
145 spacer { "padding_center2";
146 scale;
147 desc { "default";
148 fixed: 1 0;
149 min: 10 0;
150 max: 10 -1;
151 rel1.to: "field2";
152 rel2 {
153 relative: 0.0 1.0;
154 to: "field2";
155 }
156 align: 1.0 0.5;
157 }
158 }
159 swallow { "field2";
160 mouse;
161 scale;
162 desc { "default";
163 fixed: 1 0;
164 min: 40 0;
165 rel1.to: "padding_right";
166 rel2 {
167 relative: 0.0 1.0;
168 to: "padding_right";
169 }
170 align: 1.0 0.5;
171 }
172 }
173 rect { "access";
174 repeat;
175 desc { "default";
176 fixed: 1 1;
177 rel1.to: "bg";
178 rel2.to: "bg";
179 color: 0 0 0 0;
180 }
181 }
182 }
183}
diff --git a/data/elementary/themes/edc/efl/spin_button.edc b/data/elementary/themes/edc/efl/spin_button.edc
index 4d502e3779..e6e7f5c6c8 100644
--- a/data/elementary/themes/edc/efl/spin_button.edc
+++ b/data/elementary/themes/edc/efl/spin_button.edc
@@ -207,303 +207,503 @@ group { "efl/spin_button:vertical";
207} 207}
208 208
209group { name: "efl/spin_button/inc_button"; 209group { name: "efl/spin_button/inc_button";
210 images.image: "sym_right_light_normal.png" COMP; 210 images.image: "sym_right_light_normal.png" COMP;
211 images.image: "sym_right_glow_normal.png" COMP; 211 images.image: "sym_right_glow_normal.png" COMP;
212 images.image: "sym_right_dark_normal.png" COMP; 212 images.image: "sym_right_dark_normal.png" COMP;
213 script { 213 script {
214 public mouse_down = 0; 214 public mouse_down = 0;
215 public multi_down = 0; 215 public multi_down = 0;
216 } 216 }
217 parts { 217 parts {
218 part { name: "arrow.image"; 218 part { name: "arrow.image";
219 scale: 1; 219 scale: 1;
220 description { state: "default" 0.0; 220 description { state: "default" 0.0;
221 min: 15 15; 221 min: 15 15;
222 max: 15 15; 222 max: 15 15;
223 color_class: "F032L1"; 223 color_class: "F032L1";
224 image.normal: "sym_right_light_normal.png"; 224 image.normal: "sym_right_light_normal.png";
225 }
226 description { state: "pressed" 0.0;
227 inherit: "default" 0.0;
228 image.normal: "sym_right_glow_normal.png";
229 }
230 description { state: "disabled" 0.0;
231 inherit: "default" 0.0;
232 image.normal: "sym_right_dark_normal.png";
233 }
234 } 225 }
235 part { name: "over"; 226 description { state: "pressed" 0.0;
236 type: RECT; 227 inherit: "default" 0.0;
237 repeat_events: 1; 228 image.normal: "sym_right_glow_normal.png";
238 description { state: "default" 0.0;
239 color: 0 0 0 0;
240 }
241 } 229 }
242 part { name: "disabler"; 230 description { state: "disabled" 0.0;
243 type: RECT; 231 inherit: "default" 0.0;
244 description { state: "default" 0.0; 232 image.normal: "sym_right_dark_normal.png";
245 color: 0 0 0 0;
246 visible: 0;
247 }
248 description { state: "disabled" 0.0;
249 inherit: "default" 0.0;
250 visible: 1;
251 }
252 } 233 }
253 } 234 }
254 programs { 235 part { name: "over";
255 program { name: "button_press"; 236 type: RECT;
256 signal: "mouse,down,1"; 237 repeat_events: 1;
257 source: "over"; 238 description { state: "default" 0.0;
258 script { 239 color: 0 0 0 0;
259 if ((get_int(multi_down) == 0) &&
260 (get_int(mouse_down) == 0)) {
261 set_int(mouse_down, 1);
262 run_program(PROGRAM:"button_press2");
263 }
264 }
265 }
266 program { name: "button_press2";
267 action: SIGNAL_EMIT "elm,action,press" "";
268 after: "button_press_anim";
269 }
270 program { name: "button_press_anim";
271 action: STATE_SET "pressed" 0.0;
272 target: "arrow.image";
273 }
274 program { name: "button_unpress";
275 signal: "mouse,up,1";
276 source: "over";
277 script {
278 if (get_int(mouse_down) == 1) {
279 set_int(mouse_down, 0);
280 run_program(PROGRAM:"button_unpress2");
281 run_program(PROGRAM:"button_unpress_anim");
282 }
283 }
284 } 240 }
285 program { name: "button_unpress2"; 241 }
286 action: SIGNAL_EMIT "elm,action,unpress" ""; 242 part { name: "disabler";
243 type: RECT;
244 description { state: "default" 0.0;
245 color: 0 0 0 0;
246 visible: 0;
287 } 247 }
288 program { name: "button_unpress_anim"; 248 description { state: "disabled" 0.0;
289 action: STATE_SET "default" 0.0; 249 inherit: "default" 0.0;
290 target: "arrow.image"; 250 visible: 1;
291 } 251 }
292 program { name: "button_click"; 252 }
293 signal: "mouse,clicked,1"; 253 }
294 source: "over"; 254 programs {
295 script { 255 program { name: "button_press";
296 if (get_int(multi_down) == 0) { 256 signal: "mouse,down,1";
297 run_program(PROGRAM:"button_click2"); 257 source: "over";
298 } 258 script {
259 if ((get_int(multi_down) == 0) &&
260 (get_int(mouse_down) == 0)) {
261 set_int(mouse_down, 1);
262 run_program(PROGRAM:"button_press2");
299 } 263 }
300 } 264 }
301 program { name: "action_unpressed"; 265 }
302 signal: "elm,action,unpressed"; 266 program { name: "button_press2";
303 source: "elm"; 267 action: SIGNAL_EMIT "elm,action,press" "";
304 after: "button_unpress_anim"; 268 after: "button_press_anim";
305 } 269 }
306 program { name: "action_pressed"; 270 program { name: "button_press_anim";
307 signal: "elm,action,pressed"; 271 action: STATE_SET "pressed" 0.0;
308 source: "elm"; 272 target: "arrow.image";
309 after: "button_press_anim"; 273 }
310 } 274 program { name: "button_unpress";
311 program { name: "button_click2"; 275 signal: "mouse,up,1";
312 action: SIGNAL_EMIT "elm,action,click" ""; 276 source: "over";
313 } 277 script {
314 program { name: "access_pressed"; 278 if (get_int(mouse_down) == 1) {
315 signal: "elm,action,anim,activate"; 279 set_int(mouse_down, 0);
316 source: "elm"; 280 run_program(PROGRAM:"button_unpress2");
317 action: STATE_SET "pressed" 0.0; 281 run_program(PROGRAM:"button_unpress_anim");
318 target: "arrow.image";
319 after: "access_pressed_anim";
320 }
321 program { name: "access_pressed_anim";
322 action: STATE_SET "default" 0.0;
323 transition: DECELERATE 0.1;
324 target: "arrow.image";
325 }
326 program { name: "disable";
327 signal: "elm,state,disabled";
328 source: "elm";
329 action: STATE_SET "disabled" 0.0;
330 target: "arrow.image";
331 target: "disabler";
332 }
333 program { name: "enable";
334 signal: "elm,state,enabled";
335 source: "elm";
336 action: STATE_SET "default" 0.0;
337 target: "arrow.image";
338 target: "disabler";
339 }
340 program {
341 name: "multi_down";
342 signal: "elm,action,multi,down";
343 source: "elm";
344 script {
345 set_int(multi_down, 1);
346 } 282 }
347 } 283 }
348 program { 284 }
349 name: "multi_up"; 285 program { name: "button_unpress2";
350 signal: "elm,action,multi,up"; 286 action: SIGNAL_EMIT "elm,action,unpress" "";
351 source: "elm"; 287 }
352 script { 288 program { name: "button_unpress_anim";
353 set_int(multi_down, 0); 289 action: STATE_SET "default" 0.0;
290 target: "arrow.image";
291 }
292 program { name: "button_click";
293 signal: "mouse,clicked,1";
294 source: "over";
295 script {
296 if (get_int(multi_down) == 0) {
297 run_program(PROGRAM:"button_click2");
354 } 298 }
355 } 299 }
356 } 300 }
301 program { name: "action_unpressed";
302 signal: "elm,action,unpressed";
303 source: "elm";
304 after: "button_unpress_anim";
305 }
306 program { name: "action_pressed";
307 signal: "elm,action,pressed";
308 source: "elm";
309 after: "button_press_anim";
310 }
311 program { name: "button_click2";
312 action: SIGNAL_EMIT "elm,action,click" "";
313 }
314 program { name: "access_pressed";
315 signal: "elm,action,anim,activate";
316 source: "elm";
317 action: STATE_SET "pressed" 0.0;
318 target: "arrow.image";
319 after: "access_pressed_anim";
320 }
321 program { name: "access_pressed_anim";
322 action: STATE_SET "default" 0.0;
323 transition: DECELERATE 0.1;
324 target: "arrow.image";
325 }
326 program { name: "disable";
327 signal: "elm,state,disabled";
328 source: "elm";
329 action: STATE_SET "disabled" 0.0;
330 target: "arrow.image";
331 target: "disabler";
332 }
333 program { name: "enable";
334 signal: "elm,state,enabled";
335 source: "elm";
336 action: STATE_SET "default" 0.0;
337 target: "arrow.image";
338 target: "disabler";
339 }
340 program {
341 name: "multi_down";
342 signal: "elm,action,multi,down";
343 source: "elm";
344 script {
345 set_int(multi_down, 1);
346 }
347 }
348 program {
349 name: "multi_up";
350 signal: "elm,action,multi,up";
351 source: "elm";
352 script {
353 set_int(multi_down, 0);
354 }
355 }
357 } 356 }
357}
358 358
359group { name: "efl/spin_button/dec_button"; 359group { name: "efl/spin_button/dec_button";
360 inherit: "efl/spin_button/inc_button"; 360 inherit: "efl/spin_button/inc_button";
361 images.image: "sym_left_light_normal.png" COMP; 361 images.image: "sym_left_light_normal.png" COMP;
362 images.image: "sym_left_glow_normal.png" COMP; 362 images.image: "sym_left_glow_normal.png" COMP;
363 images.image: "sym_left_dark_normal.png" COMP; 363 images.image: "sym_left_dark_normal.png" COMP;
364 parts { 364 parts {
365 part { name: "arrow.image"; 365 part { name: "arrow.image";
366 scale: 1; 366 scale: 1;
367 description { state: "default" 0.0; 367 description { state: "default" 0.0;
368 min: 15 15; 368 min: 15 15;
369 max: 15 15; 369 max: 15 15;
370 image.normal: "sym_left_light_normal.png"; 370 image.normal: "sym_left_light_normal.png";
371 } 371 }
372 description { state: "pressed" 0.0; 372 description { state: "pressed" 0.0;
373 inherit: "default" 0.0; 373 inherit: "default" 0.0;
374 image.normal: "sym_left_glow_normal.png"; 374 image.normal: "sym_left_glow_normal.png";
375 } 375 }
376 description { state: "disabled" 0.0; 376 description { state: "disabled" 0.0;
377 inherit: "default" 0.0; 377 inherit: "default" 0.0;
378 image.normal: "sym_left_dark_normal.png"; 378 image.normal: "sym_left_dark_normal.png";
379 }
380 } 379 }
381 } 380 }
381 }
382} 382}
383 383
384group { name: "efl/spin_button/text_button"; 384group { name: "efl/spin_button/text_button";
385 alias: "efl/spin_button/text_button:vertical"; 385 alias: "efl/spin_button/text_button:vertical";
386 parts { 386 parts {
387 part { name: "bg"; 387 part { name: "bg";
388 type: SPACER; 388 type: SPACER;
389 scale: 1; 389 scale: 1;
390 description { state: "default" 0.0; 390 description { state: "default" 0.0;
391 }
392 } 391 }
393 part { name: "elm.text"; 392 }
394 type: TEXT; 393 part { name: "elm.text";
395 scale: 1; 394 type: TEXT;
396 effect: SHADOW BOTTOM; 395 scale: 1;
397 description { state: "default" 0.0; 396 effect: SHADOW BOTTOM;
398 color: FN_COL_DEFAULT; 397 description { state: "default" 0.0;
399 color_class: "spinner"; 398 color: FN_COL_DEFAULT;
400 rel1.to: "bg"; 399 color_class: "spinner";
401 rel2.to: "bg"; 400 rel1.to: "bg";
402 text { font: FN; size: 10; 401 rel2.to: "bg";
403 min: 1 1; 402 text { font: FN; size: 10;
404 text_class: "spinner"; 403 min: 1 1;
405 ellipsis: -1; 404 text_class: "spinner";
406 } 405 ellipsis: -1;
407 }
408 description { state: "disabled" 0.0;
409 inherit: "default" 0.0 ;
410 color: FN_COL_DISABLE;
411 color_class: "spinner_disabled";
412 } 406 }
413 } 407 }
414 part { name: "over"; 408 description { state: "disabled" 0.0;
415 type: RECT; 409 inherit: "default" 0.0 ;
416 repeat_events: 1; 410 color: FN_COL_DISABLE;
417 description { state: "default" 0.0; 411 color_class: "spinner_disabled";
418 color: 0 0 0 0; 412 }
419 } 413 }
414 part { name: "over";
415 type: RECT;
416 repeat_events: 1;
417 description { state: "default" 0.0;
418 color: 0 0 0 0;
419 }
420 }
421 part { name: "disabler";
422 type: RECT;
423 description { state: "default" 0.0;
424 color: 0 0 0 0;
425 visible: 0;
426 }
427 description { state: "disabled" 0.0;
428 inherit: "default" 0.0;
429 visible: 1;
430 }
431 }
432 }
433 programs {
434 program { name: "button_click";
435 signal: "mouse,clicked,1";
436 source: "over";
437 script {
438 run_program(PROGRAM:"button_click2");
420 } 439 }
421 part { name: "disabler"; 440 }
422 type: RECT; 441 program { name: "button_click2";
423 description { state: "default" 0.0; 442 action: SIGNAL_EMIT "elm,action,click" "";
424 color: 0 0 0 0; 443 }
425 visible: 0; 444 program { name: "disable";
445 signal: "elm,state,disabled";
446 source: "elm";
447 action: STATE_SET "disabled" 0.0;
448 target: "disabler";
449 target: "elm.text";
450 }
451 program { name: "enable";
452 signal: "elm,state,enabled";
453 source: "elm";
454 action: STATE_SET "default" 0.0;
455 target: "disabler";
456 target: "elm.text";
457 }
458 }
459}
460
461group { "efl/spin_button:picker";
462 parts {
463 rect { "clip";
464 desc { "default";
465 rel.to: "elm.swallow.text_button";
466 }
467 }
468 spacer { "base";
469 scale;
470 desc { "default";
471 min: 40 150;
472 }
473 }
474 rect { "bg";
475 scale;
476 desc { "default";
477 color_class: "spinner_bg";
478 }
479 }
480 rect { "access";
481 repeat;
482 desc { "default";
483 fixed: 1 1;
484 color: 0 0 0 0;
485 rel1.to: "base";
486 rel2.to: "base";
487 hid;
488 }
489 desc { "active";
490 inherit: "default";
491 vis;
492 }
493 }
494 swallow { "elm.swallow.inc_button";
495 scale;
496 desc { "default";
497 align: 0.5 0.0;
498 min: 40 40;
499 max: 40 40;
500 fixed: 1 1;
501 }
502 }
503 swallow { "elm.swallow.dec_button";
504 scale;
505 desc { "default";
506 align: 0.5 1.0;
507 min: 40 40;
508 max: 40 40;
509 fixed: 1 1;
510 }
511 }
512 swallow { "elm.swallow.entry";
513 clip: "clip";
514 desc { "default";
515 fixed: 1 1;
516 rel1.to: "elm.swallow.text_button";
517 rel2.to: "elm.swallow.text_button";
518 hid;
519 }
520 desc { "active";
521 inherit: "default";
522 vis;
523 }
524 }
525 swallow { "elm.swallow.text_button";
526 scale;
527 desc { "default";
528 rel.to_x: "base";
529 rel1 {
530 to_y: "elm.swallow.inc_button";
531 relative: 0.0 1.0;
426 } 532 }
427 description { state: "disabled" 0.0; 533 rel2 {
428 inherit: "default" 0.0; 534 to_y: "elm.swallow.dec_button";
429 visible: 1; 535 relative: 1.0 0.0;
430 } 536 }
537 min: 0 70;
538 max: -1 70;
539 fixed: 0 1;
540 }
541 desc { "inactive";
542 inherit: "default";
543 hid;
431 } 544 }
432 } 545 }
433 programs { 546 rect { "disabler";
434 program { name: "button_click"; 547 norepeat;
435 signal: "mouse,clicked,1"; 548 nomouse;
436 source: "over"; 549 desc { "default";
437 script { 550 color: 0 0 0 0;
438 run_program(PROGRAM:"button_click2"); 551 hid;
439 }
440 } 552 }
441 program { name: "button_click2"; 553 desc { "disabled";
442 action: SIGNAL_EMIT "elm,action,click" ""; 554 inherit: "default";
443 } 555 vis;
444 program { name: "disable"; 556 }
445 signal: "elm,state,disabled"; 557 }
446 source: "elm"; 558 }
447 action: STATE_SET "disabled" 0.0; 559 programs {
448 target: "disabler"; 560 program { "entry_active";
449 target: "elm.text"; 561 signal: "elm,state,entry,active";
450 } 562 source: "elm";
451 program { name: "enable"; 563 action: STATE_SET "active";
452 signal: "elm,state,enabled"; 564 target: "elm.swallow.entry";
453 source: "elm"; 565 }
454 action: STATE_SET "default" 0.0; 566 program { "entry_inactive";
455 target: "disabler"; 567 signal: "elm,state,entry,inactive";
456 target: "elm.text"; 568 source: "elm";
457 } 569 action: STATE_SET "default";
458 } 570 target: "elm.swallow.entry";
571 }
572 program { "text_button_active";
573 signal: "elm,state,button,active";
574 source: "elm";
575 action: STATE_SET "default";
576 target: "elm.swallow.text_button";
577 }
578 program { "text_button_inactive";
579 signal: "elm,state,button,inactive";
580 source: "elm";
581 action: STATE_SET "inactive";
582 target: "elm.swallow.text_button";
583 }
584 program { "access_activate";
585 signal: "elm,state,access,active";
586 source: "elm";
587 action: STATE_SET "active";
588 target: "access";
589 }
590 program { "access_inactivate";
591 signal: "elm,state,access,inactive";
592 source: "elm";
593 action: STATE_SET "default";
594 target: "access";
595 }
596 program { "disable";
597 signal: "elm,state,disabled";
598 source: "elm";
599 action: STATE_SET "disabled";
600 target: "disabler";
601 }
602 program { "enable";
603 signal: "elm,state,enabled";
604 source: "elm";
605 action: STATE_SET "default";
606 target: "disabler";
607 }
608 }
459} 609}
460 610
461group { name: "efl/spin_button/inc_button:vertical"; 611group { name: "efl/spin_button/inc_button:vertical";
462 inherit: "efl/spin_button/inc_button"; 612 inherit: "efl/spin_button/inc_button";
463 images.image: "sym_up_light_normal.png" COMP; 613 images.image: "sym_up_light_normal.png" COMP;
464 images.image: "sym_up_glow_normal.png" COMP; 614 images.image: "sym_up_glow_normal.png" COMP;
465 images.image: "sym_up_dark_normal.png" COMP; 615 images.image: "sym_up_dark_normal.png" COMP;
466 parts { 616 parts {
467 part { name: "arrow.image"; 617 part { name: "arrow.image";
468 scale: 1; 618 scale: 1;
469 description { state: "default" 0.0; 619 description { state: "default" 0.0;
470 min: 15 15; 620 min: 15 15;
471 max: 15 15; 621 max: 15 15;
472 image.normal: "sym_up_light_normal.png"; 622 image.normal: "sym_up_light_normal.png";
473 } 623 }
474 description { state: "pressed" 0.0; 624 description { state: "pressed" 0.0;
475 inherit: "default" 0.0; 625 inherit: "default" 0.0;
476 image.normal: "sym_up_glow_normal.png"; 626 image.normal: "sym_up_glow_normal.png";
477 } 627 }
478 description { state: "disabled" 0.0; 628 description { state: "disabled" 0.0;
479 inherit: "default" 0.0; 629 inherit: "default" 0.0;
480 image.normal: "sym_up_dark_normal.png"; 630 image.normal: "sym_up_dark_normal.png";
481 } 631 }
482 } 632 }
483 } 633 }
484} 634}
485 635
486group { name: "efl/spin_button/dec_button:vertical"; 636group { name: "efl/spin_button/dec_button:vertical";
487 inherit: "efl/spin_button/dec_button"; 637 inherit: "efl/spin_button/dec_button";
488 images.image: "sym_down_light_normal.png" COMP; 638 images.image: "sym_down_light_normal.png" COMP;
489 images.image: "sym_down_glow_normal.png" COMP; 639 images.image: "sym_down_glow_normal.png" COMP;
490 images.image: "sym_down_dark_normal.png" COMP; 640 images.image: "sym_down_dark_normal.png" COMP;
491 parts { 641 parts {
492 part { name: "arrow.image"; 642 part { name: "arrow.image";
493 scale: 1; 643 scale: 1;
494 description { state: "default" 0.0; 644 description { state: "default" 0.0;
495 min: 15 15; 645 min: 15 15;
496 max: 15 15; 646 max: 15 15;
497 image.normal: "sym_down_light_normal.png"; 647 image.normal: "sym_down_light_normal.png";
498 } 648 }
499 description { state: "pressed" 0.0; 649 description { state: "pressed" 0.0;
500 inherit: "default" 0.0; 650 inherit: "default" 0.0;
501 image.normal: "sym_down_glow_normal.png"; 651 image.normal: "sym_down_glow_normal.png";
502 } 652 }
503 description { state: "disabled" 0.0; 653 description { state: "disabled" 0.0;
504 inherit: "default" 0.0; 654 inherit: "default" 0.0;
505 image.normal: "sym_down_dark_normal.png"; 655 image.normal: "sym_down_dark_normal.png";
506 } 656 }
657 }
658 }
659}
660
661group { "efl/spin_button/inc_button:picker";
662 inherit: "efl/spin_button/inc_button";
663 images.image: "sym_up_light_normal.png" COMP;
664 images.image: "sym_up_glow_normal.png" COMP;
665 images.image: "sym_up_dark_normal.png" COMP;
666 parts {
667 part { name: "arrow.image";
668 scale: 1;
669 description { state: "default" 0.0;
670 min: 15 15;
671 max: 15 15;
672 image.normal: "sym_up_light_normal.png";
673 }
674 description { state: "pressed" 0.0;
675 inherit: "default" 0.0;
676 image.normal: "sym_up_glow_normal.png";
677 }
678 description { state: "disabled" 0.0;
679 inherit: "default" 0.0;
680 image.normal: "sym_up_dark_normal.png";
507 } 681 }
508 } 682 }
509 } 683 }
684}
685
686group { "efl/spin_button/dec_button:picker";
687 inherit: "efl/spin_button/dec_button";
688 images.image: "sym_down_light_normal.png" COMP;
689 images.image: "sym_down_glow_normal.png" COMP;
690 images.image: "sym_down_dark_normal.png" COMP;
691 parts {
692 part { name: "arrow.image";
693 scale: 1;
694 description { state: "default" 0.0;
695 min: 15 15;
696 max: 15 15;
697 image.normal: "sym_down_light_normal.png";
698 }
699 description { state: "pressed" 0.0;
700 inherit: "default" 0.0;
701 image.normal: "sym_down_glow_normal.png";
702 }
703 description { state: "disabled" 0.0;
704 inherit: "default" 0.0;
705 image.normal: "sym_down_dark_normal.png";
706 }
707 }
708 }
709}
diff --git a/data/elementary/themes/edc/efl/timepicker.edc b/data/elementary/themes/edc/efl/timepicker.edc
new file mode 100644
index 0000000000..a1f030e8a4
--- /dev/null
+++ b/data/elementary/themes/edc/efl/timepicker.edc
@@ -0,0 +1,378 @@
1group { "efl/timepicker";
2 nomouse;
3 parts {
4 spacer { "base";
5 scale;
6 desc { "default";
7 min: 150 170;
8 }
9 desc { "24layout";
10 min: 110 170;
11 }
12 }
13 rect { "base_bg";
14 scale;
15 desc { "default";
16 rel.to: "base";
17 color: 0 0 0 35;
18 }
19 }
20 spacer { "padding_bg_top";
21 scale;
22 desc { "default";
23 min: 0 10;
24 max: -1 10;
25 fixed: 0 1;
26 rel1 {
27 relative: 0.0 0.0;
28 to: "base_bg";
29 }
30 rel2 {
31 relative: 1.0 0.0;
32 to: "base_bg";
33 }
34 align: 0.5 0.0;
35 }
36 }
37 spacer { "padding_bg_bottom";
38 scale;
39 desc { "default";
40 min: 0 10;
41 max: -1 10;
42 fixed: 0 1;
43 rel1 {
44 relative: 0.0 1.0;
45 to: "base_bg";
46 }
47 rel2 {
48 relative: 1.0 1.0;
49 to: "base_bg";
50 }
51 align: 0.5 1.0;
52 }
53 }
54 spacer { "bg";
55 scale;
56 desc { "default";
57 min: 150 150;
58 max: 150 150;
59 rel1 {
60 relative: 0.0 1.0;
61 to: "padding_bg_top";
62 }
63 rel2 {
64 relative: 1.0 0.0;
65 to: "padding_bg_bottom";
66 }
67 }
68 desc { "24layout";
69 inherit: "default";
70 min: 110 150;
71 max: 110 150;
72 }
73 }
74 spacer { "padding_left";
75 scale;
76 desc { "default";
77 min: 0 0;
78 max: 0 -1;
79 fixed: 1 0;
80 rel1 {
81 relative: 0.0 0.0;
82 to: "bg";
83 }
84 rel2 {
85 relative: 0.0 1.0;
86 to: "bg";
87 }
88 align: 0.0 0.0;
89 }
90 }
91 spacer { "padding_right";
92 scale;
93 desc { "default";
94 min: 0 0;
95 max: 0 -1;
96 fixed: 1 0;
97 rel1 {
98 relative: 1.0 0.0;
99 to: "bg";
100 }
101 rel2 {
102 relative: 1.0 1.0;
103 to: "bg";
104 }
105 align: 1.0 1.0;
106 }
107 }
108 swallow { "field0";
109 mouse;
110 scale;
111 desc { "default";
112 fixed: 1 0;
113 min: 40 0;
114 rel1 {
115 relative: 1.0 0.0;
116 to: "padding_left";
117 }
118 rel2.to: "padding_left";
119 align: 0.0 0.5;
120 }
121 }
122 spacer{ "padding_center1";
123 scale;
124 desc { "default";
125 fixed: 1 0;
126 min: 3 0;
127 max: 3 -1;
128 rel1 {
129 relative: 1.0 0.0;
130 to: "field0";
131 }
132 rel2.to: "field0";
133 align: 0.0 0.5;
134 }
135 desc { "invisible";
136 inherit: default 0.0;
137 min: 15 0;
138 max: 15 -1;
139 }
140 }
141 spacer { "bg_text";
142 scale;
143 desc { "default";
144 rel1 {
145 relative: 1.0 0.0;
146 to: "padding_center1";
147 }
148 rel2.to: "padding_center1";
149 align: 0.0 0.5;
150 min: 9 0;
151 max: 9 -1;
152 fixed: 1 0;
153 }
154 desc { "invisible";
155 inherit: default 0.0;
156 min: 0 0;
157 max: 0 0;
158 }
159 }
160 text { "hour_minute_colon";
161 scale;
162 desc { "default";
163 rel1.to: "bg_text";
164 rel2.to: "bg_text";
165 color: 255 255 255 255;
166 fixed: 1 1;
167 text {
168 min: 1 0;
169 font: "Sans";
170 size: "15";
171 //text: ":";
172 align: 0.5 0.44;
173 }
174 vis;
175 }
176 desc { "invisible";
177 inherit: default 0.0;
178 hid;
179 }
180 }
181 spacer { "padding_center2";
182 scale;
183 desc { "default";
184 fixed: 1 0;
185 min: 3 0;
186 max: 3 -1;
187 rel1 {
188 relative: 1.0 0.0;
189 to: "bg_text";
190 }
191 rel2.to: "bg_text";
192 align: 0.0 0.5;
193 }
194 desc { "invisible";
195 inherit: default 0.0;
196 min: 0 0;
197 max: 0 0;
198 }
199 }
200 swallow { "field1";
201 mouse;
202 scale;
203 desc { "default";
204 fixed: 1 0;
205 min: 40 0;
206 rel1 {
207 relative: 1.0 0.0;
208 to: "padding_center2";
209 }
210 rel2.to: "padding_center2";
211 align: 0.0 0.5;
212 }
213 }
214 spacer { "padding_center3";
215 scale;
216 desc { "default";
217 fixed: 1 0;
218 min: 3 0;
219 max: 3 -1;
220 rel1 {
221 relative: 1.0 0.0;
222 to: "field1";
223 }
224 rel2.to: "field1";
225 align: 0.0 0.5;
226 }
227 desc { "invisible";
228 inherit: default 0.0;
229 min: 15 0;
230 max: 15 -1;
231 }
232 }
233 spacer { "bg_text2";
234 scale;
235 desc { "default";
236 rel1 {
237 relative: 1.0 0.0;
238 to: "padding_center3";
239 }
240 rel2.to: "padding_center3";
241 align: 0.0 0.5;
242 min: 9 0;
243 max: 9 -1;
244 fixed: 1 0;
245 }
246 desc { "invisible";
247 inherit: default 0.0;
248 min: 0 0;
249 max: 0 0;
250 }
251 }
252 text { "hour_minute_colon2";
253 scale;
254 desc { "default";
255 rel1.to: "bg_text2";
256 rel2.to: "bg_text2";
257 color: 255 255 255 255;
258 fixed: 1 1;
259 text {
260 min: 1 0;
261 font: "Sans";
262 size: "15";
263 //text: ":";
264 align: 0.5 0.44;
265 }
266 vis;
267 }
268 desc { "invisible";
269 inherit: default 0.0;
270 hid;
271 }
272 }
273 spacer { "padding_center4";
274 scale;
275 desc { "default";
276 fixed: 1 0;
277 min: 3 0;
278 max: 3 -1;
279 rel1 {
280 relative: 1.0 0.0;
281 to: "bg_text2";
282 }
283 rel2.to: "bg_text2";
284 align: 0.0 0.5;
285 }
286 desc { "invisible";
287 inherit: default 0.0;
288 min: 0 0;
289 max: 0 0;
290 }
291 }
292 swallow { "field2";
293 mouse;
294 scale;
295 desc { "default";
296 fixed: 1 0;
297 min: 40 0;
298 max: 40 -1;
299 rel1 {
300 relative: 1.0 0.0;
301 to: "padding_center4";
302 }
303 rel2.to: "padding_center4";
304 align: 0.0 0.5;
305 }
306 desc { "24layout";
307 hid;
308 min: 0 0;
309 max: 0 -1;
310 }
311 }
312 rect { "access";
313 repeat;
314 desc { "default";
315 fixed: 1 1;
316 rel1.to: "bg";
317 rel2.to: "bg";
318 color: 0 0 0 0;
319 }
320 }
321 }
322 programs {
323 program { "visible_ampm";
324 signal: "elm,state,ampm,visible";
325 source: "elm";
326 script {
327 set_state(PART:"base", "default", 0.0);
328 set_state(PART:"bg", "default", 0.0);
329 set_state(PART:"field2", "default", 0.0);
330 }
331 }
332 program { "invisible_ampm";
333 signal: "elm,state,ampm,invisible";
334 source: "elm";
335 script {
336 set_state(PART:"base", "24layout", 0.0);
337 set_state(PART:"bg", "24layout", 0.0);
338 set_state(PART:"field2", "24layout", 0.0);
339 }
340 }
341 program { "visible_colon_field0";
342 signal: "elm,state,colon,visible,field0";
343 source: "elm";
344 action: STATE_SET "default";
345 target: "padding_center1";
346 target: "hour_minute_colon";
347 target: "bg_text";
348 target: "padding_center2";
349 }
350 program { "invisible_colon_field0";
351 signal: "elm,state,colon,invisible,field0";
352 source: "elm";
353 action: STATE_SET "invisible";
354 target: "padding_center1";
355 target: "hour_minute_colon";
356 target: "bg_text";
357 target: "padding_center2";
358 }
359 program { "visible_colon_field1";
360 signal: "elm,state,colon,visible,field1";
361 source: "elm";
362 action: STATE_SET "default";
363 target: "padding_center3";
364 target: "hour_minute_colon2";
365 target: "bg_text2";
366 target: "padding_center4";
367 }
368 program { "invisible_colon_field1";
369 signal: "elm,state,colon,invisible,field1";
370 source: "elm";
371 action: STATE_SET "invisible";
372 target: "padding_center3";
373 target: "hour_minute_colon2";
374 target: "bg_text2";
375 target: "padding_center4";
376 }
377 }
378}
diff --git a/data/elementary/themes/edc/elm/button.edc b/data/elementary/themes/edc/elm/button.edc
index c5c48d3a21..1d0064765b 100644
--- a/data/elementary/themes/edc/elm/button.edc
+++ b/data/elementary/themes/edc/elm/button.edc
@@ -1783,6 +1783,30 @@ group { name: "elm/button/base/hoversel_horizontal_entry/default";
1783 } 1783 }
1784 } 1784 }
1785 } 1785 }
1786
1787 group { name: "elm/button/base/spinner/increase/picker";
1788 inherit: "elm/button/base/spinner/increase/vertical";
1789 parts {
1790 part { name: "arrow.image";
1791 description { state: "default" 0.0;
1792 min: 20 20;
1793 max: 20 20;
1794 }
1795 }
1796 }
1797 }
1798
1799 group { name: "elm/button/base/spinner/decrease/picker";
1800 inherit: "elm/button/base/spinner/decrease/vertical";
1801 parts {
1802 part { name: "arrow.image";
1803 description { state: "default" 0.0;
1804 min: 20 20;
1805 max: 20 20;
1806 }
1807 }
1808 }
1809 }
1786/******************* SPINNER BUTTONS STYLES END **********************/ 1810/******************* SPINNER BUTTONS STYLES END **********************/
1787group { name: "elm/button/base/combobox_vertical/default"; 1811group { name: "elm/button/base/combobox_vertical/default";
1788 alias: "elm/button/base/combobox_vertical/entry"; 1812 alias: "elm/button/base/combobox_vertical/entry";
diff --git a/data/elementary/themes/edc/elm/entry.edc b/data/elementary/themes/edc/elm/entry.edc
index 189bf968d7..0a806a6901 100644
--- a/data/elementary/themes/edc/elm/entry.edc
+++ b/data/elementary/themes/edc/elm/entry.edc
@@ -854,6 +854,7 @@ group { name: "elm/entry/base-single/default";
854 854
855group { name: "elm/entry/base-single/spinner/default"; 855group { name: "elm/entry/base-single/spinner/default";
856 alias: "elm/entry/base-single/spinner/vertical"; 856 alias: "elm/entry/base-single/spinner/vertical";
857 alias: "elm/entry/base-single/spinner/picker";
857 alias: "elm/entry/base-single/spin_button/default"; 858 alias: "elm/entry/base-single/spin_button/default";
858 alias: "elm/entry/base-single/spin_button/vertical"; 859 alias: "elm/entry/base-single/spin_button/vertical";
859 inherit: "elm/entry/base-single/default"; 860 inherit: "elm/entry/base-single/default";
diff --git a/src/Makefile_Efl.am b/src/Makefile_Efl.am
index f98f554362..6f9c3fc9c9 100644
--- a/src/Makefile_Efl.am
+++ b/src/Makefile_Efl.am
@@ -75,6 +75,9 @@ efl_eolian_files = \
75 lib/efl/interfaces/efl_ui_menu.eo \ 75 lib/efl/interfaces/efl_ui_menu.eo \
76 lib/efl/interfaces/efl_ui_autorepeat.eo \ 76 lib/efl/interfaces/efl_ui_autorepeat.eo \
77 lib/efl/interfaces/efl_ui_format.eo \ 77 lib/efl/interfaces/efl_ui_format.eo \
78 lib/efl/interfaces/efl_ui_datetime.eo \
79 lib/efl/interfaces/efl_ui_date.eo \
80 lib/efl/interfaces/efl_ui_time.eo \
78 lib/efl/interfaces/efl_gfx_color_class.eo \ 81 lib/efl/interfaces/efl_gfx_color_class.eo \
79 lib/efl/interfaces/efl_gfx_text_class.eo \ 82 lib/efl/interfaces/efl_gfx_text_class.eo \
80 lib/efl/interfaces/efl_gfx_size_class.eo \ 83 lib/efl/interfaces/efl_gfx_size_class.eo \
@@ -128,6 +131,7 @@ lib/efl/interfaces/efl_io_queue.c \
128lib/efl/interfaces/efl_observer.c \ 131lib/efl/interfaces/efl_observer.c \
129lib/efl/interfaces/efl_file.c \ 132lib/efl/interfaces/efl_file.c \
130lib/efl/interfaces/efl_ui_format.c \ 133lib/efl/interfaces/efl_ui_format.c \
134lib/efl/interfaces/efl_ui_datetime.c \
131lib/efl/interfaces/efl_gfx_color.c \ 135lib/efl/interfaces/efl_gfx_color.c \
132lib/efl/interfaces/efl_text_markup_util.c \ 136lib/efl/interfaces/efl_text_markup_util.c \
133$(NULL) 137$(NULL)
diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index 02008ee6e1..cbfdeda975 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -23,6 +23,8 @@ elm_public_eolian_files = \
23 lib/elementary/efl_ui_slider_interval.eo \ 23 lib/elementary/efl_ui_slider_interval.eo \
24 lib/elementary/efl_ui_spin.eo \ 24 lib/elementary/efl_ui_spin.eo \
25 lib/elementary/efl_ui_spin_button.eo \ 25 lib/elementary/efl_ui_spin_button.eo \
26 lib/elementary/efl_ui_datepicker.eo \
27 lib/elementary/efl_ui_timepicker.eo \
26 lib/elementary/efl_ui_video.eo \ 28 lib/elementary/efl_ui_video.eo \
27 lib/elementary/efl_ui_win.eo \ 29 lib/elementary/efl_ui_win.eo \
28 lib/elementary/efl_ui_win_inlined.eo \ 30 lib/elementary/efl_ui_win_inlined.eo \
@@ -370,6 +372,8 @@ includesunstable_HEADERS = \
370 lib/elementary/elm_widget_spinner.h \ 372 lib/elementary/elm_widget_spinner.h \
371 lib/elementary/efl_ui_spin_private.h \ 373 lib/elementary/efl_ui_spin_private.h \
372 lib/elementary/efl_ui_spin_button_private.h \ 374 lib/elementary/efl_ui_spin_button_private.h \
375 lib/elementary/efl_ui_datepicker_private.h \
376 lib/elementary/efl_ui_timepicker_private.h \
373 lib/elementary/elm_widget_table.h \ 377 lib/elementary/elm_widget_table.h \
374 lib/elementary/elm_widget_thumb.h \ 378 lib/elementary/elm_widget_thumb.h \
375 lib/elementary/elm_widget_toolbar.h \ 379 lib/elementary/elm_widget_toolbar.h \
@@ -722,6 +726,8 @@ lib_elementary_libelementary_la_SOURCES = \
722 lib/elementary/efl_ui_slider_interval.c \ 726 lib/elementary/efl_ui_slider_interval.c \
723 lib/elementary/efl_ui_spin.c \ 727 lib/elementary/efl_ui_spin.c \
724 lib/elementary/efl_ui_spin_button.c \ 728 lib/elementary/efl_ui_spin_button.c \
729 lib/elementary/efl_ui_datepicker.c \
730 lib/elementary/efl_ui_timepicker.c \
725 lib/elementary/elm_slideshow.c \ 731 lib/elementary/elm_slideshow.c \
726 lib/elementary/elm_spinner.c \ 732 lib/elementary/elm_spinner.c \
727 lib/elementary/elm_store.c \ 733 lib/elementary/elm_store.c \
@@ -974,6 +980,8 @@ bin/elementary/test_ui_slider.c \
974bin/elementary/test_ui_slider_interval.c \ 980bin/elementary/test_ui_slider_interval.c \
975bin/elementary/test_ui_spin.c \ 981bin/elementary/test_ui_spin.c \
976bin/elementary/test_ui_spin_button.c \ 982bin/elementary/test_ui_spin_button.c \
983bin/elementary/test_ui_datepicker.c \
984bin/elementary/test_ui_timepicker.c \
977bin/elementary/test_slideshow.c \ 985bin/elementary/test_slideshow.c \
978bin/elementary/test_spinner.c \ 986bin/elementary/test_spinner.c \
979bin/elementary/test_store.c \ 987bin/elementary/test_store.c \
diff --git a/src/bin/elementary/Makefile.am b/src/bin/elementary/Makefile.am
index 0749293876..57c6035b79 100644
--- a/src/bin/elementary/Makefile.am
+++ b/src/bin/elementary/Makefile.am
@@ -133,6 +133,8 @@ test_slideshow.c \
133test_spinner.c \ 133test_spinner.c \
134test_ui_spinner.c \ 134test_ui_spinner.c \
135test_ui_buttonspin.c \ 135test_ui_buttonspin.c \
136test_ui_datepicker.c \
137test_ui_timepicker.c \
136test_store.c \ 138test_store.c \
137test_sys_notify.c \ 139test_sys_notify.c \
138test_systray.c \ 140test_systray.c \
diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c
index 9862d1d906..81676a080e 100644
--- a/src/bin/elementary/test.c
+++ b/src/bin/elementary/test.c
@@ -183,6 +183,8 @@ void test_efl_ui_scroller2(void *data, Evas_Object *obj, void *event_info);
183void test_spinner(void *data, Evas_Object *obj, void *event_info); 183void test_spinner(void *data, Evas_Object *obj, void *event_info);
184void test_ui_spin(void *data, Evas_Object *obj, void *event_info); 184void test_ui_spin(void *data, Evas_Object *obj, void *event_info);
185void test_ui_spin_button(void *data, Evas_Object *obj, void *event_info); 185void test_ui_spin_button(void *data, Evas_Object *obj, void *event_info);
186void test_ui_datepicker(void *data, Evas_Object *obj, void *event_info);
187void test_ui_timepicker(void *data, Evas_Object *obj, void *event_info);
186void test_index(void *data, Evas_Object *obj, void *event_info); 188void test_index(void *data, Evas_Object *obj, void *event_info);
187void test_index2(void *data, Evas_Object *obj, void *event_info); 189void test_index2(void *data, Evas_Object *obj, void *event_info);
188void test_index3(void *data, Evas_Object *obj, void *event_info); 190void test_index3(void *data, Evas_Object *obj, void *event_info);
@@ -1083,6 +1085,8 @@ add_tests:
1083 ADD_TEST(NULL, "Times & Dates", "Datetime", test_datetime); 1085 ADD_TEST(NULL, "Times & Dates", "Datetime", test_datetime);
1084 ADD_TEST_EO(NULL, "Times & Dates", "Efl.Ui.Calendar", test_efl_ui_calendar); 1086 ADD_TEST_EO(NULL, "Times & Dates", "Efl.Ui.Calendar", test_efl_ui_calendar);
1085 ADD_TEST_EO(NULL, "Times & Dates", "Efl.Ui.Clock", test_ui_clock); 1087 ADD_TEST_EO(NULL, "Times & Dates", "Efl.Ui.Clock", test_ui_clock);
1088 ADD_TEST_EO(NULL, "Times & Dates", "Efl.Ui.Datepicker", test_ui_datepicker);
1089 ADD_TEST_EO(NULL, "Times & Dates", "Efl.Ui.Timepicker", test_ui_timepicker);
1086 1090
1087 //------------------------------// 1091 //------------------------------//
1088 ADD_TEST(NULL, "Text", "Label", test_label); 1092 ADD_TEST(NULL, "Text", "Label", test_label);
diff --git a/src/bin/elementary/test_ui_datepicker.c b/src/bin/elementary/test_ui_datepicker.c
new file mode 100644
index 0000000000..219ed2ee2b
--- /dev/null
+++ b/src/bin/elementary/test_ui_datepicker.c
@@ -0,0 +1,37 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4#include <Elementary.h>
5
6static void
7_date_changed_cb(void *data EINA_UNUSED, const Efl_Event *ev)
8{
9 int year, month, day;
10
11 efl_ui_date_get(ev->object, &year, &month, &day);
12 printf("Current date is %d %d %d\n", year, month, day);
13}
14
15void
16test_ui_datepicker(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
17{
18 Eo *win, *bx;
19
20 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
21 efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
22 efl_text_set(efl_added, "Efl.Ui.Datepicker"),
23 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
24
25 bx = efl_add(EFL_UI_BOX_CLASS, win,
26 efl_content_set(win, efl_added),
27 efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
28
29 efl_add(EFL_UI_DATEPICKER_CLASS, bx,
30 efl_ui_date_set(efl_added, 1987, 9, 17),
31 efl_ui_date_max_set(efl_added, 1985, 6, 7),
32 efl_ui_date_min_set(efl_added, 1980, 6, 7),
33 efl_event_callback_add(efl_added, EFL_UI_DATEPICKER_EVENT_CHANGED,_date_changed_cb, NULL),
34 efl_pack(bx, efl_added));
35
36 efl_gfx_size_set(win, EINA_SIZE2D(150, 170));
37}
diff --git a/src/bin/elementary/test_ui_timepicker.c b/src/bin/elementary/test_ui_timepicker.c
new file mode 100644
index 0000000000..bbf373a740
--- /dev/null
+++ b/src/bin/elementary/test_ui_timepicker.c
@@ -0,0 +1,36 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4#include <Elementary.h>
5
6static void
7_time_changed_cb(void *data EINA_UNUSED, const Efl_Event *ev)
8{
9 int hour, min;
10
11 efl_ui_time_get(ev->object, &hour, &min);
12 printf("Current time is %d %d\n", hour, min);
13}
14
15
16void
17test_ui_timepicker(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
18{
19 Eo *win, *bx;
20
21 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
22 efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
23 efl_text_set(efl_added, "Efl.Ui.Timepicker"),
24 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
25
26 bx = efl_add(EFL_UI_BOX_CLASS, win,
27 efl_content_set(win, efl_added),
28 efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
29
30 efl_add(EFL_UI_TIMEPICKER_CLASS, bx,
31 efl_ui_time_set(efl_added, 11, 35),
32 efl_event_callback_add(efl_added, EFL_UI_TIMEPICKER_EVENT_CHANGED,_time_changed_cb, NULL),
33 efl_pack(bx, efl_added));
34
35 efl_gfx_size_set(win, EINA_SIZE2D(150, 170));
36}
diff --git a/src/lib/efl/CMakeLists.txt b/src/lib/efl/CMakeLists.txt
index 909cea5b5b..ba8f0a7016 100644
--- a/src/lib/efl/CMakeLists.txt
+++ b/src/lib/efl/CMakeLists.txt
@@ -53,6 +53,8 @@ set(PUBLIC_EO_FILES
53 interfaces/efl_ui_item.eo 53 interfaces/efl_ui_item.eo
54 interfaces/efl_ui_menu.eo 54 interfaces/efl_ui_menu.eo
55 interfaces/efl_ui_range.eo 55 interfaces/efl_ui_range.eo
56 interfaces/efl_ui_date.eo
57 interfaces/efl_ui_time.eo
56 interfaces/efl_ui_autorepeat.eo 58 interfaces/efl_ui_autorepeat.eo
57 interfaces/efl_vpath.eo 59 interfaces/efl_vpath.eo
58 interfaces/efl_vpath_core.eo 60 interfaces/efl_vpath_core.eo
diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h
index 2399c9c30b..1909a0e283 100644
--- a/src/lib/efl/Efl.h
+++ b/src/lib/efl/Efl.h
@@ -95,6 +95,8 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
95#include "interfaces/efl_ui_scrollable_interactive.eo.h" 95#include "interfaces/efl_ui_scrollable_interactive.eo.h"
96#include "interfaces/efl_ui_selectable.eo.h" 96#include "interfaces/efl_ui_selectable.eo.h"
97#include "interfaces/efl_ui_zoom.eo.h" 97#include "interfaces/efl_ui_zoom.eo.h"
98#include "interfaces/efl_ui_date.eo.h"
99#include "interfaces/efl_ui_time.eo.h"
98 100
99#include "interfaces/efl_screen.eo.h" 101#include "interfaces/efl_screen.eo.h"
100 102
@@ -136,6 +138,7 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
136#include "interfaces/efl_ui_model_connect.eo.h" 138#include "interfaces/efl_ui_model_connect.eo.h"
137#include "interfaces/efl_ui_factory.eo.h" 139#include "interfaces/efl_ui_factory.eo.h"
138#include "interfaces/efl_ui_format.eo.h" 140#include "interfaces/efl_ui_format.eo.h"
141#include "interfaces/efl_ui_datetime.eo.h"
139 142
140/* Observable interface */ 143/* Observable interface */
141#include "interfaces/efl_observer.eo.h" 144#include "interfaces/efl_observer.eo.h"
diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c b/src/lib/efl/interfaces/efl_interfaces_main.c
index cb1738e52b..c7742fe39b 100644
--- a/src/lib/efl/interfaces/efl_interfaces_main.c
+++ b/src/lib/efl/interfaces/efl_interfaces_main.c
@@ -77,6 +77,8 @@
77#include "interfaces/efl_ui_scrollbar.eo.c" 77#include "interfaces/efl_ui_scrollbar.eo.c"
78#include "interfaces/efl_ui_selectable.eo.c" 78#include "interfaces/efl_ui_selectable.eo.c"
79#include "interfaces/efl_ui_zoom.eo.c" 79#include "interfaces/efl_ui_zoom.eo.c"
80#include "interfaces/efl_ui_date.eo.c"
81#include "interfaces/efl_ui_time.eo.c"
80 82
81EAPI void 83EAPI void
82__efl_internal_init(void) 84__efl_internal_init(void)
diff --git a/src/lib/efl/interfaces/efl_ui_date.eo b/src/lib/efl/interfaces/efl_ui_date.eo
new file mode 100644
index 0000000000..74d938ff39
--- /dev/null
+++ b/src/lib/efl/interfaces/efl_ui_date.eo
@@ -0,0 +1,63 @@
1interface Efl.Ui.Date
2{
3 [[Efl UI date interface]]
4 methods {
5 @property min {
6 [[The lower boundary of date.
7
8 Year: years since 1900. Negative value represents year below 1900
9 (year value -30 represents 1870). Year default range is from 70
10 to 137.
11
12 Month: default value range is from 0 to 11.
13
14 Day: default value range is from 1 to 31 according to the month
15 value.
16 ]]
17 set {} get{}
18 values {
19 year: int; [[The year value.]]
20 month: int; [[The month value.]]
21 day: int; [[The day value.]]
22 }
23 }
24 @property max {
25 [[The upper boundary of date.
26
27 Year: years since 1900. Negative value represents year below 1900
28 (year value -30 represents 1870). Year default range is from 70
29 to 137.
30
31 Month: default value range is from 0 to 11.
32
33 Day: default value range is from 1 to 31 according to the month
34 value.
35 ]]
36 set {} get{}
37 values {
38 year: int; [[The year value.]]
39 month: int; [[The month value.]]
40 day: int; [[The day value.]]
41 }
42 }
43 @property date {
44 [[The current value of date.
45
46 Year: years since 1900. Negative value represents year below 1900
47 (year value -30 represents 1870). Year default range is from 70
48 to 137.
49
50 Month: default value range is from 0 to 11.
51
52 Day: default value range is from 1 to 31 according to the month
53 value.
54 ]]
55 set {} get{}
56 values {
57 year: int; [[The year value.]]
58 month: int; [[The month value.]]
59 day: int; [[The day value.]]
60 }
61 }
62 }
63}
diff --git a/src/lib/efl/interfaces/efl_ui_datetime.c b/src/lib/efl/interfaces/efl_ui_datetime.c
new file mode 100644
index 0000000000..afec3abe5e
--- /dev/null
+++ b/src/lib/efl/interfaces/efl_ui_datetime.c
@@ -0,0 +1,176 @@
1#include <config.h>
2#include "Efl.h"
3
4#ifdef HAVE_LANGINFO_H
5# include <langinfo.h>
6#endif
7
8#define ERR(...) EINA_LOG_DOM_ERR(EINA_LOG_DOMAIN_DEFAULT, __VA_ARGS__)
9#define DBG(...) EINA_LOG_DOM_DBG(EINA_LOG_DOMAIN_DEFAULT, __VA_ARGS__)
10
11#define MAX_FORMAT_LEN 32
12
13static const char *multifield_formats = "cxXrRTDF";
14
15typedef struct
16{
17 Efl_Time time;
18 char format[MAX_FORMAT_LEN];
19} Efl_Ui_Datetime_Data;
20
21Eina_Bool init = EINA_FALSE;
22
23static void
24_time_init(Efl_Time *curr_time)
25{
26 time_t t;
27
28 t = time(NULL);
29 localtime_r(&t, curr_time);
30
31 init = EINA_TRUE;
32}
33
34static char *
35_expanded_fmt_str_get(char ch)
36{
37 char *exp_fmt = "";
38 switch (ch)
39 {
40 case 'c':
41#if defined(HAVE_LANGINFO_H) || defined (_WIN32)
42 exp_fmt = nl_langinfo(D_T_FMT);
43#else
44 exp_fmt = "";
45#endif
46 break;
47
48 case 'x':
49#if defined(HAVE_LANGINFO_H) || defined (_WIN32)
50 exp_fmt = nl_langinfo(D_FMT);
51#else
52 exp_fmt = "";
53#endif
54 break;
55
56 case 'X':
57#if defined(HAVE_LANGINFO_H) || defined (_WIN32)
58 exp_fmt = nl_langinfo(T_FMT);
59#else
60 exp_fmt = "";
61#endif
62 break;
63
64 case 'r':
65#if defined(HAVE_LANGINFO_H) || defined (_WIN32)
66 exp_fmt = nl_langinfo(T_FMT_AMPM);
67#else
68 exp_fmt = "";
69#endif
70 break;
71
72 case 'R':
73 exp_fmt = "%H:%M";
74 break;
75
76 case 'T':
77 exp_fmt = "%H:%M:%S";
78 break;
79
80 case 'D':
81 exp_fmt = "%m/%d/%y";
82 break;
83
84 case 'F':
85 exp_fmt = "%Y-%m-%d";
86 break;
87
88 default:
89 exp_fmt = "";
90 break;
91 }
92
93 return exp_fmt;
94}
95
96static void
97_expand_format(char *dt_fmt)
98{
99 char *ptr, *expanded_fmt, ch;
100 unsigned int idx, len = 0;
101 char buf[MAX_FORMAT_LEN] = {0, };
102 Eina_Bool fmt_char, fmt_expanded;
103
104 do {
105 idx = 0;
106 fmt_char = EINA_FALSE;
107 fmt_expanded = EINA_FALSE;
108 ptr = dt_fmt;
109 while ((ch = *ptr))
110 {
111 if ((fmt_char) && (strchr(multifield_formats, ch)))
112 {
113 /* replace the multi-field format characters with
114 * corresponding expanded format */
115 expanded_fmt = _expanded_fmt_str_get(ch);
116 len = strlen(expanded_fmt);
117 if (len > 0) fmt_expanded = EINA_TRUE;
118 buf[--idx] = 0;
119 strncat(buf, expanded_fmt, len);
120 idx += len;
121 }
122 else buf[idx++] = ch;
123
124 if (ch == '%') fmt_char = EINA_TRUE;
125 else fmt_char = EINA_FALSE;
126
127 ptr++;
128 }
129
130 buf[idx] = 0;
131 strncpy(dt_fmt, buf, MAX_FORMAT_LEN);
132 } while (fmt_expanded);
133}
134
135EOLIAN static void
136_efl_ui_datetime_datetime_value_set(Eo *obj, Efl_Ui_Datetime_Data *sd, Efl_Time newtime)
137{
138 sd->time = newtime;
139}
140
141EOLIAN static Efl_Time
142_efl_ui_datetime_datetime_value_get(Eo *obj EINA_UNUSED, Efl_Ui_Datetime_Data *sd)
143{
144 if (!init) _time_init(&sd->time);
145
146 return sd->time;
147}
148
149EOLIAN static void
150_efl_ui_datetime_datetime_format_set(Eo *obj, Efl_Ui_Datetime_Data *sd, const char *fmt)
151{
152 //Is this needed?
153}
154
155EOLIAN static const char *
156_efl_ui_datetime_datetime_format_get(Eo *obj EINA_UNUSED, Efl_Ui_Datetime_Data *sd)
157{
158#if defined(HAVE_LANGINFO_H) || defined (_WIN32)
159 strncpy(sd->format, nl_langinfo(D_T_FMT), MAX_FORMAT_LEN);
160#else
161 strncpy(sd->format, "", MAX_FORMAT_LEN);
162#endif
163 sd->format[MAX_FORMAT_LEN - 1] = '\0';
164
165 _expand_format(sd->format);
166
167 return sd->format;
168}
169EOLIAN static const char *
170_efl_ui_datetime_datetime_string_get(Eo *obj EINA_UNUSED, Efl_Ui_Datetime_Data *sd EINA_UNUSED, const char *fmt EINA_UNUSED)
171{
172 //TODO: strftime on upsteam, icu module connect here on tizen.
173 return NULL;
174}
175#include "interfaces/efl_ui_datetime.eo.c"
176
diff --git a/src/lib/efl/interfaces/efl_ui_datetime.eo b/src/lib/efl/interfaces/efl_ui_datetime.eo
new file mode 100644
index 0000000000..9ffc054808
--- /dev/null
+++ b/src/lib/efl/interfaces/efl_ui_datetime.eo
@@ -0,0 +1,38 @@
1import efl_types;
2
3mixin Efl.Ui.Datetime
4{
5 [[interface class for Date/time picker]]
6 methods {
7 @property datetime_value {
8 [[The value of a date, time.
9
10 The year, month, day values for date picker, hour, min values for
11 time picker.
12 ]]
13 values {
14 newtime: Efl.Time; [[Time structure containing the date, time value.]]
15 }
16 }
17 @property datetime_format {
18 [[The date, time format.
19
20 Default format is taken as per the system locale settings.
21 ]]
22 values {
23 fmt: string; [[The format string]]
24 }
25 }
26 @property datetime_string {
27 get {
28 [[Get the string that matches with the format.]]
29 }
30 keys {
31 fmt: string; [[The format string]]
32 }
33 values {
34 string: string; [[The format string]]
35 }
36 }
37 }
38}
diff --git a/src/lib/efl/interfaces/efl_ui_time.eo b/src/lib/efl/interfaces/efl_ui_time.eo
new file mode 100644
index 0000000000..3565a695b6
--- /dev/null
+++ b/src/lib/efl/interfaces/efl_ui_time.eo
@@ -0,0 +1,19 @@
1interface Efl.Ui.Time
2{
3 [[Efl UI Time class]]
4 methods {
5 @property time {
6 [[The current value of time
7
8 Hour: The value will be in terms of 24 hr format (0~23)
9
10 Minute: The range is from 0 to 59.
11 ]]
12 set {} get{}
13 values {
14 hour: int; [[The hour value.]]
15 min: int; [[The minute value.]]
16 }
17 }
18 }
19}
diff --git a/src/lib/elementary/Elementary.h b/src/lib/elementary/Elementary.h
index a7161e4a9c..d832a4d08e 100644
--- a/src/lib/elementary/Elementary.h
+++ b/src/lib/elementary/Elementary.h
@@ -319,6 +319,8 @@ typedef Eo Efl_Ui_Focus_Manager;
319# include <efl_ui_clock.eo.h> 319# include <efl_ui_clock.eo.h>
320# include <efl_ui_spin.eo.h> 320# include <efl_ui_spin.eo.h>
321# include <efl_ui_spin_button.eo.h> 321# include <efl_ui_spin_button.eo.h>
322# include <efl_ui_datepicker.eo.h>
323# include <efl_ui_timepicker.eo.h>
322# include <efl_ui_image_factory.eo.h> 324# include <efl_ui_image_factory.eo.h>
323# include <efl_ui_slider_interval.eo.h> 325# include <efl_ui_slider_interval.eo.h>
324# include <efl_ui_layout_factory.eo.h> 326# include <efl_ui_layout_factory.eo.h>
diff --git a/src/lib/elementary/efl_ui_datepicker.c b/src/lib/elementary/efl_ui_datepicker.c
new file mode 100644
index 0000000000..19555d5c3b
--- /dev/null
+++ b/src/lib/elementary/efl_ui_datepicker.c
@@ -0,0 +1,352 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4
5#include <Elementary.h>
6
7#include "elm_priv.h"
8#include "efl_ui_datepicker_private.h"
9
10#define MY_CLASS EFL_UI_DATEPICKER_CLASS
11
12#define MY_CLASS_NAME "Efl.Ui.Datepicker"
13
14#define FMT_LEN_MAX 32
15
16#define DATE_GET(obj) \
17 do { \
18 Efl_Time t = efl_ui_datetime_value_get(obj); \
19 sd->cur_date[DATEPICKER_YEAR] = t.tm_year + 1900; \
20 sd->cur_date[DATEPICKER_MONTH] = t.tm_mon + 1; \
21 sd->cur_date[DATEPICKER_DAY] = t.tm_mday; \
22 } while (0)
23
24#define DATE_SET(obj) \
25 do { \
26 Efl_Time t; \
27 t.tm_year = sd->cur_date[DATEPICKER_YEAR] - 1900; \
28 t.tm_mon = sd->cur_date[DATEPICKER_MONTH] - 1; \
29 t.tm_mday = sd->cur_date[DATEPICKER_DAY]; \
30 efl_ui_datetime_value_set(obj, t); \
31 } while (0)
32
33static const char *fmt_char[] = {"Yy", "mbBh", "de"};
34
35static Eina_Bool
36_validate_params(int year, int month, int day)
37{
38 if (year < 1900 || year > 2037 || month < 1 || month > 12 || day < 0 || day > 31)
39 return EINA_FALSE;
40 else return EINA_TRUE;
41}
42
43static Eina_Bool
44_date_cmp(int time1[], int time2[])
45{
46 unsigned int idx;
47
48 for (idx = 0; idx < EFL_UI_DATEPICKER_TYPE_COUNT; idx++)
49 {
50 if (time1[idx] != time2[idx])
51 return EINA_FALSE;
52 }
53
54 return EINA_TRUE;
55}
56
57static Eina_Bool
58_validate_date_limits(int time1[], int time2[], Eina_Bool swap)
59{
60 unsigned int idx;
61 int *t1, *t2;
62
63 t1 = (swap) ? time2 : time1;
64 t2 = (swap) ? time1 : time2;
65
66 for (idx = 0; idx < EFL_UI_DATEPICKER_TYPE_COUNT; idx++)
67 {
68 if (time1[idx] < time2[idx])
69 {
70 memcpy(t1, t2, (sizeof(int) * EFL_UI_DATEPICKER_TYPE_COUNT));
71 return EINA_TRUE;
72 }
73 else if (time1[idx] > time2[idx])
74 return EINA_FALSE;
75 }
76
77 return EINA_FALSE;
78}
79
80static int
81_max_days_get(int year, int month)
82{
83 struct tm time1;
84 time_t t;
85 int day;
86
87 t = time(NULL);
88 localtime_r(&t, &time1);
89 time1.tm_year = year;
90 time1.tm_mon = month;
91 for (day = 28; day <= 31;
92 day++)
93 {
94 time1.tm_mday = day;
95 mktime(&time1);
96 /* To restrict month wrapping because of summer time in some locales,
97 * ignore day light saving mode in mktime(). */
98 time1.tm_isdst = -1;
99 if (time1.tm_mday == 1) break;
100 }
101 day--;
102
103 return day;
104}
105
106static void
107_field_value_update(Eo *obj)
108{
109 Efl_Ui_Datepicker_Data *sd = efl_data_scope_get(obj, MY_CLASS);
110
111 efl_ui_range_value_set(sd->year, sd->cur_date[DATEPICKER_YEAR]);
112 efl_ui_range_value_set(sd->month, sd->cur_date[DATEPICKER_MONTH]);
113 efl_ui_range_value_set(sd->day, sd->cur_date[DATEPICKER_DAY]);
114
115 DATE_SET(obj);
116}
117
118static void
119_field_changed_cb(void *data, const Efl_Event *ev)
120{
121 int max_day;
122
123 Efl_Ui_Datepicker_Data *sd = efl_data_scope_get(data, MY_CLASS);
124
125 if (ev->object == sd->year)
126 sd->cur_date[DATEPICKER_YEAR] = efl_ui_range_value_get(sd->year);
127 else if (ev->object == sd->month)
128 sd->cur_date[DATEPICKER_MONTH] = efl_ui_range_value_get(sd->month);
129 else
130 sd->cur_date[DATEPICKER_DAY] = efl_ui_range_value_get(sd->day);
131
132 if (!(ev->object == sd->day))
133 {
134 max_day = _max_days_get(sd->cur_date[DATEPICKER_YEAR], sd->cur_date[DATEPICKER_MONTH]);
135 efl_ui_range_min_max_set(sd->day, 1, max_day);
136 }
137
138 if (_validate_date_limits(sd->cur_date, sd->min_date, EINA_FALSE) ||
139 _validate_date_limits(sd->max_date, sd->cur_date, EINA_TRUE))
140 {
141 _field_value_update(data);
142 return;
143 }
144
145 DATE_SET(data);
146 efl_event_callback_call(data, EFL_UI_DATEPICKER_EVENT_CHANGED, NULL);
147}
148
149static void
150_fields_init(Eo *obj)
151{
152 const char *fmt;
153 char ch;
154 int i;
155 int field = 0;
156 char buf[FMT_LEN_MAX];
157
158 Efl_Ui_Datepicker_Data *sd = efl_data_scope_get(obj, MY_CLASS);
159
160 //Field create.
161 sd->year = efl_add(EFL_UI_SPIN_BUTTON_CLASS, obj,
162 efl_ui_range_min_max_set(efl_added, 1970, 2037),
163 efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE),
164 efl_ui_spin_button_editable_set(efl_added, EINA_TRUE),
165 efl_event_callback_add(efl_added, EFL_UI_SPIN_EVENT_CHANGED,_field_changed_cb, obj),
166 elm_object_style_set(efl_added, "picker"));
167
168 sd->month = efl_add(EFL_UI_SPIN_BUTTON_CLASS, obj,
169 efl_ui_range_min_max_set(efl_added, 1, 12),
170 efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE),
171 efl_ui_spin_button_editable_set(efl_added, EINA_TRUE),
172 efl_event_callback_add(efl_added, EFL_UI_SPIN_EVENT_CHANGED,_field_changed_cb, obj),
173 elm_object_style_set(efl_added, "picker"));
174
175 sd->day = efl_add(EFL_UI_SPIN_BUTTON_CLASS, obj,
176 efl_ui_range_min_max_set(efl_added, 1, 31),
177 efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE),
178 efl_ui_spin_button_editable_set(efl_added, EINA_TRUE),
179 efl_event_callback_add(efl_added, EFL_UI_SPIN_EVENT_CHANGED,_field_changed_cb, obj),
180 elm_object_style_set(efl_added, "picker"));
181
182 DATE_GET(obj);
183 //Using system config?
184 sd->min_date[DATEPICKER_YEAR] = 1970;
185 sd->min_date[DATEPICKER_MONTH] = 1;
186 sd->min_date[DATEPICKER_DAY] = 1;
187 sd->max_date[DATEPICKER_YEAR] = 2037;
188 sd->max_date[DATEPICKER_MONTH] = 12;
189 sd->max_date[DATEPICKER_DAY] = 31;
190
191 _field_value_update(obj);
192
193 fmt = efl_ui_datetime_format_get(obj);
194 if (!fmt)
195 {
196 ERR("Failed to get current format.");
197 //Gives default format when the gets format failed.
198 fmt = "%Y %b %d";
199 }
200
201 //Sort fields by format.
202 while((ch = *fmt))
203 {
204 //TODO: ignore extensions and separators.
205 for (i = 0; i < EFL_UI_DATEPICKER_TYPE_COUNT; i++)
206 {
207 if (strchr(fmt_char[i], ch))
208 {
209 snprintf(buf, sizeof(buf), "field%d", field++);
210 if (i == DATEPICKER_YEAR)
211 efl_content_set(efl_part(obj, buf), sd->year);
212 else if (i == DATEPICKER_MONTH)
213 efl_content_set(efl_part(obj, buf), sd->month);
214 else
215 efl_content_set(efl_part(obj, buf), sd->day);
216
217 break;
218 }
219 }
220 fmt++;
221 }
222}
223
224EOLIAN static void
225_efl_ui_datepicker_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Datepicker_Data *_pd EINA_UNUSED)
226{
227 Evas_Coord minw = -1, minh = -1;
228 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
229
230 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
231 edje_object_size_min_restricted_calc
232 (wd->resize_obj, &minw, &minh, minw, minh);
233 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
234 evas_object_size_hint_min_set(obj, minw, minh);
235 evas_object_size_hint_max_set(obj, -1, -1);
236}
237
238EOLIAN static Eina_Bool
239_efl_ui_datepicker_efl_ui_widget_widget_event(Eo *obj, Efl_Ui_Datepicker_Data *sd, const Efl_Event *eo_event, Evas_Object *src EINA_UNUSED)
240{
241 return EINA_TRUE;
242}
243
244EOLIAN static Eo *
245_efl_ui_datepicker_efl_object_constructor(Eo *obj, Efl_Ui_Datepicker_Data *sd)
246{
247 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
248
249 if (!elm_widget_theme_klass_get(obj))
250 elm_widget_theme_klass_set(obj, "datepicker");
251 obj = efl_constructor(efl_super(obj, MY_CLASS));
252
253 if (!elm_widget_theme_object_set(obj, wd->resize_obj,
254 elm_widget_theme_klass_get(obj),
255 elm_widget_theme_element_get(obj),
256 elm_widget_theme_style_get(obj)))
257 CRI("Failed to set layout!");
258
259 _fields_init(obj);
260
261 elm_widget_sub_object_parent_add(obj);
262
263 elm_widget_can_focus_set(obj, EINA_TRUE);
264
265 return obj;
266}
267
268EOLIAN static void
269_efl_ui_datepicker_efl_object_destructor(Eo *obj, Efl_Ui_Datepicker_Data *sd EINA_UNUSED)
270{
271 efl_destructor(efl_super(obj, MY_CLASS));
272}
273
274EOLIAN static void
275_efl_ui_datepicker_efl_ui_date_min_set(Eo *obj, Efl_Ui_Datepicker_Data *sd EINA_UNUSED, int year, int month, int day)
276{
277 int new_time[EFL_UI_DATEPICKER_TYPE_COUNT] = {year, month, day};
278
279 if (!_validate_params(year, month, day)) return;
280 if (_date_cmp(sd->min_date, new_time)) return;
281
282 memcpy(sd->min_date, new_time, (sizeof(int) * EFL_UI_DATEPICKER_TYPE_COUNT));
283
284 _validate_date_limits(sd->max_date, sd->min_date, EINA_FALSE);
285 _validate_date_limits(sd->cur_date, sd->min_date, EINA_FALSE);
286
287 DATE_SET(obj);
288 _field_value_update(obj);
289}
290
291EOLIAN static void
292_efl_ui_datepicker_efl_ui_date_min_get(Eo *obj EINA_UNUSED, Efl_Ui_Datepicker_Data *sd, int *year, int *month, int *day)
293{
294 *year = sd->min_date[DATEPICKER_YEAR];
295 *month = sd->min_date[DATEPICKER_MONTH];
296 *day = sd->min_date[DATEPICKER_DAY];
297}
298
299EOLIAN static void
300_efl_ui_datepicker_efl_ui_date_max_set(Eo *obj, Efl_Ui_Datepicker_Data *sd EINA_UNUSED, int year, int month, int day)
301{
302 int new_time[EFL_UI_DATEPICKER_TYPE_COUNT] = {year, month, day};
303
304 if (!_validate_params(year, month, day)) return;
305 if (_date_cmp(sd->max_date, new_time)) return;
306
307 memcpy(sd->max_date, new_time, (sizeof(int) * EFL_UI_DATEPICKER_TYPE_COUNT));
308
309 _validate_date_limits(sd->max_date, sd->min_date, EINA_TRUE);
310 _validate_date_limits(sd->max_date, sd->cur_date, EINA_TRUE);
311
312 DATE_SET(obj);
313 _field_value_update(obj);
314}
315
316EOLIAN static void
317_efl_ui_datepicker_efl_ui_date_max_get(Eo *obj EINA_UNUSED, Efl_Ui_Datepicker_Data *sd, int *year, int *month, int *day)
318{
319 *year = sd->max_date[DATEPICKER_YEAR];
320 *month = sd->max_date[DATEPICKER_MONTH];
321 *day = sd->max_date[DATEPICKER_DAY];
322}
323
324EOLIAN static void
325_efl_ui_datepicker_efl_ui_date_date_set(Eo *obj, Efl_Ui_Datepicker_Data *sd, int year, int month, int day)
326{
327 int new_time[EFL_UI_DATEPICKER_TYPE_COUNT] = {year, month, day};
328
329 if (!_validate_params(year, month, day)) return;
330 if (_date_cmp(sd->cur_date, new_time)) return;
331
332 memcpy(sd->cur_date, new_time, (sizeof(int) * EFL_UI_DATEPICKER_TYPE_COUNT));
333
334 _validate_date_limits(sd->cur_date, sd->min_date, EINA_FALSE);
335 _validate_date_limits(sd->max_date, sd->cur_date, EINA_TRUE);
336
337 DATE_SET(obj);
338 _field_value_update(obj);
339}
340
341EOLIAN static void
342_efl_ui_datepicker_efl_ui_date_date_get(Eo *obj EINA_UNUSED, Efl_Ui_Datepicker_Data *sd, int *year, int *month, int *day)
343{
344 *year = sd->cur_date[DATEPICKER_YEAR];
345 *month = sd->cur_date[DATEPICKER_MONTH];
346 *day = sd->cur_date[DATEPICKER_DAY];
347}
348
349#define EFL_UI_DATEPICKER_EXTRA_OPS \
350 ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_datepicker), \
351
352#include "efl_ui_datepicker.eo.c"
diff --git a/src/lib/elementary/efl_ui_datepicker.eo b/src/lib/elementary/efl_ui_datepicker.eo
new file mode 100644
index 0000000000..9b372d2bdd
--- /dev/null
+++ b/src/lib/elementary/efl_ui_datepicker.eo
@@ -0,0 +1,21 @@
1class Efl.Ui.Datepicker (Efl.Ui.Layout, Efl.Ui.Datetime, Efl.Ui.Date)
2{
3 [[A Datepicker
4
5 This is a widget which allows the user to pick a date using internal spinner.
6 User can use the internal spinner to select year, month, day or user can enter
7 value using internal entry.
8 ]]
9 methods {
10 }
11 implements {
12 Efl.Object.constructor;
13 Efl.Object.destructor;
14 Efl.Ui.Date.min { get; set; }
15 Efl.Ui.Date.max { get; set; }
16 Efl.Ui.Date.date { get; set; }
17 }
18 events {
19 changed; [[Called when date value changed]]
20 }
21}
diff --git a/src/lib/elementary/efl_ui_datepicker_private.h b/src/lib/elementary/efl_ui_datepicker_private.h
new file mode 100644
index 0000000000..4254ee6b0c
--- /dev/null
+++ b/src/lib/elementary/efl_ui_datepicker_private.h
@@ -0,0 +1,22 @@
1#ifndef EFL_UI_DATEPICKER_PRIVATE_H
2#define EFL_UI_DATEPICKER_PRIVATE_H
3
4#define EFL_UI_DATEPICKER_TYPE_COUNT 3
5
6typedef enum _Efl_Ui_Datepicker_Field_Type
7{
8 DATEPICKER_YEAR,
9 DATEPICKER_MONTH,
10 DATEPICKER_DAY
11} Efl_Ui_Datepicker_Field_Type;
12
13typedef struct _Efl_Ui_Datepicker_Data Efl_Ui_Datepicker_Data;
14struct _Efl_Ui_Datepicker_Data
15{
16 Eo *year, *month, *day;
17 int cur_date[EFL_UI_DATEPICKER_TYPE_COUNT],
18 min_date[EFL_UI_DATEPICKER_TYPE_COUNT],
19 max_date[EFL_UI_DATEPICKER_TYPE_COUNT];
20};
21
22#endif
diff --git a/src/lib/elementary/efl_ui_timepicker.c b/src/lib/elementary/efl_ui_timepicker.c
new file mode 100644
index 0000000000..d8998253a9
--- /dev/null
+++ b/src/lib/elementary/efl_ui_timepicker.c
@@ -0,0 +1,282 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4
5#include <Elementary.h>
6
7#include "elm_priv.h"
8#include "efl_ui_timepicker_private.h"
9
10#define MY_CLASS EFL_UI_TIMEPICKER_CLASS
11
12#define MY_CLASS_NAME "Efl.Ui.Timepicker"
13
14#define FMT_LEN_MAX 32
15
16#define TIME_GET(obj) \
17 do { \
18 Efl_Time t = efl_ui_datetime_value_get(obj); \
19 sd->cur_time[TIMEPICKER_HOUR] = t.tm_hour; \
20 sd->cur_time[TIMEPICKER_MIN] = t.tm_min; \
21 } while (0)
22
23#define TIME_SET(obj) \
24 do { \
25 Efl_Time t; \
26 t.tm_hour = sd->cur_time[TIMEPICKER_HOUR]; \
27 t.tm_min = sd->cur_time[TIMEPICKER_MIN]; \
28 efl_ui_datetime_value_set(obj, t); \
29 } while (0)
30
31static const char *fmt_char[] = {"IHkl", "M", "Aa"};
32
33static Eina_Bool
34_validate_params(int hour, int min)
35{
36 if (hour < 0 || hour > 23 || min < 0 || min > 59)
37 return EINA_FALSE;
38 else return EINA_TRUE;
39}
40
41static Eina_Bool
42_time_cmp(int time1[], int time2[])
43{
44 unsigned int idx;
45
46 for (idx = 0; idx < EFL_UI_TIMEPICKER_TYPE_COUNT -1; idx++)
47 {
48 if (time1[idx] != time2[idx])
49 return EINA_FALSE;
50 }
51
52 return EINA_TRUE;
53}
54
55static void
56_field_value_update(Eo *obj)
57{
58 Efl_Ui_Timepicker_Data *sd = efl_data_scope_get(obj, MY_CLASS);
59
60 if (!sd->is_24hour)
61 {
62 if (sd->cur_time[TIMEPICKER_HOUR] >= 12)
63 {
64 //TODO: gets text from strftime.
65 efl_text_set(sd->ampm, "PM");
66 efl_ui_range_value_set(sd->hour, sd->cur_time[TIMEPICKER_HOUR] - 12);
67 }
68 else
69 {
70 efl_text_set(sd->ampm, "AM");
71 efl_ui_range_value_set(sd->hour, sd->cur_time[TIMEPICKER_HOUR] + 12);
72 }
73 }
74 efl_ui_range_value_set(sd->min, sd->cur_time[TIMEPICKER_MIN]);
75
76 TIME_SET(obj);
77}
78
79static void
80_field_changed_cb(void *data, const Efl_Event *ev)
81{
82 Efl_Ui_Timepicker_Data *sd = efl_data_scope_get(data, MY_CLASS);
83
84 //TODO: hour value increase when min reached max.
85 if (ev->object == sd->hour)
86 {
87 sd->cur_time[TIMEPICKER_HOUR] = efl_ui_range_value_get(sd->hour);
88 if (!sd->is_24hour && !strcmp(efl_text_get(sd->ampm), "PM"))
89 sd->cur_time[TIMEPICKER_HOUR] += 12;
90 }
91 else if (ev->object == sd->min)
92 sd->cur_time[TIMEPICKER_MIN] = efl_ui_range_value_get(sd->min);
93 else
94 {
95 if (!strcmp(efl_text_get(sd->ampm), "PM"))
96 {
97 efl_text_set(sd->ampm, "AM");
98 sd->cur_time[TIMEPICKER_HOUR] -= 12;
99 }
100 else
101 {
102 efl_text_set(sd->ampm, "PM");
103 sd->cur_time[TIMEPICKER_HOUR] += 12;
104 }
105 }
106
107 TIME_SET(data);
108 efl_event_callback_call(data, EFL_UI_TIMEPICKER_EVENT_CHANGED, NULL);
109}
110
111static void
112_fields_init(Eo *obj)
113{
114 const char *fmt;
115 char ch;
116 int i;
117 int field = 0;
118 char buf[FMT_LEN_MAX];
119
120 Efl_Ui_Timepicker_Data *sd = efl_data_scope_get(obj, MY_CLASS);
121
122 //Field create.
123 sd->hour = efl_add(EFL_UI_SPIN_BUTTON_CLASS, obj,
124 efl_ui_range_min_max_set(efl_added, 1, 12),
125 efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE),
126 efl_ui_spin_button_editable_set(efl_added, EINA_TRUE),
127 efl_event_callback_add(efl_added, EFL_UI_SPIN_EVENT_CHANGED,_field_changed_cb, obj),
128 elm_object_style_set(efl_added, "picker"));
129
130 sd->min = efl_add(EFL_UI_SPIN_BUTTON_CLASS, obj,
131 efl_ui_range_min_max_set(efl_added, 0, 59),
132 efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE),
133 efl_ui_spin_button_editable_set(efl_added, EINA_TRUE),
134 efl_event_callback_add(efl_added, EFL_UI_SPIN_EVENT_CHANGED,_field_changed_cb, obj),
135 elm_object_style_set(efl_added, "picker"));
136
137 sd->ampm = efl_add(EFL_UI_BUTTON_CLASS, obj,
138 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _field_changed_cb, obj),
139 elm_object_style_set(efl_added, "ampm"));
140
141 TIME_GET(obj);
142
143 sd->is_24hour = EINA_FALSE;
144
145 _field_value_update(obj);
146
147 fmt = efl_ui_datetime_format_get(obj);
148 if (!fmt)
149 {
150 ERR("Failed to get current format.");
151 //Gives default format when the gets format failed.
152 fmt = "%H:%M %a";
153 }
154
155 //Sort fields by format.
156 while((ch = *fmt))
157 {
158 //TODO: ignore extensions and separators.
159 for (i = 0; i < EFL_UI_TIMEPICKER_TYPE_COUNT; i++)
160 {
161 if (strchr(fmt_char[i], ch))
162 {
163 snprintf(buf, sizeof(buf), "field%d", field);
164 if (i == TIMEPICKER_HOUR)
165 efl_content_set(efl_part(obj, buf), sd->hour);
166 else if (i == TIMEPICKER_MIN)
167 efl_content_set(efl_part(obj, buf), sd->min);
168 else
169 {
170 //TODO: monitoring locale change and update field location.
171 if (field == 0)
172 {
173 elm_object_signal_emit(obj, "elm,state,colon,visible,field1", "elm");
174 elm_object_signal_emit(obj, "elm,state,colon,invisible,field0", "elm");
175 }
176 else
177 {
178 elm_object_signal_emit(obj, "elm,state,colon,visible,field0", "elm");
179 elm_object_signal_emit(obj, "elm,state,colon,invisible,field1", "elm");
180 }
181
182 elm_layout_signal_emit(obj, "elm,state,ampm,visible", "elm");
183 edje_object_message_signal_process(elm_layout_edje_get(obj));
184 efl_content_set(efl_part(obj, buf), sd->ampm);
185 }
186
187 field++;
188 break;
189 }
190 }
191 fmt++;
192 }
193}
194
195EOLIAN static void
196_efl_ui_timepicker_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Timepicker_Data *_pd EINA_UNUSED)
197{
198 Evas_Coord minw = -1, minh = -1;
199 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
200
201 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
202 edje_object_size_min_restricted_calc
203 (wd->resize_obj, &minw, &minh, minw, minh);
204 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
205 evas_object_size_hint_min_set(obj, minw, minh);
206 evas_object_size_hint_max_set(obj, -1, -1);
207}
208
209EOLIAN static Eo *
210_efl_ui_timepicker_efl_object_constructor(Eo *obj, Efl_Ui_Timepicker_Data *sd EINA_UNUSED)
211{
212 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
213
214 if (!elm_widget_theme_klass_get(obj))
215 elm_widget_theme_klass_set(obj, "timepicker");
216 obj = efl_constructor(efl_super(obj, MY_CLASS));
217
218 if (!elm_widget_theme_object_set(obj, wd->resize_obj,
219 elm_widget_theme_klass_get(obj),
220 elm_widget_theme_element_get(obj),
221 elm_widget_theme_style_get(obj)))
222 CRI("Failed to set layout!");
223
224 _fields_init(obj);
225
226 elm_widget_sub_object_parent_add(obj);
227
228 elm_widget_can_focus_set(obj, EINA_TRUE);
229
230 return obj;
231}
232
233EOLIAN static void
234_efl_ui_timepicker_efl_object_destructor(Eo *obj, Efl_Ui_Timepicker_Data *sd EINA_UNUSED)
235{
236 efl_destructor(efl_super(obj, MY_CLASS));
237}
238
239EOLIAN static void
240_efl_ui_timepicker_efl_ui_time_time_set(Eo *obj, Efl_Ui_Timepicker_Data *sd, int hour, int min)
241{
242 int new_time[EFL_UI_TIMEPICKER_TYPE_COUNT - 1] = {hour, min};
243
244 if (!_validate_params(hour, min)) return;
245 if (_time_cmp(sd->cur_time, new_time)) return;
246
247 memcpy(sd->cur_time, new_time, (sizeof(int) * (EFL_UI_TIMEPICKER_TYPE_COUNT -1)));
248
249 TIME_SET(obj);
250 _field_value_update(obj);
251}
252
253EOLIAN static void
254_efl_ui_timepicker_efl_ui_time_time_get(Eo *obj EINA_UNUSED, Efl_Ui_Timepicker_Data *sd, int *hour, int *min)
255{
256 *hour = sd->cur_time[TIMEPICKER_HOUR];
257 *min = sd->cur_time[TIMEPICKER_MIN];
258}
259
260EOLIAN static void
261_efl_ui_timepicker_ampm_set(Eo *obj, Efl_Ui_Timepicker_Data *sd, Eina_Bool is_24hour)
262{
263 if (sd->is_24hour == is_24hour) return;
264
265 sd->is_24hour = is_24hour;
266 if (sd->is_24hour == EINA_TRUE)
267 elm_layout_signal_emit(obj, "elm,state,ampm,invisible", "elm");
268 else
269 elm_layout_signal_emit(obj, "elm,state,ampm,visible", "elm");
270 _field_value_update(obj);
271}
272
273EOLIAN static Eina_Bool
274_efl_ui_timepicker_ampm_get(Eo *obj EINA_UNUSED, Efl_Ui_Timepicker_Data *sd)
275{
276 return sd->is_24hour;
277}
278
279#define EFL_UI_TIMEPICKER_EXTRA_OPS \
280 ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_timepicker), \
281
282#include "efl_ui_timepicker.eo.c"
diff --git a/src/lib/elementary/efl_ui_timepicker.eo b/src/lib/elementary/efl_ui_timepicker.eo
new file mode 100644
index 0000000000..ea2577867e
--- /dev/null
+++ b/src/lib/elementary/efl_ui_timepicker.eo
@@ -0,0 +1,26 @@
1class Efl.Ui.Timepicker (Efl.Ui.Layout, Efl.Ui.Datetime, Efl.Ui.Time)
2{
3 [[A timepicker
4
5 This is a widget which allows the user to pick a time using internal spinner.
6 User can use the internal spinner to select hour, minute, AM/PM or user can enter
7 value using internal entry.
8 ]]
9 methods {
10 @property ampm {
11 [[Control the picker will displayed for 24 hour or 12 hour including the AM/PM buttons.]]
12 set {} get {}
13 values {
14 is_24hour: bool; [[$ture the 24 hour timepicker will be shown, $false 12 hour timepicker will be shown.]]
15 }
16 }
17 }
18 implements {
19 Efl.Object.constructor;
20 Efl.Object.destructor;
21 Efl.Ui.Time.time { get; set; }
22 }
23 events {
24 changed; [[Called when date changed]]
25 }
26}
diff --git a/src/lib/elementary/efl_ui_timepicker_private.h b/src/lib/elementary/efl_ui_timepicker_private.h
new file mode 100644
index 0000000000..e2ace95f68
--- /dev/null
+++ b/src/lib/elementary/efl_ui_timepicker_private.h
@@ -0,0 +1,21 @@
1#ifndef EFL_UI_TIMEPICKER_PRIVATE_H
2#define EFL_UI_TIMEPICKER_PRIVATE_H
3
4#define EFL_UI_TIMEPICKER_TYPE_COUNT 3
5
6typedef enum _Efl_Ui_Timepicker_Field_Type
7{
8 TIMEPICKER_HOUR,
9 TIMEPICKER_MIN,
10 TIMEPICKER_AMPM
11} Efl_Ui_Timepicker_Field_Type;
12
13typedef struct _Efl_Ui_Timepicker_Data Efl_Ui_Timepicker_Data;
14struct _Efl_Ui_Timepicker_Data
15{
16 Eo *hour, *min, *ampm;
17 int cur_time[EFL_UI_TIMEPICKER_TYPE_COUNT];
18 Eina_Bool is_24hour;
19};
20
21#endif