3f752e3b8ec4d9c9af09b1a2b782a6315c3b3571
[apps/core/preloaded/calendar.git] / data / edc / layout / inc.main.tab.edc
1 /*
2   *
3   *  Copyright 2012  Samsung Electronics Co., Ltd
4   *
5   *  Licensed under the Flora License, Version 1.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://floralicense.org/license/
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 // Main view tab layout
19 group { name, "main/tab";
20
21         images {
22                 image, CALENDAR_TAB COMP;
23                 image, CALENDAR_TAB_FOCUS_BG COMP;
24                 image, CALENDAR_TAB_PRESS COMP;
25                 image, CALENDAR_TODAY_ICON COMP;
26                 image, CALENDAR_TODAY_ICON_PRESS COMP;
27                 image, TAB_FOCUS COMP;
28                 image, TAB_BG COMP;
29                 image, TAB_DEFAULT COMP;
30                 image, TAB_PRESS COMP;
31         }
32
33         parts {
34                 part { name, "base";
35                         type, RECT;
36                         description {
37                                 state, "default" 0.0;
38                                 color, 0 0 0 0;
39                         }
40                 }
41
42                 part { name, "tab/bg";
43                         description {
44                                 state, "default" 0.0;
45                                 rel1 { relative, 0.0 0.0; to, base; }
46                                 rel2 { relative, 1.0 1.0; offset, 0 0; to, base; }
47                                 image.normal, TAB_BG;
48                         }
49                 }
50
51 #define PART_TAB(_name, x1, x2) \
52                 part { name, "tab/"_name"/bg"; \
53                         description { \
54                                 state, "default" 0.0; \
55                                 rel1 { relative, x1 0.0; to, "tab/bg"; } \
56                                 rel2 { relative, x2 1.0; to, "tab/bg"; } \
57                                 image.normal, "P01_tab_default.png"; \
58                         } \
59                         description { \
60                                 state, "default" 1.0; \
61                                 inherit, "default" 0.0; \
62                                 image.normal, "P01_tab_press.png"; \
63                         } \
64                         description { \
65                                 state, "selected" 0.0; \
66                                 inherit, "default" 0.0; \
67                                 image.normal, TAB_FOCUS; \
68                         } \
69                 } \
70                 part { name, "tab/"_name"/text"; \
71                         type, TEXT; \
72                         scale, 1; \
73                         description { \
74                                 state, "default" 0.0; \
75                                 rel1.to, "tab/"_name"/bg"; \
76                                 rel2.to, "tab/"_name"/bg"; \
77                                 color, COLOR_OF_TEXT_FOR_MAIN_TAB; \
78                                 text { \
79                                         font, "SLP:style=Medium"; \
80                                         size, 30; \
81                                         align, 0.5 0.5; \
82                                 } \
83                         } \
84                         description { \
85                                 state, "default" 1.0; \
86                                 inherit, "default" 0.0; \
87                                 color, COLOR_OF_TEXT_DEFAULT_FOR_MAIN_TAB; \
88                         } \
89                         description { \
90                                 state, "selected" 0.0; \
91                                 inherit, "default" 0.0; \
92                                 color, COLOR_OF_TEXT_SELECTED_FOR_MAIN_TAB; \
93                         } \
94                 } \
95                 part { name, "tab/"_name"/evt"; \
96                         type, RECT; \
97                         description { \
98                                 state, "default" 0.0; \
99                                 rel1 { to_x, "tab/"_name"/bg"; to_y, "tab/bg"; } \
100                                 rel2 { to_x, "tab/"_name"/bg"; to_y, "tab/bg"; } \
101                                 color, 0 0 0 0; \
102                         } \
103                 }
104
105                 PART_TAB("year", (0/4), (1/4))
106                 PART_TAB("month", (1/4), (2/4))
107                 PART_TAB("day", (2/4), (3/4))
108                 PART_TAB("list", (3/4), (4/4))
109         }
110
111         programs {
112                 program { name, "tab/reset";
113                         signal, "reset";
114                         source, "prog";
115                         action, STATE_SET "default" 0.0;
116                         target, "tab/year/bg";
117                         target, "tab/year/text";
118                         target, "tab/month/bg";
119                         target, "tab/month/text";
120                         target, "tab/day/bg";
121                         target, "tab/day/text";
122                         target, "tab/list/bg";
123                         target, "tab/list/text";
124                 }
125
126 #define PROG_TAB(_name) \
127                 program { name, "tab/"_name"/down"; \
128                         signal, "mouse,down,1"; \
129                         source, "tab/"_name"/evt"; \
130                         filter, "tab/"_name"/bg" "default"; \
131                         action, STATE_SET "default" 1.0; \
132                         target, "tab/"_name"/bg"; \
133                         target, "tab/"_name"/text"; \
134                 } \
135                 program { name, "tab/"_name"/up"; \
136                         signal, "mouse,up,1"; \
137                         source, "tab/"_name"/evt"; \
138                         filter, "tab/"_name"/bg" "default"; \
139                         action, STATE_SET "default" 0.0; \
140                         target, "tab/"_name"/bg"; \
141                         target, "tab/"_name"/text"; \
142                 } \
143                 program { name, "tab/"_name"/clicked"; \
144                         signal, "mouse,clicked,1"; \
145                         filter, "tab/"_name"/bg" "default"; \
146                         source, "tab/"_name"/evt"; \
147                         action, SIGNAL_EMIT _name "tab"; \
148                 } \
149                 program { name, "tab/"_name"/select"; \
150                         signal, "select,"_name; \
151                         source, "prog"; \
152                         action, STATE_SET "selected" 0.0; \
153                         target, "tab/"_name"/bg"; \
154                         target, "tab/"_name"/text"; \
155                 }
156
157                 PROG_TAB("year")
158                 PROG_TAB("month")
159                 PROG_TAB("day")
160                 PROG_TAB("list")
161         }
162 }