2 name: "elm/layout/ofono-efl/keypad";
5 * Represents the dialer keypad with the current number display and buttons.
8 * TEXT: elm.text.display
11 * Emit (source is "keypad"):
12 * pressed,<ID>: key <ID> was pressed
13 * released,<ID>: key <ID> was released
14 * clicked,<ID>: key <ID> was clicked (press and release in the key)
15 * enable,<ACTION>: key <ID> is now clickable
16 * disable,<ACTION>: key <ID> is now inactive
18 * Where <ID> is: numbers 0 to 9, star, hash, save, call or backspace.
20 * Where <ACTION> is: save, call or backspace.
24 image: "bg_keypad.jpg" COMP;
25 image: "ico_call.png" COMP;
26 image: "ico_backspace.png" COMP;
27 image: "ico_add_contact.png" COMP;
37 color: 255 255 255 255;
38 color_class: "primary";
43 name: "elm.text.display";
47 api: "display" "displays the current number";
50 color: 255 255 255 255;
51 color_class: "action";
52 min: (WIDTH - BORDER_PADDING*2) ACTION_HEIGHT;
54 offset: BORDER_PADDING 0;
58 offset: (-BORDER_PADDING -1) (ACTION_HEIGHT - 1);
61 text: "+1 (12) 3456-7890";
64 size_range: SIZE_TINY SIZE_HUGE;
73 name: "elm.text.contact-and-type";
79 color: 255 255 255 255;
80 color_class: "secondary";
84 to: "elm.text.display";
89 to: "elm.text.display";
102 inherit: "default" 0.0;
112 state: "default" 0.0;
114 min: WIDTH ACTION_HEIGHT;
115 max: WIDTH WIDTH; /* keep it tight centered */
118 offset: 0 SEPARATOR_HEIGHT;
119 to_y: "elm.text.contact-and-type";
123 offset: 0 -SEPARATOR_HEIGHT;
134 state: "default" 0.0;
136 min: WIDTH ACTION_HEIGHT;
137 max: WIDTH 99999; /* keep it tight centered */
140 offset: 0 -ACTION_HEIGHT;
145 #define SEPARATOR(id, rely, offy, relto) \
147 name: "separator.primary."##id; \
151 state: "default" 0.0; \
152 color: 255 255 255 255; \
153 color_class: "primary"; \
155 relative: 0.0 rely; \
160 relative: 1.0 rely; \
161 offset: -1 (offy + SEPARATOR_HEIGHT / 2); \
167 name: "separator.bg."##id; \
171 state: "default" 0.0; \
172 color: 255 255 255 255; \
175 relative: 0.0 rely; \
176 offset: 0 (offy + SEPARATOR_HEIGHT / 2); \
180 relative: 1.0 rely; \
181 offset: -1 (offy + SEPARATOR_HEIGHT); \
187 SEPARATOR("number", 1.0, 0, "elm.text.contact-and-type");
188 SEPARATOR("actions", 0.0, -SEPARATOR_HEIGHT, "bg.actions");
192 #define BUTTON(id, label, sub, ccls, r1, r2) \
194 name: "button."##id; \
198 state: "default" 0.0; \
199 color: 255 255 255 0; \
200 color_class: "action"; \
212 state: "pressed" 0.0; \
213 inherit: "default" 0.0; \
214 color: 255 255 255 255; \
218 name: "label."##id; \
222 state: "default" 0.0; \
223 color: 255 255 255 255; \
225 rel1.to: "button."##id; \
238 state: "pressed" 0.0; \
239 inherit: "default" 0.0; \
240 color: 16 16 16 255; \
249 state: "default" 0.0; \
250 color: 255 255 255 255; \
251 color_class: "secondary"; \
257 rel2.to: "button."##id; \
266 state: "pressed" 0.0; \
267 inherit: "default" 0.0; \
268 color: 16 16 16 255; \
274 signal: "mouse,up,1"; \
275 source: "button."##id; \
276 action: SIGNAL_EMIT "released,"##id "keypad"; \
277 after: "show_up_"##id; \
278 api: id"_released" id" was released"; \
281 name: "show_up_"##id; \
282 action: STATE_SET "default" 0.0; \
283 transition: DECELERATE 0.1; \
284 target: "button."##id; \
285 target: "label."##id; \
286 target: "sub."##id; \
289 signal: "mouse,down,1"; \
290 source: "button."##id; \
291 after: "show_down_"##id; \
292 action: SIGNAL_EMIT "pressed,"##id "keypad"; \
293 api: id"_pressed" id" was pressed"; \
296 name: "show_down_"##id; \
297 action: STATE_SET "pressed" 0.0; \
298 transition: ACCELERATE 0.3; \
299 target: "button."##id; \
300 target: "label."##id; \
301 target: "sub."##id; \
304 signal: "mouse,clicked,1"; \
305 source: "button."##id; \
306 action: SIGNAL_EMIT "clicked,"##id "keypad"; \
307 api: id"_clicked" id" was clicked"; \
310 signal: "mouse,down,1,double"; \
311 source: "button."##id; \
313 emit("pressed,"##id, "keypad"); \
317 signal: "mouse,down,1,triple"; \
318 source: "button."##id; \
320 emit("pressed,"##id, "keypad"); \
325 BUTTON("1", "1", "", "action", 0.000 0.0, 0.333 0.25);
326 BUTTON("2", "2", "ABC", "action", 0.333 0.0, 0.666 0.25);
327 BUTTON("3", "3", "DEF", "action", 0.666 0.0, 1.000 0.25);
329 BUTTON("4", "4", "GHI", "action", 0.000 0.25, 0.333 0.50);
330 BUTTON("5", "5", "JKL", "action", 0.333 0.25, 0.666 0.50);
331 BUTTON("6", "6", "MNO", "action", 0.666 0.25, 1.000 0.50);
333 BUTTON("7", "7", "PQRS", "action", 0.000 0.50, 0.333 0.75);
334 BUTTON("8", "8", "TUV", "action", 0.333 0.50, 0.666 0.75);
335 BUTTON("9", "9", "WXYZ", "action", 0.666 0.50, 1.000 0.75);
337 BUTTON("star", "*", "", "secondary", 0.000 0.75, 0.333 1.00);
338 BUTTON("0", "0", "+", "action", 0.333 0.75, 0.666 1.00);
339 BUTTON("hash", "#", "", "secondary", 0.666 0.75, 1.000 1.00);
343 #define ACTION_BUTTON(id, img, x0, x1) \
345 name: "clipper."##id; \
348 state: "default" 0.0; \
349 color: 255 255 255 255; \
352 state: "disabled" 0.0; \
353 inherit: "default" 0.0; \
354 color_class: "disabled"; \
358 name: "button."##id; \
361 clip_to: "clipper."##id; \
363 state: "default" 0.0; \
364 color: 255 255 255 0; \
365 color_class: "action"; \
366 min: ACTION_WIDTH ACTION_HEIGHT; \
367 max: ACTION_WIDTH ACTION_HEIGHT; \
380 state: "pressed" 0.0; \
381 inherit: "default" 0.0; \
382 color: 255 255 255 255; \
386 name: "button.ico."##id; \
389 clip_to: "clipper."##id; \
391 state: "default" 0.0; \
392 color: 255 255 255 255; \
393 color_class: "action"; \
394 min: ACTION_HEIGHT ACTION_HEIGHT; \
395 max: ACTION_HEIGHT ACTION_HEIGHT; \
397 rel1.to: "button."##id; \
398 rel2.to: "button."##id; \
399 image.normal: "ico_"##img".png"; \
402 state: "pressed" 0.0; \
403 inherit: "default" 0.0; \
408 name: "blocker."##id; \
411 clip_to: "clipper."##id; \
413 state: "default" 0.0; \
416 rel1.to: "button."##id; \
417 rel2.to: "button."##id; \
420 state: "disabled" 0.0; \
421 inherit: "default" 0.0; \
427 signal: "mouse,up,1"; \
428 source: "button."##id; \
429 action: SIGNAL_EMIT "released,"##id "keypad"; \
430 after: "show_up_"##id; \
431 api: id"_released" id" was released"; \
434 name: "show_up_"##id; \
435 action: STATE_SET "default" 0.0; \
436 transition: DECELERATE 0.1; \
437 target: "button."##id; \
438 target: "button.ico."##id; \
441 signal: "mouse,down,1"; \
442 source: "button."##id; \
443 after: "show_down_"##id; \
444 action: SIGNAL_EMIT "pressed,"##id "keypad"; \
445 api: id"_pressed" id" was pressed"; \
448 name: "show_down_"##id; \
449 action: STATE_SET "pressed" 0.0; \
450 transition: ACCELERATE 0.1; \
451 target: "button."##id; \
452 target: "button.ico."##id; \
455 signal: "mouse,clicked,1"; \
456 source: "button."##id; \
457 action: SIGNAL_EMIT "clicked,"##id "keypad"; \
458 api: id"_clicked" id" was clicked"; \
461 signal: "disable,"##id; \
463 action: STATE_SET "disabled" 0.0; \
464 target: "blocker."##id; \
465 target: "clipper."##id; \
466 api: id"_disable" "disable "##id; \
469 signal: "enable,"##id; \
471 action: STATE_SET "default" 0.0; \
472 target: "blocker."##id; \
473 target: "clipper."##id; \
474 api: id"_enable" "enable "##id; \
478 ACTION_BUTTON("save", "add_contact", 0.000000000, 0.333333333);
479 ACTION_BUTTON("call", "call", 0.333333333, 0.666666666);
480 ACTION_BUTTON("backspace", "backspace", 0.666666666, 1.000000000);
486 signal: "show,contact";
488 action: STATE_SET "show" 0.0;
489 target: "elm.text.contact-and-type";
493 signal: "hide,contact";
495 action: STATE_SET "default" 0.0;
496 target: "elm.text.contact-and-type";