2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org/license/
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #define __TMR_SETTING_C__
20 #include "timer_setting.h"
21 #include "timer_utils.h"
22 /**********************************************************************
23 ******************Local function declear, extern function declear*************************************
24 ***********************************************************************/
26 static void _timer_view_setting_update_time(void *data);
27 static int _timer_view_setting_btn_set(setting_view * view);
29 static int _timer_view_setting_key_num_cb(struct appdata *ad, char key);
30 static int _timer_view_setting_key_plu_cb(struct appdata *ad);
32 static int _timer_view_setting_create(void *data);
33 static int _timer_view_setting_destroy(void *data);
34 static int _timer_view_setting_update(void *data);
35 static int _timer_view_setting_cleanup(void *data);
37 static int _timer_view_setting_create_layout(void *data);
38 static int _timer_view_setting_update_layout(void *data);
39 /**********************************************************************
40 ******************Global val , static global val*************************************
41 ***********************************************************************/
43 static int first_focus; // 1: for EINA_TRUE, it is first focus; 0: for EINA_FALSE, it is not first focus.
45 clk_view timer_view_setting = {
46 .create = _timer_view_setting_create,
47 .destroy = _timer_view_setting_destroy,
48 .update = _timer_view_setting_update,
49 .cleanup = _timer_view_setting_cleanup,
50 .is_create = EINA_FALSE,
51 .layer = MAX_CLK_FWK_VIEW_LAYER,
54 static Edje_Color_Class g_color_class_btn_hl = {
55 .name = STRING_TIMER_SETTING_BTN_TXT_COLOR,
56 .r = 249,.g = 249,.b = 249,.a = 255,
57 .r2 = 0,.g2 = 0,.b2 = 0,.a2 = 102,
58 .r3 = 0,.g3 = 0,.b3 = 0,.a3 = 0,
61 /**********************************************************************
62 ******************Local function ref*************************************
63 ***********************************************************************/
66 * Debug function: to reset time to the value setted last time.
67 * This function requires data as parameters
69 * _timer_view_setting_update_time()
70 * @param[in] data Pointer to user data, which contains the data of application
74 static void _timer_view_setting_update_time(void *data)
76 retm_if(!data, "data null");
77 struct appdata *ad = (struct appdata *)data;
78 setting_view *view = ad->view_setting;
79 retm_if(!view, "view null");
82 ad->entry_number = TIMER_FOCUS_MIN;
83 nErr = timer_vconf_load_start_time(ad);
84 if (nErr != SUCCESS) {
86 vconf_set_int(VCONF_TIMER_START_TIME, 100);
88 timer_vconf_load_focus_id(data);
90 char time_str[30] = { 0 };
91 switch (ad->entry_number) {
92 case TIMER_FOCUS_HOUR:
93 edje_object_signal_emit(_EDJ(view->eo_content),
94 STRING_TIMER_MOURSE_CLICKED_1,
95 STRING_TIMER_TIME_RECT_H);
96 snprintf(time_str, sizeof(time_str), "%c", ad->chour[0]);
97 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_H1);
98 snprintf(time_str, sizeof(time_str), "%c", ad->chour[1]);
99 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_H2);
100 snprintf(time_str, sizeof(time_str), "%c.unfocused", ad->cminute[0]);
101 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_M1);
102 snprintf(time_str, sizeof(time_str), "%c.unfocused", ad->cminute[1]);
103 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_M2);
104 snprintf(time_str, sizeof(time_str), "%c.unfocused", ad->csecond[0]);
105 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_S1);
106 snprintf(time_str, sizeof(time_str), "%c.unfocused", ad->csecond[1]);
107 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_S2);
110 case TIMER_FOCUS_MIN:
111 edje_object_signal_emit(_EDJ(view->eo_content),
112 STRING_TIMER_MOURSE_CLICKED_1,
113 STRING_TIMER_TIME_RECT_M);
114 snprintf(time_str, sizeof(time_str), "%c.unfocused", ad->chour[0]);
115 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_H1);
116 snprintf(time_str, sizeof(time_str), "%c.unfocused", ad->chour[1]);
117 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_H2);
118 snprintf(time_str, sizeof(time_str), "%c", ad->cminute[0]);
119 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_M1);
120 snprintf(time_str, sizeof(time_str), "%c", ad->cminute[1]);
121 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_M2);
122 snprintf(time_str, sizeof(time_str), "%c.unfocused", ad->csecond[0]);
123 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_S1);
124 snprintf(time_str, sizeof(time_str), "%c.unfocused", ad->csecond[1]);
125 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_S2);
128 case TIMER_FOCUS_SEC:
129 edje_object_signal_emit(_EDJ(view->eo_content),
130 STRING_TIMER_MOURSE_CLICKED_1,
131 STRING_TIMER_TIME_RECT_S);
132 snprintf(time_str, sizeof(time_str), "%c.unfocused", ad->chour[0]);
133 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_H1);
134 snprintf(time_str, sizeof(time_str), "%c.unfocused", ad->chour[1]);
135 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_H2);
136 snprintf(time_str, sizeof(time_str), "%c.unfocused", ad->cminute[0]);
137 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_M1);
138 snprintf(time_str, sizeof(time_str), "%c.unfocused", ad->cminute[1]);
139 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_M2);
140 snprintf(time_str, sizeof(time_str), "%c", ad->csecond[0]);
141 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_S1);
142 snprintf(time_str, sizeof(time_str), "%c", ad->csecond[1]);
143 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_S2);
152 static int _timer_view_setting_btn_set(setting_view * view)
154 retvm_if(NULL_CHECK(view), FAILED, "view null");
155 edje_object_part_text_set(_EDJ(view->eo_btn), STRING_TIMER_TXT,
156 STRING_TIMER_IDS_TMR_SK_START_);
158 vconf_get_int(VCONF_TIMER_START_TIME, &start_time);
159 if (IS_EQUAL(0, start_time)) {
160 edje_object_signal_emit(_EDJ(view->eo_btn), STRING_TIMER_HIDE,
162 edje_object_signal_emit(_EDJ(view->eo_btn), STRING_TIMER_DIM,
164 edje_object_color_class_set(_EDJ(view->eo_btn),
165 STRING_TIMER_SETTING_BTN_TXT_COLOR,
166 255, 255, 255, 255, 0, 0, 0, 102, 0, 0,
169 edje_object_signal_emit(_EDJ(view->eo_btn), STRING_TIMER_SHOW,
171 edje_object_signal_emit(_EDJ(view->eo_btn), STRING_TIMER_NORMAL,
173 edje_object_color_class_set(_EDJ(view->eo_btn),
174 STRING_TIMER_SETTING_BTN_TXT_COLOR,
175 255, 255, 255, 255, 0, 0, 0, 102, 0,
182 * Debug function: to handle digit key click event for input digits
183 * when click a digit in keypad, this callback will be called
184 * This function requires data, obj, emission, source as parameters
186 * _timer_view_setting_key_num_cb()
187 * @param[in] ad Pointer to struct appdata
189 * @return int return SUCCESS when success, or return FAILED if failed
191 static int _timer_view_setting_key_num_cb(struct appdata *ad, char key)
193 int val_0 = 0, val_1 = 0, val_src = 0; // to define variables for tens, units of last setting for operating unit, and val_src is for the value on current pressed key
197 setting_view *view = ad->view_setting;
201 char time_str[6] = { 0 };
202 switch (ad->entry_number) {
203 case TIMER_FOCUS_HOUR:
204 val_0 = ad->chour[0] - '0'; // to get digit on tens of current unit of time
205 val_1 = ad->chour[1] - '0'; // to get digit on units of current unit of time
206 val_src = key - '0'; // to get the digit on current pressed key
208 if (first_focus == 1) { // to confirm whether this is the first operation on this unit of time
209 ad->chour[0] = '0'; // to set tens to 0 if it is the first operation.
210 ad->chour[1] = key; // to set units to the digit on current digit key
211 first_focus = 0; // to clear first operation flag
212 } else { // It is not the first operation on specified unit
213 if (val_0 == 0) { // condition that tens is zero
214 // the units value of last setting is 0, 1, because hour cannot larger than 12.
217 && ((val_src == 0) || (val_src == 1)
218 || (val_src == 2)))) {
219 ad->chour[0] = ad->chour[1]; // to move units to tens
220 ad->chour[1] = key; // set units with the digit on current pressed key
221 } else if ((val_1 > 1) || ((val_1 == 1) && (val_src > 2))) { // set hour 12 if hour is larger than 12.
222 ad->chour[0] = '1'; // to set tens of hour
223 ad->chour[1] = '2'; // to set units of hour
225 } else { // current input is even times
226 ad->chour[0] = '0'; // to set tens 0
227 ad->chour[1] = key; // to set units with the digit on current pressed key
232 // to update hour unit of time with new value
233 snprintf(time_str, sizeof(time_str), "%c", ad->chour[0]);
234 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_H1);
235 snprintf(time_str, sizeof(time_str), "%c", ad->chour[1]);
236 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_H2);
239 case TIMER_FOCUS_MIN: //m
240 // input digit to minute unit
241 val_0 = ad->cminute[0] - '0'; // to get digit on tens of current unit of time
242 val_1 = ad->cminute[1] - '0'; // to get digit on units of current unit of time
244 if (first_focus == 1) { // to confirm whether this is the first operation on this unit of time
245 ad->cminute[0] = '0'; // to set tens to 0 if it is the first operation.
246 ad->cminute[1] = key; // to set units to the digit on current digit key
247 first_focus = 0; // to clear first operation flag
248 } else { // It is not the first operation on specified unit
249 if (val_0 == 0) { // condition that tens is zero
250 // the units value of last setting is 0, 1, 2, 3, 4, 5, because minute cannot larger than 59, so the tens cannot larger than 5.
251 if ((val_1 == 0) || (val_1 == 1) || (val_1 == 2)
252 || (val_1 == 3) || (val_1 == 4)
254 ad->cminute[0] = ad->cminute[1]; // to move units to tens
255 ad->cminute[1] = key; // set units with the digit on current pressed key
256 } else { // set minute 59 if minute is larger than 59.
257 ad->cminute[0] = '5'; // to set tens of minute
258 ad->cminute[1] = '9'; // to set units of minute
260 } else { // current input is even times
261 ad->cminute[0] = '0'; // to set tens 0
262 ad->cminute[1] = key; // to set units with the digit on current pressed key
267 // to update minute unit of time with new value
268 snprintf(time_str, sizeof(time_str), "%c", ad->cminute[0]);
269 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_M1);
270 snprintf(time_str, sizeof(time_str), "%c", ad->cminute[1]);
271 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_M2);
274 case TIMER_FOCUS_SEC: //s1
275 // input digit to minute unit
276 val_0 = ad->csecond[0] - '0'; // to get digit on tens of current unit of time
277 val_1 = ad->csecond[1] - '0'; // to get digit on units of current unit of time
279 if (first_focus == 1) { // to confirm whether this is the first operation on this unit of time
280 ad->csecond[0] = '0'; // to set tens to 0 if it is the first operation.
281 ad->csecond[1] = key; // to set units to the digit on current digit key
282 first_focus = 0; // to clear first operation flag
283 } else { // It is not the first operation on specified unit
284 if (val_0 == 0) { // condition that tens is zero
285 // the units value of last setting is 0, 1, 2, 3, 4, 5, because second cannot larger than 59, so the tens cannot larger than 5.
286 if ((val_1 == 0) || (val_1 == 1) || (val_1 == 2)
287 || (val_1 == 3) || (val_1 == 4)
289 ad->csecond[0] = ad->csecond[1];
290 ad->csecond[1] = key;
291 } else { // set minute 59 if second is larger than 59.
292 ad->csecond[0] = '5'; // to set tens of minute
293 ad->csecond[1] = '9'; // to set units of minute
295 } else { // current input is even times
296 ad->csecond[0] = '0'; // to set tens 0
297 ad->csecond[1] = key; // to set units with the digit on current pressed key
301 // to update second unit of time with new value
302 snprintf(time_str, sizeof(time_str), "%c", ad->csecond[0]);
303 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_S1);
304 snprintf(time_str, sizeof(time_str), "%c", ad->csecond[1]);
305 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_S2);
309 CLK_ERR("no time entry selected\n"); // to print error information
312 timer_vconf_set_start_time(ad); // to save the time setting
314 _timer_view_setting_btn_set(view);
319 static int _timer_view_setting_key_plu_cb(struct appdata *ad)
324 setting_view *view = ad->view_setting;
328 char time_str[6] = { 0 };
329 switch (ad->entry_number) { // to start a switch loop for implementing the logic of different units of time
330 case TIMER_FOCUS_HOUR: //h
333 // to update hour with new value.
334 snprintf(time_str, sizeof(time_str), "%c", ad->chour[0]);
335 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_H1);
336 snprintf(time_str, sizeof(time_str), "%c", ad->chour[1]);
337 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_H2);
340 case TIMER_FOCUS_MIN: //m
341 ad->cminute[0] = '0';
342 ad->cminute[1] = '0';
343 // to update minute with new value
344 snprintf(time_str, sizeof(time_str), "%c", ad->cminute[0]);
345 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_M1);
346 snprintf(time_str, sizeof(time_str), "%c", ad->cminute[1]);
347 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_M2);
350 case TIMER_FOCUS_SEC: //s
351 ad->csecond[0] = '0';
352 ad->csecond[1] = '0';
353 // to update second with new value
354 snprintf(time_str, sizeof(time_str), "%c", ad->csecond[0]);
355 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_S1);
356 snprintf(time_str, sizeof(time_str), "%c", ad->csecond[1]);
357 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_S2);
361 CLK_ERR("no time entry selected\n"); // to print error information
364 timer_vconf_set_start_time(ad); // to save the time setting
366 _timer_view_setting_btn_set(view);
371 static int _timer_view_setting_create(void *data)
374 struct appdata *ad = NULL;
376 ad = (struct appdata *)data;
378 ad->page = TIMER_VIEW_PAGE_SETTING;
379 ret = _timer_view_setting_create_layout(data);
380 ret |= _timer_view_setting_update_layout(data);
382 timer_show_view(ad, EINA_TRUE);
383 timer_view_setting.is_create = EINA_TRUE;
384 timer_view_setting.layer = 1;
390 static int __timer_view_setting_destroy_cb(void *data)
392 struct appdata *ad = NULL;
393 setting_view *view = NULL;
394 ad = (struct appdata *)data;
395 view = ad->view_setting;
397 EVAS_OBJECT_DELIF(view->eo_content);
398 // EVAS_OBJECT_DELIF(view->eo_content_ly);
399 timer_view_setting.is_create = EINA_FALSE;
404 static int _timer_view_setting_destroy(void *data)
408 __timer_view_setting_destroy_cb(data);
414 static int _timer_view_setting_update(void *data)
417 struct appdata *ad = NULL;
419 ad = (struct appdata *)data;
421 ad->page = TIMER_VIEW_PAGE_SETTING;
422 ret = _timer_view_setting_update_layout(data);
423 timer_show_view(ad, EINA_TRUE);
429 static int _timer_view_setting_cleanup(void *data)
431 return _timer_view_setting_destroy(data);
435 * Debug function: to create and show setting view
436 * This function requires data as parameters
438 * _timer_view_setting_create_layout()
439 * @param[in] data Pointer to user data, which contains the data of application
441 * @return int, which indicates whether the operation is successful.
443 static int _timer_view_setting_create_layout(void *data)
445 retvm_if(!data, FAILED, "data null");
446 struct appdata *ad = (struct appdata *)data;
447 setting_view *view = ad->view_setting;
448 retvm_if(!view, FAILED, "view null");
450 view->eo_parent = ad->parent;
451 view->eo_layout = ad->layout;
452 view->eo_content = load_edj(view->eo_layout, EDJ_NAME, CONTENT_SETTING);
453 // elm_object_part_content_set(ad->eo_effect, "elm.swallow.center", view->eo_content);
456 clk_widget_create_button(view->eo_content, EDJ_NAME,
457 STRING_TIMER_SETTING_BTN,
458 &g_color_class_btn_hl,
459 timer_setting_btn_cb, ad);
460 elm_object_part_content_set(view->eo_content, STRING_TIMER_SW_BTN,
463 edje_object_part_text_set(_EDJ(view->eo_content),
464 STRING_TIMER_TIME_LABEL_HOUR,
465 STRING_TIMER_IDS_TMR_BODY_HOUR_);
466 edje_object_part_text_set(_EDJ(view->eo_content),
467 STRING_TIMER_TIME_LABEL_MINUTE,
468 STRING_TIMER_IDS_TMR_BODY_MIN_);
469 edje_object_part_text_set(_EDJ(view->eo_content),
470 STRING_TIMER_TIME_LABEL_SECOND,
471 STRING_TIMER_IDS_TMR_BODY_SEC_);
473 edje_object_signal_callback_add(_EDJ(view->eo_content),
474 STRING_TIMER_CLICK_DIGIT, "*",
475 timer_digit_click_cb, ad);
476 edje_object_signal_callback_add(_EDJ(view->eo_content),
477 STRING_TIMER_CLICK_TIME, "*",
478 timer_time_click_cb, ad);
485 static int _timer_view_setting_update_layout(void *data)
487 retvm_if(!data, FAILED, "data null");
488 struct appdata *ad = (struct appdata *)data;
489 setting_view *view = ad->view_setting;
490 retvm_if(!view, FAILED, "view null");
491 edje_object_part_text_set(_EDJ(view->eo_content),
492 STRING_TIMER_TIME_LABEL_HOUR,
493 STRING_TIMER_IDS_TMR_BODY_HOUR_);
494 edje_object_part_text_set(_EDJ(view->eo_content),
495 STRING_TIMER_TIME_LABEL_MINUTE,
496 STRING_TIMER_IDS_TMR_BODY_MIN_);
497 edje_object_part_text_set(_EDJ(view->eo_content),
498 STRING_TIMER_TIME_LABEL_SECOND,
499 STRING_TIMER_IDS_TMR_BODY_SEC_);
501 _timer_view_setting_update_time(ad);
502 _timer_view_setting_btn_set(view);
506 /**********************************************************************
507 ******************Global function ref*************************************
508 ***********************************************************************/
511 * Debug function: to handle digit key click event for input digits
512 * when click a digit in keypad, this callback will be called
513 * This function requires data, obj, emission, source as parameters
515 * timer_digit_click_cb()
516 * @param[in] data Pointer to user data, which contains the data of application
517 * @param[in] obj Pointer to button object
518 * @param[in] emission Pointer to signal
519 * @param[in] source Pointer to the source from which signal is emitted
523 void timer_digit_click_cb(void *data, Evas_Object * obj, const char *emission,
526 struct appdata *ad = (struct appdata *)data;
527 if (!source || !ad) {
530 char key = source[0];
531 if (TIMER_KEY_IS_NUM(key)) {
532 _timer_view_setting_key_num_cb(ad, key);
533 } else if (TIMER_KEY_IS_PLUS(key)) {
534 _timer_view_setting_key_plu_cb(ad);
536 CLK_ERR("key=%d, not support", key);
539 feedback_play(FEEDBACK_PATTERN_SIP);
543 * Debug function: to handle logic of focus on which unit of time
544 * It is callback function of signal "click_time"
545 * This function requires data, obj, emission, source as parameters
547 * timer_time_click_cb()
548 * @param[in] data Pointer to user data, which contains the data of application
549 * @param[in] obj Pointer to button object
550 * @param[in] emission Pointer to signal
551 * @param[in] source Pointer to the source from which signal is emitted
555 void timer_time_click_cb(void *data, Evas_Object * obj, const char *emission,
558 struct appdata *ad = (struct appdata *)data;
560 if (IS_STR_EQUAL("h", source) && (ad->entry_number != TIMER_FOCUS_HOUR)) {
561 ECORE_TIMER_DELIF(ad->tap_timer);
562 ad->entry_number = TIMER_FOCUS_HOUR;
564 } else if (IS_STR_EQUAL("m", source)
565 && (ad->entry_number != TIMER_FOCUS_MIN)) {
566 ECORE_TIMER_DELIF(ad->tap_timer);
567 ad->entry_number = TIMER_FOCUS_MIN;
569 } else if (IS_STR_EQUAL("s", source)
570 && (ad->entry_number != TIMER_FOCUS_SEC)) {
571 ECORE_TIMER_DELIF(ad->tap_timer);
572 ad->entry_number = TIMER_FOCUS_SEC;
575 CLK_ERR("invalid source\n");
578 timer_vconf_set_focus_id(ad);
579 char time_str[30] = { 0 };
580 setting_view *view = ad->view_setting;
581 retm_if(!view, "view null");
582 switch (ad->entry_number) {
583 case TIMER_FOCUS_HOUR:
584 edje_object_signal_emit(_EDJ(view->eo_content),
585 STRING_TIMER_MOURSE_CLICKED_1,
586 STRING_TIMER_TIME_RECT_H);
587 snprintf(time_str, sizeof(time_str), "%c", ad->chour[0]);
588 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_H1);
589 snprintf(time_str, sizeof(time_str), "%c", ad->chour[1]);
590 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_H2);
591 snprintf(time_str, sizeof(time_str), "%c.unfocused", ad->cminute[0]);
592 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_M1);
593 snprintf(time_str, sizeof(time_str), "%c.unfocused", ad->cminute[1]);
594 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_M2);
595 snprintf(time_str, sizeof(time_str), "%c.unfocused", ad->csecond[0]);
596 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_S1);
597 snprintf(time_str, sizeof(time_str), "%c.unfocused", ad->csecond[1]);
598 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_S2);
601 case TIMER_FOCUS_MIN:
602 edje_object_signal_emit(_EDJ(view->eo_content),
603 STRING_TIMER_MOURSE_CLICKED_1,
604 STRING_TIMER_TIME_RECT_M);
605 snprintf(time_str, sizeof(time_str), "%c.unfocused", ad->chour[0]);
606 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_H1);
607 snprintf(time_str, sizeof(time_str), "%c.unfocused", ad->chour[1]);
608 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_H2);
609 snprintf(time_str, sizeof(time_str), "%c", ad->cminute[0]);
610 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_M1);
611 snprintf(time_str, sizeof(time_str), "%c", ad->cminute[1]);
612 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_M2);
613 snprintf(time_str, sizeof(time_str), "%c.unfocused", ad->csecond[0]);
614 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_S1);
615 snprintf(time_str, sizeof(time_str), "%c.unfocused", ad->csecond[1]);
616 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_S2);
619 case TIMER_FOCUS_SEC:
620 edje_object_signal_emit(_EDJ(view->eo_content),
621 STRING_TIMER_MOURSE_CLICKED_1,
622 STRING_TIMER_TIME_RECT_S);
623 snprintf(time_str, sizeof(time_str), "%c.unfocused", ad->chour[0]);
624 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_H1);
625 snprintf(time_str, sizeof(time_str), "%c.unfocused", ad->chour[1]);
626 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_H2);
627 snprintf(time_str, sizeof(time_str), "%c.unfocused", ad->cminute[0]);
628 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_M1);
629 snprintf(time_str, sizeof(time_str), "%c.unfocused", ad->cminute[1]);
630 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_M2);
631 snprintf(time_str, sizeof(time_str), "%c", ad->csecond[0]);
632 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_S1);
633 snprintf(time_str, sizeof(time_str), "%c", ad->csecond[1]);
634 edje_object_signal_emit(_EDJ(view->eo_content), time_str, STRING_TIMER_TIME_IMG_S2);
643 * Debug function: to handle button clicking logic
644 * This function requires data, obj, emission, source as parameters
646 * timer_softkey_tap_cb()
647 * @param[in] data Pointer to user data, which contains the data of application
648 * @param[in] obj Pointer to button object
649 * @param[in] emission Pointer to signal
650 * @param[in] source Pointer to the source from which signal is emitted
654 void timer_setting_btn_cb(void *data, Evas_Object * obj, const char *emission,
657 retm_if(!data, "data null");
658 struct appdata *ad = (struct appdata *)data;
659 timer_utils_time_get(ad);
660 if (EINA_FALSE == is_timer_utils_time_validate(ad)) {
663 int nErr = timer_utils_register_alarm(ad);
664 if (SUCCESS != nErr) {
665 timer_widget_create_popup(ad->win_main, nErr);
668 timer_utils_view_change(ad);
671 void timer_view_setting_btn_cb_back(void *data, Evas_Object * obj,
675 Evas_Object *win = (Evas_Object *) data;