SDB is enabled with debug mode
[apps/core/preloaded/settings.git] / setting-common / src / setting-common-draw-genlist.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-common-draw-widget.h>
22 #include <glib.h>
23 #include <utilX.h>
24 #include <Ecore_X.h>
25 #include <system_settings.h>
26
27 #define EXCEED_LIMITATION_STR           "The content is too long."
28
29 static Evas_Object *_gl_Gendial_content_get(void *data, Evas_Object *obj, const char *part);
30 static char *_gl_Gendial_text_get(void *data, Evas_Object *obj, const char *part);
31 static void _gl_Gendial_del(void *data, Evas_Object *obj);
32 const Elm_Genlist_Item_Class itc_seperator = {
33         .item_style = "dialogue/separator/21/with_line",
34         .func.text_get = NULL,
35         .func.content_get = NULL,
36         .func.state_get = NULL,
37         .func.del = NULL,
38 };
39
40 const Elm_Genlist_Item_Class itc_bottom_seperator = {
41         .item_style = "dialogue/separator/20",
42         .func.text_get = NULL,
43         .func.content_get = NULL,
44         .func.state_get = NULL,
45         .func.del = NULL,
46 };
47
48 const Elm_Genlist_Item_Class itc_sep_line = {
49         .item_style = "dialogue/separator/1/with_line",
50         .func.text_get = _gl_Gendial_text_get,
51         .func.content_get = NULL,
52         .func.state_get = NULL,
53         .func.del = NULL,
54 };
55
56 #define DEFINE_ITC1(style, name) \
57 const Elm_Genlist_Item_Class name = {\
58         .item_style = style,\
59         .func.text_get = _gl_Gendial_text_get,\
60         .func.content_get = _gl_Gendial_content_get,\
61         .func.state_get = NULL,\
62         .func.del = _gl_Gendial_del,\
63 };
64
65 DEFINE_ITC1("dialogue/1text", itc_1text);
66 DEFINE_ITC1("dialogue/1text.1icon.2", itc_1text_1icon_2);
67
68 DEFINE_ITC1("dialogue/1icon", itc_1icon);
69 DEFINE_ITC1("dialogue/1text.1icon/expandable2", itc_1icon_1text_sub);
70 DEFINE_ITC1("dialogue/1text.1icon", itc_1text_1icon);
71 DEFINE_ITC1("dialogue/1text.2icon", itc_1text_2icon);
72 DEFINE_ITC1("dialogue/1text.2icon.2", itc_1text_2icon_2);
73
74 DEFINE_ITC1("dialogue/2text.2", itc_2text_2);
75 DEFINE_ITC1("dialogue/2text", itc_2text);
76 DEFINE_ITC1("multiline/2text.1icon", itc_multiline_2text_1icon);
77 DEFINE_ITC1("dialogue/2text.1icon.3", itc_2text_1icon_3);
78 DEFINE_ITC1("dialogue/2text.1icon.6", itc_2text_1icon_6);
79 DEFINE_ITC1("dialogue/2text.1icon.7", itc_2text_1icon_7);
80
81 DEFINE_ITC1("dialogue/2text.3/expandable", itc_2text_3_parent);
82 DEFINE_ITC1("dialogue/2text.3", itc_2text_3);
83 DEFINE_ITC1("dialogue/2text.2icon.3", itc_2text_2icon_3);
84
85 DEFINE_ITC1("multiline/1text", itc_multiline_text);
86 DEFINE_ITC1("1text.1icon.2", itc_cm_1text_1icon_2);
87 DEFINE_ITC1("select_all", itc_sel_all);
88 DEFINE_ITC1("dialogue/bg/1icon", itc_bg_1icon);
89 DEFINE_ITC1("dialogue/title", itc_group_item);
90
91 /**
92  * Do process when clicking on a common genlist item
93  */
94 void setting_mouse_up_Gendial_list_radio_cb(void *data, Evas_Object *obj,
95                                             void *event_info)
96 {
97         /* error check */
98         retm_if(event_info == NULL, "Invalid argument: event info is NULL");
99         Elm_Object_Item *item = (Elm_Object_Item *) event_info;
100         elm_genlist_item_selected_set(item, 0);
101         Setting_GenGroupItem_Data *list_item =
102             (Setting_GenGroupItem_Data *) elm_object_item_data_get(item);
103
104         setting_retm_if(data == NULL, "Data parameter is NULL");
105         Evas_Object *radio = data;
106         elm_radio_value_set(radio, list_item->chk_status);
107 }
108
109 static void __radio_changed(void *data, Evas_Object *obj, void *event_info)
110 {
111         retm_if(data == NULL, "Data parameter is NULL");
112         Setting_GenGroupItem_Data *list_item =
113             (Setting_GenGroupItem_Data *) data;
114         list_item->chk_status = elm_radio_value_get(obj);       /*  for update */
115 }
116
117 static void __entry_changed(void *data, Evas_Object *obj, void *event_info)
118 {
119         retm_if(data == NULL, "Data parameter is NULL");
120         SETTING_TRACE_BEGIN;
121         Setting_GenGroupItem_Data *list_item =
122             (Setting_GenGroupItem_Data *) data;
123         list_item->sub_desc = (char *)g_strdup(elm_entry_entry_get(obj));
124         Evas_Object *entry_container = elm_object_parent_widget_get(obj);
125         if (entry_container)
126         {
127                 if (elm_entry_is_empty(obj))
128                 {
129                         elm_object_signal_emit(entry_container, "elm,state,guidetext,show", "elm");
130                         elm_object_signal_emit(entry_container, "elm,state,eraser,hide", "elm");
131                 }
132                 else
133                 {
134                         elm_object_signal_emit(entry_container, "elm,state,guidetext,hide", "elm");
135                         if (elm_object_focus_get(obj)) //only do when entry is focused
136                         {
137                                 elm_object_signal_emit(entry_container, "elm,state,eraser,show", "elm");
138                         }
139                 }
140         }
141 }
142
143 static void __entry_unfocused(void *data, Evas_Object *obj, void *event_info) // Unfocused callback will show guidetext and hide X marked button.
144 {
145         ret_if(!data);
146         SETTING_TRACE_BEGIN;
147         Evas_Object *entry_container = data;
148         //whe entry unfocused, its guidetext will becomes "Input here"
149         elm_object_part_text_set(entry_container, "elm.guidetext", _("IDS_ST_BODY_TAP_TO_INSERT"));
150         if (elm_entry_is_empty(obj))
151                 elm_object_signal_emit(entry_container, "elm,state,guidetext,show", "elm");
152         elm_object_signal_emit(entry_container, "elm,state,eraser,hide", "elm");
153 }
154 static void __entry_focused(void *data, Evas_Object *obj, void *event_info) // Focused callback will show X marked button and hide guidetext.
155 {
156         ret_if(!data);
157         SETTING_TRACE_BEGIN;
158         Evas_Object *entry_container = data;
159         //whe entry focused, its guidetext will becomes "Input here"
160         elm_object_part_text_set(entry_container, "elm.guidetext", _("IDS_ST_BODY_TAP_TO_INSERT"));
161         if (!elm_entry_is_empty(obj))
162                 elm_object_signal_emit(entry_container, "elm,state,eraser,show", "elm");
163         elm_object_signal_emit(entry_container, "elm,state,guidetext,hide", "elm");
164
165         Ecore_IMF_Context *imf_context = (Ecore_IMF_Context *)elm_entry_imf_context_get(obj);
166         if (imf_context) ecore_imf_context_input_panel_show(imf_context);
167 }
168 static void __eraser_clicked(void *data, Evas_Object *obj, const char *emission, const char *source) // When X marked button is clicked, empty entry's contents.
169 {
170         ret_if(!data);
171         Evas_Object *entry = data;
172         elm_entry_entry_set(entry, "");
173         elm_object_focus_set(entry, EINA_TRUE);
174 }
175
176 static void __chk_changed(void *data, Evas_Object *obj, void *event_info)
177 {
178         retm_if(data == NULL, "Data parameter is NULL");
179         Setting_GenGroupItem_Data *list_item =
180             (Setting_GenGroupItem_Data *) data;
181         list_item->chk_status = elm_check_state_get(obj);       /*  for update */
182 }
183
184 static void __error_popup_response_cb(void *data, Evas_Object *obj,
185                                      void *event_info)
186 {
187         SETTING_TRACE_BEGIN;
188         retm_if(data == NULL, "Data parameter is NULL");
189         Setting_GenGroupItem_Data *list_item = data;
190         if (list_item->notify) {
191                 evas_object_del(list_item->notify);
192                 list_item->notify = NULL;
193         }
194 }
195
196 static void __max_len_reached(void *data, Evas_Object *obj, void *event_info)
197 {
198         SETTING_TRACE_BEGIN;
199         retm_if(data == NULL, "Data parameter is NULL");
200         retm_if(!elm_object_focus_get(obj), "Entry is not focused");//notify only when entry is being focused on.
201
202         Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
203         if (!list_item->notify)
204         {
205                 list_item->notify = setting_create_popup_without_btn(list_item, list_item->win_main,
206                                                          NULL, _(EXCEED_LIMITATION_STR),
207                                                          __error_popup_response_cb,
208                                                          POPUP_INTERVAL, FALSE, FALSE);
209                 elm_object_focus_set(list_item->eo_check, EINA_FALSE);
210         } else {
211                 //postpone 2 seconds again
212                 elm_popup_timeout_set(list_item->notify, POPUP_INTERVAL);
213         }
214
215 }
216 static void __entry_keydown(void *data, Evas *e, Evas_Object *obj, void *event_info)
217 {
218         ret_if(event_info == NULL);
219         Evas_Event_Key_Down *ev = (Evas_Event_Key_Down *)event_info;
220         if(safeStrCmp(ev->key, "KP_Enter") == 0 //it is for Japanese keyboard to fix N_SE-10719
221            || safeStrCmp(ev->key, "Return") == 0) //to disable the 'Enter' orginal function
222         {
223                 SETTING_TRACE("ENTER %s ev->key:%s", __FUNCTION__, ev->key);
224                 //hide the eraser button
225                 //format like:xx<br/>
226                 const char *entry_str = remove_first_substring(elm_entry_entry_get(obj), "<br/>");
227                 elm_entry_entry_set(obj, entry_str);
228                 FREE(entry_str);
229                 elm_entry_cursor_end_set(obj);
230                 setting_hide_input_pannel_cb(obj);
231         } else {
232                 Evas_Object *entry_container = elm_object_parent_widget_get(obj);
233                 if(safeStrLen(elm_entry_entry_get(obj)) > 0) {
234                         elm_object_signal_emit(entry_container, "elm,state,guidetext,hide", "elm");
235                 } else {
236                         elm_object_signal_emit(entry_container, "elm,state,guidetext,show", "elm");
237                 }
238         }
239
240 }
241
242 /**
243  * Do process when clicking radio in subitem of expandable item
244  */
245 void setting_sub_list_rd_change(void *data, Evas_Object *obj, void *event_info)
246 {
247         SETTING_TRACE_BEGIN;
248         retm_if(data == NULL, "Data parameter is NULL");
249         Setting_GenGroupItem_Data *list_item =
250             (Setting_GenGroupItem_Data *) data;
251         list_item->chk_status = elm_radio_value_get(obj);       /*  for update */
252
253         Elm_Object_Item *subItem = list_item->item;
254         Elm_Object_Item *parentItem = elm_genlist_item_parent_get(subItem);
255
256         Setting_GenGroupItem_Data *data_subItem = elm_object_item_data_get(subItem);    /* subItem data */
257         Setting_GenGroupItem_Data *data_parentItem = elm_object_item_data_get(parentItem);      /* parent data */
258
259         ret_if(NULL == data_subItem || NULL == data_parentItem);
260         int err;
261         setting_set_int_slp_key(data_parentItem->int_slp_setting_binded,
262                                 list_item->chk_status, &err);
263         ret_if(0 != err);
264         data_parentItem->sub_desc = (char *)g_strdup(_(data_subItem->keyStr));
265         elm_object_item_data_set(data_parentItem->item, data_parentItem);
266         elm_genlist_item_update(data_parentItem->item);
267 }
268
269 /**
270  * Do process when clicking on subitem of expandable item
271  */
272 void setting_sub_list_sel_cb(void *data, Evas_Object *obj, void *event_info)
273 {
274         SETTING_TRACE_BEGIN;
275         /* error check */
276         retm_if(event_info == NULL, "Invalid argument: event info is NULL");
277         Elm_Object_Item *subitem = (Elm_Object_Item *) event_info;
278         Elm_Object_Item *parentItem = elm_genlist_item_parent_get(subitem);
279         elm_genlist_item_selected_set(subitem, 0);
280         Setting_GenGroupItem_Data *data_subItem =
281             elm_object_item_data_get(subitem);
282         Setting_GenGroupItem_Data *data_parentItem = elm_object_item_data_get(parentItem);      /* parent data */
283         ret_if(NULL == data_subItem || NULL == data_parentItem);
284
285         elm_radio_value_set(data_subItem->rgd, data_subItem->chk_status);
286         int err;
287         setting_set_int_slp_key(data_parentItem->int_slp_setting_binded,
288                                 data_subItem->chk_status, &err);
289         setting_retm_if(0 != err, "Set vconf error[%d]",data_parentItem->int_slp_setting_binded);
290
291         data_parentItem->sub_desc = (char *)g_strdup(_(data_subItem->keyStr));
292         elm_object_item_data_set(data_parentItem->item, data_parentItem);
293         elm_genlist_item_update(data_parentItem->item);
294 }
295
296 static void __exp_list_smart_cb(void *data, Evas_Object *obj, void *event_info)
297 {
298         ret_if(data == NULL || event_info == NULL);
299         Elm_Object_Item *item = (Elm_Object_Item *) event_info;
300         char *cb_type = data;
301
302         if (0 == safeStrCmp(cb_type, "drag")
303             || 0 == safeStrCmp(cb_type, "longpressed")) {
304                 //Evas_Object *base_view = (Evas_Object *) elm_genlist_item_object_get(item);
305                 //edje_object_signal_emit(base_view, "mouse,out", "touch_arrow");
306         } else if (0 == safeStrCmp(cb_type, "contracted")) {
307                 elm_genlist_item_subitems_clear(item);
308         }
309 }
310
311 static void _gl_Gendial_sel(void *data, Evas_Object *obj, void *event_info)
312 {
313         /* SETTING_TRACE_BEGIN; */
314         retm_if(event_info == NULL, "Invalid argument: event info is NULL");
315         Elm_Object_Item *item = (Elm_Object_Item *) event_info;
316         elm_genlist_item_selected_set(item, 0);
317 }
318
319 static void _gl_Gendial_sel_expand(void *data, Evas_Object *obj,
320                                    void *event_info)
321 {
322         /* SETTING_TRACE_BEGIN; */
323         retm_if(event_info == NULL, "Invalid argument: event info is NULL");
324         Elm_Object_Item *item = (Elm_Object_Item *) event_info;
325         elm_genlist_item_selected_set(item, 0);
326         bool status = !elm_genlist_item_expanded_get(item);
327         elm_genlist_item_expanded_set(item, status);
328 }
329
330 static char *_gl_Gendial_text_get(void *data, Evas_Object *obj,
331                                    const char *part)
332 {
333         /* SETTING_TRACE_BEGIN; */
334         Setting_GenGroupItem_Data *item_data =
335             (Setting_GenGroupItem_Data *) data;
336         /* SETTING_TRACE("part:%s", part); */
337         if (SWALLOW_Type_LAYOUT_ENTRY == item_data->swallow_type) {     /* no need to create 'text' part */
338                 return NULL;
339         }
340
341         /* for font size view */
342         if (SWALLOW_Type_1RADIO_1LABLE == item_data->swallow_type) {
343                 char speciliztion[MAX_SPECIALIZITION_LEN] = {0,};
344                 int font_size = -1;
345                 SETTING_TRACE("item_data->chk_status:%d", item_data->chk_status);
346                 if (SYSTEM_SETTINGS_FONT_SIZE_SMALL == item_data->chk_status) {
347                         font_size = LABEL_FONT_SIZE_SMALL;
348                 } else if (SYSTEM_SETTINGS_FONT_SIZE_LARGE == item_data->chk_status) {
349                         font_size = LABEL_FONT_SIZE_LARGE;
350                 } else if (SYSTEM_SETTINGS_FONT_SIZE_HUGE == item_data->chk_status) {
351                         font_size = LABEL_FONT_SIZE_HUGE;
352                 } else if (SYSTEM_SETTINGS_FONT_SIZE_GIANT == item_data->chk_status) {
353                         font_size = LABEL_FONT_SIZE_GIANT;
354                 } else {
355                         font_size = LABEL_FONT_SIZE_NORMAL;
356                 }
357                 SETTING_TRACE("font_size:%d", font_size);
358                 snprintf(speciliztion, sizeof(speciliztion), "<font_size=%d>%s</font_size>",
359                         font_size, _(item_data->keyStr));
360                 return (char *)g_strdup(speciliztion);
361         }
362
363         if (!safeStrCmp(part, "elm.text") || !safeStrCmp(part, "elm.text.1")) { /* title */
364                 if (item_data->keyStr) {
365                         return (char *)g_strdup(_(item_data->keyStr));  /* use item_data->keyStr */
366                 }
367
368         } else if (!safeStrCmp(part, "elm.text.2")) {   /* bottom or right */
369                 if (item_data->sub_desc) {
370                         return (char *)g_strdup(item_data->sub_desc);
371                 }
372         }
373
374         return NULL;
375 }
376
377 static Evas_Object *__add_check(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
378 {
379         retv_if(!item_data || !parent, NULL);
380         Evas_Object *check = elm_check_add(parent);
381         elm_check_state_set(check, item_data->chk_status);
382         evas_object_show(check);
383         evas_object_pass_events_set(check, 1);
384         evas_object_propagate_events_set(check, 0);
385
386         item_data->eo_check = check;
387
388         if (item_data->chk_change_cb) {
389                 evas_object_smart_callback_add(check,"changed",item_data->chk_change_cb,item_data);
390         } else {
391                 evas_object_smart_callback_add(check,"changed", __chk_changed, item_data);
392         }
393         return check;
394 }
395 static Evas_Object *__add_check_icon(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
396 {
397         retv_if(!item_data || !parent, NULL);
398         Evas_Object *check = __add_check(item_data, parent);
399
400         Evas_Object *thumb = NULL;
401         if (item_data->r_swallow_path) {
402                 thumb = elm_icon_add(parent);
403                 elm_icon_file_set(thumb,
404                                   item_data->r_swallow_path,
405                                   NULL);
406                 evas_object_size_hint_aspect_set(thumb,
407                                                  EVAS_ASPECT_CONTROL_VERTICAL,
408                                                  1, 1);
409         }
410
411         Evas_Object *layout = elm_layout_add(parent);
412         elm_layout_file_set(layout, SETTING_THEME_EDJ_NAME,
413                             "thumbnail_icon2");
414         evas_object_size_hint_weight_set(layout,
415                                          EVAS_HINT_EXPAND,
416                                          EVAS_HINT_EXPAND);
417         elm_object_part_content_set(layout, "checkbox", check);
418         elm_object_part_content_set(layout, "thumbnail", thumb);
419         evas_object_show(layout);
420         return layout;
421 }
422 static Evas_Object *__add_toggle(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
423 {
424         retv_if(!item_data || !parent, NULL);
425         Evas_Object *check = __add_check(item_data, parent);
426         elm_object_style_set(check, "on&off");
427         return check;
428 }
429 static Evas_Object *__add_multiline_toggle(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
430 {
431         retv_if(!item_data || !parent, NULL);
432         Evas_Object *chk = __add_toggle(item_data, parent);
433         elm_object_style_set(chk, "on&off");
434         return chk;
435 }
436
437 static Evas_Object *__add_radio(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
438 {
439         retv_if(!item_data || !parent, NULL);
440         if (!item_data->rgd) {  /* exceptional handling */
441                 item_data->rgd = elm_radio_add(parent);
442                 elm_radio_state_value_set(item_data->rgd, -1);
443         }
444         Evas_Object *radio = elm_radio_add(parent);
445         elm_radio_state_value_set(radio,
446                                   item_data->chk_status);
447         elm_radio_group_add(radio, item_data->rgd);
448         evas_object_show(radio);
449         item_data->eo_check = radio;
450         if (item_data->chk_change_cb) {
451                 evas_object_smart_callback_add(radio,
452                                                "changed",
453                                                item_data->chk_change_cb,
454                                                item_data);
455         } else {
456                 evas_object_smart_callback_add(radio,
457                                                "changed",
458                                                __radio_changed,
459                                                item_data);
460         }
461         return radio;
462 }
463 static Evas_Object *__add_button(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
464 {
465         retv_if(!item_data || !parent, NULL);
466         Evas_Object *btn = elm_button_add(parent);
467         evas_object_show(btn);
468         if (item_data->r_swallow_path)
469         {
470                 elm_object_style_set(btn, item_data->r_swallow_path);
471         }
472         if (item_data->keyStr)
473         {
474                 elm_object_text_set(btn, _(item_data->keyStr));
475         }
476         evas_object_propagate_events_set(btn, EINA_FALSE);
477         if (item_data->chk_change_cb)
478                 evas_object_smart_callback_add(btn,
479                                                "clicked",
480                                                item_data->chk_change_cb,
481                                                item_data);
482         return btn;
483 }
484 static Evas_Object *__add_entry(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
485 {
486         retv_if(!item_data || !parent, NULL);
487         elm_genlist_mode_set(parent, ELM_LIST_COMPRESS);        /* resolve abnormal height issue */
488         Evas_Object *ed_name =
489             setting_create_editfiled(parent, _(item_data->keyStr),
490                                      item_data->sub_desc);
491         Evas_Object *entry = elm_object_part_content_get(ed_name, "elm.swallow.content");
492         item_data->eo_check = entry;
493         elm_entry_input_panel_layout_set(entry,
494                                          item_data->input_type);
495
496         if (item_data->isSinglelineFlag) {
497                 elm_entry_single_line_set(entry, EINA_TRUE);
498         }
499
500         if (item_data->isPasswordFlag) {
501                 elm_entry_single_line_set(entry, EINA_TRUE);
502                 elm_entry_password_set(entry, EINA_TRUE);
503         }
504
505         if (item_data->limit_filter_data) {
506                 elm_entry_markup_filter_append
507                     (entry,
508                      elm_entry_filter_limit_size,
509                      item_data->limit_filter_data);
510
511                 evas_object_smart_callback_add(entry,
512                                               "maxlength,reached",
513                                               __max_len_reached,
514                                               item_data);
515
516         }
517         if (item_data->stop_change_cb) {//invoked when stop focusing on
518                 evas_object_smart_callback_add(entry,
519                                                       "unfocused",
520                                                       item_data->stop_change_cb,
521                                                       item_data);
522         }
523         else
524         {
525                 evas_object_smart_callback_add(entry,
526                                               "unfocused",
527                                               __entry_unfocused,
528                                               ed_name);
529         }
530         if (item_data->digits_filter_data) {
531                 elm_entry_markup_filter_append
532                     (entry,
533                      elm_entry_filter_accept_set,
534                      item_data->digits_filter_data);
535         }
536
537         /* for Setting App, All the entrys's context popup shouldn't be able */
538         /* to insert images, text is the only one can be inserted. */
539         elm_entry_cnp_mode_set(entry, ELM_CNP_MODE_PLAINTEXT);
540
541         if (item_data->chk_change_cb) {
542                 evas_object_smart_callback_add
543                     (entry,
544                      "changed", item_data->chk_change_cb,
545                      item_data);
546         }
547         //default handle
548         evas_object_smart_callback_add(entry, "changed", __entry_changed, item_data);
549         evas_object_smart_callback_add(entry, "focused", __entry_focused, ed_name);
550         elm_object_signal_callback_add(ed_name, "elm,eraser,clicked", "elm", __eraser_clicked, entry);
551
552         if (item_data->start_change_cb) {
553                 evas_object_event_callback_add(entry, EVAS_CALLBACK_KEY_DOWN, (Evas_Object_Event_Cb)(item_data->start_change_cb), item_data->userdata);
554         }
555         evas_object_event_callback_add(entry, EVAS_CALLBACK_KEY_DOWN, __entry_keydown, item_data);
556
557         if (item_data->input_panel_disable_flag) {
558                 elm_entry_input_panel_enabled_set(entry, EINA_FALSE);
559         }
560         return ed_name;
561 }
562 static Evas_Object *__add_slider(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
563 {
564         retv_if(!item_data || !parent, NULL);
565         Evas_Object *li_slider =
566             setting_create_slider(parent, item_data->evas,
567                                   item_data->l_swallow_path,
568                                   item_data->r_swallow_path,
569                                   item_data->chk_status,
570                                   item_data->isIndicatorVisible,
571                                   item_data->slider_min,
572                                   item_data->slider_max,
573                                   item_data->chk_change_cb,
574                                   item_data->start_change_cb,
575                                   item_data->stop_change_cb,
576                                   item_data);
577         evas_object_pass_events_set(li_slider, 1);
578         evas_object_propagate_events_set(li_slider, 0);
579         item_data->eo_check = li_slider;
580         return li_slider;
581 }
582
583 static Evas_Object *__add_datefield(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
584 {
585         retv_if(!item_data || !parent, NULL);
586         /* **********create time/date field */
587         Evas_Object *datetimefield = item_data->eo_check = elm_datetime_add(parent);
588         evas_object_size_hint_weight_set(datetimefield, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
589         evas_object_size_hint_align_set(datetimefield, EVAS_HINT_FILL, 0.5);
590         evas_object_show(datetimefield);
591
592         char date_format[MAX_DATETIME_FORMAT_LEN + 1] = {0, };
593         const char *time_format = NULL;
594         if (item_data->chk_status)//12 hours
595         {
596                 time_format = "%I : %M %p";
597         } else { //24 hours
598                 time_format = "%H : %M";
599         }
600
601 #if SUPPORT_DATEFIELD_DATE_FORMAT_AUTOSET //Get date-format from datefiled itself, if elm_datetime_add() supports set date-format via ICU.
602         char *old_format = elm_datetime_format_get(datetimefield);
603         snprintf(date_format, MAX_DATE_FORMAT_LEN + 1, //add one space " "
604                  "%s", old_format);
605         safeStrNCat(date_format, time_format, MAX_DATETIME_FORMAT_LEN);
606         FREE(old_format);
607         SETTING_TRACE("datefield_format:%s", date_format);
608 #else
609         snprintf(date_format, MAX_DATETIME_FORMAT_LEN,
610                  "%s %s", item_data->sub_desc, time_format);
611 #endif
612         elm_datetime_format_set(datetimefield, date_format);
613
614         // min : 1970 1, 01, Thursday 00:00:00
615         // max : 2038 1, 19, Thursday 03:14:07
616         struct tm ts_ret;
617         memset(&ts_ret, 0, sizeof(struct tm));
618         ts_ret.tm_year = 138;
619         ts_ret.tm_mon = 1;
620         ts_ret.tm_mday = 19;
621         elm_datetime_value_max_set(datetimefield, &ts_ret);
622
623         ts_ret.tm_year = 70;
624         ts_ret.tm_mon = 0;
625         ts_ret.tm_mday = 1;
626         elm_datetime_value_min_set(datetimefield, &ts_ret);
627
628
629         time_t ctime = time(NULL);
630         //struct tm ts_ret;
631         struct tm *ts = localtime_r(&ctime, &ts_ret);
632         retv_if(!ts, NULL);
633
634         elm_datetime_value_set(datetimefield, &ts_ret);
635
636         if (item_data->chk_change_cb) {
637                 evas_object_smart_callback_add(datetimefield,
638                                                "changed",
639                                                item_data->chk_change_cb,
640                                                item_data);
641         }
642
643         if (item_data->isItemDisableFlag) {
644                 setting_disable_evas_object(datetimefield);
645         }
646         return datetimefield;
647 }
648 static Evas_Object *__add_radio_search(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
649 {
650         retv_if(!item_data || !parent, NULL);
651         Evas_Object *box = elm_box_add(parent);
652         elm_box_horizontal_set(box, 1);
653
654         //a.radio..
655         Evas_Object *radio = __add_radio(item_data, parent);
656         setting_disable_evas_object(radio);
657         elm_box_pack_end(box, radio);
658
659         //b.separator..
660         Evas_Object *separator =
661                 setting_create_blank_rect_customize(box,
662                                 SETTING_HALF_SCREEN_WIDTH,
663                                 SETTING_PADDING_HEIGHT);
664         elm_box_pack_end(box, separator);
665
666         //c.progressbar..
667         Evas_Object *progressbar = elm_progressbar_add(parent);
668         elm_object_style_set(progressbar, "list_process");
669         evas_object_size_hint_align_set(progressbar,
670                                         EVAS_HINT_FILL, 0.5);
671         evas_object_size_hint_weight_set(progressbar,
672                                          EVAS_HINT_EXPAND,
673                                          EVAS_HINT_EXPAND);
674         elm_progressbar_pulse(progressbar, EINA_TRUE);
675         evas_object_show(progressbar);
676         elm_box_pack_end(box, progressbar);
677
678         evas_object_show(box);
679         return box;
680 }
681 static Evas_Object *__add_search(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
682 {
683         retv_if(!item_data || !parent, NULL);
684         // added by JTS: CQ H0100135171
685         Evas_Object *box = elm_box_add(parent);
686         elm_box_horizontal_set(box, 1);
687
688         //b.separator..
689         Evas_Object *separator =
690                 setting_create_blank_rect_customize(box,
691                 SETTING_HALF_SCREEN_WIDTH, SETTING_PADDING_HEIGHT);
692         elm_box_pack_end(box, separator);
693
694         //c.progressbar..
695         Evas_Object *progressbar = elm_progressbar_add(parent);
696         elm_object_style_set(progressbar, "list_process");
697         evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, 0.5);
698         evas_object_size_hint_weight_set(progressbar,
699                                         EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
700         elm_progressbar_pulse(progressbar, EINA_TRUE);
701         evas_object_show(progressbar);
702         elm_box_pack_end(box, progressbar);
703
704         evas_object_show(box);
705         return box;
706
707 }
708 static Evas_Object *__add_process(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
709 {
710         retv_if(!item_data || !parent, NULL);
711         Evas_Object *progressbar = elm_progressbar_add(parent);
712         elm_object_style_set(progressbar, "list_process");
713         evas_object_size_hint_align_set(progressbar,
714                                         EVAS_HINT_FILL, 0.5);
715         evas_object_size_hint_weight_set(progressbar,
716                                          EVAS_HINT_EXPAND,
717                                          EVAS_HINT_EXPAND);
718         elm_progressbar_pulse(progressbar, EINA_TRUE);
719         evas_object_show(progressbar);
720         return progressbar;
721 }
722
723 static Evas_Object *__add_radio_lable(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
724 {
725         retv_if(!item_data || !parent, NULL);
726
727         //a.radio..
728         Evas_Object *radio = __add_radio(item_data, parent);
729
730         return radio;
731 }
732
733 static Evas_Object *__add_left_default(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
734 {
735         retv_if(!item_data || !parent || !item_data->l_swallow_path, NULL);
736         Evas_Object *icon = elm_icon_add(parent);
737         elm_icon_file_set(icon, item_data->l_swallow_path,NULL);
738         evas_object_size_hint_aspect_set(icon,EVAS_ASPECT_CONTROL_VERTICAL,1, 1);
739         return icon;
740 }
741 static Evas_Object *__add_right_default(Setting_GenGroupItem_Data *item_data, Evas_Object *parent)
742 {
743         retv_if(!item_data || !parent || !item_data->r_swallow_path, NULL);
744         Evas_Object *icon = elm_icon_add(parent);
745         elm_icon_file_set(icon, item_data->r_swallow_path,NULL);
746         evas_object_size_hint_aspect_set(icon,EVAS_ASPECT_CONTROL_VERTICAL,1, 1);
747         return icon;
748 }
749
750 // draw handler
751 typedef Evas_Object * (*__drawer_fp)(Setting_GenGroupItem_Data *item_data, Evas_Object *parent);
752 typedef struct
753 {
754         SWALLOW_Type type;                      // ui type
755         __drawer_fp draw;
756 } __Content_Drawer;
757 static __Content_Drawer __cd_left[SWALLOW_Type_MAX] = {
758         //base objects
759         {SWALLOW_Type_1CHECK, __add_check},
760         {SWALLOW_Type_1TOGGLE, __add_toggle},
761         {SWALLOW_Type_1RADIO, __add_radio},
762         {SWALLOW_Type_1BUTTON, __add_button},
763
764         //base objects in an layout
765         {SWALLOW_Type_LAYOUT_ENTRY, __add_entry},
766         {SWALLOW_Type_LAYOUT_SLIDER, __add_slider},
767         {SWALLOW_Type_LAYOUT_DATEFIELD, __add_datefield},
768
769         //other compelx objects
770         {SWALLOW_Type_1SEARCH, __add_search},
771         {SWALLOW_Type_1PROCESS, __add_process},
772         {SWALLOW_Type_MULTILINE_1TOGGLE, __add_multiline_toggle},
773         {SWALLOW_Type_1CHECKICON, __add_check_icon},
774         {SWALLOW_Type_1RADIO_1SEARCH, __add_radio_search},
775         {SWALLOW_Type_1RADIO_1LABLE, __add_radio_lable},
776
777         //left part object of the type
778         {SWALLOW_Type_1ICON_1RADIO, __add_left_default},
779         {SWALLOW_Type_1RADIO_1PROCESS, __add_radio},
780 };
781 static __Content_Drawer __cd_right[SWALLOW_Type_MAX] = {
782         //right part object of the type
783         {SWALLOW_Type_1ICON_1RADIO, __add_toggle},
784         {SWALLOW_Type_1RADIO_1PROCESS, __add_process},
785 };
786
787 static __Content_Drawer __cd_end[SWALLOW_Type_MAX] = {
788         //end part object of the type
789         {SWALLOW_Type_1RADIO, __add_radio},
790 };
791 /*static __Part_Drawer __pd[__MAX_PART_NUM] = {
792         {"elm.icon", __cd_left},
793         {"elm.icon.1", __cd_left},
794         {"elm.icon.2", __cd_right},
795         {"elm.swallow.end", __cd_end},
796 };*/
797
798 static Evas_Object *_gl_Gendial_content_get(void *data, Evas_Object *obj,
799                                          const char *part)
800 {
801         retv_if(!data, NULL);
802         Setting_GenGroupItem_Data *item_data = data;
803         retv_if(!data, NULL);
804         __Content_Drawer *cd_list = NULL;
805         __drawer_fp fp = NULL;
806         if (!safeStrCmp(part, "elm.icon") || !safeStrCmp(part, "elm.icon.1"))
807         {
808                 fp = __add_left_default; //hold default drawer
809                 cd_list = __cd_left;
810         }
811         else if (!safeStrCmp(part, "elm.icon.2"))
812         {
813                 fp = __add_right_default; //hold default drawer
814                 cd_list = __cd_right;
815         }
816         else if (!safeStrCmp(part, "elm.swallow.end"))
817         {
818                 //the default value of fp is NULL here
819                 cd_list = __cd_end;
820         }
821         if (!cd_list) return NULL;//invalid part
822
823         int idx = 0;
824         for (; idx < SWALLOW_Type_MAX; idx++)
825         {
826                 if (item_data->swallow_type == cd_list[idx].type)//match using swallow type
827                 {
828                         fp = cd_list[idx].draw;
829                         break;
830                 }
831         }
832         return fp ? fp(item_data, obj) : NULL;
833 }
834
835 static void _gl_Gendial_del(void *data, Evas_Object *obj)
836 {
837         /* SETTING_TRACE_BEGIN; */
838         Setting_GenGroupItem_Data *item_data =
839             (Setting_GenGroupItem_Data *) data;
840         if (item_data) {
841                 G_FREE(item_data->keyStr);
842                 G_FREE(item_data->sub_desc);
843                 G_FREE((item_data->l_swallow_path));
844                 G_FREE((item_data->r_swallow_path));
845                 G_FREE(item_data->item_style);
846
847
848                 if (item_data->digits_filter_data)
849                 {
850                         G_FREE(item_data->digits_filter_data->accepted);
851                         G_FREE(item_data->digits_filter_data->rejected);
852                         FREE(item_data->digits_filter_data);
853
854                 }
855
856                 if (item_data->notify) {
857                         evas_object_del(item_data->notify);
858                         item_data->notify = NULL;
859                 }
860
861                 FREE(item_data->limit_filter_data);
862                 __BACK_POINTER_UNSET(item_data);
863                 FREE(item_data);
864         }
865         /* SETTING_TRACE_END; */
866 }
867
868 /**
869  * To intialize an Elm_Genlist_Item_Class, according to item style
870  *
871  * @param[in] item_style
872  * @param[in/out] itc
873  */
874 bool setting_create_Gendial_itc(const char *item_style,
875                                 Elm_Genlist_Item_Class *itc)
876 {
877         itc->item_style = item_style;
878         itc->func.text_get = _gl_Gendial_text_get;
879         itc->func.content_get = _gl_Gendial_content_get;
880         itc->func.state_get = NULL;
881         itc->func.del = _gl_Gendial_del;        /* _gl_Gendial_del; */
882         return TRUE;
883 }
884
885 /**
886  * Create group style item
887  *
888  * @return a pointer to Setting_GenGroupItem_Data
889  */
890 Setting_GenGroupItem_Data *setting_create_Gendial_field_group_titleItem(Evas_Object *genlist,
891                                                 const Elm_Genlist_Item_Class *itc,
892                                                 Elm_Object_Item *parent,
893                                                 Elm_Genlist_Item_Type flag,     /* ELM_GENLIST_ITEM_GROUP or ELM_GENLIST_ITEM_NONE */
894                                                 const char *keyStr,
895                                                 setting_call_back_func gl_sel)
896 {
897         /* SETTING_TRACE_BEGIN; */
898         Setting_GenGroupItem_Data *item_data =
899             (Setting_GenGroupItem_Data *) calloc(1,
900                                                  sizeof
901                                                  (Setting_GenGroupItem_Data));
902         setting_retvm_if(!item_data, NULL, "calloc failed");
903         item_data->keyStr = (char *)g_strdup(keyStr);
904         if (gl_sel) {
905                 item_data->item =
906                     elm_genlist_item_append(genlist, itc, item_data, parent,
907                                             flag, gl_sel, NULL);
908         } else {
909                 item_data->item =
910                     elm_genlist_item_append(genlist, itc, item_data, parent,
911                                             flag, _gl_Gendial_sel, NULL);
912         }
913         return item_data;
914 }
915
916 /**
917  * Create separator style item with title
918  *
919  * @return a pointer to Setting_GenGroupItem_Data
920  */
921 Setting_GenGroupItem_Data *setting_create_Gendial_field_titleItem(
922                                                 Evas_Object *genlist,
923                                                 const Elm_Genlist_Item_Class *itc,
924                                                 const char *keyStr,
925                                                 setting_call_back_func gl_sel)
926 {
927         /* SETTING_TRACE_BEGIN; */
928         Setting_GenGroupItem_Data *item_data =
929             (Setting_GenGroupItem_Data *) calloc(1,
930                                                  sizeof
931                                                  (Setting_GenGroupItem_Data));
932         setting_retvm_if(!item_data, NULL, "calloc failed");
933         item_data->keyStr = (char *)g_strdup(keyStr);
934         if (gl_sel) {
935                 item_data->item =
936                     elm_genlist_item_append(genlist, itc, item_data, NULL,
937                                             ELM_GENLIST_ITEM_NONE, gl_sel,
938                                             NULL);
939         } else {
940                 item_data->item =
941                     elm_genlist_item_append(genlist, itc, item_data, NULL,
942                                             ELM_GENLIST_ITEM_NONE,
943                                             _gl_Gendial_sel, NULL);
944         }
945         return item_data;
946 }
947
948 /**
949  * Create 1radio-1text style item
950  *
951  * @return a pointer to Setting_GenGroupItem_Data
952  */
953
954 Setting_GenGroupItem_Data *setting_create_Gendial_field_1radio(
955                                         Evas_Object *genlist,
956                                         const Elm_Genlist_Item_Class *itc,
957                                         setting_call_back_func gl_sel,
958                                         void *sel_data,
959                                         SWALLOW_Type swallow_type,
960                                         Evas_Object *rgd, int chk_status,
961                                         const char *keyStr,
962                                         setting_call_back_func chk_change_cb)
963 {
964         /* SETTING_TRACE_BEGIN; */
965         Setting_GenGroupItem_Data *item_data =
966             (Setting_GenGroupItem_Data *) calloc(1,
967                                                  sizeof
968                                                  (Setting_GenGroupItem_Data));
969         setting_retvm_if(!item_data, NULL, "calloc failed");
970         item_data->keyStr = (char *)g_strdup(keyStr);
971         item_data->swallow_type = swallow_type;
972         item_data->chk_status = chk_status;
973         item_data->chk_change_cb = chk_change_cb;
974         item_data->rgd = rgd;
975
976         if (gl_sel) {
977                 item_data->item =
978                     elm_genlist_item_append(genlist, itc, item_data, NULL,
979                                             ELM_GENLIST_ITEM_NONE, gl_sel,
980                                             sel_data);
981         } else {
982                 item_data->item =
983                     elm_genlist_item_append(genlist, itc, item_data, NULL,
984                                             ELM_GENLIST_ITEM_NONE,
985                                             _gl_Gendial_sel, sel_data);
986         }
987         return item_data;
988 }
989
990 Setting_GenGroupItem_Data *setting_create_Gendial_field_2radio(
991                                         Evas_Object *genlist,
992                                         const Elm_Genlist_Item_Class *itc,
993                                         setting_call_back_func gl_sel,
994                                         void *sel_data,
995                                         SWALLOW_Type swallow_type,
996                                         Evas_Object *rgd, int chk_status,
997                                         const char *keyStr,
998                                         const char *sub_desc,
999                                         setting_call_back_func chk_change_cb)
1000 {
1001         /* SETTING_TRACE_BEGIN; */
1002         Setting_GenGroupItem_Data *item_data =
1003             (Setting_GenGroupItem_Data *) calloc(1,
1004                                                  sizeof
1005                                                  (Setting_GenGroupItem_Data));
1006         setting_retvm_if(!item_data, NULL, "calloc failed");
1007         item_data->keyStr = (char *)g_strdup(keyStr);
1008         item_data->sub_desc = (char *)g_strdup(sub_desc);
1009         item_data->swallow_type = swallow_type;
1010         item_data->chk_status = chk_status;
1011         item_data->chk_change_cb = chk_change_cb;
1012         item_data->rgd = rgd;
1013
1014         if (gl_sel) {
1015                 item_data->item =
1016                     elm_genlist_item_append(genlist, itc, item_data, NULL,
1017                                             ELM_GENLIST_ITEM_NONE, gl_sel,
1018                                             sel_data);
1019         } else {
1020                 item_data->item =
1021                     elm_genlist_item_append(genlist, itc, item_data, NULL,
1022                                             ELM_GENLIST_ITEM_NONE,
1023                                             _gl_Gendial_sel, sel_data);
1024         }
1025         return item_data;
1026 }
1027
1028 /**
1029  * Create common style item with menu icon
1030  *
1031  * @return a pointer to Setting_GenGroupItem_Data
1032  */
1033 Setting_GenGroupItem_Data *setting_create_Gendial_field_groupitem(
1034                                         Evas_Object *genlist,
1035                                         const Elm_Genlist_Item_Class *itc,
1036                                         Elm_Object_Item *parent,
1037                                         setting_call_back_func gl_sel,
1038                                         void *sel_data,
1039                                         SWALLOW_Type swallow_type,
1040                                         char *l_icon_path,
1041                                         char *r_icon_path, int chk_status,
1042                                         const char *keyStr, char *sub_desc,
1043                                         setting_call_back_func
1044                                         chk_change_cb)
1045 {
1046 //      SETTING_TRACE_BEGIN;
1047         Setting_GenGroupItem_Data *item_data = (
1048                 Setting_GenGroupItem_Data *) calloc(1, sizeof(Setting_GenGroupItem_Data));
1049         setting_retvm_if(!item_data, NULL, "calloc failed");
1050
1051         /* to do formatting customizition in one place */
1052         if (SWALLOW_Type_LAYOUT_SPECIALIZTION == swallow_type
1053             || SWALLOW_Type_LAYOUT_SPECIALIZTION_X == swallow_type) {
1054                 elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
1055
1056                 char speciliztion[MAX_SPECIALIZITION_LEN] = { 0, };
1057                 char* temp1 = (char *)keyStr;
1058                 char*temp2 = strchr(temp1, '&');
1059                 char* temp = NULL;
1060
1061                 while (NULL != temp2) {
1062                         if (0 == safeStrNCmp(temp2, "&amp;", strlen("&amp;")) ||//'&'
1063                             0 == safeStrNCmp(temp2, "&lt;", strlen("&lt;")) ||//'<'
1064                             0 == safeStrNCmp(temp2, "&gt;", strlen("&gt;")) ||//'>'
1065                             0 == safeStrNCmp(temp2, "&quot;", strlen("&quot;")) ||//double quotes
1066                             0 == safeStrNCmp(temp2, "&apos;", strlen("&apos;")) ||//single quotes
1067                             0 == safeStrNCmp(temp2, "&nbsp;", strlen("&nbsp;")) ||//space character
1068                             0 == safeStrNCmp(temp2, "&copy;", strlen("&copy;")) ||//copyright character
1069                             0 == safeStrNCmp(temp2, "&reg;", strlen("&reg;"))//registeration character
1070                            ) {//escape character,do nothing
1071                            temp = temp2 + 1;
1072                            if ('\0' == temp[0]) break;
1073                            temp2 = strchr(temp, '&');
1074                         }
1075                         else
1076                         {
1077                                 g_strlcat(speciliztion, temp1, temp2 - temp1 +1);
1078                                 g_strlcat(speciliztion, "&amp;", MAX_SPECIALIZITION_LEN);
1079                                 temp1 = temp2 + 1;
1080                                 if ('\0' == temp1[0]) break;
1081                                 temp2 = strchr(temp1, '&');
1082                         }
1083                 }
1084                 if ('\0' != temp1[0]) {
1085                         g_strlcat(speciliztion, temp1, MAX_SPECIALIZITION_LEN);
1086                 }
1087
1088
1089                 item_data->keyStr = (char *)g_strdup(speciliztion);
1090         } else {
1091                 item_data->keyStr = (char *)g_strdup(keyStr);
1092         }
1093
1094         item_data->sub_desc = (char *)g_strdup(sub_desc);
1095         item_data->swallow_type = swallow_type;
1096         item_data->l_swallow_path = (char *)g_strdup(l_icon_path);
1097         item_data->r_swallow_path = (char *)g_strdup(r_icon_path);
1098         item_data->chk_status = chk_status;
1099         item_data->chk_change_cb = chk_change_cb;
1100
1101         if (gl_sel) {
1102                 item_data->item =
1103                     elm_genlist_item_append(genlist, itc, item_data, parent,
1104                                             ELM_GENLIST_ITEM_NONE, gl_sel,
1105                                             sel_data);
1106         } else {
1107                 item_data->item =
1108                     elm_genlist_item_append(genlist, itc, item_data, parent,
1109                                             ELM_GENLIST_ITEM_NONE,
1110                                             _gl_Gendial_sel, sel_data);
1111         }
1112         if (SWALLOW_Type_LAYOUT_SPECIALIZTION == swallow_type) {
1113                 Elm_Object_Item *item = elm_genlist_item_append(genlist,
1114                                                                 &(itc_sep_line),
1115                                                                 NULL, NULL,
1116                                                                 ELM_GENLIST_ITEM_NONE,
1117                                                                 NULL, NULL);
1118                 elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
1119                 //Fix the separator line disappear issue when clicking "SPECIALIZTION" words in new HD theme
1120                 elm_genlist_item_select_mode_set(item_data->item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
1121         }
1122
1123         return item_data;
1124 }
1125
1126 /**
1127  * Common function to create a genlist item
1128  * @return a pointer to Setting_GenGroupItem_Data
1129  */
1130 Setting_GenGroupItem_Data *setting_create_Gendial_field_def(Evas_Object *
1131                                                             genlist,
1132                                                             const Elm_Genlist_Item_Class *itc,
1133                                                             setting_call_back_func
1134                                                             gl_sel,
1135                                                             void *sel_data,
1136                                                             SWALLOW_Type
1137                                                             swallow_type,
1138                                                             char *l_icon_path,
1139                                                             char *r_icon_path,
1140                                                             int chk_status,
1141                                                             const char *keyStr,
1142                                                             char *sub_desc,
1143                                                             setting_call_back_func chk_change_cb)
1144 {
1145         return setting_create_Gendial_field_groupitem(genlist, itc, NULL,
1146                                                       gl_sel, sel_data,
1147                                                       swallow_type, l_icon_path,
1148                                                       r_icon_path, chk_status,
1149                                                       keyStr, sub_desc,
1150                                                       chk_change_cb);
1151 }
1152
1153 /**
1154  * Create 1entry style item
1155  * @return a pointer to Setting_GenGroupItem_Data
1156  */
1157 Setting_GenGroupItem_Data *setting_create_Gendial_field_entry(Evas_Object *
1158                                                               genlist,
1159                                                               const Elm_Genlist_Item_Class *itc,
1160                                                               setting_call_back_func gl_sel,
1161                                                               void *sel_data,
1162                                                               SWALLOW_Type
1163                                                               swallow_type,
1164                                                               char *l_icon_path,
1165                                                               char *r_icon_path,
1166                                                               int chk_status,
1167                                                               const char *keyStr,
1168                                                               char *sub_desc,
1169                                                               setting_call_back_func
1170                                                               chk_change_cb,
1171                                                               Elm_Input_Panel_Layout
1172                                                               input_type,
1173                                                               bool isPasswordFlag,
1174                                                               bool isFocusFlag,
1175                                                               int max_char_count,
1176                                                               int max_byte_count,
1177                                                               char *accepted,
1178                                                               char *rejected)
1179 {
1180         /* SETTING_TRACE_BEGIN; */
1181         Setting_GenGroupItem_Data *item_data = (Setting_GenGroupItem_Data *) calloc(1,
1182                                                  sizeof (Setting_GenGroupItem_Data));
1183         setting_retvm_if(!item_data, NULL, "calloc failed");
1184         item_data->keyStr = (char *)g_strdup(keyStr);
1185         item_data->sub_desc = (char *)g_strdup(sub_desc);
1186         item_data->swallow_type = swallow_type;
1187         item_data->l_swallow_path = (char *)g_strdup(l_icon_path);
1188         item_data->r_swallow_path = (char *)g_strdup(r_icon_path);
1189         item_data->chk_status = chk_status;
1190         item_data->chk_change_cb = chk_change_cb;
1191
1192         item_data->input_type = input_type;
1193         item_data->isPasswordFlag = isPasswordFlag;
1194         item_data->isFocusFlag = isFocusFlag;
1195
1196         Elm_Entry_Filter_Accept_Set *digits_filter_data =
1197             (Elm_Entry_Filter_Accept_Set *) calloc(1, sizeof (Elm_Entry_Filter_Accept_Set));
1198         if(!digits_filter_data) {
1199                 SETTING_TRACE_ERROR("calloc Elm_Entry_Filter_Accept_Set failed");
1200                 // free allocated data
1201                 G_FREE(item_data->keyStr);
1202                 G_FREE(item_data->sub_desc);
1203                 G_FREE(item_data->l_swallow_path);
1204                 G_FREE(item_data->r_swallow_path);
1205                 FREE(item_data);
1206                 return NULL;
1207         }
1208
1209
1210         Elm_Entry_Filter_Limit_Size *limit_filter_data =
1211             (Elm_Entry_Filter_Limit_Size *) calloc(1, sizeof (Elm_Entry_Filter_Limit_Size));
1212         if(!limit_filter_data) {
1213                 SETTING_TRACE_ERROR("calloc Elm_Entry_Filter_Limit_Size failed");
1214
1215                 // free allocated data
1216                 G_FREE(item_data->keyStr);
1217                 G_FREE(item_data->sub_desc);
1218                 G_FREE(item_data->l_swallow_path);
1219                 G_FREE(item_data->r_swallow_path);
1220                 FREE(item_data);
1221                 FREE(digits_filter_data);
1222                 return NULL;
1223         }
1224
1225         limit_filter_data->max_char_count = max_char_count;
1226         limit_filter_data->max_byte_count = max_byte_count;
1227         digits_filter_data->accepted = (char *)g_strdup(accepted);
1228         digits_filter_data->rejected = (char *)g_strdup(rejected);
1229
1230         item_data->digits_filter_data = digits_filter_data;
1231         item_data->limit_filter_data = limit_filter_data;
1232         item_data->userdata = sel_data;
1233
1234         if (gl_sel) {
1235                 item_data->item =
1236                     elm_genlist_item_append(genlist, itc, item_data, NULL,
1237                                             ELM_GENLIST_ITEM_NONE, gl_sel,
1238                                             sel_data);
1239         } else {
1240                 item_data->item =
1241                     elm_genlist_item_append(genlist, itc, item_data, NULL,
1242                                             ELM_GENLIST_ITEM_NONE,
1243                                             _gl_Gendial_sel, sel_data);
1244         }
1245         return item_data;
1246 }
1247
1248 /**
1249  * General function to create a parent item of expandable item
1250  *
1251  * @return a pointer to Setting_GenGroupItem_Data
1252  */
1253 Setting_GenGroupItem_Data *setting_create_Gendial_exp_parent_field(
1254                                                 Evas_Object *genlist,
1255                                                 const Elm_Genlist_Item_Class *itc,
1256                                                 setting_call_back_func gl_sel,
1257                                                 void *sel_data,
1258                                                 SWALLOW_Type swallow_type,
1259                                                 const char *keyStr,
1260                                                 char *sub_desc)
1261 {
1262         /* SETTING_TRACE_BEGIN; */
1263         Setting_GenGroupItem_Data *item_data =
1264             (Setting_GenGroupItem_Data *) calloc(1,
1265                                                  sizeof
1266                                                  (Setting_GenGroupItem_Data));
1267         setting_retvm_if(!item_data, NULL, "calloc failed");
1268         item_data->keyStr = (char *)g_strdup(keyStr);
1269         item_data->sub_desc = (char *)g_strdup(sub_desc);
1270         item_data->swallow_type = swallow_type;
1271         item_data->childs = NULL;
1272
1273         if (gl_sel) {
1274                 item_data->item =
1275                     elm_genlist_item_append(genlist, itc, item_data, NULL,
1276                                             ELM_GENLIST_ITEM_TREE, gl_sel,
1277                                             sel_data);
1278         } else {
1279                 item_data->item =
1280                     elm_genlist_item_append(genlist, itc, item_data, NULL,
1281                                             ELM_GENLIST_ITEM_TREE,
1282                                             _gl_Gendial_sel_expand, sel_data);
1283         }
1284         return item_data;
1285 }
1286
1287 /**
1288  * General function to create a subitem of expandable item
1289  *
1290  * @return a pointer to Setting_GenGroupItem_Data
1291  */
1292 Setting_GenGroupItem_Data *setting_create_Gendial_exp_sub_field(
1293                                         Evas_Object *genlist,
1294                                         const Elm_Genlist_Item_Class *itc,
1295                                         setting_call_back_func gl_sel,
1296                                         void *sel_data,
1297                                         Elm_Object_Item *parent,
1298                                         SWALLOW_Type swallow_type,
1299                                         Evas_Object *rgd, int chk_status,
1300                                         const char *keyStr,
1301                                         setting_call_back_func
1302                                         chk_change_cb)
1303 {
1304         /* SETTING_TRACE_BEGIN; */
1305         Setting_GenGroupItem_Data *item_data =
1306             (Setting_GenGroupItem_Data *) calloc(1,
1307                                                  sizeof
1308                                                  (Setting_GenGroupItem_Data));
1309         setting_retvm_if(!item_data, NULL, "calloc failed");
1310         item_data->keyStr = (char *)g_strdup(keyStr);
1311         item_data->swallow_type = swallow_type;
1312         item_data->chk_status = chk_status;
1313         item_data->rgd = rgd;
1314
1315         if (!gl_sel) {
1316                 gl_sel = setting_sub_list_sel_cb;
1317         }
1318         if (!chk_change_cb) {
1319                 chk_change_cb = setting_sub_list_rd_change;
1320         }
1321
1322         item_data->chk_change_cb = chk_change_cb;
1323         item_data->item =
1324             elm_genlist_item_append(genlist, itc, item_data, parent,
1325                                     ELM_GENLIST_ITEM_NONE, gl_sel, sel_data);
1326         return item_data;
1327 }
1328
1329 /**
1330  * To make genlist support expandable style item
1331  */
1332 void setting_enable_expandable_genlist(Evas_Object *genlist, void *data,
1333                                        setting_call_back_func gl_exp_cb,
1334                                        setting_call_back_func gl_smart_cb)
1335 {
1336         ret_if(NULL == genlist);
1337         elm_genlist_tree_effect_enabled_set(genlist, TRUE);
1338         if (!gl_smart_cb) {
1339                 gl_smart_cb = __exp_list_smart_cb;
1340         }
1341
1342         if (gl_exp_cb)
1343                 evas_object_smart_callback_add(genlist, "expanded", gl_exp_cb, data);
1344         evas_object_smart_callback_add(genlist, "contracted", gl_smart_cb, "contracted");
1345
1346         evas_object_smart_callback_add(genlist, "drag", gl_smart_cb, "drag");
1347         evas_object_smart_callback_add(genlist, "longpressed", gl_smart_cb, "longpressed");
1348 }
1349
1350 /*
1351 example:
1352
1353 setting_create_Gendial_itc("dialogue/1text.2icon.2",
1354                                                         &(networkUG->itc_1text_2icon));
1355
1356 1. create a process genlist item : [intial state is 'PROCESS']
1357 ad->data_searching_net = setting_create_Gendial_field_1radio(scroller, &(ad->itc_1text_2icon),
1358                                                 setting_network_select_network_mouse_up_Gendial_list_radio_cb, ad,
1359                                                 SWALLOW_Type_1RADIO_1PROCESS,
1360                                                 ad->chk_sel, TAPI_NETWORK_SELECTIONMODE_MANUAL,
1361                                                 "Searching..", NULL);
1362 or [intial state is 'UNPROCESS']
1363 ad->data_searching_net = setting_create_Gendial_field_1radio(scroller, &(ad->itc_1text_2icon),
1364                                                 setting_network_select_network_mouse_up_Gendial_list_radio_cb, ad,
1365                                                 SWALLOW_Type_1RADIO,
1366                                                 ad->chk_sel, TAPI_NETWORK_SELECTIONMODE_MANUAL,
1367                                                 "Searching..", NULL);
1368
1369 2. to set the PROCESS state at any place as you like:
1370 setting_begin_progress_genlist_item(ad->data_searching_net); -- change from UNPROCESS->PROCESS
1371 setting_finish_progress_genlist_item(ad->data_searching_net);--change from PROCESS->UNPROCESS
1372 */
1373 void setting_begin_progress_genlist_item(Setting_GenGroupItem_Data *data_item)
1374 {
1375         if (data_item) {
1376                 if (SWALLOW_Type_1RADIO != data_item->swallow_type) {
1377                         return;
1378                 }
1379
1380                 data_item->swallow_type = SWALLOW_Type_1RADIO_1PROCESS;
1381                 elm_object_item_data_set(data_item->item, data_item);
1382                 elm_genlist_item_update(data_item->item);
1383         }
1384 }
1385
1386 void setting_finish_progress_genlist_item(Setting_GenGroupItem_Data *data_item)
1387 {
1388         if (data_item) {
1389                 if (SWALLOW_Type_1RADIO_1PROCESS != data_item->swallow_type) {
1390                         return;
1391                 }
1392                 data_item->swallow_type = SWALLOW_Type_1RADIO;
1393                 elm_object_item_data_set(data_item->item, data_item);
1394                 elm_genlist_item_update(data_item->item);
1395         }
1396 }
1397
1398 /**
1399 * Check if some item is selected in done-list
1400 */
1401
1402 bool setting_done_list_is_some_item_selected(Setting_Done_List_Data *list_data)
1403 {
1404         SETTING_TRACE_BEGIN;
1405         bool isFound = FALSE;   /* wether can found some item checked */
1406         int idx = 0;
1407         int state = 0;
1408         for (; idx < list_data->cur_item_num; idx++) {
1409                 state =
1410                     elm_check_state_get(list_data->chk_items[idx].
1411                                         data_GenItem->eo_check);
1412                 if (state) {
1413                         isFound = TRUE;
1414                         break;
1415                 }
1416         }
1417         return isFound;
1418 }
1419
1420 static void __setting_done_list_item_sel(void *data)
1421 {
1422         SETTING_TRACE_BEGIN;
1423         retm_if(data == NULL, "data == NULL");
1424         Setting_Done_List_Data *list_data = (Setting_Done_List_Data *)data;
1425
1426         int sel_num = 0;
1427         int idx = 0;
1428
1429         setting_create_sel_info_popup(list_data->ly_parent,
1430                                       &(list_data->selInfoPop_layout),
1431                                       &(list_data->selInfoPop));
1432
1433         /* else for other checks, do rotinue checking */
1434         bool isFound = FALSE;   /* wether found the item not checked */
1435         for (idx = 0; idx < list_data->cur_item_num; idx++) {
1436                 if (!list_data->chk_items[idx].data_GenItem->chk_status) {
1437                         /* SETTING_TRACE("%s not select", _(list_data->chk_items[idx].item_name)); */
1438                         isFound = TRUE;
1439                         /* break; */
1440                 } else {
1441                         /* SETTING_TRACE("%s select", _(list_data->chk_items[idx].item_name)); */
1442                         sel_num++;
1443                 }
1444         }
1445
1446         if (isFound) {  /* reset state of chk_sel_all */
1447                 list_data->select_all_checked = 0;
1448                 elm_check_state_pointer_set(list_data->select_all_checkbox, &list_data->select_all_checked);
1449         } else {
1450                 list_data->select_all_checked = 1;
1451                 elm_check_state_pointer_set(list_data->select_all_checkbox, &list_data->select_all_checked);
1452         }
1453
1454         /* SETTING_TRACE("sel_num:%d", sel_num); */
1455         if (!sel_num) {
1456                 Elm_Object_Item *button = elm_toolbar_first_item_get(list_data->controllbar);
1457                 elm_object_item_disabled_set(button, EINA_TRUE);
1458                 evas_object_hide(list_data->selInfoPop);
1459                 return;
1460         }
1461         char text[MAX_DISPLAY_NAME_LEN_ON_UI +1] = {0, };
1462         snprintf(text, MAX_DISPLAY_NAME_LEN_ON_UI, "%s(%d)", _("IDS_ST_OPT_SELECTED"), sel_num);
1463
1464         /*  text set and timeout set */
1465         edje_object_part_text_set(_EDJ(list_data->selInfoPop_layout), "elm.text", text);
1466
1467         Elm_Object_Item *button = elm_toolbar_first_item_get(list_data->controllbar);
1468         elm_object_item_disabled_set(button, EINA_FALSE);
1469 }
1470
1471 /**
1472 * Do process when clicking the check object in the done-list item
1473 */
1474 void setting_done_list_Gendial_chk_btn_cb(void *data, Evas_Object *obj,
1475                                           void *event_info)
1476 {
1477         SETTING_TRACE_BEGIN;
1478         /* error check */
1479         retm_if(data == NULL, "Data parameter is NULL");
1480         Setting_GenGroupItem_Data *list_item = (Setting_GenGroupItem_Data *) data;
1481
1482         /* new status */
1483         list_item->chk_status = elm_check_state_get(list_item->eo_check);
1484
1485         Setting_Done_List_Data *list_data = list_item->userdata;
1486         __setting_done_list_item_sel(list_data);
1487 }
1488
1489 static void setting_done_list_Gendial_mouse_up_cb(void *data, Evas_Object *obj,
1490                                                   void *event_info)
1491 {
1492         /* error check */
1493         retm_if(event_info == NULL, "Invalid argument: event info is NULL");
1494         Elm_Object_Item *item = (Elm_Object_Item *) event_info;
1495         elm_genlist_item_selected_set(item, 0);
1496         Setting_GenGroupItem_Data *list_item =
1497             (Setting_GenGroupItem_Data *) elm_object_item_data_get(item);
1498
1499         int old_status = elm_check_state_get(list_item->eo_check);
1500         /* new status */
1501         list_item->chk_status = !old_status;
1502         elm_check_state_set(list_item->eo_check, list_item->chk_status);
1503
1504         /* other process.. */
1505         Setting_Done_List_Data *list_data = list_item->userdata;
1506         __setting_done_list_item_sel(list_data);
1507 }
1508
1509 static void __setting_select_all_done(void *data)
1510 {
1511         SETTING_TRACE_BEGIN;
1512         retm_if(data == NULL, "data == NULL");
1513         Setting_Done_List_Data *list_data = (Setting_Done_List_Data *)data;
1514
1515         int sel_num = 0;
1516         int idx = 0;
1517
1518         setting_create_sel_info_popup(list_data->ly_parent,
1519                                       &(list_data->selInfoPop_layout),
1520                                       &(list_data->selInfoPop));
1521
1522         if (list_data->select_all_checked) {
1523                 /* set all other checks state to be 1 */
1524                 SETTING_TRACE_DEBUG("Select All checked");
1525                 for (idx = 0; idx < list_data->cur_item_num; idx++) {
1526                         list_data->chk_items[idx].data_GenItem->chk_status = 1;
1527                         elm_object_item_data_set(list_data->chk_items[idx].data_GenItem->item, list_data->chk_items [idx].data_GenItem);
1528                         elm_genlist_item_update(list_data->chk_items [idx].data_GenItem->item);
1529                 }
1530                 sel_num = list_data->cur_item_num;
1531         } else {
1532                 SETTING_TRACE_DEBUG("Select All unchecked");
1533                 /* set all other checks state to be 0 */
1534                 for (idx = 0; idx < list_data->cur_item_num; idx++) {
1535                         list_data->chk_items[idx].data_GenItem->chk_status = 0;
1536                         elm_object_item_data_set(list_data->chk_items[idx].data_GenItem->item, list_data->chk_items[idx].data_GenItem);
1537                         elm_genlist_item_update(list_data->chk_items[idx].data_GenItem->item);
1538                 }
1539                 sel_num = 0;
1540         }
1541
1542         /* SETTING_TRACE("sel_num:%d", sel_num); */
1543         if (!sel_num) {
1544                 Elm_Object_Item *button = elm_toolbar_first_item_get(list_data->controllbar);
1545                 elm_object_item_disabled_set(button, EINA_TRUE);
1546                 evas_object_hide(list_data->selInfoPop);
1547                 return;
1548         }
1549         char text[MAX_DISPLAY_NAME_LEN_ON_UI +1] = {0, };
1550         snprintf(text, MAX_DISPLAY_NAME_LEN_ON_UI, "%s(%d)", _("IDS_ST_OPT_SELECTED"), sel_num);
1551
1552         /*  text set and timeout set */
1553         edje_object_part_text_set(_EDJ(list_data->selInfoPop_layout), "elm.text", text);
1554         Elm_Object_Item *button = elm_toolbar_first_item_get(list_data->controllbar);
1555         elm_object_item_disabled_set(button, EINA_FALSE);
1556 }
1557
1558 static void __setting_select_all_layout_mouse_down_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
1559 {
1560         SETTING_TRACE_BEGIN;
1561         retm_if(data == NULL, "data == NULL");
1562         Setting_Done_List_Data *list_data = (Setting_Done_List_Data *)data;
1563
1564         list_data->select_all_checked = !list_data->select_all_checked;
1565         elm_check_state_pointer_set(list_data->select_all_checkbox, &list_data->select_all_checked);
1566
1567         __setting_select_all_done(list_data);
1568 }
1569
1570 static void __setting_select_all_check_changed_cb(void *data, Evas_Object *obj, void *event_info)
1571 {
1572         SETTING_TRACE_BEGIN;
1573         retm_if(data == NULL, "data == NULL");
1574         Setting_Done_List_Data *list_data = (Setting_Done_List_Data *)data;
1575
1576         list_data->select_all_checked = elm_check_state_get(list_data->select_all_checkbox);
1577         elm_check_state_pointer_set(list_data->select_all_checkbox, &list_data->select_all_checked);
1578         __setting_select_all_done(data);
1579 }
1580
1581 /**
1582 * The API to create done-list.
1583 *
1584 * @param[in] list_data
1585 * @return a done-list
1586 */
1587 Evas_Object *setting_create_done_list(Setting_Done_List_Data *list_data)
1588 {
1589         SETTING_TRACE_BEGIN;
1590         retvm_if(list_data == NULL, NULL, "list_data == NULL");
1591         Evas_Object *sub_layout = elm_layout_add(list_data->win_main);
1592         elm_layout_file_set(sub_layout, SETTING_THEME_EDJ_NAME, "search_layout");
1593         evas_object_size_hint_weight_set(sub_layout, EVAS_HINT_EXPAND, 0.0);
1594         evas_object_show(sub_layout);
1595
1596         setting_create_Gendial_itc("1text.1icon.2", &(list_data->itc_1text_1icon));
1597
1598         Evas_Object *select_all_layout = elm_layout_add(sub_layout);
1599         retvm_if(select_all_layout == NULL, NULL, "select_all_layout == NULL");
1600         elm_layout_theme_set(select_all_layout, "genlist", "item", "select_all/default");
1601         evas_object_size_hint_weight_set(select_all_layout, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
1602         evas_object_size_hint_align_set(select_all_layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
1603         evas_object_event_callback_add(select_all_layout, EVAS_CALLBACK_MOUSE_DOWN, __setting_select_all_layout_mouse_down_cb, list_data);
1604
1605         Eina_Bool select_all_checked = list_data->select_all_checked;
1606         Evas_Object *select_all_checkbox = elm_check_add(select_all_layout);
1607         elm_check_state_pointer_set(select_all_checkbox, &select_all_checked);
1608         evas_object_smart_callback_add(select_all_checkbox, "changed", __setting_select_all_check_changed_cb, list_data);
1609         evas_object_propagate_events_set(select_all_checkbox, EINA_FALSE);
1610         elm_object_part_content_set(select_all_layout, "elm.icon", select_all_checkbox);
1611
1612         list_data->select_all_checkbox = select_all_checkbox;
1613         elm_object_part_text_set(select_all_layout, "elm.text", _(KeyStr_Select_All));
1614
1615         Evas_Object *scroller = elm_genlist_add(list_data->win_main);
1616         retvm_if(scroller == NULL, NULL, "scroller == NULL");
1617         elm_genlist_clear(scroller);    /* first to clear list */
1618
1619         elm_object_part_content_set(sub_layout, "search_list", scroller);
1620         elm_object_part_content_set(sub_layout, "search_bar", select_all_layout);
1621
1622         int index = 0;
1623         for (; index < list_data->cur_item_num; index++) {
1624                 list_data->chk_items[index].data_GenItem =
1625                     setting_create_Gendial_field_def(scroller,
1626                                                      &(list_data->itc_1text_1icon),
1627                                                      setting_done_list_Gendial_mouse_up_cb,
1628                                                      list_data,
1629                                                      SWALLOW_Type_1CHECK, NULL,
1630                                                      NULL, 0,
1631                                                      list_data->chk_items
1632                                                      [index].item_name, NULL,
1633                                                      setting_done_list_Gendial_chk_btn_cb);
1634                 if (list_data->chk_items[index].data_GenItem) {
1635                         list_data->chk_items[index].data_GenItem->userdata = list_data;
1636                 } else {
1637                         SETTING_TRACE_ERROR("list_data->chk_items[index].data_GenItem is NULL");
1638                 }
1639
1640         }
1641
1642         return sub_layout;
1643 }
1644
1645 /**
1646 * To disable a specialized genlist item
1647 *
1648 * @param[in] item
1649 */
1650 void setting_disable_genlist_item(Elm_Object_Item *item)
1651 {
1652         if (item) {
1653                 elm_object_item_disabled_set(item, EINA_TRUE); /* make it be dim displayed */
1654         }
1655 }
1656
1657 /**
1658 * To enable a specialized genlist item
1659 *
1660 * @param[in] item
1661 */
1662 void setting_enable_genlist_item(Elm_Object_Item *item)
1663 {
1664         if (item) {
1665                 elm_object_item_disabled_set(item, EINA_FALSE); /* make it be normally displayed */
1666         }
1667 }
1668