tizen 2.3.1 release
[framework/uifw/efl-theme-tizen.git] / 2.3-mobile / widgets / multibuttonentry.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  group {
28    name: "elm/multibuttonentry/base/default";
29
30    data.item: "horizontal_pad" MULTIBUTTONENTRY_BOX_HORIZONTAL_PAD_INC;
31    data.item: "vertical_pad" MULTIBUTTONENTRY_BOX_VERTICAL_PAD_INC;
32    data.item: "closed_button_type" "label"; /* image, label, default: label */
33
34    parts {
35       part {
36          name: "bg";
37          type: RECT;
38          mouse_events: 0;
39          scale: 1;
40          description {
41             state: "default" 0.0;
42             color: 0 0 0 0;
43          }
44       }
45       part {
46          name: "top.left.pad";
47          type: SPACER;
48          scale: 1;
49          description {
50             state: "default" 0.0;
51             min : MULTIBUTTONENTRY_WIDTH_PAD_INC MULTIBUTTONENTRY_HEIGHT_PAD_INC;
52             fixed: 1 1;
53             rel2.relative: 0.0 0.0;
54             align: 0.0 0.0;
55          }
56       }
57       part {
58          name: "bottom.right.pad";
59          type: SPACER;
60          scale: 1;
61          description {
62             state: "default" 0.0;
63             min : MULTIBUTTONENTRY_WIDTH_PAD_INC MULTIBUTTONENTRY_BOTTOM_HEIGHT_PAD_INC;
64             fixed: 1 1;
65             rel1.relative: 1.0 1.0;
66             align: 1.0 1.0;
67          }
68       }
69       part {
70          name: "box.swallow";
71          type: SWALLOW;
72          description {
73             state: "default" 0.0;
74             rel1 {
75                relative: 1.0 1.0;
76                to: "top.left.pad";
77             }
78             rel2 {
79                relative: 0.0 0.0;
80                to: "bottom.right.pad";
81             }
82          }
83       }
84       part { name: "block_events";
85          type: RECT;
86          description {
87             state: "default" 0.0;
88             color: 0 0 0 0;
89          }
90          description {
91             state: "invisible" 0.0;
92             visible: 0;
93          }
94       }
95       part { name: "events";
96          type: RECT;
97          repeat_events: 1;
98          ignore_flags: ON_HOLD;
99          description {
100             state: "default" 0.0;
101             color: 0 0 0 0;
102          }
103       }
104    }
105    programs {
106       program {
107          name: "clicked";
108          signal: "mouse,clicked,1";
109          source: "events";
110          action: SIGNAL_EMIT "elm,action,clicked" "";
111       }
112       program {
113          name: "event_allow";
114          signal: "elm,state,event,allow";
115          source: "";
116          action: STATE_SET "invisible" 0.0;
117          target: "block_events";
118       }
119       program {
120          name: "event_block";
121          signal: "elm,state,event,block";
122          source: "";
123          action: STATE_SET "default" 0.0;
124          target: "block_events";
125       }
126    }
127 }
128
129  group {
130    name: "elm/multibuttonentry/guidetext/default";
131
132    styles {
133       style {
134          name: "multibuttonentry_guide_style";
135          base: "font=Tizen:style=Regular font_size="MULTIBUTTONENTRY_GUIDE_TEXT_SIZE_INC" color=#000000FF wrap=char text_class=tizen";
136          tag:  "br" "\n";
137          tag:  "ps" "ps";
138          tag:  "hilight" "+ font_weight=Bold";
139          tag:  "b" "+ font_weight=Bold";
140          tag:  "tab" "\t";
141       }
142    }
143    parts {
144       part {
145          name: "elm.text";
146          type: TEXTBLOCK;
147          mouse_events: 0;
148          scale: 1;
149          description {
150             state: "default" 0.0;
151             min: 0 MULTIBUTTONENTRY_GUIDE_HEIGHT_INC;
152             text.style: "multibuttonentry_guide_style";
153          }
154          description {
155             state: "invisible" 0.0;
156             inherit: "default" 0.0;
157             visible: 0;
158          }
159       }
160    }
161    programs {
162       program {
163          name: "show";
164          signal: "elm,state,guidetext,show";
165          source: "elm";
166          action: STATE_SET "default" 0.0;
167          target: "elm.text";
168       }
169       program {
170          name: "hide";
171          signal: "elm,state,guidetext,hide";
172          source: "elm";
173          action: STATE_SET "invisible" 0.0;
174          target: "elm.text";
175       }
176    }
177  }
178
179  group {
180    name: "elm/multibuttonentry/btn/default";
181
182    styles {
183       style {
184          name: "multibuttonentry_btn_text_style";
185          base: "font=Tizen:style=Regular font_size="MULTIBUTTONENTRY_BUTTON_TEXT_SIZE_INC" color=#FFFFFFFF text_class=tizen align=center";
186       }
187       style {
188          name: "multibuttonentry_btn_text_pressed_style";
189          base: "font=Tizen:style=Regular font_size="MULTIBUTTONENTRY_BUTTON_TEXT_SIZE_INC" color=#FFFFFFFF text_class=tizen align=center";
190       }
191       style {
192          name: "multibuttonentry_btn_text_dim_style";
193          base: "font=Tizen:style=Regular font_size="MULTIBUTTONENTRY_BUTTON_TEXT_SIZE_INC" color=#FFFFFF7F text_class=tizen align=center";
194       }
195       style {
196          name: "multibuttonentry_btn_text_ellipsis_style";
197          base: "font=Tizen:style=Regular font_size="MULTIBUTTONENTRY_BUTTON_TEXT_SIZE_INC" color=#FFFFFFFF ellipsis=1 text_class=tizen";
198       }
199       style {
200          name: "multibuttonentry_btn_text_ellipsis_pressed_style";
201          base: "font=Tizen:style=Regular font_size="MULTIBUTTONENTRY_BUTTON_TEXT_SIZE_INC" color=#FFFFFFFF ellipsis=1 text_class=tizen";
202       }
203       style {
204          name: "multibuttonentry_btn_text_ellipsis_dim_style";
205          base: "font=Tizen:style=Regular font_size="MULTIBUTTONENTRY_BUTTON_TEXT_SIZE_INC" color=#FFFFFF7F ellipsis=1 text_class=tizen";
206       }
207    }
208    script {
209       public disabled = 0;
210    }
211    images {
212       set {
213          name: "core_list_button_bg.#";
214          image {
215             image: SMALL"images/Controls/core_list_button_bg.#.png" COMP;
216          }
217          image {
218             image: MEDIUM"images/Controls/core_list_button_bg.#.png" COMP;
219          }
220       }
221    }
222
223    data.item: "button_left_pad" MULTIBUTTONENTRY_BUTTON_PAD_INC;
224    data.item: "button_right_pad" MULTIBUTTONENTRY_BUTTON_PAD_INC;
225    data.item: "focus_highlight" "on";
226
227    parts {
228       part { name: "button_image";
229          scale: 1;
230          description { state: "default" 0.0;
231             min: MULTIBUTTONENTRY_BUTTON_WIDTH_INC MULTIBUTTONENTRY_BUTTON_HEIGHT_INC;
232             image.normal: "core_list_button_bg.#";
233             color: 38 107 191 255; /*(Changeable UI) color_class: "W012";*/
234          }
235          description { state: "pressed" 0.0;
236             inherit: "default" 0.0;
237             color: 30 85 153 255; /*(Changeable UI) color_class: "W012P";*/
238          }
239          description { state: "disabled" 0.0;
240             inherit: "default" 0.0;
241             color: 76 128 191 255; /*(Changeable UI) color_class: "W012D";*/
242          }
243       }
244       part {
245          name: "left.padding";
246          type: SPACER;
247          scale: 1;
248          description {
249             state: "default" 0.0;
250             min: MULTIBUTTONENTRY_BUTTON_PAD_INC 0;
251             fixed: 1 0;
252             rel2.relative: 0.0 1.0;
253             align: 0.0 0.5;
254          }
255       }
256       part {
257          name: "right.padding";
258          type: SPACER;
259          scale: 1;
260          description {
261             state: "default" 0.0;
262             min: MULTIBUTTONENTRY_BUTTON_PAD_INC 0;
263             fixed: 1 0;
264             rel1.relative: 1.0 0.0;
265             align: 1.0 0.5;
266          }
267       }
268       part {
269          name: "elm.btn.text";
270          type: TEXTBLOCK;
271          mouse_events: 0;
272          multiline: 0;
273          scale: 1;
274          description {
275             state: "default" 0.0;
276             text {
277                style: "multibuttonentry_btn_text_style";
278                min: 1 0;
279             }
280             rel1 {
281                relative: 1.0 0.0;
282                to: "left.padding";
283             }
284             rel2 {
285                relative: 0.0 1.0;
286                to: "right.padding";
287             }
288          }
289          description {
290             state: "pressed" 0.0;
291             inherit: "default" 0.0;
292             text.style: "multibuttonentry_btn_text_pressed_style";
293          }
294          description {
295             state: "disabled" 0.0;
296             inherit: "default" 0.0;
297             text.style: "multibuttonentry_btn_text_dim_style";
298          }
299          description {
300             state: "ellipsis" 0.0;
301             inherit: "default" 0.0;
302             text {
303                style: "multibuttonentry_btn_text_ellipsis_style";
304                min: 0 0;
305             }
306          }
307          description {
308             state: "ellipsis_pressed" 0.0;
309             inherit: "ellipsis" 0.0;
310             text.style: "multibuttonentry_btn_text_ellipsis_pressed_style";
311          }
312          description {
313             state: "ellipsis_disabled" 0.0;
314             inherit: "ellipsis" 0.0;
315             text.style: "multibuttonentry_btn_text_ellipsis_dim_style";
316          }
317       }
318       part {
319          name: "events";
320          type: RECT;
321          ignore_flags: ON_HOLD;
322          description {
323             state: "default" 0.0;
324             color: 0 0 0 0;
325          }
326       }
327       part {
328          name: "drag";
329          type: RECT;
330          scale: 1;
331          repeat_events: 1;
332          dragable {
333             x: 1 1 0;
334             y: 1 1 0;
335          }
336          description {
337             state: "default" 0.0;
338             rel1.to: "button_image";
339             rel2.to: "button_image";
340             color: 0 0 0 0;
341          }
342       }
343    }
344    programs {
345       program {
346          name: "text_ellipsis";
347          signal: "elm,state,text,ellipsis";
348          source: "";
349          script {
350             new st[31];
351             new Float:vl;
352             get_state(PART:"elm.btn.text", st, 30, vl);
353             if (!strcmp(st, "ellipsis_disabled"))
354               set_state(PART:"elm.btn.text", "ellipsis_disabled", 0.0);
355             else
356               set_state(PART:"elm.btn.text", "ellipsis", 0.0);
357          }
358       }
359       program {
360          name: "text_default";
361          signal: "elm,state,text,default";
362          source: "";
363          action: STATE_SET "default" 0.0;
364          target: "elm.btn.text";
365       }
366       program {
367          name: "pressed";
368          signal: "mouse,down,1";
369          source: "drag";
370          script {
371             new st[31];
372             new Float:vl;
373             if (get_int(disabled) ==  1)
374               return;
375             get_state(PART:"elm.btn.text", st, 30, vl);
376             if (!strcmp(st, "default") || !strcmp(st, "pressed"))
377               set_state(PART:"elm.btn.text", "pressed", 0.0);
378             else if (!strcmp(st, "ellipsis") || !strcmp(st, "ellipsis_pressed"))
379               set_state(PART:"elm.btn.text", "ellipsis_pressed", 0.0);
380             set_state(PART:"button_image", "pressed", 0.0);
381          }
382          after: "selected";
383       }
384       program {
385          name: "move";
386          signal: "drag";
387          source: "drag";
388          script {
389             new Float:dx, Float:dy;
390             if (get_int(disabled) ==  1)
391               return;
392             get_drag(PART:"drag", dx, dy);
393             if ((abs(dx) > 20) || (abs(dy) > 20)) {
394                new st[31];
395                new Float:vl;
396                get_state(PART:"elm.btn.text", st, 30, vl);
397                if (!strcmp(st, "default") || !strcmp(st, "pressed"))
398                  set_state(PART:"elm.btn.text", "default", 0.0);
399                else if (!strcmp(st, "ellipsis") || !strcmp(st, "ellipsis_pressed"))
400                  set_state(PART:"elm.btn.text", "ellipsis", 0.0);
401                set_state(PART:"button_image", "default", 0.0);
402             }
403          }
404       }
405       program {
406          name: "released";
407          signal: "mouse,up,1";
408          source: "drag";
409          script {
410             new st[31];
411             new Float:vl;
412             if (get_int(disabled) ==  1)
413               return;
414             get_state(PART:"elm.btn.text", st, 30, vl);
415             if (!strcmp(st, "default") || !strcmp(st, "pressed"))
416               set_state(PART:"elm.btn.text", "default", 0.0);
417             else if (!strcmp(st, "ellipsis") || !strcmp(st, "ellipsis_pressed"))
418               set_state(PART:"elm.btn.text", "ellipsis", 0.0);
419             set_state(PART:"button_image", "default", 0.0);
420             set_drag(PART:"drag", 0.0, 0.0);
421          }
422          after: "unselected";
423       }
424       program {
425          name: "selected_elm";
426          signal: "elm,action,btn,selected";
427          source: "";
428          script {
429             new st[31];
430             new Float:vl;
431             get_state(PART:"elm.btn.text", st, 30, vl);
432             if (!strcmp(st, "default") || !strcmp(st, "pressed"))
433               set_state(PART:"elm.btn.text", "default", 0.0);
434             else if (!strcmp(st, "ellipsis") || !strcmp(st, "ellipsis_pressed"))
435               set_state(PART:"elm.btn.text", "ellipsis", 0.0);
436             set_state(PART:"button_image", "pressed", 0.0);
437          }
438          after: "selected";
439       }
440       program {
441          name: "unselected_elm";
442          signal: "elm,action,btn,unselected";
443          source: "";
444          script {
445             new st[31];
446             new Float:vl;
447             get_state(PART:"elm.btn.text", st, 30, vl);
448             if (!strcmp(st, "default") || !strcmp(st, "pressed"))
449               set_state(PART:"elm.btn.text", "default", 0.0);
450             else if (!strcmp(st, "ellipsis") || !strcmp(st, "ellipsis_pressed"))
451               set_state(PART:"elm.btn.text", "ellipsis", 0.0);
452             if (get_int(disabled) ==  0)
453               set_state(PART:"button_image", "default", 0.0);
454             else
455               set_state(PART:"button_image", "disabled", 0.0);
456             set_drag(PART:"drag", 0.0, 0.0);
457          }
458          after: "unselected";
459       }
460       program {
461          name: "enable";
462          signal: "elm,state,enabled";
463          source: "elm";
464          script {
465             new st[31];
466             new Float:vl;
467             get_state(PART:"elm.btn.text", st, 30, vl);
468             if (!strcmp(st, "default") || !strcmp(st, "disabled"))
469               set_state(PART:"elm.btn.text", "default", 0.0);
470             else if (!strcmp(st, "ellipsis") || !strcmp(st, "ellipsis_disabled"))
471               set_state(PART:"elm.btn.text", "ellipsis", 0.0);
472             set_state(PART:"button_image", "default", 0.0);
473             set_int(disabled , 0);
474          }
475       }
476       program {
477          name: "disable";
478          signal: "elm,state,disabled";
479          source: "elm";
480          script {
481             new st[31];
482             new Float:vl;
483             get_state(PART:"elm.btn.text", st, 30, vl);
484             if (!strcmp(st, "default") || !strcmp(st, "disabled"))
485               set_state(PART:"elm.btn.text", "disabled", 0.0);
486             else if (!strcmp(st, "ellipsis") || !strcmp(st, "ellipsis_disabled"))
487               set_state(PART:"elm.btn.text", "ellipsis_disabled", 0.0);
488             set_state(PART:"button_image", "disabled", 0.0);
489             set_int(disabled , 1);
490          }
491       }
492       program {
493          name: "clicked";
494          signal: "mouse,clicked,1";
495          source: "events";
496          action: SIGNAL_EMIT "elm,action,clicked" "";
497          after: "touch_snd";
498       }
499       program {
500          name: "touch_snd";
501          action: RUN_PLUGIN "touch_sound" ;
502       }
503       program {
504          name: "selected";
505          action: SIGNAL_EMIT "elm,action,selected" "";
506       }
507       program {
508          name: "unselected";
509          action: SIGNAL_EMIT "elm,action,unselected" "";
510       }
511    }
512  }
513
514  group {
515    name: "elm/multibuttonentry/number/default";
516
517    styles {
518       style {
519          name: "multibuttonentry_number_text_style";
520          base: "font=Tizen:style=Regular font_size="MULTIBUTTONENTRY_BUTTON_TEXT_SIZE_INC" color=#023D84FF text_class=tizen";
521       }
522       style {
523          name: "multibuttonentry_number_text_ellipsis_style";
524          base: "font=Tizen:style=Regular font_size="MULTIBUTTONENTRY_BUTTON_TEXT_SIZE_INC" color=#023D84FF ellipsis=1 text_class=tizen";
525       }
526    }
527    parts {
528       part {
529          name: "left.pad";
530          type: SPACER;
531          scale: 1;
532          description {
533             state: "default" 0.0;
534             min: MULTIBUTTONENTRY_LABEL_PAD_INC 0;
535             fixed: 1 0;
536             rel2.relative: 0.0 1.0;
537             align: 0.0 0.5;
538          }
539       }
540       part {
541          name: "elm.text";
542          type: TEXTBLOCK;
543          mouse_events: 0;
544          scale: 1;
545          description {
546             state: "default" 0.0;
547             min: 0 MULTIBUTTONENTRY_LABEL_HEIGHT_INC;
548             text {
549                style: "multibuttonentry_number_text_style";
550                min: 1 0;
551             }
552             rel1 {
553                relative: 1.0 0.0;
554                to: "left.pad";
555             }
556          }
557          description {
558             state: "ellipsis" 0.0;
559             inherit: "default" 0.0;
560             text.style: "multibuttonentry_number_text_ellipsis_style";
561             text.min: 0 0;
562          }
563       }
564    }
565    programs {
566       program {
567          name: "text,default";
568          signal: "elm,state,number,default";
569          source: "";
570          action: STATE_SET "default" 0.0;
571          target: "elm.text";
572       }
573       program {
574          name: "text,ellipsis";
575          signal: "elm,state,number,ellipsis";
576          source: "";
577          action: STATE_SET "ellipsis" 0.0;
578          target: "elm.text";
579       }
580    }
581  }
582
583  group {
584    name: "elm/multibuttonentry/label/default";
585
586    styles {
587       style {
588          name: "multibuttonentry_label_style";
589          base: "font=Tizen:style=Regular font_size="MULTIBUTTONENTRY_LABEL_TEXT_SIZE_INC" color=#000000FF wrap=char text_class=tizen";
590          tag:  "br" "\n";
591          tag:  "ps" "ps";
592          tag:  "hilight" "+ font_weight=Bold";
593          tag:  "b" "+ font_weight=Bold";
594          tag:  "tab" "\t";
595       }
596    }
597
598    parts {
599       part {
600          name: "mbe.label.right.padding";
601          type: SPACER;
602          scale: 1;
603          description {
604             state: "default" 0.0;
605             min: MULTIBUTTONENTRY_LABEL_PAD_INC 0;
606             fixed: 1 0;
607             rel1.relative: 1.0 0.0;
608             align: 1.0 0.5;
609          }
610       }
611       part {
612          name: "mbe.label";
613          type: TEXTBLOCK;
614          mouse_events: 0;
615          scale: 1;
616          description {
617             state: "default" 0.0;
618             min: 0 MULTIBUTTONENTRY_LABEL_HEIGHT_INC;
619             text {
620                style: "multibuttonentry_label_style";
621                min: 1 0;
622             }
623             rel2 {
624                relative: 0.0 1.0;
625                to: "mbe.label.right.padding";
626             }
627          }
628       }
629    }
630  }