4c9c0aefdf17efb45b70713574ea8a3b72927d77
[platform/core/uifw/efl-theme-tizen.git] / themes / widgets / datetime.edc
1 /*
2  * efl-theme-tizen
3  * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Apache License, Version 2.0 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an AS IS BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18
19 ///////////////////////////////////////////////////////////////////////////////
20 // datetime
21 ///////////////////////////////////////////////////////////////////////////////
22
23 #define DATETIME_FIELD(_pos, _after) \
24    part {\
25       name: "field"#_pos; \
26       type: SWALLOW; \
27       scale: 1;\
28       clip_to: "clipper";\
29       repeat_events: 1;\
30       description { state: "default" 0.0; \
31          visible: 0;\
32          min: 0 0;\
33          align: 0.0 0.5;\
34          fixed: 1 1;\
35          rel1 {\
36             relative: 1.0 0.0;\
37             to: "separator"#_after;\
38          }\
39          rel2 {\
40             relative: 1.0 1.0;\
41             to: "separator"#_after;\
42          }\
43       }\
44       description { state: "enable" 0.0;\
45          inherit: "default" 0.0;\
46          visible: 1;\
47          min: DATETIME_FIELD_MIN_SIZE_INC;\
48       }\
49    }\
50    programs{\
51       program {\
52          name: "field_"#_pos"enabled";\
53          signal: "field"#_pos",enable";\
54          source: "elm";\
55          action: STATE_SET "enable" 0.0;\
56          target: "field"#_pos;\
57       }\
58       program {\
59          name: "field_"#_pos"disabled";\
60          signal: "field"#_pos",disable";\
61          source: "elm";\
62          action: STATE_SET "default" 0.0;\
63          target: "field"#_pos;\
64       }\
65     }
66
67 #define DATETIME_SEPARATOR(_pos) \
68    part {\
69       name: "separator"#_pos; \
70       type: TEXT;\
71       scale: 1;\
72       clip_to: "clipper";\
73       repeat_events: 1;\
74       description {\
75          state: "default" 0.0;\
76          visible: 0;\
77          min: DATETIME_SEPARATOR_MIN_SIZE_INC;\
78          align: 0.0 0.5;\
79          fixed: 1 1;\
80          rel1 {\
81             relative: 1.0 0.0;\
82             to: "field"#_pos;\
83          }\
84          rel2 {\
85             relative: 1.0 1.0;\
86             to: "field"#_pos;\
87          }\
88          color: DATETIME_SEPARATOR_TEXT_COLOR_INC;\
89          text {\
90             font: "Tizen:style=Regular";\
91             size: DATETIME_SEPARATOR_TEXT_FONT_SIZE_INC;\
92             min: 1 0; \
93             text_class: "tizen";\
94          }\
95       }\
96       description { state: "enable" 0.0;\
97          inherit: "default" 0.0;\
98          visible: 1;\
99       }\
100       description { state: "hide" 0.0;\
101          inherit: "default" 0.0;\
102          min: 0 0;\
103          max: 0 0;\
104       }\
105    }\
106    programs {\
107       program {\
108          name: "separator"#_pos",enabled";\
109          signal: "field"#_pos",separator,enable";\
110          source: "elm";\
111          action: STATE_SET "enable" 0.0;\
112          target: "separator"#_pos;\
113       }\
114       program {\
115          name: "separator"#_pos",disabled";\
116          signal: "field"#_pos",separator,disable";\
117          source: "elm";\
118          script {\
119             new st[31];\
120             new Float:vl;\
121             get_state(PART:"separator"#_pos, st, 30, vl);\
122             if (strcmp(st, "hide")) \
123             {\
124                set_state(PART:"separator"#_pos, "default", 0.0);\
125             }\
126          }\
127       }\
128       program {\
129          name: "separator"#_pos",hide";\
130          signal: "field"#_pos",disable";\
131          source: "elm";\
132          action: STATE_SET "hide" 0.0;\
133          target: "separator"#_pos;\
134       }\
135    }
136
137
138 group { name: "elm/datetime/base/default";
139    parts {
140       part {
141          name: "bg";
142          type: RECT;
143          scale: 1;
144          description {
145             state: "default" 0.0;
146             color: 0 0 0 0;
147          }
148       }
149       part {
150          name: "left.padding";
151          type: RECT;
152          scale: 1;
153          clip_to: "clipper";
154          mouse_events: 0;
155          description {
156             state: "default" 0.0;
157             visible: 0;
158             min: DATETIME_LEFT_PADDING_SIZE_INC;
159             max: DATETIME_LEFT_PADDING_SIZE_INC;
160             align: 0.0 0.5;
161             fixed: 1 1;
162             rel1.to: "bg";
163             rel2 {
164                relative: 0.0 1.0;
165                to: "bg";
166             }
167          }
168       }
169       part {
170          name: "field0";
171          type: SWALLOW;
172          scale: 1;
173          clip_to: "clipper";
174          repeat_events: 1;
175          description {
176             state: "default" 0.0;
177             visible: 0;
178             min: 0 0;
179             align: 0.0 0.5;
180             fixed: 1 0;
181             rel1 {
182                relative: 0.5 0.0;
183                to_x: "left.padding";
184             }
185             rel2 {
186                relative: 0.5 1.0;
187                to_x: "left.padding";
188             }
189          }
190          description { state: "enable" 0.0;
191             inherit: "default" 0.0;
192             visible: 1;
193             min: DATETIME_FIELD_MIN_SIZE_INC;
194          }
195       }
196       DATETIME_SEPARATOR(0)
197       DATETIME_FIELD(1, 0)
198       DATETIME_SEPARATOR(1)
199       DATETIME_FIELD(2, 1)
200       DATETIME_SEPARATOR(2)
201       DATETIME_FIELD(3, 2)
202       DATETIME_SEPARATOR(3)
203       DATETIME_FIELD(4, 3)
204       DATETIME_SEPARATOR(4)
205       DATETIME_FIELD(5, 4)
206       DATETIME_SEPARATOR(5)
207       part {
208          name: "right.padding";
209          type: RECT;
210          scale: 1;
211          clip_to: "clipper";
212          mouse_events: 0;
213          description {
214             state: "default" 0.0;
215             visible: 0;
216             min: DATETIME_LEFT_PADDING_SIZE_INC;
217             max: DATETIME_LEFT_PADDING_SIZE_INC;
218             align: 1.0 0.5;
219             fixed: 1 1;
220             rel2 {
221                relative: 1.0 0.0;
222                to: "bg";
223             }
224             rel2.to: "bg";
225          }
226       }
227       part {
228          name: "clipper";
229          type: RECT;
230          description { state: "default" 0.0;
231             color: 255 255 255 255;
232          }
233          description { state: "visible" 0.0;
234             inherit: "default" 0.0;
235             color: 255 255 255 102;
236          }
237       }
238       part {
239          name: "disabler";
240          type: RECT;
241          description { state: "default" 0.0;
242             color: 0 0 0 0;
243             visible: 0;
244          }
245          description { state: "visible" 0.0;
246             inherit: "default" 0.0;
247             visible: 1;
248          }
249       }
250    }
251    programs {
252       program {
253          name: "disble_datetime";
254          signal: "elm,state,disabled";
255          source: "elm";
256          action: STATE_SET "visible" 0.0;
257          target: "disabler";
258          target: "clipper";
259       }
260       program {
261          name: "enable_datetime";
262          signal: "elm,state,enabled";
263          source: "elm";
264          action: STATE_SET "default" 0.0;
265          target: "disabler";
266          target: "clipper";
267       }
268       program {
269          name: "field0,enabled";
270          signal: "field0,enable";
271          source: "elm";
272          action: STATE_SET "enable" 0.0;
273          target: "field0";
274       }
275       program {
276          name: "field0,disabled";
277          signal: "field0,disable";
278          source: "elm";
279          action: STATE_SET "default" 0.0;
280          target: "field0";
281       }
282    }
283 }