messages implementation.
[profile/ivi/lemolo.git] / data / themes / includes / messages-overview.edc
1 group {
2    name: "elm/layout/ofono-efl/messages-overview";
3
4    /*
5     * Represents the messages compose layout with actions and swallows.
6     *
7     * Parts:
8     *
9     * SWALLOW: elm.swallow.genlist - Where all the conversations will appear
10     *
11     * Signals:
12     *   Emit (source is "gui"):
13     *   clicked,edit - When the edit button is cliked
14     *   clicked,edit,done - When The Button "Done" while editing is clicked
15     *
16     *   Listens (source is "gui"):
17     *   show,genlist  - Show the genlist with the current message thread
18     *   hidden,genlist - Hide the genlist
19     *   toggle,on,edit - User is editing
20     *   toggle,off,edit - User finished the editing
21     *
22     * Where <ID> is the name of the button
23     *
24     */
25
26    images {
27       image: "bg_keypad.jpg" COMP;
28    }
29
30    parts {
31       part {
32          name: "bg";
33          type: IMAGE;
34          mouse_events: 0;
35          description {
36             state: "default" 0.0;
37             color: 255 255 255 255;
38             color_class: "dark";
39             image {
40                normal: "bg_keypad.jpg";
41                scale_hint: STATIC;
42             }
43             fill.smooth: 1;
44
45          }
46       }
47
48       part {
49          name: "notification.bar";
50          type: RECT;
51          mouse_events: 0;
52          description {
53             state: "default" 0.0;
54             color: 0 0 0 255;
55             rel1.relative: 0.0 0.0;
56             rel2 {
57                relative: 1.0 0.0;
58                offset: -1 NOTIFICATION_BAR_HEIGHT;
59             }
60          }
61       }
62
63       part {
64          name: "button.area.clipper";
65          type: RECT;
66          description {
67             state: "default" 0.0;
68             rel1.to: "bg.buttons";
69             rel2 {
70                to: "bg.buttons";
71                offset: -1 SEPARATOR_HEIGHT;
72             }
73          }
74       }
75
76
77       part {
78          name: "button.clipper";
79          type: RECT;
80          clip_to: "button.area.clipper";
81          description {
82             state: "default" 0.0;
83             rel1.to: "button.area.clipper";
84             rel2.to: "button.area.clipper";
85          }
86          description {
87             state: "alternate" 0.0;
88             color: 255 255 255 0;
89             visible: 0;
90          }
91       }
92
93       part {
94          name: "edit-button.clipper";
95          type: RECT;
96          clip_to: "button.area.clipper";
97          description {
98             state: "default" 0.0;
99             color: 255 255 255 0;
100             visible: 0;
101             rel1.to: "button.area.clipper";
102             rel2.to: "button.area.clipper";
103          }
104          description {
105             state: "alternate" 0.0;
106             color: 255 255 255 255;
107             visible: 1;
108          }
109       }
110
111       part {
112          name: "edit.clipper";
113          type: RECT;
114          description {
115             state: "default" 0.0;
116             rel1.to: "bg.edit";
117             rel2 {
118                to: "bg.edit";
119                offset: -1 SEPARATOR_HEIGHT;
120             }
121          }
122       }
123
124       part {
125          name: "bg.buttons";
126          type: RECT;
127          mouse_events: 0;
128          clip_to: "button.clipper";
129          description {
130             state: "default" 0.0;
131             color: 0 0 0 0;
132             fixed: 1 1;
133             min: 0 (ACTION_HEIGHT / 2);
134             rel1 {
135                to: "notification.bar";
136                relative: 0.0 1.0;
137             }
138             rel2 {
139                to_x: "bg.edit";
140                to_y: "notification.bar";
141                relative: 0.0 1.0;
142                offset: (-ITEM_PADDING - 1) (ACTION_HEIGHT / 2 - 1);
143             }
144          }
145       }
146
147       part {
148          name: "bg.edit";
149          type: RECT;
150          mouse_events: 0;
151          clip_to: "edit.clipper";
152          description {
153             state: "default" 0.0;
154             color: 0 0 0 0;
155             min: 0 (ACTION_HEIGHT / 2);
156             rel1 {
157                to: "notification.bar";
158                relative: 1.0 1.0;
159                offset: (-LIST_ICON_SIZE - ITEM_PADDING - BORDER_PADDING) 0;
160             }
161             rel2 {
162                to: "notification.bar";
163                relative: 1.0 1.0;
164                offset: -1 (ACTION_HEIGHT / 2 - 1);
165             }
166          }
167       }
168
169 #define SEPARATOR(id, clip, rely, offy, relto)                          \
170       part {                                                            \
171          name: "separator.dark."##id;                                   \
172          type: RECT;                                                    \
173          mouse_events: 0;                                               \
174          clip_to: clip;                                                 \
175          description {                                                  \
176             state: "default" 0.0;                                       \
177             color: 255 255 255 255;                                     \
178             color_class: "dark";                                        \
179             rel1 {                                                      \
180                relative: 0.0 rely;                                      \
181                offset: 0 offy;                                          \
182                to_y: relto;                                             \
183             }                                                           \
184             rel2 {                                                      \
185                relative: 1.0 rely;                                      \
186                offset: -1 (offy + SEPARATOR_HEIGHT / 2);                \
187                to_y: relto;                                             \
188             }                                                           \
189          }                                                              \
190       }                                                                 \
191       part {                                                            \
192          name: "separator.bg."##id;                                     \
193          type: RECT;                                                    \
194          mouse_events: 0;                                               \
195          clip_to: clip;                                                 \
196          description {                                                  \
197             state: "default" 0.0;                                       \
198             color: 255 255 255 255;                                     \
199             color_class: "bg";                                          \
200             rel1 {                                                      \
201                relative: 0.0 rely;                                      \
202                offset: 0 (offy + SEPARATOR_HEIGHT / 2);                 \
203                to_y: relto;                                             \
204             }                                                           \
205             rel2 {                                                      \
206                relative: 1.0 rely;                                      \
207                offset: -1 (offy + SEPARATOR_HEIGHT);                    \
208                to_y: relto;                                             \
209             }                                                           \
210          }                                                              \
211       }
212
213       SEPARATOR("button", "button.area.clipper", 1.0, 0, "bg.buttons");
214       SEPARATOR("edit-button", "button.area.clipper", 1.0, 0, "bg.buttons");
215       SEPARATOR("edit", "edit.clipper", 1.0, 0, "bg.edit");
216 #undef SEPARATOR
217
218
219 #define BUTTON(id, label, ccls, clip, r1, r2)                           \
220       part {                                                            \
221          name: "button."##id;                                           \
222          type: RECT;                                                    \
223          mouse_events: 1;                                               \
224          clip_to: clip;                                                 \
225          description {                                                  \
226             state: "default" 0.0;                                       \
227             color: 255 255 255 0;                                       \
228             color_class: "action";                                      \
229             rel1 {                                                      \
230                to: "bg.buttons";                                        \
231                relative: r1;                                            \
232             }                                                           \
233             rel2 {                                                      \
234                to: "bg.buttons";                                        \
235                relative: r2;                                            \
236             }                                                           \
237          }                                                              \
238          description {                                                  \
239             state: "pressed" 0.0;                                       \
240             inherit: "default" 0.0;                                     \
241             color: 255 255 255 255;                                     \
242          }                                                              \
243       }                                                                 \
244       part {                                                            \
245          name: "label."##id;                                            \
246          type: TEXT;                                                    \
247          mouse_events: 0;                                               \
248          clip_to: clip;                                                 \
249          description {                                                  \
250             state: "default" 0.0;                                       \
251             color: 255 255 255 255;                                     \
252             color_class: ccls;                                          \
253             rel1.to: "button."##id;                                     \
254             rel2 {                                                      \
255                to: "button."##id;                                       \
256             }                                                           \
257             text {                                                      \
258                text: label;                                             \
259                font: FONT_NORMAL;                                       \
260                size: SIZE_MEDIUM;                                       \
261                align: 0.5 0.5;                                          \
262             }                                                           \
263          }                                                              \
264          description {                                                  \
265             state: "pressed" 0.0;                                       \
266             inherit: "default" 0.0;                                     \
267             color: 16 16 16 255;                                        \
268          }                                                              \
269       }                                                                 \
270                                                                         \
271       programs {                                                        \
272          program {                                                      \
273             signal: "toggle,on,"##id;                                   \
274             source: "gui";                                              \
275             action: STATE_SET "pressed" 0.0;                            \
276             target: "button."##id;                                      \
277             target: "label."##id;                                       \
278          }                                                              \
279          program {                                                      \
280             signal: "toggle,off,"##id;                                  \
281             source: "gui";                                              \
282             action: STATE_SET "default" 0.0;                            \
283             target: "button."##id;                                      \
284             target: "label."##id;                                       \
285          }                                                              \
286          program {                                                      \
287             signal: "mouse,clicked,1";                                  \
288             source: "button."##id;                                      \
289             action: SIGNAL_EMIT "clicked,"##id "gui";                   \
290             api: id"_clicked" id" was clicked";                         \
291          }                                                              \
292       }
293
294       BUTTON("view",    "View",    "action", "button.clipper", 0.0 0.0, 0.5 1.0);
295       BUTTON("compose", "Compose", "action", "button.clipper", 0.5 0.0, 1.0 1.0);
296
297       BUTTON("clear",     "Clear", "caution", "edit-button.clipper", 0.0 0.0, 0.5 1.0);
298       BUTTON("edit,done", "Done",  "action", "edit-button.clipper", 0.5 0.0, 1.0 1.0);
299 #undef BUTTON
300
301       part {
302          name: "button.edit";
303          type: RECT;
304          mouse_events: 1;
305          clip_to: "edit.clipper";
306          description {
307             state: "default" 0.0;
308             color: 255 255 255 0;
309             color_class: "caution";
310             rel1.to: "bg.edit";
311             rel2.to: "bg.edit";
312          }
313          description {
314             state: "pressed" 0.0;
315             inherit: "default" 0.0;
316             color: 255 255 255 255;
317          }
318       }
319       part {
320          name: "ico.edit";
321          type: IMAGE;
322          mouse_events: 0;
323          clip_to: "edit.clipper";
324          description {
325             state: "default" 0.0;
326             min: LIST_ICON_SIZE LIST_ICON_SIZE;
327             max: LIST_ICON_SIZE LIST_ICON_SIZE;
328             align: 0.0 0.5;
329             color: 255 255 255 255;
330             color_class: "caution";
331             rel1 {
332                to: "button.edit";
333                offset: ITEM_PADDING 0;
334             }
335             rel2 {
336                to: "button.edit";
337                offset: (-BORDER_PADDING - 1) -1;
338             }
339             image {
340                normal: "ico_del.png";
341                scale_hint: STATIC;
342             }
343          }
344          description {
345             state: "pressed" 0.0;
346             inherit: "default" 0.0;
347             color: 16 16 16 255;
348          }
349       }
350       part {
351          name: "button.over.edit";
352          type: RECT;
353          mouse_events: 1;
354          clip_to: "edit.clipper";
355          description {
356             state: "default" 0.0;
357             color: 0 0 0 0;
358             visible: 0;
359             rel1.to: "bg.edit";
360             rel2.to: "bg.edit";
361          }
362          description {
363             state: "pressed" 0.0;
364             inherit: "default" 0.0;
365             visible: 1;
366          }
367       }
368
369       part {
370          name: "elm.swallow.genlist";
371          type: SWALLOW;
372          description {
373             state: "default" 0.0;
374             rel1 {
375                to_y: "separator.bg.button";
376                relative: 0.0 1.0;
377             }
378          }
379       }
380    }
381
382    programs {
383       program {
384          signal: "toggle,on,edit";
385          source: "gui";
386          action: STATE_SET "pressed" 0.0;
387          target: "button.edit";
388          target: "button.over.edit";
389          target: "ico.edit";
390          after: "show_edit_buttons";
391       }
392       program {
393          name: "show_edit_buttons";
394          action: STATE_SET "alternate" 0.0;
395          transition: ACCELERATE 0.3;
396          target: "button.clipper";
397          target: "edit-button.clipper";
398       }
399
400       program {
401          signal: "toggle,off,edit";
402          source: "gui";
403          action: STATE_SET "default" 0.0;
404          target: "button.edit";
405          target: "button.over.edit";
406          target: "ico.edit";
407          after: "hide_edit_buttons";
408       }
409       program {
410          name: "hide_edit_buttons";
411          action: STATE_SET "default" 0.0;
412          transition: ACCELERATE 0.3;
413          target: "button.clipper";
414          target: "edit-button.clipper";
415       }
416
417       program {
418          signal: "mouse,clicked,1";
419          source: "button.edit";
420          action: SIGNAL_EMIT "clicked,edit" "gui";
421          api: "edit was clicked";
422       }
423       program {
424          signal: "mouse,clicked,1";
425          source: "button.over.edit";
426          action: SIGNAL_EMIT "clicked,edit,done" "gui";
427          api: "edit_done was clicked";
428       }
429    }
430 }