05a4ad83c9c97e5d589a017159c3e133e9621e5e
[profile/ivi/efl-theme-tizen.git] / themes / widgets / label.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 #define TEXT_SLIDE_DURATION 10
21
22       styles {
23          style { name: "textblock_style";
24             base: "font=Tizen:style=Medium font_size="LABEL_FONT_SIZE_INC" color="LABEL_TEXT_BLOCK_STYLE_COLOR_INC" text_class=tizen";
25             tag:  "br" "\n";
26             tag:  "ps" "ps";
27             tag:  "hilight" "+ font=Tizen:style=Bold";
28             tag:  "b" "+ font=Tizen:style=Bold";
29             tag:  "tab" "\t";
30          }
31          style { name: "naviframe_title_style";
32             base: "font=Tizen:style=Medium font_size="NAVIFRAME_TITLE_FONT_SIZE_INC" color="NAVIFRAME_TITLE_STYLE_COLOR_INC" text_class=tizen";
33             tag:  "br" "\n";
34             tag:  "ps" "ps";
35             tag:  "hilight" "+ font=Tizen:style=Bold";
36             tag:  "b" "+ font=Tizen:style=Bold";
37             tag:  "tab" "\t";
38          }
39          /* label doesn't use it */
40          style { name: "textblock_charwrap_style";
41 base: "font=Tizen:style=Medium font_size="LABEL_FONT_SIZE_INC" color="LABEL_TEXT_BLOCK_STYLE_COLOR_INC" text_class=tizen";
42             tag:  "br" "\n";
43             tag:  "ps" "ps";
44             tag:  "hilight" "+ font=Tizen:style=Bold";
45             tag:  "b" "+ font=Tizen:style=Bold";
46             tag:  "tab" "\t";
47          }
48       }
49
50       group { name: "elm/label/base/default";
51          parts {
52             part { name: "label.text.clip";
53                type: RECT;
54                description { state: "default" 0.0;
55                }
56             }
57             part { name: "elm.text";
58                type: TEXTBLOCK;
59                scale: 1;
60                clip_to: "label.text.clip";
61                description { state: "default" 0.0;
62                   text {
63                      style: "textblock_style";
64                      min: 0 1;
65                      align: 0.0 0.0;
66                   }
67                }
68             }
69          }
70       }
71
72       /* default label doesn't use it */
73       group { name: "elm/label/base_wrap/default";
74          parts {
75             part { name: "elm.text";
76                type: TEXTBLOCK;
77                mouse_events: 1;
78                scale: 1;
79                multiline: 1;
80                description { state: "default" 0.0;
81                   text {
82                        style: "textblock_style";
83                        min: 0 1;
84                        align: 0.0 0.0;
85                   }
86                }
87                description { state: "charwrap_mode" 0.0;
88                   text {
89                      style: "textblock_charwrap_style";
90                      min: 0 1;
91                      align: 0.0 0.0;
92                   }
93                }
94             }
95          }
96          programs {
97             program { name: "default_on";
98                signal: "elm,state,default";
99                source: "elm";
100                action: STATE_SET "default" 0.0;
101                target: "elm.text";
102             }
103             program { name: "charwrap_on";
104                signal: "elm,state,charwrap";
105                source: "elm";
106                action: STATE_SET "charwrap_mode" 0.0;
107                target: "elm.text";
108             }
109          } // end programs
110       } // end group
111
112       /* default label doesn't use it */
113       group { name: "elm/label/base_wrap_ellipsis/default";
114          parts {
115             part { name: "elm.text";
116                type: TEXTBLOCK;
117                mouse_events: 0;
118                scale: 1;
119                multiline: 1;
120                description { state: "default" 0.0;
121                   // FIXME : fixed for multiline ellipsis.
122                   //         does it need to make another ellipsis style? 
123                   fixed: 0 1;
124                   text {
125                      style: "textblock_style";
126                      min: 0 1;
127                      align: 0.0 0.0;
128                   }
129                }
130                description { state: "charwrap_mode" 0.0;
131                   // FIXME : fixed for multiline ellipsis.
132                   //         does it need to make another ellipsis style? 
133                   fixed: 0 1;
134                   text {
135                      style: "textblock_charwrap_style";
136                      min: 0 1;
137                      align: 0.0 0.0;
138                   }
139                }
140             }
141          }
142          programs {
143             program { name: "default_on";
144                signal: "elm,state,default";
145                source: "elm";
146                action: STATE_SET "default" 0.0;
147                target: "elm.text";
148             }
149             program { name: "charwrap_on";
150                signal: "elm,state,charwrap";
151                source: "elm";
152                action: STATE_SET "charwrap_mode" 0.0;
153                target: "elm.text";
154             }
155          } // end programs
156       } // end group
157
158       group { name: "elm/label/base/marker";
159          styles {
160             style { name: "textblock_style2";
161                base: "font=Tizen:style=Bold font_size=14 align=center color=#fff wrap=word text_class=tizen";
162                tag:  "br" "\n";
163                tag:  "ps" "ps";
164                tag:  "hilight" "+ color=#ffff";
165                tag:  "b" "+ color=#ffff";
166                tag:  "tab" "\t";
167             }
168          }
169          parts {
170             part { name: "elm.text";
171                type: TEXTBLOCK;
172                mouse_events: 0;
173                scale: 1;
174                description { state: "default" 0.0;
175                   text {
176                      style: "textblock_style2";
177                      min: 1 1;
178                      align: 0.0 0.0;
179                   }
180                }
181             }
182          }
183       }
184
185       /* default label doesn't use it */
186       group { name: "elm/label/base_wrap/marker";
187          parts {
188             part { name: "elm.text";
189                type: TEXTBLOCK;
190                mouse_events: 0;
191                scale: 1;
192                multiline: 1;
193                description { state: "default" 0.0;
194                   text {
195                      style: "textblock_style2";
196                      min: 1 1;
197                      align: 0.0 0.0;
198                   }
199                }
200             }
201          }
202       }
203
204       group { name: "elm/label/base/slide_long";
205          script {
206             public g_duration, g_stopslide, g_timer_id, g_anim_id;
207
208             public message(Msg_Type:type, id, ...) {
209                if ((type == MSG_FLOAT_SET) && (id == 0)) {
210                   new Float:duration;
211                   duration = getfarg(2);
212                   set_float(g_duration, duration);
213                }
214             }
215             public slide_to_end_anim(val, Float:pos) {
216                new stopflag;
217                new id;
218                stopflag = get_int(g_stopslide);
219                if (stopflag == 1) return;
220                set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0);
221                if (pos >= 1.0) {
222                   id = timer(0.5, "slide_to_begin", 1);
223                   set_int(g_timer_id, id);
224                }
225             }
226             public slide_to_end() {
227                new stopflag;
228                new id;
229                new Float:duration;
230                stopflag = get_int(g_stopslide);
231                if (stopflag == 1) return;
232                duration = get_float(g_duration);
233                id = anim(duration, "slide_to_end_anim", 1);
234                set_int(g_anim_id, id);
235             }
236             public slide_to_begin() {
237                new stopflag;
238                new id;
239                stopflag = get_int(g_stopslide);
240                if (stopflag == 1) return;
241                set_state(PART:"elm.text", "slide_begin", 0.0);
242                id = timer(0.5, "slide_to_end", 1);
243                set_int(g_timer_id, id);
244             }
245             public start_slide() {
246                set_int(g_stopslide, 0);
247                set_state(PART:"elm.text", "slide_begin", 0.0);
248                slide_to_end();
249             }
250             public stop_slide() {
251                new id;
252                set_int(g_stopslide, 1);
253                id = get_int(g_anim_id);
254                cancel_anim(id);
255                id = get_int(g_timer_id);
256                cancel_timer(id);
257                set_state(PART:"elm.text", "default", 0.0);
258             }
259          }
260
261          parts {
262             part { name: "label.text.clip";
263                type: RECT;
264                description { state: "default" 0.0;
265                }
266             }
267             part { name: "elm.text";
268                type: TEXTBLOCK;
269                mouse_events: 0;
270                scale: 1;
271                clip_to: "label.text.clip";
272                description { state: "default" 0.0;
273                   rel1.relative: 0.0 0.0;
274                   rel2.relative: 1.0 1.0;
275                   align: 0.0 0.0;
276                   text {
277                      style: "textblock_style";
278                      min: 0 1;
279                      align: 0.0 0.0;
280                   }
281                }
282                description { state: "slide_end" 0.0;
283                   inherit: "default" 0.0;
284                   rel1.relative: 0.0 0.0;
285                   rel2.relative: 0.0 1.0;
286                   align: 1.0 0.0;
287                   text {
288                      style: "textblock_style";
289                      min: 1 1;
290                      align: 0.0 0.0;
291                   }
292                }
293                description { state: "slide_begin" 0.0;
294                   inherit: "default" 0.0;
295                   rel1.relative: 1.0 0.0;
296                   rel2.relative: 1.0 1.0;
297                   align: 0.0 0.0;
298                   text {
299                      style: "textblock_style";
300                      min: 1 1;
301                      align: 0.0 0.0;
302                   }
303                }
304             }
305          }
306          programs {
307             program { name: "start_slide";
308                source: "elm";
309                signal: "elm,state,slide,start";
310                script {
311                   start_slide();
312                }
313             }
314             program { name: "stop_slide";
315                source: "elm";
316                signal: "elm,state,slide,stop";
317                script {
318                   stop_slide();
319                }
320             }
321          }
322       }
323
324       group { name: "elm/label/base/slide_short";
325          script {
326             public g_duration, g_stopslide, g_timer_id, g_anim_id;
327
328             public message(Msg_Type:type, id, ...) {
329                if ((type == MSG_FLOAT_SET) && (id == 0)) {
330                   new Float:duration;
331                   duration = getfarg(2);
332                   set_float(g_duration, duration);
333                }
334             }
335             public slide_to_end_anim(val, Float:pos) {
336                new stopflag;
337                new id;
338                stopflag = get_int(g_stopslide);
339                if (stopflag == 1) return;
340                set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0);
341                if (pos >= 1.0) {
342                   id = timer(0.5, "slide_to_begin", 1);
343                   set_int(g_timer_id, id);
344                }
345             }
346             public slide_to_end() {
347                new stopflag;
348                new id;
349                new Float:duration;
350                stopflag = get_int(g_stopslide);
351                if (stopflag == 1) return;
352                duration = get_float(g_duration);
353                id = anim(duration, "slide_to_end_anim", 1);
354                set_int(g_anim_id, id);
355             }
356             public slide_to_begin() {
357                new stopflag;
358                new id;
359                stopflag = get_int(g_stopslide);
360                if (stopflag == 1) return;
361                set_state(PART:"elm.text", "slide_begin", 0.0);
362                id = timer(0.5, "slide_to_end", 1);
363                set_int(g_timer_id, id);
364             }
365             public start_slide() {
366                set_int(g_stopslide, 0);
367                set_state(PART:"elm.text", "slide_begin", 0.0);
368                slide_to_end();
369             }
370             public stop_slide() {
371                new id;
372                set_int(g_stopslide, 1);
373                id = get_int(g_anim_id);
374                cancel_anim(id);
375                id = get_int(g_timer_id);
376                cancel_timer(id);
377                set_state(PART:"elm.text", "default", 0.0);
378             }
379          }
380
381          parts {
382             part { name: "label.text.clip";
383                type: RECT;
384                description { state: "default" 0.0;
385                }
386             }
387             part { name: "elm.text";
388                type: TEXTBLOCK;
389                mouse_events: 0;
390                scale: 1;
391                clip_to: "label.text.clip";
392                description { state: "default" 0.0;
393                   rel1.relative: 0.0 0.0;
394                   rel2.relative: 1.0 1.0;
395                   align: 0.0 0.0;
396                   text {
397                      style: "textblock_style";
398                      min: 0 1;
399                      align: 0.0 0.0;
400                   }
401                }
402                description { state: "slide_end" 0.0;
403                   inherit: "default" 0.0;
404                   rel1.relative: 1.0 0.0;
405                   rel2.relative: 1.0 1.0;
406                   align: 1.0 0.0;
407                   text {
408                      style: "textblock_style";
409                      min: 1 1;
410                      align: 0.0 0.0;
411                   }
412                }
413                description { state: "slide_begin" 0.0;
414                   inherit: "default" 0.0;
415                   rel1.relative: 0.0 0.0;
416                   rel2.relative: 0.0 1.0;
417                   align: 0.0 0.0;
418                   text {
419                      style: "textblock_style";
420                      min: 1 1;
421                      align: 0.0 0.0;
422                   }
423                }
424             }
425          }
426          programs {
427             program { name: "start_slide";
428                source: "elm";
429                signal: "elm,state,slide,start";
430                script {
431                   start_slide();
432                }
433             }
434             program { name: "stop_slide";
435                source: "elm";
436                signal: "elm,state,slide,stop";
437                script {
438                   stop_slide();
439                }
440             }
441          }
442       }
443
444       group { name: "elm/label/base/slide_bounce";
445          script {
446             public g_duration, g_stopslide, g_timer_id, g_anim_id;
447
448             public message(Msg_Type:type, id, ...) {
449                if ((type == MSG_FLOAT_SET) && (id == 0)) {
450                   new Float:duration;
451                   duration = getfarg(2);
452                   set_float(g_duration, duration);
453                }
454             }
455             public slide_to_end_anim(val, Float:pos) {
456                new stopflag;
457                new id;
458                stopflag = get_int(g_stopslide);
459                if (stopflag == 1) return;
460                set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0);
461                if (pos >= 1.0) {
462                   id = timer(0.5, "slide_to_begin", 1);
463                   set_int(g_timer_id, id);
464                }
465             }
466             public slide_to_end() {
467                new stopflag;
468                new id;
469                new Float:duration;
470                stopflag = get_int(g_stopslide);
471                if (stopflag == 1) return;
472                duration = get_float(g_duration);
473                id = anim(duration, "slide_to_end_anim", 1);
474                set_int(g_anim_id, id);
475             }
476             public slide_to_begin_anim(val, Float:pos) {
477                new stopflag;
478                new id;
479                stopflag = get_int(g_stopslide);
480                if (stopflag == 1) return;
481                set_tween_state(PART:"elm.text", pos, "slide_end", 0.0, "slide_begin", 0.0);
482                if (pos >= 1.0) {
483                   id = timer(0.5, "slide_to_end", 1);
484                   set_int(g_timer_id, id);
485                }
486             }
487             public slide_to_begin() {
488                new stopflag;
489                new id;
490                new Float:duration;
491                stopflag = get_int(g_stopslide);
492                if (stopflag == 1) return;
493                duration = get_float(g_duration);
494                id = anim(duration, "slide_to_begin_anim", 1);
495                set_int(g_anim_id, id);
496             }
497             public start_slide() {
498                set_int(g_stopslide, 0);
499                set_state(PART:"elm.text", "slide_begin", 0.0);
500                slide_to_end();
501             }
502             public stop_slide() {
503                new id;
504                set_int(g_stopslide, 1);
505                id = get_int(g_anim_id);
506                cancel_anim(id);
507                id = get_int(g_timer_id);
508                cancel_timer(id);
509                set_state(PART:"elm.text", "default", 0.0);
510             }
511          }
512
513          parts {
514             part { name: "label.text.clip";
515                type: RECT;
516                description { state: "default" 0.0;
517                }
518             }
519             part { name: "elm.text";
520                type: TEXTBLOCK;
521                mouse_events: 0;
522                scale: 1;
523                clip_to: "label.text.clip";
524                description { state: "default" 0.0;
525                   rel1.relative: 0.0 0.0;
526                   rel2.relative: 1.0 1.0;
527                   align: 0.0 0.0;
528                   text {
529                      style: "textblock_style";
530                      min: 0 1;
531                      align: 0.0 0.0;
532                   }
533                }
534                description { state: "slide_end" 0.0;
535                   inherit: "default" 0.0;
536                   rel1.relative: 1.0 0.0;
537                   rel2.relative: 1.0 1.0;
538                   align: 1.0 0.0;
539                   text {
540                      style: "textblock_style";
541                      min: 1 1;
542                      align: 0.0 0.0;
543                   }
544                }
545                description { state: "slide_begin" 0.0;
546                   inherit: "default" 0.0;
547                   rel1.relative: 0.0 0.0;
548                   rel2.relative: 0.0 1.0;
549                   align: 0.0 0.0;
550                   text {
551                      style: "textblock_style";
552                      min: 1 1;
553                      align: 0.0 0.0;
554                   }
555                }
556             }
557          }
558          programs {
559             program { name: "start_slide";
560                source: "elm";
561                signal: "elm,state,slide,start";
562                script {
563                   start_slide();
564                }
565             }
566             program { name: "stop_slide";
567                source: "elm";
568                signal: "elm,state,slide,stop";
569                script {
570                   stop_slide();
571                }
572             }
573          }
574       }
575
576       group { name: "elm/label/base/naviframe_title";
577          script {
578             public g_duration, g_stopslide, g_timer_id, g_anim_id;
579
580             public message(Msg_Type:type, id, ...) {
581                if ((type == MSG_FLOAT_SET) && (id == 0)) {
582                   new Float:duration;
583                   duration = getfarg(2);
584                   set_float(g_duration, duration);
585                }
586             }
587             public slide_end_pending(val, Float:pos) {
588                if (pos >= 1.0) {
589                   stop_slide();
590                   emit("elm,state,slide,end", "");
591                }
592             }
593             public slide_to_end_anim(val, Float:pos) {
594                new stopflag;
595                stopflag = get_int(g_stopslide);
596                if (stopflag == 1) return;
597                set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0);
598                if (pos >= 1.0)
599                  anim(1, "slide_end_pending", 1);
600             }
601             public slide_to_end() {
602                new stopflag;
603                new id;
604                new Float:duration;
605                stopflag = get_int(g_stopslide);
606                if (stopflag == 1) return;
607                duration = get_float(g_duration);
608                id = anim(duration, "slide_to_end_anim", 1);
609                set_int(g_anim_id, id);
610             }
611             public slide_to_begin() {
612                new stopflag;
613                new id;
614                stopflag = get_int(g_stopslide);
615                if (stopflag == 1) return;
616                set_state(PART:"elm.text", "slide_begin", 0.0);
617                id = timer(0.5, "slide_to_end", 1);
618                set_int(g_timer_id, id);
619             }
620             public start_slide() {
621                set_int(g_stopslide, 0);
622                set_state(PART:"elm.text", "slide_begin", 0.0);
623                slide_to_end();
624             }
625             public stop_slide() {
626                new id;
627                set_int(g_stopslide, 1);
628                id = get_int(g_anim_id);
629                cancel_anim(id);
630                id = get_int(g_timer_id);
631                cancel_timer(id);
632                set_state(PART:"elm.text", "default", 0.0);
633             }
634          }
635
636          parts {
637             part { name: "label.text.clip";
638                type: RECT;
639                description { state: "default" 0.0;
640                }
641             }
642             part { name: "elm.text";
643                type: TEXTBLOCK;
644                mouse_events: 0;
645                scale: 1;
646                clip_to: "label.text.clip";
647                description { state: "default" 0.0;
648                   rel1.relative: 0.0 0.0;
649                   rel2.relative: 1.0 1.0;
650                   align: 0.0 0.0;
651                   text {
652                      style: "naviframe_title_style";
653                      min: 0 1;
654                   }
655                }
656                description { state: "slide_end" 0.0;
657                   inherit: "default" 0.0;
658                   rel1.relative: 1.0 0.0;
659                   rel2.relative: 1.0 1.0;
660                   align: 1.0 0.0;
661                   text {
662                      style: "naviframe_title_style";
663                      min: 1 1;
664                   }
665                }
666                description { state: "slide_begin" 0.0;
667                   inherit: "default" 0.0;
668                   rel1.relative: 0.0 0.0;
669                   rel2.relative: 0.0 1.0;
670                   align: 0.0 0.0;
671                   text {
672                      style: "naviframe_title_style";
673                      min: 1 1;
674                   }
675                }
676             }
677          }
678          programs {
679             program { name: "start_slide";
680                source: "elm";
681                signal: "elm,state,slide,start";
682                script {
683                   start_slide();
684                }
685             }
686             program { name: "stop_slide";
687                source: "elm";
688                signal: "elm,state,slide,stop";
689                script {
690                   stop_slide();
691                }
692             }
693          }
694       }
695
696
697       group { name: "elm/label/base/datetime";
698          inherit: "elm/label/base/default";
699          parts {
700             part { name: "elm.text";
701                type: TEXT;
702                scale: 1;
703                clip_to: "label.text.clip";
704                description { state: "default" 0.0;
705                 color: DATETIME_LABEL_TEXT_BLOCK_STYLE_COLOR_INC;
706                   text {
707                      font: "Tizen:style=Regular";
708                      size: DATETIME_TEXT_FONT_SIZE_INC;
709                      text_class: "tizen";
710                      min: 1 0;
711                   }
712                }
713                description { state: "selected" 0.0;
714                   inherit: "default" 0.0;
715                   color: DATETIME_LABEL_TEXT_BLOCK_STYLE_SELECTED_COLOR_INC;
716                }
717             }
718          }
719          programs {
720             program { name: "label_select";
721                signal: "elm,state,select";
722                source: "elm";
723                action: STATE_SET "selected" 0.0;
724                target: "elm.text";
725             }
726             program { name: "label_unselect";
727                signal: "elm,state,unselect";
728                source: "elm";
729                action: STATE_SET "default" 0.0;
730                target: "elm.text";
731             }
732          }
733       }