5095804cb146107613289702e08d369565126469
[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          max: DATETIME_SEPARATOR_MIN_SIZE_INC;\
79          align: 0.0 0.5;\
80          fixed: 1 1;\
81          rel1 {\
82             relative: 1.0 0.0;\
83             to: "field"#_pos;\
84          }\
85          rel2 {\
86             relative: 1.0 1.0;\
87             to: "field"#_pos;\
88          }\
89          color: DATETIME_SEPARATOR_TEXT_COLOR_INC;\
90          text {\
91             font: "Tizen:style=Regular";\
92             size: DATETIME_SEPARATOR_TEXT_FONT_SIZE_INC;\
93             min: 1 0; \
94             text_class: "tizen";\
95          }\
96       }\
97       description { state: "enable" 0.0;\
98          inherit: "default" 0.0;\
99          visible: 1;\
100       }\
101       description { state: "hide" 0.0;\
102          inherit: "default" 0.0;\
103          min: 0 0;\
104          max: 0 0;\
105       }\
106    }\
107    programs {\
108       program {\
109          name: "separator"#_pos",enabled";\
110          signal: "field"#_pos",separator,enable";\
111          source: "elm";\
112          action: STATE_SET "enable" 0.0;\
113          target: "separator"#_pos;\
114       }\
115       program {\
116          name: "separator"#_pos",disabled";\
117          signal: "field"#_pos",separator,disable";\
118          source: "elm";\
119          script {\
120             new st[31];\
121             new Float:vl;\
122             get_state(PART:"separator"#_pos, st, 30, vl);\
123             if (strcmp(st, "hide")) \
124             {\
125                set_state(PART:"separator"#_pos, "default", 0.0);\
126             }\
127          }\
128       }\
129       program {\
130          name: "separator"#_pos",hide";\
131          signal: "field"#_pos",disable";\
132          source: "elm";\
133          action: STATE_SET "hide" 0.0;\
134          target: "separator"#_pos;\
135       }\
136    }
137
138
139 group { name: "elm/datetime/base/default";
140    parts {
141       part {
142          name: "bg";
143          type: RECT;
144          scale: 1;
145          description {
146             state: "default" 0.0;
147             color: 0 0 0 0;
148          }
149       }
150       part {
151          name: "left.padding";
152          type: RECT;
153          scale: 1;
154          clip_to: "clipper";
155          mouse_events: 0;
156          description {
157             state: "default" 0.0;
158             visible: 0;
159             min: DATETIME_LEFT_PADDING_SIZE_INC;
160             max: DATETIME_LEFT_PADDING_SIZE_INC;
161             align: 0.0 0.5;
162             fixed: 1 1;
163             rel1.to: "bg";
164             rel2 {
165                relative: 0.0 1.0;
166                to: "bg";
167             }
168          }
169       }
170       part {
171          name: "field0";
172          type: SWALLOW;
173          scale: 1;
174          clip_to: "clipper";
175          repeat_events: 1;
176          description {
177             state: "default" 0.0;
178             visible: 0;
179             min: 0 0;
180             align: 0.0 0.5;
181             fixed: 1 0;
182             rel1 {
183                relative: 0.5 0.0;
184                to_x: "left.padding";
185             }
186             rel2 {
187                relative: 0.5 1.0;
188                to_x: "left.padding";
189             }
190          }
191          description { state: "enable" 0.0;
192             inherit: "default" 0.0;
193             visible: 1;
194             min: DATETIME_FIELD_MIN_SIZE_INC;
195          }
196       }
197       DATETIME_SEPARATOR(0)
198       DATETIME_FIELD(1, 0)
199       DATETIME_SEPARATOR(1)
200       DATETIME_FIELD(2, 1)
201       DATETIME_SEPARATOR(2)
202       DATETIME_FIELD(3, 2)
203       DATETIME_SEPARATOR(3)
204       DATETIME_FIELD(4, 3)
205       DATETIME_SEPARATOR(4)
206       DATETIME_FIELD(5, 4)
207       DATETIME_SEPARATOR(5)
208       part {
209          name: "right.padding";
210          type: RECT;
211          scale: 1;
212          clip_to: "clipper";
213          mouse_events: 0;
214          description {
215             state: "default" 0.0;
216             visible: 0;
217             min: DATETIME_LEFT_PADDING_SIZE_INC;
218             max: DATETIME_LEFT_PADDING_SIZE_INC;
219             align: 1.0 0.5;
220             fixed: 1 1;
221             rel2 {
222                relative: 1.0 0.0;
223                to: "bg";
224             }
225             rel2.to: "bg";
226          }
227       }
228       part {
229          name: "clipper";
230          type: RECT;
231          description { state: "default" 0.0;
232             color: 255 255 255 255;
233          }
234          description { state: "visible" 0.0;
235             inherit: "default" 0.0;
236             color: 255 255 255 102;
237          }
238       }
239       part {
240          name: "disabler";
241          type: RECT;
242          description { state: "default" 0.0;
243             color: 0 0 0 0;
244             visible: 0;
245          }
246          description { state: "visible" 0.0;
247             inherit: "default" 0.0;
248             visible: 1;
249          }
250       }
251    }
252    programs {
253       program {
254          name: "disble_datetime";
255          signal: "elm,state,disabled";
256          source: "elm";
257          action: STATE_SET "visible" 0.0;
258          target: "disabler";
259          target: "clipper";
260       }
261       program {
262          name: "enable_datetime";
263          signal: "elm,state,enabled";
264          source: "elm";
265          action: STATE_SET "default" 0.0;
266          target: "disabler";
267          target: "clipper";
268       }
269       program {
270          name: "field0,enabled";
271          signal: "field0,enable";
272          source: "elm";
273          action: STATE_SET "enable" 0.0;
274          target: "field0";
275       }
276       program {
277          name: "field0,disabled";
278          signal: "field0,disable";
279          source: "elm";
280          action: STATE_SET "default" 0.0;
281          target: "field0";
282       }
283    }
284 }