tizen 2.3.1 release
[apps/home/settings.git] / setting-phone / src / setting-phone-ticker-notification-details.c
1 /*
2  * setting
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
5  *
6  * Contact: MyoungJune Park <mj2004.park@samsung.com>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21 #include <setting-phone-ticker-notification-details.h>
22 #include <ail.h>
23 #include <badge.h>
24 /*#include <badge_error.h> */
25
26 #define NOTIFICATION_STR "IDS_ST_BODY_NOTIFICATION"
27 #define DISPLAY_CONTENT_STR "IDS_ST_BODY_DISPLAY_CONTENTS"
28 #define BADGE_STR "IDS_COM_BODY_BADGE_ABB"
29
30 #define STR_NOTIFICATION_DETAILS_HELP3 "IDS_ST_BODY_IF_YOU_DONT_WANT_TO_SEE_A_NUMBER_APPEAR_ON_THE_APP_ICON_FOR_EACH_NEW_EVENT_DISABLE_BADGE"
31
32 #define STR_NOTIFICATION_DETAILS_NOTI_HELP "You can turn off notification of this application."
33 #define STR_NOTIFICATION_DETAILS_DISPLAY_HELP "If you don't want to see contents in notification popup, turn off the display contents."
34 #define STR_NOTIFICATION_DETAILS_BADGE_HELP "If you don't want to display badge on app icon with a new event number, turn off the Badge."
35
36 /*--------------- */
37 static char *pkg_list[] = {"org.tizen.email", "org.tizen.message", "xnq5eh9vop.ChatON"};
38 /*--------------- */
39
40 static int setting_phone_ticker_notification_details_create(void *cb);
41 static int setting_phone_ticker_notification_details_destroy(void *cb);
42 static int setting_phone_ticker_notification_details_update(void *cb);
43 static int setting_phone_ticker_notification_details_cleanup(void *cb);
44
45 static void setting_phone_noti_details_chk_btn_cb(void *data, Evas_Object *obj, void *event_info);
46 static void setting_phone_noti_details_mouse_up_Gendial_list_cb(void *data, Evas_Object *obj, void *event_info);
47
48 static int __status_get_notification_str(char *title);
49 static int __status_get_sound_str(char *title);
50 static int __status_get_display_contents_str(char *title);
51 static int __status_get_badge_str(char *title);
52 static void __status_set_display_contents_str(void *data);
53
54 setting_view setting_view_phone_ticker_notification_details = {
55         .create = setting_phone_ticker_notification_details_create,
56         .destroy = setting_phone_ticker_notification_details_destroy,
57         .update = setting_phone_ticker_notification_details_update,
58         .cleanup = setting_phone_ticker_notification_details_cleanup,
59 };
60
61 /* ***************************************************
62  *
63  *basic func
64  *
65  ***************************************************/
66 char *g_sel_string = NULL;
67 SettingPhoneUG *g_phone_ad = NULL;
68
69 static int setting_phone_ticker_notification_details_create(void *cb)
70 {
71         SETTING_TRACE_BEGIN;
72         /* error check */
73         retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
74         SettingPhoneUG *ad = (SettingPhoneUG *) cb;
75         g_phone_ad = ad;
76
77         Evas_Object *scroller;
78
79         /* scroller is a genlist */
80         const char *title = NULL;
81         if (0 == safeStrCmp(ad->sel_string, "IDS_COM_BODY_INSTANT_MESSENGER")) {
82                 title = "IDS_COM_BODY_INSTANT_MESSENGER";
83         } else if (0 == safeStrCmp(ad->sel_string, "IDS_ST_BODY_MESSAGE")) {
84                 title = "IDS_ST_BODY_MESSAGE";
85         } else if (0 == safeStrCmp(ad->sel_string, "IDS_ST_BODY_EMAIL")) {
86                 title = "IDS_ST_BODY_EMAIL";
87         } else {
88                 title = ad->sel_string;
89         }
90         SETTING_TRACE("title:%s", title);
91         setting_push_layout_navi_bar_genlist(ad->win_main_layout, ad->win_get,
92                                              _(title),
93                                              dgettext("sys_string", "IDS_COM_BODY_BACK"),
94                                              NULL,
95                                              setting_phone_noti_details_click_softkey_back_cb,
96                                              NULL, ad, &scroller,
97                                              ad->navi_bar);
98
99         Elm_Object_Item *item;
100
101         g_sel_string = ad->sel_string;
102
103         /* [UI] Separator */
104         item =
105             elm_genlist_item_append(scroller, &itc_seperator, NULL, NULL,
106                                     ELM_GENLIST_ITEM_NONE, NULL, NULL);
107         elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
108
109         /* [UI] Notification */
110         int noti_val = __status_get_notification_str(ad->sel_string);
111         ad->data_details_notification =
112             setting_create_Gendial_field_def(scroller, &(ad->itc_1text_1icon),
113                                              setting_phone_noti_details_mouse_up_Gendial_list_cb,
114                                              ad, SWALLOW_Type_1TOGGLE, NULL,
115                                              NULL, noti_val,
116                                              NOTIFICATION_STR, NULL,
117                                              setting_phone_noti_details_chk_btn_cb);
118         if (ad->data_details_notification) {
119                 ad->data_details_notification->userdata = ad;
120                 ad->data_details_notification->group_style = SETTING_GROUP_STYLE_TOP;
121         } else {
122                 SETTING_TRACE_ERROR("ad->data_launch_effect is NULL");
123         }
124
125         /* [UI] Sound */
126         int sound_val = __status_get_sound_str(ad->sel_string);
127         ad->data_details_sound =
128             setting_create_Gendial_field_def(scroller, &(ad->itc_1text_1icon),
129                                              setting_phone_noti_details_mouse_up_Gendial_list_cb,
130                                              ad, SWALLOW_Type_1TOGGLE, NULL,
131                                              NULL, sound_val,
132                                              KeyStr_Sounds, NULL,
133                                              setting_phone_noti_details_chk_btn_cb);
134         if (ad->data_details_sound) {
135                 ad->data_details_sound->userdata = ad;
136                 ad->data_details_sound->group_style = SETTING_GROUP_STYLE_CENTER;
137         } else {
138                 SETTING_TRACE_ERROR("ad->data_launch_effect is NULL");
139         }
140
141         /* [UI] Display contents */
142         int display_val = __status_get_display_contents_str(ad->sel_string);
143         ad->data_details_display_content =
144             setting_create_Gendial_field_def(scroller, &(ad->itc_1text_1icon),
145                                              setting_phone_noti_details_mouse_up_Gendial_list_cb,
146                                              ad, SWALLOW_Type_1TOGGLE, NULL,
147                                              NULL, display_val,
148                                              DISPLAY_CONTENT_STR, NULL,
149                                              setting_phone_noti_details_chk_btn_cb);
150         if (ad->data_details_display_content) {
151                 ad->data_details_display_content->userdata = ad;
152                 ad->data_details_display_content->group_style = SETTING_GROUP_STYLE_CENTER;
153         } else {
154                 SETTING_TRACE_ERROR("ad->data_launch_effect is NULL");
155         }
156         /* [UI] Badge */
157         int badge_val = __status_get_badge_str(ad->sel_string);
158         ad->data_details_badge =
159             setting_create_Gendial_field_def(scroller, &(ad->itc_1text_1icon),
160                                              setting_phone_noti_details_mouse_up_Gendial_list_cb,
161                                              ad, SWALLOW_Type_1TOGGLE, NULL,
162                                              NULL, badge_val,
163                                              BADGE_STR, NULL,
164                                              setting_phone_noti_details_chk_btn_cb);
165         if (ad->data_details_badge) {
166                 ad->data_details_badge->userdata = ad;
167                 ad->data_details_badge->group_style = SETTING_GROUP_STYLE_BOTTOM;
168         } else {
169                 SETTING_TRACE_ERROR("ad->data_launch_effect is NULL");
170         }
171         setting_view_phone_ticker_notification_details.is_create = 1;
172         return SETTING_RETURN_SUCCESS;
173
174 }
175
176 static int setting_phone_ticker_notification_details_destroy(void *cb)
177 {
178         SETTING_TRACE_BEGIN;
179         /* error check */
180         retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
181
182         SettingPhoneUG *ad = (SettingPhoneUG *) cb;
183
184         elm_naviframe_item_pop(ad->navi_bar);
185         setting_view_phone_ticker_notification_details.is_create = 0;
186
187         return SETTING_RETURN_SUCCESS;
188 }
189
190 static int setting_phone_ticker_notification_details_update(void *cb)
191 {
192         SETTING_TRACE_BEGIN;
193         return SETTING_RETURN_SUCCESS;
194 }
195
196 static int setting_phone_ticker_notification_details_cleanup(void *cb)
197 {
198         SETTING_TRACE_BEGIN;
199         retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
200         setting_phone_ticker_notification_details_destroy(cb);
201         return SETTING_RETURN_SUCCESS;
202 }
203
204 /* ***************************************************
205  *
206  *general func
207  *
208  ***************************************************/
209
210 /* ***************************************************
211  *
212  *call back func
213  *
214  ***************************************************/
215
216 static void
217 setting_phone_noti_details_click_softkey_back_cb(void *data, Evas_Object *obj,
218                                                  void *event_info)
219 {
220         SETTING_TRACE_BEGIN;
221         /* error check */
222         retm_if(data == NULL, "Data parameter is NULL");
223         SettingPhoneUG *ad = (SettingPhoneUG *) data;
224
225         setting_view_change(&setting_view_phone_ticker_notification_details, &setting_view_phone_ticker_notification, ad);
226 }
227
228
229 /* -1  : failed */
230 /*  0  : off */
231 /*  1  : on */
232 static int __status_get_notification_str(char *title)
233 {
234         SETTING_TRACE_BEGIN;
235         int val = -1;
236         const char *vconf_key = NULL;
237
238         if (0 == safeStrCmp(title, "IDS_ST_BODY_MESSAGE")) {
239                 vconf_key = VCONFKEY_SETAPPL_STATE_TICKER_NOTI_MESSAGES_BOOL;
240         } else if (0 == safeStrCmp(title, "IDS_ST_BODY_EMAIL")) {
241                 vconf_key = VCONFKEY_SETAPPL_STATE_TICKER_NOTI_EMAIL_BOOL;
242         }
243         /* add new menu */
244         else if (0 == safeStrCmp(title, "IDS_COM_BODY_INSTANT_MESSENGER")) {
245                 vconf_key = VCONFKEY_SETAPPL_STATE_TICKER_NOTI_IM_BOOL;
246         } else if (0 == safeStrCmp(title, KeyStr_Twitter)) {
247                 vconf_key = VCONFKEY_SETAPPL_STATE_TICKER_NOTI_TWITTER_BOOL;
248         } else if (0 == safeStrCmp(title, KeyStr_Facebook)) {
249                 vconf_key = VCONFKEY_SETAPPL_STATE_TICKER_NOTI_FACEBOOK_BOOL;
250         }
251
252         SETTING_TRACE("vconf_key:%s", vconf_key);
253         vconf_get_bool(vconf_key, &val);
254         SETTING_TRACE_DEBUG("title : %s, value : %d", title, val);
255         return val;
256 }
257
258 static int __status_get_sound_str(char *title)
259 {
260         SETTING_TRACE_BEGIN;
261         int val = -1;
262         const char *vconf_key = NULL;
263         if (0 == safeStrCmp(title, "IDS_ST_BODY_MESSAGE")) {
264                 vconf_key = VCONFKEY_TICKER_NOTI_SOUND_MESSAGES;
265
266         } else if (0 == safeStrCmp(title, "IDS_ST_BODY_EMAIL")) {
267                 vconf_key = VCONFKEY_TICKER_NOTI_SOUND_EMAIL;
268
269         } else if (0 == safeStrCmp(title, "IDS_COM_BODY_INSTANT_MESSENGER")) {
270                 vconf_key = VCONFKEY_TICKER_NOTI_SOUND_IM;
271
272         } else if (0 == safeStrCmp(title, KeyStr_Twitter)) {
273                 /*vconf_key = VCONFKEY_TICKER_NOTI_BADGE_TWITTER; */
274
275         } else if (0 == safeStrCmp(title, KeyStr_Facebook)) {
276                 /*vconf_key = VCONFKEY_TICKER_NOTI_BADGE_FACEBOOK; */
277
278         }
279         SETTING_TRACE("vconf_key:%s", vconf_key);
280         vconf_get_bool(vconf_key, &val);
281         SETTING_TRACE_DEBUG("title : %s, value : %d", title, val);
282         return val;
283 }
284
285 /* -1  : failed */
286 /*  0  : off */
287 /*  1  : on */
288 static int __status_get_display_contents_str(char *title)
289 {
290         SETTING_TRACE_BEGIN;
291         int val = -1;
292         const char *vconf_key = NULL;
293
294         if (0 == safeStrCmp(title, "IDS_ST_BODY_MESSAGE")) {
295                 vconf_key = VCONFKEY_TICKER_NOTI_DISPLAY_CONTENT_MESSASGES;
296         } else if (0 == safeStrCmp(title, "IDS_ST_BODY_EMAIL")) {
297                 vconf_key = VCONFKEY_TICKER_NOTI_DISPLAY_CONTENT_EMAIL;
298         }
299         /* add new menu */
300         else if (0 == safeStrCmp(title, "IDS_COM_BODY_INSTANT_MESSENGER")) {
301                 vconf_key = VCONFKEY_TICKER_NOTI_DISPLAY_CONTENT_IM;
302         } else if (0 == safeStrCmp(title, KeyStr_Twitter)) {
303                 vconf_key = VCONFKEY_TICKER_NOTI_DISPLAY_CONTENT_TWITTER;
304         } else if (0 == safeStrCmp(title, KeyStr_Facebook)) {
305                 vconf_key = VCONFKEY_TICKER_NOTI_DISPLAY_CONTENT_FACEBOOK;
306         }
307
308         SETTING_TRACE("vconf_key:%s", vconf_key);
309         vconf_get_bool(vconf_key, &val);
310         SETTING_TRACE_DEBUG("title : %s, value : %d", title, val);
311         return val;
312 }
313 static int __status_get_badge_str(char *title)
314 {
315         SETTING_TRACE_BEGIN;
316         int val = -1;
317         const char *vconf_key = NULL;
318         if (0 == safeStrCmp(title, "IDS_ST_BODY_MESSAGE")) {
319                 vconf_key = VCONFKEY_TICKER_NOTI_BADGE_MESSAGES;
320         } else if (0 == safeStrCmp(title, "IDS_ST_BODY_EMAIL")) {
321                 vconf_key = VCONFKEY_TICKER_NOTI_BADGE_EMAIL;
322         }
323         /* add new menu */
324         else if (0 == safeStrCmp(title, "IDS_COM_BODY_INSTANT_MESSENGER")) {
325                 vconf_key = VCONFKEY_TICKER_NOTI_BADGE_IM;
326         } else if (0 == safeStrCmp(title, KeyStr_Twitter)) {
327                 vconf_key = VCONFKEY_TICKER_NOTI_BADGE_TWITTER;
328         } else if (0 == safeStrCmp(title, KeyStr_Facebook)) {
329                 vconf_key = VCONFKEY_TICKER_NOTI_BADGE_FACEBOOK;
330         }
331         SETTING_TRACE("vconf_key:%s", vconf_key);
332         vconf_get_bool(vconf_key, &val);
333         SETTING_TRACE_DEBUG("title : %s, value : %d", title, val);
334         return val;
335 }
336
337 static void __status_set_notification_str(void *data)
338 {
339         SETTING_TRACE_BEGIN;
340         Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *)data;
341
342         /* message update in previos page */
343         Setting_GenGroupItem_Data *item_to_update = NULL;
344
345         char *status;
346
347         if (list_item->chk_status == 1) {
348                 status = setting_gettext("IDS_COM_BODY_ON_M_STATUS");
349         } else {
350                 status = setting_gettext("IDS_COM_BODY_OFF_M_STATUS");
351         }
352
353         SETTING_TRACE("g_sel_string:%s", g_sel_string);
354         const char *vconf_key = NULL;
355
356         if (0 == safeStrCmp(g_sel_string, "IDS_ST_BODY_MESSAGE")) {
357                 vconf_key = VCONFKEY_SETAPPL_STATE_TICKER_NOTI_MESSAGES_BOOL;
358                 item_to_update = g_phone_ad->data_n_msg;
359         } else if (0 == safeStrCmp(g_sel_string, "IDS_ST_BODY_EMAIL")) {
360                 vconf_key = VCONFKEY_SETAPPL_STATE_TICKER_NOTI_EMAIL_BOOL;
361                 item_to_update = g_phone_ad->data_n_email;
362         }
363         /* add new menu */
364         else if (0 == safeStrCmp(g_sel_string, "IDS_COM_BODY_INSTANT_MESSENGER")) {
365                 vconf_key = VCONFKEY_SETAPPL_STATE_TICKER_NOTI_IM_BOOL;
366                 item_to_update = g_phone_ad->data_n_im;
367         } else if (0 == safeStrCmp(g_sel_string, KeyStr_Twitter)) {
368                 vconf_key = VCONFKEY_SETAPPL_STATE_TICKER_NOTI_TWITTER_BOOL;
369                 item_to_update = g_phone_ad->data_n_twt;
370         } else if (0 == safeStrCmp(g_sel_string, KeyStr_Facebook)) {
371                 vconf_key = VCONFKEY_SETAPPL_STATE_TICKER_NOTI_FACEBOOK_BOOL;
372                 item_to_update = g_phone_ad->data_n_fb;
373         }
374
375         SETTING_TRACE("vconf_key:%s", vconf_key);
376         int ret = vconf_set_bool(vconf_key, list_item->chk_status);
377         setting_retm_if(ret != 0, "fail to set vconf");
378
379         /* update UI */
380         if (item_to_update) {
381                 item_to_update->sub_desc = strdup(status);
382                 elm_object_item_data_set(item_to_update->item, item_to_update);
383                 elm_genlist_item_update(item_to_update->item);
384         }
385 }
386
387 static void __status_set_sound_str(void *data)
388 {
389         SETTING_TRACE_BEGIN;
390         setting_retm_if(data == NULL, "Data parameter is NULL");
391         Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *)data;
392
393         /* since the status is never used, so comment it.
394         char *status = NULL;
395
396         if (list_item->chk_status == 1) {
397                 status = setting_gettext("IDS_COM_BODY_ON_M_STATUS");
398         } else {
399                 status = setting_gettext("IDS_COM_BODY_OFF_M_STATUS");
400         }*/
401
402         SETTING_TRACE("g_sel_string:%s", g_sel_string);
403         const char *vconf_key = NULL;
404
405         if (0 == safeStrCmp(g_sel_string, "IDS_ST_BODY_MESSAGE")) {
406                 vconf_key = VCONFKEY_TICKER_NOTI_SOUND_MESSAGES;
407
408         } else if (0 == safeStrCmp(g_sel_string, "IDS_ST_BODY_EMAIL")) {
409                 vconf_key = VCONFKEY_TICKER_NOTI_SOUND_EMAIL;
410
411         } else if (0 == safeStrCmp(g_sel_string, "IDS_COM_BODY_INSTANT_MESSENGER")) {
412                 vconf_key = VCONFKEY_TICKER_NOTI_SOUND_IM;
413
414         } else if (0 == safeStrCmp(g_sel_string, KeyStr_Twitter)) {
415                 /*vconf_key = VCONFKEY_TICKER_NOTI_BADGE_TWITTER; */
416
417         } else if (0 == safeStrCmp(g_sel_string, KeyStr_Facebook)) {
418                 /*vconf_key = VCONFKEY_TICKER_NOTI_BADGE_FACEBOOK; */
419
420         }
421
422         SETTING_TRACE("vconf_key:%s", vconf_key);
423         int ret = vconf_set_bool(vconf_key, list_item->chk_status);
424         setting_retm_if(ret != 0, "fail to set vconf");
425 }
426
427 static void __status_set_display_contents_str(void *data)
428 {
429         SETTING_TRACE_BEGIN;
430
431         Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *)data;
432
433         SETTING_TRACE("g_sel_string:%s", g_sel_string);
434         const char *vconf_key = NULL;
435
436         if (0 == safeStrCmp(g_sel_string, "IDS_ST_BODY_MESSAGE")) {
437                 vconf_key = VCONFKEY_TICKER_NOTI_DISPLAY_CONTENT_MESSASGES;
438         } else if (0 == safeStrCmp(g_sel_string, "IDS_ST_BODY_EMAIL")) {
439                 vconf_key = VCONFKEY_TICKER_NOTI_DISPLAY_CONTENT_EMAIL;
440         }
441         /* add new menu */
442         else if (0 == safeStrCmp(g_sel_string, "IDS_COM_BODY_INSTANT_MESSENGER")) {
443                 vconf_key = VCONFKEY_TICKER_NOTI_DISPLAY_CONTENT_IM;
444         } else if (0 == safeStrCmp(g_sel_string, KeyStr_Twitter)) {
445                 vconf_key = VCONFKEY_TICKER_NOTI_DISPLAY_CONTENT_TWITTER;
446         } else if (0 == safeStrCmp(g_sel_string, KeyStr_Facebook)) {
447                 vconf_key = VCONFKEY_TICKER_NOTI_DISPLAY_CONTENT_FACEBOOK;
448         }
449         SETTING_TRACE("vconf_key:%s", vconf_key);
450         int ret = vconf_set_bool(vconf_key, list_item->chk_status);
451         setting_retm_if(ret != 0, "fail to set vconf");
452 }
453
454
455 static void __status_set_badge_str(void *data)
456 {
457         SETTING_TRACE_BEGIN;
458         setting_retm_if(data == NULL, "Data parameter is NULL");
459         Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *)data;
460
461         SETTING_TRACE("g_sel_string:%s", g_sel_string);
462         const char *vconf_key = NULL;
463         char *pkgname = NULL;
464         if (0 == safeStrCmp(g_sel_string, "IDS_ST_BODY_MESSAGE")) {
465                 vconf_key = VCONFKEY_TICKER_NOTI_BADGE_MESSAGES;
466                 pkgname = pkg_list[1]; /* message */
467         } else if (0 == safeStrCmp(g_sel_string, "IDS_ST_BODY_EMAIL")) {
468                 vconf_key = VCONFKEY_TICKER_NOTI_BADGE_EMAIL;
469                 pkgname = pkg_list[0]; /* email */
470         }
471         /* add new menu */
472         else if (0 == safeStrCmp(g_sel_string, "IDS_COM_BODY_INSTANT_MESSENGER")) {
473                 vconf_key = VCONFKEY_TICKER_NOTI_BADGE_IM;
474                 pkgname = pkg_list[2]; /* email */
475         }
476
477 #if 0
478         else if (0 == safeStrCmp(g_sel_string, KeyStr_Twitter)) {
479                 vconf_key = VCONFKEY_TICKER_NOTI_BADGE_TWITTER;
480         } else if (0 == safeStrCmp(g_sel_string, KeyStr_Facebook)) {
481                 vconf_key = VCONFKEY_TICKER_NOTI_BADGE_FACEBOOK;
482         }
483 #endif
484
485         SETTING_TRACE("vconf_key:%s", vconf_key);
486         int ret = vconf_set_bool(vconf_key, list_item->chk_status);
487
488         if (ret != 0) {
489                 /* error */
490         } else {
491                 /*BADGE_ERROR_NONE = 0,                 /**< Success * / */
492                 badge_error_e badge_ret = badge_set_display(pkgname, list_item->chk_status);
493                 if (badge_ret == BADGE_ERROR_NONE) {
494                         SETTING_TRACE("pkg name : %s -- badge : %d \n", pkgname, list_item->chk_status);
495                 } else {
496                         SETTING_TRACE_ERROR("badge_set_display ERROR : %d \n", badge_ret);
497                 }
498         }
499 }
500
501 /**
502  * genlist click
503  */
504 static void setting_phone_noti_details_mouse_up_Gendial_list_cb(void *data, Evas_Object *obj, void *event_info)
505 {
506         SETTING_TRACE_BEGIN;
507         /* error check */
508         setting_retm_if(data == NULL, "Data parameter is NULL");
509
510         retm_if(event_info == NULL, "Invalid argument: event info is NULL");
511         Elm_Object_Item *item = (Elm_Object_Item *) event_info;
512         elm_genlist_item_selected_set(item, 0);
513         Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) elm_object_item_data_get(item);
514
515
516         setting_update_gl_item_chk_status(list_item, !(list_item->chk_status));
517
518         if (0 == safeStrCmp(list_item->keyStr, NOTIFICATION_STR)) {
519                 __status_set_notification_str(list_item);
520         } else if (0 == safeStrCmp(list_item->keyStr, KeyStr_Sounds)) {
521                 __status_set_sound_str(list_item);
522         } else if (0 == safeStrCmp(list_item->keyStr, DISPLAY_CONTENT_STR)) {
523                 /* vconf setting by g_sel_string */
524                 __status_set_display_contents_str(list_item);
525         }  else if (0 == safeStrCmp(list_item->keyStr, BADGE_STR)) {
526                 __status_set_badge_str(list_item);
527         }
528 }
529
530
531 /**
532  * check box
533  */
534 static void setting_phone_noti_details_chk_btn_cb(void *data, Evas_Object *obj, void *event_info)
535 {
536         SETTING_TRACE_BEGIN;
537         /* error check */
538         retm_if(data == NULL, "Data parameter is NULL");
539         Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
540         list_item->chk_status = elm_check_state_get(obj);       /*  for genlist update status */
541
542         if (0 == safeStrCmp(list_item->keyStr, NOTIFICATION_STR)) {
543                 __status_set_notification_str(list_item);
544         } else if (0 == safeStrCmp(list_item->keyStr, KeyStr_Sounds)) {
545                 __status_set_sound_str(list_item);
546         } else if (0 == safeStrCmp(list_item->keyStr, DISPLAY_CONTENT_STR)) {
547                 __status_set_display_contents_str(list_item);
548         } else if (0 == safeStrCmp(list_item->keyStr, BADGE_STR)) {
549                 __status_set_badge_str(list_item);
550         }
551 }
552