2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org/license/
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifdef _CALL_SET_BARRING_SUPPORT
19 #include <Elementary.h>
21 #include "cst-common-string.h"
22 #include "cst-call-setting.h"
24 #include "cst-barring.h"
25 #include "cst-barring-ime.h"
26 #include "cst-widget.h"
27 #include "cst-common.h"
28 #include "cst-tapi-request.h"
31 static void __cst_destroy_genlist_item_styles(void);
32 static void __cst_on_click_cb_onoff(void *data, Evas *evas, Evas_Object *obj, void *event_info);
33 static void __cst_on_click_voice_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info);
34 static void __cst_on_click_cf_voice_video_back_button(void *data, Evas_Object *obj, void *event_info);
36 static Elm_Genlist_Item_Class *itc_1text_1icon = NULL;
37 static Elm_Genlist_Item_Class *itc_1text = NULL;
38 Evas_Object *ec_item[3];
40 static Evas_Object *barring_gl = NULL;
42 static gboolean keypad_enabled = EINA_FALSE;
44 static CstGlItemDisplayInfo_t list_call_type[] = {
45 {1, CST_STR_VOICECALL, ELM_GENLIST_ITEM_NONE, CST_GL_ITEM_TEXT, __cst_on_click_voice_cb},
46 {1, -1, ELM_GENLIST_ITEM_NONE, CST_GL_ITEM_NONE, NULL},
49 static CstGlItemDisplayInfo_t list_call_barring[] = {
50 {1, CST_STR_CALL_ALL_OUTGOING_CALLS, ELM_GENLIST_ITEM_NONE, CST_GL_ITEM_1TEXT_ONOFF_PROGRESS, __cst_on_click_cb_onoff},
51 {1, CST_STR_INTL_CALLS, ELM_GENLIST_ITEM_NONE, CST_GL_ITEM_1TEXT_ONOFF_PROGRESS, __cst_on_click_cb_onoff},
52 {1, CST_STR_CALL_INTL_EXCEPT_HOME, ELM_GENLIST_ITEM_NONE, CST_GL_ITEM_1TEXT_ONOFF_PROGRESS, __cst_on_click_cb_onoff},
53 {1, CST_STR_ALL_INCOMING_CALLS, ELM_GENLIST_ITEM_NONE, CST_GL_ITEM_1TEXT_ONOFF_PROGRESS, __cst_on_click_cb_onoff},
54 {1, CST_STR_CALL_INCOMING_WHEN_ROAMING, ELM_GENLIST_ITEM_NONE, CST_GL_ITEM_1TEXT_ONOFF_PROGRESS, __cst_on_click_cb_onoff},
56 {1, -1, ELM_GENLIST_ITEM_NONE, CST_GL_ITEM_NONE, NULL},
59 static void __cst_destroy_genlist_item_styles(void)
61 ENTER(__cst_destroy_genlist_item_styles);
63 if (itc_1text_1icon) {
64 elm_genlist_item_class_free(itc_1text_1icon);
65 itc_1text_1icon = NULL;
68 elm_genlist_item_class_free(itc_1text);
73 void _cst_call_barring_entry_changed_cb(void *data, Evas_Object *obj, void *event_info)
75 ENTER(_cst_call_barring_entry_changed_cb);
77 CstUgData_t *ugd = (CstUgData_t *)data;
78 Evas_Object *btn = NULL;
79 const char *entry_input = NULL;
81 Elm_Object_Item *top_it = elm_naviframe_top_item_get(ugd->nf);
84 entry_input = elm_entry_entry_get(ugd->dg_entry);
85 if ((btn = elm_object_item_part_content_get(top_it, "title_left_btn")) != NULL) {
86 if (entry_input && strlen(entry_input) > 0) {
87 elm_object_disabled_set(btn, EINA_FALSE);
89 elm_object_disabled_set(btn, EINA_TRUE);
92 if (entry_input && strlen(entry_input) > 0) {
93 elm_object_disabled_set(ec_item[0], EINA_FALSE);
95 elm_object_disabled_set(ec_item[0], EINA_TRUE);
100 static void __cst_on_click_cf_voice_video_back_button(void *data, Evas_Object *obj, void *event_info)
102 ENTER(__cst_on_click_cf_voice_video_back_button);
104 retm_if(data == NULL, "NULL UgData");
106 CstUgData_t *ugd = (CstUgData_t *)data;
108 ugd->back_button = _cst_get_navifr_prev_btn(ugd->nf);
109 _cst_cancel_all_ss_request(ugd);
112 static void __cst_on_click_cb_back_button(void *data, Evas_Object *obj, void *event_info)
114 ENTER(__cst_on_click_cb_back_button);
116 __cst_on_click_cf_voice_video_back_button(data, obj, event_info);
118 _cst_destroy_call_barring();
121 static void __cst_disable_cb_glitem(CstGlItemData_t *item_data)
123 ENTER(__cst_disable_cb_glitem);
124 CstUgData_t *ugd = (CstUgData_t *)item_data->ugd;
125 ugd->cb_state[item_data->index] = CST_SS_STATE_OFF;
126 elm_genlist_item_update(item_data->gl_item);
128 elm_object_item_disabled_set(item_data->gl_item, EINA_TRUE);
129 #endif /* _CALL_SET_TBD */
132 static int __cst_update_cb_state(int call_type, int cb_flavour,
133 Eina_Bool cb_state, char *number,
134 int error, int req_action, void *data)
136 retv_if(NULL == data, -1);
137 CstGlItemData_t *item_data = (CstGlItemData_t *)data;
138 CstUgData_t *ugd = item_data->ugd;
139 DBG("call_type=%d (0:voice 1:video)", call_type);
140 DBG("cb_flavour=%d (6:BAOC 7:BAOIC 8:BAOIC exc home 9:BAIC 10:BAIC roaming)", cb_flavour);
141 DBG("cb_state=%d (1:on 0:off), error=%d", cb_state, error);
142 DBG("req_action=%d(0: Activate, 1:Deactivate, 2:Query)", req_action);
143 retv_if((call_type != ugd->call_type && call_type != CST_CALLTYPE_ALL), -1);
145 if (error == CST_ERROR_NONE) {
146 if (cb_state == EINA_TRUE) {
147 ugd->cb_state[item_data->index] = CST_SS_STATE_ON;
149 ugd->cb_state[item_data->index] = CST_SS_STATE_OFF;
151 elm_genlist_item_update(item_data->gl_item);
153 if (req_action != CST_ACTION_QUERY) {
154 if (error != CST_ERROR_SERVICE_UNAVAILABLE &&
155 error != CST_ERROR_REJECTED_BY_NETWORK &&
156 error != CST_ERROR_UNKNOWN) {
157 if (req_action == CST_ACTION_DEACTIVATE) {
158 ugd->cb_state[item_data->index] = CST_SS_STATE_ON;
160 ugd->cb_state[item_data->index] = CST_SS_STATE_OFF;
163 ugd->cb_state[item_data->index] = CST_SS_STATE_OFF;
166 elm_genlist_item_update(item_data->gl_item);
167 ugd->popup = (Evas_Object *)_cst_create_error_popup(ugd->nf, error);
168 evas_object_show(ugd->popup);
170 __cst_disable_cb_glitem(item_data);
176 static void __cst_query_cb_status(CstGlItemData_t *item_data)
178 ENTER(__cst_query_cb_status);
179 ret_if(NULL == item_data);
180 CstUgData_t *ugd = (CstUgData_t *)item_data->ugd;
183 ugd->original_state = EINA_FALSE;
184 switch (item_data->index) {
186 cb_flavour = CST_SSTYPE_CB_OC;
187 DBG("CST_SSTYPE_CB_OC");
190 cb_flavour = CST_SSTYPE_CB_OIC;
191 DBG("CST_SSTYPE_CB_OIC");
194 cb_flavour = CST_SSTYPE_CB_OICEH;
195 DBG("CST_SSTYPE_CB_OICEH");
198 cb_flavour = CST_SSTYPE_CB_IC;
199 DBG("CST_SSTYPE_CB_IC");
202 cb_flavour = CST_SSTYPE_CB_ICR;
203 DBG("CST_SSTYPE_CB_ICR");
210 _cst_add_ss_request(&ugd->req_queue,
211 CST_ACTION_QUERY, ugd->call_type, cb_flavour,
212 NULL, __cst_update_cb_state, item_data, -1, ugd);
215 static void __cst_on_click_cb_ime_done_btn(void *data, Evas_Object *obj, void *event_info)
217 ENTER(__cst_on_click_cb_ime_done_btn);
220 CallSettingSSReq_t *req = (CallSettingSSReq_t *)data;
222 CstGlItemData_t *item_data = (CstGlItemData_t *)req->data;
223 CstUgData_t *ugd = item_data->ugd;
225 Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(ugd->dg_entry);
227 char buffer[CST_MAX_PHONE_NUMBER_LEN];
229 if (_cst_get_cb_input_password(buffer, ugd) > 0) {
230 ugd->cb_state[item_data->index] = CST_SS_STATE_PROGRESS;
231 elm_genlist_item_update(item_data->gl_item);
233 DBG("activate CB pwd=%s", buffer);
234 snprintf(req->number, CST_MAX_PHONE_NUMBER_LEN, "%s", buffer);
235 _cst_add_ss_request(&ugd->req_queue,
236 req->action, req->call_type, req->flavour,
237 req->number, __cst_update_cb_state, item_data, -1, ugd);
240 ecore_imf_context_input_panel_event_callback_del(imf_context, ECORE_IMF_INPUT_PANEL_STATE_EVENT, _cst_call_barring_input_panel_event_callback);
241 ecore_imf_context_input_panel_enabled_set(imf_context, EINA_FALSE);
243 evas_object_smart_callback_del(ugd->dg_entry, "changed", _cst_call_barring_entry_changed_cb);
244 evas_object_smart_callback_del(ugd->dg_entry, "preedit,changed", _cst_call_barring_entry_changed_cb);
246 keypad_enabled = EINA_FALSE;
248 memset(ugd->c_item, 0, sizeof(ugd->c_item));
249 /* ecore_timer_add(CST_NAVIFRAME_ITEM_POP_TIMER, _cst_naviframe_item_pop_cb, ugd);
251 _cst_naviframe_item_pop_cb(ugd);
255 static void __cst_on_click_cb_ime_cancel_btn(void *data, Evas_Object *obj, void *event_info)
257 ENTER(__cst_on_click_cb_ime_cancel_btn);
260 CallSettingSSReq_t *req = (CallSettingSSReq_t *)data;
261 CstGlItemData_t *item_data = (CstGlItemData_t *)req->data;
262 CstUgData_t *ugd = item_data->ugd;
264 Ecore_IMF_Context *imf_context = elm_entry_imf_context_get(ugd->dg_entry);
266 DBG("original state : %d", req->original_state);
267 if (req->original_state == CST_SS_STATE_ON) {
268 ugd->cb_state[item_data->index] = CST_SS_STATE_ON;
270 ugd->cb_state[item_data->index] = CST_SS_STATE_OFF;
272 elm_genlist_item_update(item_data->gl_item);
275 ecore_imf_context_input_panel_event_callback_del(imf_context, ECORE_IMF_INPUT_PANEL_STATE_EVENT, _cst_call_barring_input_panel_event_callback);
276 ecore_imf_context_input_panel_enabled_set(imf_context, EINA_FALSE);
278 evas_object_smart_callback_del(ugd->dg_entry, "changed", _cst_call_barring_entry_changed_cb);
279 evas_object_smart_callback_del(ugd->dg_entry, "preedit,changed", _cst_call_barring_entry_changed_cb);
281 keypad_enabled = EINA_FALSE;
283 memset(ugd->c_item, 0, sizeof(ugd->c_item));
284 /* ecore_timer_add(CST_NAVIFRAME_ITEM_POP_TIMER, _cst_naviframe_item_pop_cb, ugd);
286 _cst_naviframe_item_pop_cb(ugd);
292 static char *__cst_gl_label_get_cb(void *data, Evas_Object *obj, const char *part)
294 retv_if(NULL == data, NULL);
295 CstGlItemData_t *item_data = (CstGlItemData_t *)data;
297 if (strcmp(part, "elm.text") == 0) {
298 if (list_call_barring[item_data->index].str_id != -1) {
299 return strdup(T_(list_call_barring[item_data->index].str_id));
305 static void __cst_gl_del_cb(void *data, Evas_Object *obj)
307 CstGlItemData_t *item_data = (CstGlItemData_t *)data;
314 static void __cst_update_change_cb_req(CstGlItemData_t *item_data, Eina_Bool req_state)
316 ret_if(item_data == NULL);
319 CallSettingSSReq_t *req = NULL;
320 CstUgData_t *ugd = item_data->ugd;
321 Elm_Object_Item *navi_it;
323 req = (CallSettingSSReq_t *)calloc(1, sizeof(CallSettingSSReq_t));
327 req->data = item_data;
328 req->call_type = ugd->call_type;
331 DBG("req_state = %d", req_state);
332 switch (item_data->index) {
334 req->flavour = CST_SSTYPE_CB_OC;
335 DBG("CST_SSTYPE_CB_OC");
338 req->flavour = CST_SSTYPE_CB_OIC;
339 DBG("CST_SSTYPE_CB_OIC");
342 req->flavour = CST_SSTYPE_CB_OICEH;
343 DBG("CST_SSTYPE_CB_OICEH");
346 req->flavour = CST_SSTYPE_CB_IC;
347 DBG("CST_SSTYPE_CB_IC");
350 req->flavour = CST_SSTYPE_CB_ICR;
351 DBG("CST_SSTYPE_CB_ICR");
358 ugd->original_state = !req_state;
359 if (req_state == EINA_TRUE) {
360 req->original_state = CST_SS_STATE_OFF;
361 req->action = CST_ACTION_ACTIVATE;
363 req->original_state = CST_SS_STATE_ON;
364 req->action = CST_ACTION_DEACTIVATE;
367 eo = _cst_create_cb_ime(ugd->nf, NULL, ugd);
369 _cst_remove_naviframe(ugd->nf);
370 navi_it = elm_naviframe_item_push(ugd->nf,
371 T_(CST_STR_PASSWORD), NULL, NULL, eo, NULL);
372 elm_object_item_data_set(navi_it, req);
375 static void __cst_on_click_cb_onoff(void *data, Evas *evas, Evas_Object *obj, void *event_info)
377 ret_if(NULL == data);
378 CstGlItemData_t *item_data = (CstGlItemData_t *)data;
379 CstUgData_t *ugd = item_data->ugd;
380 if (ugd->cb_state[item_data->index] == CST_SS_STATE_PROGRESS) {
384 Eina_Bool check_state = elm_check_state_get(item_data->eo_check);
386 __cst_update_change_cb_req(item_data, !check_state);
387 elm_genlist_item_update(item_data->gl_item);
390 static void __cst_gl_sel_cb(void *data, Evas_Object *obj, void *event_info)
392 ret_if(data == NULL);
393 CstGlItemData_t *item_data = (CstGlItemData_t *)data;
394 elm_genlist_item_selected_set((Elm_Object_Item *)event_info, EINA_FALSE);
395 if (list_call_barring[item_data->index].func) {
396 list_call_barring[item_data->index].func((void *)item_data, NULL, obj, event_info);
401 static void __cst_on_changed_cb_check(void *data, Evas_Object *obj, void *event_info)
403 CstGlItemData_t *item_data = (CstGlItemData_t *)data;
404 Eina_Bool check_state = elm_check_state_get(obj);
406 if (elm_object_item_disabled_get(item_data->gl_item) == EINA_TRUE) {
407 elm_check_state_set(obj, EINA_FALSE);
411 __cst_update_change_cb_req(item_data, check_state);
414 static Evas_Object *__cst_gl_icon_get_cb(void *data, Evas_Object *obj, const char *part)
416 retv_if(NULL == data, NULL);
417 Evas_Object *icon = NULL;
418 CstGlItemData_t *item_data = (CstGlItemData_t *)data;
419 CstUgData_t *ugd = (CstUgData_t *)item_data->ugd;
420 Eina_Bool check_state = EINA_FALSE;
422 if (!strcmp(part, "elm.icon")) {
423 switch (ugd->cb_state[item_data->index]) {
424 case CST_SS_STATE_ON:
425 case CST_SS_STATE_OFF:
426 DBG("ugd->cb_state : %d(%d)",
427 ugd->cb_state[item_data->index], item_data->index);
428 if (ugd->cb_state[item_data->index] == CST_SS_STATE_ON) {
429 check_state = EINA_TRUE;
431 item_data->eo_check = icon = _cst_create_onoff_button(obj, check_state,
432 __cst_on_changed_cb_check, item_data);
434 case CST_SS_STATE_PROGRESS:
435 icon = _cst_create_progressbar(obj);
444 static Evas_Object *__cst_create_genlist_cb(void *data)
446 ENTER(__cst_create_genlist_cb);
447 retv_if(NULL == data, NULL);
448 CstUgData_t *ugd = (CstUgData_t *)data;
450 Evas_Object *genlist;
451 CstGlItemData_t *item_data;
453 itc_1text_1icon->item_style = "dialogue/1text.1icon";
454 itc_1text_1icon->func.text_get = __cst_gl_label_get_cb;
455 itc_1text_1icon->func.content_get = __cst_gl_icon_get_cb;
456 itc_1text_1icon->func.state_get = NULL;
457 itc_1text_1icon->func.del = __cst_gl_del_cb;
459 genlist = elm_genlist_add(ugd->nf);
461 _cst_create_genlist_separator(genlist, EINA_FALSE);
462 for (index = 0; list_call_barring[index].style != CST_GL_ITEM_NONE; ++index) {
463 item_data = (CstGlItemData_t *)calloc(1, sizeof(CstGlItemData_t));
464 retv_if(item_data == NULL, NULL);
465 item_data->index = index;
466 item_data->ugd = ugd;
467 if (list_call_barring[index].style == CST_GL_ITEM_1TEXT_ONOFF_PROGRESS) {
468 ugd->cb_state[index] = CST_SS_STATE_PROGRESS;
469 item_data->gl_item = elm_genlist_item_append(genlist, itc_1text_1icon,
470 (void *)item_data, NULL, list_call_barring[index].flags,
471 __cst_gl_sel_cb, item_data);
472 __cst_query_cb_status(item_data);
480 _cst_create_genlist_separator_no_line(genlist);
485 static void __cst_on_click_voice_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
487 ENTER(__cst_on_click_voice_cb);
488 ret_if(NULL == data);
489 CstUgData_t *ugd = (CstUgData_t *)data;
490 Evas_Object *back_btn = NULL;
492 Elm_Object_Item *navi_it;
494 ugd->call_type = CST_CALLTYPE_VOICE;
497 Evas_Object *genlist = __cst_create_genlist_cb(ugd);
499 layout = elm_layout_add(ugd->nf);
500 elm_layout_file_set(layout, EDJ_NAME, "toolbar");
501 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
502 evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
503 elm_object_part_content_set(layout, "elm.swallow.contents", genlist);
504 navi_it = elm_naviframe_item_push(ugd->nf, T_(CST_STR_VOICE_CALL_BARRING),
505 NULL, NULL, layout, NULL);
506 back_btn = elm_object_item_part_content_get(navi_it, "prev_btn");
507 evas_object_smart_callback_add(back_btn, "clicked",
508 __cst_on_click_cf_voice_video_back_button, ugd);
511 static void __cst_gl_sel_call_type(void *data, Evas_Object *obj, void *event_info)
513 ret_if(data == NULL);
514 CstUgData_t *ugd = (CstUgData_t *)data;
515 Elm_Object_Item *item= (Elm_Object_Item *)event_info;
516 int index = (int)elm_object_item_data_get(item);
517 elm_genlist_item_selected_set(item, EINA_FALSE);
519 if (list_call_type[index].func) {
520 list_call_type[index].func((void *)ugd, NULL, obj, event_info);
525 static char *__cst_gl_label_get_call_type(void *data, Evas_Object *obj, const char *part)
527 int index = (int)data;
529 if (strcmp(part, "elm.text") == 0) {
530 if (list_call_type[index].str_id != -1) {
531 return strdup(T_(list_call_type[index].str_id));
537 static Evas_Object *__cst_create_genlist_call_type(void *data)
539 ENTER(__cst_create_genlist_call_type);
540 retv_if(NULL == data, NULL);
541 CstUgData_t *ugd = (CstUgData_t *)data;
542 Evas_Object *genlist;
545 if (!itc_1text_1icon) {
546 itc_1text_1icon = elm_genlist_item_class_new();
550 itc_1text = elm_genlist_item_class_new();
553 itc_1text->item_style = "dialogue/1text";
554 itc_1text->func.text_get = __cst_gl_label_get_call_type;
555 itc_1text->func.content_get = NULL;
556 itc_1text->func.state_get = NULL;
557 itc_1text->func.del = NULL;
559 genlist = elm_genlist_add(ugd->nf);
561 _cst_create_genlist_separator(genlist, EINA_FALSE);
562 for (index = 0; list_call_type[index].style != CST_GL_ITEM_NONE; index++) {
563 elm_genlist_item_append(genlist, itc_1text,
564 (void *)index, NULL, ELM_GENLIST_ITEM_NONE,
565 __cst_gl_sel_call_type, (void *)ugd);
567 _cst_create_genlist_separator_no_line(genlist);
572 void _cst_call_barring_input_panel_event_callback(void *data, Ecore_IMF_Context *imf_context, int value)
574 ENTER(_cst_call_barring_input_panel_event_callback);
576 CstUgData_t *ugd = (CstUgData_t *)data;
577 Evas_Object *btn = NULL;
578 CallSettingSSReq_t *req = NULL;
579 const char *entry_input = NULL;
581 Elm_Object_Item *top_it = elm_naviframe_top_item_get(ugd->nf);
583 req = (CallSettingSSReq_t *)elm_object_item_data_get(top_it);
586 if (EINA_FALSE == keypad_enabled) {
587 DBG("keypad_enabled = %d", keypad_enabled);
588 keypad_enabled = EINA_TRUE;
592 if (value == ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW) {
596 entry_input = elm_entry_entry_get(ugd->dg_entry);
597 if (value == ECORE_IMF_INPUT_PANEL_STATE_SHOW) {
598 DBG("ECORE_IMF_INPUT_PANEL_STATE_SHOW");
600 elm_object_item_part_content_set(top_it, "toolbar_button1", NULL);
601 elm_object_item_part_content_set(top_it, "toolbar_button2", NULL);
603 btn = _cst_create_title_btn(ugd->nf, (char *)T_(CST_STR_CANCEL),
604 __cst_on_click_cb_ime_cancel_btn, (void *)req);
605 elm_object_item_part_content_set(top_it, "title_right_btn", btn);
607 btn = _cst_create_title_btn(ugd->nf, (char *)T_(CST_STR_DONE),
608 __cst_on_click_cb_ime_done_btn, (void *)req);
609 elm_object_item_part_content_set(top_it, "title_left_btn", btn);
610 if (entry_input && strlen(entry_input) > 0) {
611 elm_object_disabled_set(btn, EINA_FALSE);
613 elm_object_disabled_set(btn, EINA_TRUE);
615 } else if (value == ECORE_IMF_INPUT_PANEL_STATE_HIDE) {
616 DBG("ECORE_IMF_INPUT_PANEL_STATE_HIDE");
617 elm_object_item_part_content_set(top_it, "title_right_btn", NULL);
618 elm_object_item_part_content_set(top_it, "title_left_btn", NULL);
619 _cst_create_navi_control_bar(ugd->nf,
620 (char *)T_(CST_STR_DONE), NULL,
621 __cst_on_click_cb_ime_done_btn,
622 (char *)T_(CST_STR_CANCEL), NULL,
623 __cst_on_click_cb_ime_cancel_btn,
626 if (entry_input && strlen(entry_input) > 0) {
627 elm_object_disabled_set(ec_item[0], EINA_FALSE);
629 elm_object_disabled_set(ec_item[0], EINA_TRUE);
634 void _cst_on_click_call_barring(void *data, Evas *evas, Evas_Object *obj, void *event_info)
636 ENTER(_cst_on_click_call_barring);
637 ret_if(NULL == data);
638 CstUgData_t *ugd = (CstUgData_t *)data;
639 Evas_Object *back_btn = NULL;
640 Elm_Object_Item *navi_it;
642 if (_cst_check_flight_mode()) {
643 ugd->popup = _cst_create_error_popup(ugd->nf,
644 CST_ERROR_CHANGE_FLIGHT_MODE);
645 evas_object_show(ugd->popup);
649 if (!_cst_check_sim_status()) {
650 ugd->popup = _cst_create_error_popup(ugd->nf,
651 CST_ERROR_INSERT_SIM_CARD);
652 evas_object_show(ugd->popup);
656 barring_gl = __cst_create_genlist_call_type(ugd);
657 navi_it = elm_naviframe_item_push(ugd->nf, T_(CST_STR_CALL_BARRING),
658 back_btn, NULL, barring_gl, NULL);
659 back_btn = elm_object_item_part_content_get(navi_it, "prev_btn");
660 evas_object_smart_callback_add(back_btn, "clicked",
661 __cst_on_click_cb_back_button, ugd);
664 void _cst_destroy_call_barring(void)
666 ENTER(_cst_destroy_call_barring);
668 __cst_destroy_genlist_item_styles();
670 if (barring_gl != NULL) {
671 elm_genlist_clear(barring_gl);
672 evas_object_del(barring_gl);
676 #endif /* _CALL_SET_BARRING_SUPPORT */