tizen 2.3.1 release
[framework/uifw/efl-theme-tizen.git] / 2.2 / widgets / datetime.edc
1 /*
2  * Copyright (c) 2010 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  *
9  *   1. Redistributions of source code must retain the above copyright notice, this
10  *      list of conditions and the following disclaimer.
11  *   2. Redistributions in binary form must reproduce the above copyright notice,
12  *      this list of conditions and the following disclaimer in the documentation
13  *      and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
19  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  */
26 ///////////////////////////////////////////////////////////////////////////////
27 // datetime
28 ///////////////////////////////////////////////////////////////////////////////
29
30 group { name: "elm/datetime/base/default";
31    parts {
32       part {
33          name: "bg";
34          type: RECT;
35          scale: 1;
36          description {
37             state: "default" 0.0;
38             color: 0 0 0 0;
39             min: 0 DATETIME_WIDGET_HEIGHT;
40             max: -1 DATETIME_WIDGET_HEIGHT;
41          }
42       }
43       part {
44          name: "date.btn";
45          type: SWALLOW;
46          scale: 1;
47          clip_to: "clipper";
48          description {
49             state: "default" 0.0;
50             min: 0 0;
51             align: 0.0 0.5;
52             fixed: 1 0;
53             rel1.to: "bg";
54             rel2 {
55                relative: 0.0 1.0;
56                to: "bg";
57             }
58          }
59       }
60       part {
61          name: "center.padding";
62          type: SPACER;
63          scale: 1;
64          clip_to: "clipper";
65          description {
66             state: "default" 0.0;
67             min: DATETIME_WIDGET_PADDING_SIZE_INC;
68             align: 0.0 0.5;
69             fixed: 1 0;
70             rel1 {
71                relative: 1.0 0.0;
72                to: "date.btn";
73             }
74             rel2 {
75                relative: 1.0 1.0;
76                to: "date.btn";
77             }
78          }
79          description { state: "hidden" 0.0;
80             inherit: "default" 0.0;
81             min: 0 0;
82          }
83       }
84       part {
85          name: "time.btn";
86          type: SWALLOW;
87          scale: 1;
88          clip_to: "clipper";
89          description {
90             state: "default" 0.0;
91             min: 0 0;
92             align: 0.0 0.5;
93             fixed: 1 0;
94             rel1 {
95                relative: 1.0 0.0;
96                to: "center.padding";
97             }
98             rel2 {
99                relative: 1.0 1.0;
100                to: "center.padding";
101             }
102          }
103       }
104       part {
105          name: "clipper";
106          type: RECT;
107          description { state: "default" 0.0;
108             color: 255 255 255 255;
109          }
110          description { state: "visible" 0.0;
111             inherit: "default" 0.0;
112             color: 255 255 255 102;
113          }
114       }
115       part {
116          name: "disabler";
117          type: RECT;
118          description { state: "default" 0.0;
119             color: 0 0 0 0;
120             visible: 0;
121             rel1.to: "bg";
122             rel2.to: "bg";
123          }
124          description { state: "visible" 0.0;
125             inherit: "default" 0.0;
126             visible: 1;
127          }
128       }
129    }
130    script {
131       public center_padding_hidden = 0; //center padding shown/hidden status
132    }
133    programs {
134       program {
135          name: "disble_datetime";
136          signal: "elm,state,disabled";
137          source: "elm";
138          action: STATE_SET "visible" 0.0;
139          target: "disabler";
140          target: "clipper";
141       }
142       program {
143          name: "enable_datetime";
144          signal: "elm,state,enabled";
145          source: "elm";
146          action: STATE_SET "default" 0.0;
147          target: "disabler";
148          target: "clipper";
149       }
150       program {
151          name: "date_hide";
152          signal: "datepicker,hide";
153          source: "elm";
154          script {
155             set_int(center_padding_hidden, 0);
156             set_state(PART:"center.padding", "hidden", 0.0);
157          }
158       }
159       program {
160          name: "time_hide";
161          signal: "timepicker,hide";
162          source: "elm";
163          script {
164             set_int(center_padding_hidden, 0);
165             set_state(PART:"center.padding", "hidden", 0.0);
166          }
167       }
168       program {
169          name: "date_show";
170          signal: "datepicker,show";
171          source: "elm";
172          script {
173             set_int(center_padding_hidden, (get_int(center_padding_hidden) + 1));
174             if (get_int(center_padding_hidden) == 2)
175               set_state(PART:"center.padding", "default", 0.0);
176          }
177       }
178       program {
179          name: "time_show";
180          signal: "timepicker,show";
181          source: "elm";
182          script {
183             set_int(center_padding_hidden, (get_int(center_padding_hidden) + 1));
184             if (get_int(center_padding_hidden) == 2)
185               set_state(PART:"center.padding", "default", 0.0);
186          }
187       }
188    }
189 }
190
191 group { name: "elm/datetime/base/pickerstyle";
192    parts {
193       part {
194          name: "date.btn";
195          type: SWALLOW;
196          description {
197             state: "default" 0.0;
198             visible: 0;
199          }
200       }
201       part {
202          name: "time.btn";
203          type: SWALLOW;
204          description {
205             state: "default" 0.0;
206             visible: 0;
207          }
208       }
209    }
210 }
211
212 group { name: "elm/spinner/base/default";
213    alias: "elm/spinner/base/vertical";
214    parts {
215       part { name: "bg";
216          type: SPACER;
217          scale: 1;
218          description { state: "default" 0.0;
219          }
220       }
221       part { name: "access";
222          type: RECT;
223          repeat_events: 1;
224          description { state: "default" 0.0;
225             fixed: 1 1;
226             color: 0 0 0 0;
227             rel1.to: "bg";
228             rel2.to: "bg";
229             visible: 1;
230          }
231          description { state: "active" 0.0;
232             inherit: "default" 0.0;
233             visible: 0;
234          }
235       }
236       part { name: "elm.swallow.inc_button";
237          type: SWALLOW;
238          scale: 1;
239          description { state: "default" 0.0;
240             align: 0.5 0.0;
241             min: SPINNER_UP_DOWN_BG_IMAGE_SIZE_INC;
242             max: SPINNER_UP_DOWN_BG_IMAGE_SIZE_INC;
243          }
244       }
245       part { name: "elm.swallow.dec_button";
246          type: SWALLOW;
247          scale: 1;
248          description { state: "default" 0.0;
249             align: 0.5 1.0;
250             min: SPINNER_UP_DOWN_BG_IMAGE_SIZE_INC;
251             max: SPINNER_UP_DOWN_BG_IMAGE_SIZE_INC;
252          }
253       }
254       part { name: "elm.swallow.text_button";
255          type: SWALLOW;
256          scale: 1;
257          description { state: "default" 0.0;
258             visible: 1;
259             min: 0 SPINNER_TEXT_HEIGHT_INC;
260             max: -1 SPINNER_TEXT_HEIGHT_INC;
261          }
262          description { state: "active" 0.0;
263             inherit: "default" 0.0;
264             visible: 0;
265          }
266       }
267       part { name: "elm.swallow.entry";
268          type: SWALLOW;
269          description { state: "default" 0.0;
270             visible: 0;
271             rel1.to: "elm.swallow.text_button";
272             rel2.to: "elm.swallow.text_button";
273             min: 0 SPINNER_TEXT_HEIGHT_INC;
274             max: -1 SPINNER_TEXT_HEIGHT_INC;
275             fixed: 1 1;
276          }
277          description { state: "active" 0.0;
278             inherit: "default" 0.0;
279             visible: 1;
280          }
281       }
282       part { name: "disabler";
283          type: RECT;
284          description { state: "default" 0.0;
285             color: 0 0 0 0;
286             visible: 0;
287          }
288          description { state: "disabled" 0.0;
289             inherit: "default" 0.0;
290             visible: 1;
291          }
292       }
293    }
294    programs {
295       program { name: "active";
296          signal: "elm,state,active";
297          source: "elm";
298          action: STATE_SET "active" 0.0;
299          target: "elm.swallow.text_button";
300          target: "elm.swallow.entry";
301       }
302       program { name: "inactive";
303          signal: "elm,state,inactive";
304          source: "elm";
305          action: STATE_SET "default" 0.0;
306          target: "elm.swallow.text_button";
307          target: "elm.swallow.entry";
308       }
309       program { name: "access_activate";
310          signal: "elm,state,access,active";
311          source: "elm";
312          action:  STATE_SET "default" 0.0;
313          target: "access";
314       }
315       program { name: "access_inactivate";
316          signal: "elm,state,access,inactive";
317          source: "elm";
318          action:  STATE_SET "active" 0.0;
319          target: "access";
320       }
321       program { name: "disable";
322          signal: "elm,state,disabled";
323          source: "elm";
324          action: STATE_SET "disabled" 0.0;
325          target: "disabler";
326       }
327       program { name: "enable";
328          signal: "elm,state,enabled";
329          source: "elm";
330          action: STATE_SET "default" 0.0;
331          target: "disabler";
332       }
333    }
334 }
335
336 group { name: "elm/layout/datetime_popup/date_layout";
337
338    parts {
339       part { name: "bg";
340          type: SPACER;
341          scale: 1;
342          description { state: "default" 0.0;
343             min: DATETIME_POPUP_CONTENT_SIZE_INC;
344             max: DATETIME_POPUP_CONTENT_SIZE_INC;
345          }
346       }
347       part { name: "top.padding";
348          type: SPACER;
349          scale: 1;
350          description { state: "default" 0.0;
351             min: 0 DATETIME_POPUP_CONTENT_TOP_PADDING_HEIGHT_INC;
352             max: -1 DATETIME_POPUP_CONTENT_TOP_PADDING_HEIGHT_INC;
353             fixed: 0 1;
354             rel1.to: "bg";
355             rel2 {
356                relative: 1.0 0.0;
357                to: "bg";
358             }
359             align: 0.5 0.0;
360          }
361       }
362       part { name: "bottom.padding";
363          type: SPACER;
364          scale: 1;
365          description { state: "default" 0.0;
366             min: 0 DATETIME_POPUP_CONTENT_BOTTOM_PADDING_HEIGHT_INC;
367             max: -1 DATETIME_POPUP_CONTENT_BOTTOM_PADDING_HEIGHT_INC;
368             fixed: 0 1;
369             rel1 {
370                relative: 0.0 1.0;
371                to: "bg";
372             }
373             rel2.to: "bg";
374             align: 0.5 1.0;
375          }
376       }
377       part { name: "left.padding";
378          type: SPACER;
379          scale: 1;
380          description { state: "default" 0.0;
381             min: DATETIME_POPUP_CONTENT_LEFT_PADDING_WIDTH_INC 0;
382             max: DATETIME_POPUP_CONTENT_LEFT_PADDING_WIDTH_INC -1;
383             fixed: 1 0;
384             rel1 {
385                relative: 0.0 1.0;
386                to_x: "bg";
387                to_y: "top.padding";
388             }
389             rel2 {
390                relative: 0.0 0.0;
391                to_x: "bg";
392                to_y: "bottom.padding";
393             }
394             align: 0.0 0.5;
395          }
396       }
397       part { name: "right.padding";
398          type: SPACER;
399          scale: 1;
400          description { state: "default" 0.0;
401             min: DATETIME_POPUP_CONTENT_RIGHT_PADDING_WIDTH_INC 0;
402             max: DATETIME_POPUP_CONTENT_RIGHT_PADDING_WIDTH_INC -1;
403             fixed: 1 0;
404             rel2.to: "bg";
405             rel1 {
406                relative: 1.0 1.0;
407                to_x: "bg";
408                to_y: "top.padding";
409             }
410             rel2 {
411                relative: 1.0 0.0;
412                to_x: "bg";
413                to_y: "bottom.padding";
414             }
415             align: 1.0 0.5;
416          }
417       }
418       part { name: "field0";
419          type: SWALLOW;
420          scale: 1;
421          description { state: "default" 0.0;
422             fixed: 1 0;
423             min: DATETIME_POPUP_CONTENT_FIELD_WIDTH_INC 0;
424             rel1 {
425                relative: 1.0 0.0;
426                to: "left.padding";
427             }
428             rel2.to: "left.padding";
429             align: 0.0 0.5;
430          }
431       }
432       part { name: "center.padding1";
433          type: SPACER;
434          scale: 1;
435          description { state: "default" 0.0;
436             fixed: 1 0;
437             min: DATETIME_POPUP_CONTENT_CENTER_PADDING_WIDTH_INC 0;
438             max: DATETIME_POPUP_CONTENT_CENTER_PADDING_WIDTH_INC -1;
439             rel1 {
440                relative: 1.0 0.0;
441                to: "field0";
442             }
443             rel2.to: "field0";
444             align: 0.0 0.5;
445          }
446       }
447       part { name: "field1";
448          type: SWALLOW;
449          scale: 1;
450          description { state: "default" 0.0;
451             fixed: 1 0;
452             min: DATETIME_POPUP_CONTENT_FIELD_WIDTH_INC 0;
453             rel1 {
454                relative: 1.0 0.0;
455                to: "center.padding1";
456             }
457             rel2 {
458                relative: 0.0 1.0;
459                to_x: "center.padding2";
460                to_y: "center.padding1";
461             }
462          }
463       }
464       part { name: "center.padding2";
465          type: SPACER;
466          scale: 1;
467          description { state: "default" 0.0;
468             fixed: 1 0;
469             min: DATETIME_POPUP_CONTENT_CENTER_PADDING_WIDTH_INC 0;
470             max: DATETIME_POPUP_CONTENT_CENTER_PADDING_WIDTH_INC -1;
471             rel1.to: "field2";
472             rel2 {
473                relative: 0.0 1.0;
474                to: "field2";
475             }
476             align: 1.0 0.5;
477          }
478       }
479       part { name: "field2";
480          type: SWALLOW;
481          scale: 1;
482          description { state: "default" 0.0;
483             fixed: 1 0;
484             min: DATETIME_POPUP_CONTENT_FIELD_WIDTH_INC 0;
485             rel1.to: "right.padding";
486             rel2 {
487                relative: 0.0 1.0;
488                to: "right.padding";
489             }
490             align: 1.0 0.5;
491          }
492       }
493       part {
494          name: "event_area";
495          type: RECT;
496          description { state: "default" 0.0;
497             color: 0 0 0 0;
498             visible: 0;
499          }
500          description { state: "visible" 0.0;
501             inherit: "default" 0.0;
502             visible: 1;
503          }
504       }
505       part { name: "access";
506          type: RECT;
507          repeat_events: 1;
508          description { state: "default" 0.0;
509             fixed: 1 1;
510             rel1.to: "bg";
511             rel2.to: "bg";
512             color: 0 0 0 0;
513          }
514       }
515    }
516 }
517
518 group { name: "elm/layout/datetime_popup/time_layout";
519    inherit: "elm/layout/datetime_popup/date_layout";
520
521    parts {
522       part { name: "hour.minute.color";
523          type: TEXT;
524          scale: 1;
525          description { state: "default" 0.0;
526             rel1.to: "center.padding1";
527             rel2.to: "center.padding1";
528             color_class: "T1233";
529             text {
530                min: 0 0;
531                text_class: "T1233";
532                text: ":";
533             }
534          }
535       }
536       part { name: "field2";
537          type: SWALLOW;
538          scale: 1;
539          description { state: "default" 0.0;
540             fixed: 1 0;
541             min: DATETIME_POPUP_CONTENT_FIELD_WIDTH_INC 0;
542             max: -1 DATETIME_POPUP_CONTENT_FIELD_HEIGHT_INC;
543             rel1.to: "right.padding";
544             rel2 {
545                relative: 0.0 1.0;
546                to: "right.padding";
547             }
548             align: 1.0 0.5;
549          }
550       }
551    }
552 }
553
554 group { name: "elm/layout/datetime_popup/time_layout_24hr";
555    inherit: "elm/layout/datetime_popup/date_layout";
556
557    parts {
558       part { name: "field0";
559          type: SWALLOW;
560          scale: 1;
561          description { state: "default" 0.0;
562             fixed: 1 0;
563             min: DATETIME_POPUP_CONTENT_TIME_24HR_FIELD_WIDTH_INC 0;
564             rel1 {
565                relative: 1.0 0.0;
566                to: "left.padding";
567             }
568             rel2.to: "left.padding";
569             align: 0.0 0.5;
570          }
571       }
572       part { name: "hour.minute.color";
573          type: TEXT;
574          scale: 1;
575          description { state: "default" 0.0;
576             rel1.to: "center.padding1";
577             rel2.to: "center.padding1";
578             color_class: "T1233";
579             text {
580                min: 0 0;
581                text_class: "T1233";
582                text: ":";
583             }
584          }
585       }
586       part { name: "field1";
587          type: SWALLOW;
588          scale: 1;
589          description { state: "default" 0.0;
590             min: DATETIME_POPUP_CONTENT_TIME_24HR_FIELD_WIDTH_INC 0;
591             rel1 {
592                relative: 1.0 0.0;
593                to: "center.padding1";
594             }
595             rel2 {
596                relative: 0.0 1.0;
597                to: "center.padding2";
598             }
599          }
600       }
601       part { name: "center.padding2";
602          type: SPACER;
603          scale: 1;
604          description { state: "default" 0.0;
605             min: 0 0;
606             max: 0 -1;
607             rel1.to: "right.padding";
608             rel2.to: "right.padding";
609          }
610       }
611       part { name: "field2";
612          type: SWALLOW;
613          scale: 1;
614          description { state: "default" 0.0;
615             min: 0 0;
616             max: 0 -1;
617             visible: 0;
618             rel1.to: "right.padding";
619             rel2.to: "right.padding";
620          }
621       }
622       part { name: "access";
623          type: RECT;
624          repeat_events: 1;
625          description { state: "default" 0.0;
626             fixed: 1 1;
627             rel1.to: "bg";
628             rel2.to: "bg";
629             color: 0 0 0 0;
630          }
631       }
632    }
633 }