#define CALLUI_PART_SWALLOW_END_BTN "swallow.end_btn"
+#define CALLUI_EO_DATA_NAME_POPUP "popup"
+
typedef struct {
int index;
- char option_msg[512];
+ char option_msg[CALLUI_BUFF_SIZE_HUG];
} callui_sec_call_popup_data_t;
static int _g_cid_size[CALLUI_CID_SIZE_COUNT] = {
CALLUI_CID_THUMBN_SIZE_BIG
};
-static void __callui_unload_second_call_popup(callui_app_data_t *ad);
-static char *__callui_gl_second_call_option_label_get(void *data, Evas_Object *obj, const char *part);
-static void __callui_gl_second_call_option_del_cb(void *data, Evas_Object *obj);
-static void __callui_gl_second_call_option_sel(void *data, Evas_Object *obj, void *event_info);
-static void __callui_second_call_cancel_btn_response_cb(void *data, Evas_Object *obj, void *event_info);
-static void __callui_unload_bt_popup(callui_app_data_t *ad);
-static void __callui_bt_popup_cancel_btn_cb(void *data, Evas_Object *obj, void *event_info);
-static void __callui_bt_popup_ok_btn_cb(void *data, Evas_Object *obj, void *event_info);
-static void __callui_get_displayed_caller_info_string(const callui_call_data_t *call_data, char *display_string, int display_string_size);
-static Evas_Object *__callui_create_style_layout(Evas_Object *parent, const char *style);
-
-static void __callui_ctxpopup_item_hold_cb(void *data, Evas_Object *obj, void *event_info);
-static void __callui_ctxpopup_item_unhold_cb(void *data, Evas_Object *obj, void *event_info);
-static void __callui_move_more_ctxpopup(Evas_Object *ctxpopup, callui_app_data_t *ad);
-static void __callui_more_ctxpopup_dismiss_cb(void *data, Evas_Object *obj, void *event_info);
-static void __callui_more_ctxpopup_delete_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void __callui_destroy_more_ctxpopup(Evas_Object *ctxpopup, callui_app_data_t *ad);
-
-static Evas_Object *__callui_create_style_layout(Evas_Object *parent, const char *style)
+static void __get_displayed_caller_info_string(const callui_call_data_t *call_data, char *display_string, int display_string_size);
+static Evas_Object *__create_style_layout(Evas_Object *parent, const char *style);
+/* Second call popup */
+static Evas_Object *__second_call_popup_del(Evas_Object *popup);
+static char *__second_call_gl_option_txt_get(void *data, Evas_Object *obj, const char *part);
+static void __second_call_gl_option_del_cb(void *data, Evas_Object *obj);
+static void __second_call_gl_option_sel_cb(void *data, Evas_Object *obj, void *event_info);
+static void __second_call_cancel_btn_response_cb(void *data, Evas_Object *obj, void *event_info);
+/* Bluetooth popup */
+static Evas_Object *__bt_popup_del(Evas_Object *popup);
+static void __bt_popup_cancel_btn_cb(void *data, Evas_Object *obj, void *event_info);
+static void __bt_popup_ok_btn_cb(void *data, Evas_Object *obj, void *event_info);
+/* More menu popup */
+static Evas_Object *__more_ctxpopup_del(Evas_Object *ctxpopup);
+static void __more_ctxpopup_item_hold_cb(void *data, Evas_Object *obj, void *event_info);
+static void __more_ctxpopup_item_unhold_cb(void *data, Evas_Object *obj, void *event_info);
+static void __more_ctxpopup_move(Evas_Object *ctxpopup, callui_app_data_t *ad);
+static void __more_ctxpopup_dismiss_cb(void *data, Evas_Object *obj, void *event_info);
+static void __more_ctxpopup_delete_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void __more_ctxpopup_destroy(Evas_Object *ctxpopup, callui_app_data_t *ad);
+
+static Evas_Object *__create_style_layout(Evas_Object *parent, const char *style)
{
Evas_Object *eo = elm_layout_add(parent);
CALLUI_RETURN_NULL_IF_FAIL(eo);
Evas_Object *_callui_create_layout(Evas_Object *parent, const char *style)
{
- return __callui_create_style_layout(parent, style);
+ return __create_style_layout(parent, style);
}
Evas_Object *_callui_edje_object_part_get(Evas_Object *parent, const char *part)
CALLUI_RETURN_NULL_IF_FAIL(type >= CALLUI_CID_TYPE_SINGLE && type < CALLUI_CID_TYPE_COUNT);
CALLUI_RETURN_NULL_IF_FAIL(size >= CALLUI_CID_SIZE_DEFAULT && size < CALLUI_CID_SIZE_COUNT);
- Evas_Object *layout = __callui_create_style_layout(parent, "caller_id");
+ Evas_Object *layout = __create_style_layout(parent, "caller_id");
CALLUI_RETURN_NULL_IF_FAIL(layout);
evas_object_show(layout);
elm_object_part_content_set(contents, "swallow.caller_id", thumbnail);
}
-static void __callui_unload_second_call_popup(callui_app_data_t *ad)
+static Evas_Object *__second_call_popup_del(Evas_Object *popup)
{
- dbg("..");
- CALLUI_RETURN_IF_FAIL(ad);
- if (ad->second_call_popup) {
- evas_object_del(ad->second_call_popup);
- ad->second_call_popup = NULL;
+ if (popup) {
+ evas_object_del(popup);
}
+ return NULL;
}
-static char *__callui_gl_second_call_option_label_get(void *data, Evas_Object *obj, const char *part)
+static char *__second_call_gl_option_txt_get(void *data, Evas_Object *obj, const char *part)
{
CALLUI_RETURN_VALUE_IF_FAIL(part, NULL);
CALLUI_RETURN_VALUE_IF_FAIL(data, NULL);
}
}
-static void __callui_gl_second_call_option_del_cb(void *data, Evas_Object *obj EINA_UNUSED)
+static void __second_call_gl_option_del_cb(void *data, Evas_Object *obj EINA_UNUSED)
{
callui_sec_call_popup_data_t *item_data = (callui_sec_call_popup_data_t *)data;
free(item_data);
}
-static void __callui_gl_second_call_option_sel(void *data, Evas_Object *obj, void *event_info)
+static void __second_call_gl_option_sel_cb(void *data, Evas_Object *obj, void *event_info)
{
CALLUI_RETURN_IF_FAIL(data);
CALLUI_RETURN_IF_FAIL(event_info);
callui_sec_call_popup_data_t *item_data = NULL;
callui_app_data_t *ad = (callui_app_data_t *)data;
- __callui_unload_second_call_popup(ad);
+ __second_call_popup_del(evas_object_data_get(obj, CALLUI_EO_DATA_NAME_POPUP));
if (item != NULL) {
item_data = (callui_sec_call_popup_data_t *) elm_object_item_data_get(item);
}
}
-static void __callui_second_call_cancel_btn_response_cb(void *data, Evas_Object *obj, void *event_info)
+static void __second_call_cancel_btn_response_cb(void *data, Evas_Object *obj, void *event_info)
{
- dbg("..");
+ CALLUI_RETURN_IF_FAIL(data);
+ CALLUI_RETURN_IF_FAIL(obj);
- callui_app_data_t *ad = (callui_app_data_t*) data;
- __callui_unload_second_call_popup(ad);
- _callui_vm_change_view(ad->view_manager, CALLUI_VIEW_INCOMING_CALL);
+ __second_call_popup_del(obj);
- return;
+ callui_app_data_t *ad = (callui_app_data_t *)data;
+ _callui_vm_change_view(ad->view_manager, CALLUI_VIEW_INCOMING_CALL);
}
-static void __callui_get_displayed_caller_info_string(const callui_call_data_t *call_data, char *display_string, int display_string_size)
+static void __get_displayed_caller_info_string(const callui_call_data_t *call_data, char *display_string, int display_string_size)
{
CALLUI_RETURN_IF_FAIL(call_data);
CALLUI_RETURN_IF_FAIL(display_string);
}
}
-void _callui_load_second_call_popup(callui_app_data_t *ad)
+Evas_Object *_callui_create_second_call_popup(Evas_Object *parent, callui_app_data_t *ad)
{
- dbg("..");
-
- CALLUI_RETURN_IF_FAIL(ad);
+ CALLUI_RETURN_NULL_IF_FAIL(parent);
+ CALLUI_RETURN_NULL_IF_FAIL(ad);
- Evas_Object *box = NULL;
char hold_call_name[CALLUI_BUFF_SIZE_HUG] = { '\0' };
char unhold_call_name[CALLUI_BUFF_SIZE_HUG] = { '\0' };
const char *temp_str = NULL;
callui_sec_call_popup_data_t *item_data = NULL;
- Elm_Genlist_Item_Class *itc = NULL;
- Evas_Object *genlist = NULL;
const callui_call_data_t *hold_call_data = _callui_stp_get_call_data(ad->state_provider, CALLUI_CALL_DATA_HELD);
const callui_call_data_t *unhold_call_data = _callui_stp_get_call_data(ad->state_provider, CALLUI_CALL_DATA_ACTIVE);
- if (unhold_call_data == NULL) {
- err("active call data is null");
- return;
+ if (!unhold_call_data) {
+ err("Active call data is null");
+ return NULL;
}
- __callui_unload_second_call_popup(ad);
-
- ad->second_call_popup = elm_popup_add(_callui_window_get_eo(ad->window));
- CALLUI_RETURN_IF_FAIL(ad->second_call_popup);
- elm_object_style_set(ad->second_call_popup, "theme_bg");
- elm_popup_align_set(ad->second_call_popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
- elm_object_translatable_part_text_set(ad->second_call_popup, "title,text", "IDS_CALL_HEADER_ANSWER_CALL_ABB");
- evas_object_size_hint_weight_set(ad->second_call_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ Evas_Object *popup = elm_popup_add(parent);
+ CALLUI_RETURN_NULL_IF_FAIL(popup);
+ elm_object_style_set(popup, "theme_bg");
+ elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
+ elm_object_translatable_part_text_set(popup, "title,text", "IDS_CALL_HEADER_ANSWER_CALL_ABB");
+ evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- box = elm_box_add(ad->second_call_popup);
- CALLUI_RETURN_IF_FAIL(box);
+ Evas_Object *box = elm_box_add(popup);
+ CALLUI_RETURN_VALUE_IF_FAIL(box, __second_call_popup_del(popup));
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- genlist = elm_genlist_add(box);
- CALLUI_RETURN_IF_FAIL(genlist);
+ Evas_Object *genlist = elm_genlist_add(box);
+ CALLUI_RETURN_VALUE_IF_FAIL(genlist, __second_call_popup_del(popup));
evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_data_set(genlist, CALLUI_EO_DATA_NAME_POPUP, popup);
- itc = elm_genlist_item_class_new();
- CALLUI_RETURN_IF_FAIL(itc);
+ static Elm_Genlist_Item_Class itc = {
+ ELM_GEN_ITEM_CLASS_HEADER,
+ .item_style = "type1",
+ .func.text_get = __second_call_gl_option_txt_get,
+ .func.del = __second_call_gl_option_del_cb,
+ };
- itc->item_style = "type1";
- itc->func.text_get = __callui_gl_second_call_option_label_get;
- itc->func.content_get = NULL;
- itc->func.state_get = NULL;
- itc->func.del = __callui_gl_second_call_option_del_cb;
-
- __callui_get_displayed_caller_info_string(hold_call_data, hold_call_name, CALLUI_BUFF_SIZE_HUG);
- __callui_get_displayed_caller_info_string(unhold_call_data, unhold_call_name, CALLUI_BUFF_SIZE_HUG);
+ __get_displayed_caller_info_string(hold_call_data, hold_call_name, CALLUI_BUFF_SIZE_HUG);
+ __get_displayed_caller_info_string(unhold_call_data, unhold_call_name, CALLUI_BUFF_SIZE_HUG);
if ((unhold_call_data) && (unhold_call_data->conf_member_count == 1) && (hold_call_data == NULL)) {
dbg("1 active call");
+
/* First option */
item_data = (callui_sec_call_popup_data_t *) calloc(1, sizeof(callui_sec_call_popup_data_t));
- if (item_data == NULL) {
- elm_genlist_item_class_free(itc);
- return;
- }
+ CALLUI_RETURN_VALUE_IF_FAIL(item_data, __second_call_popup_del(popup));
item_data->index = 0;
- memset(item_data->option_msg, 0x00, 512);
temp_str = _("IDS_CALL_OPT_PUT_PS_ON_HOLD_ABB");
- snprintf(item_data->option_msg, 512, temp_str, unhold_call_name);
- elm_genlist_item_append(genlist, itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __callui_gl_second_call_option_sel, ad);
+ snprintf(item_data->option_msg, CALLUI_BUFF_SIZE_HUG, temp_str, unhold_call_name);
+ elm_genlist_item_append(genlist, &itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __second_call_gl_option_sel_cb, ad);
/* Second option */
item_data = (callui_sec_call_popup_data_t *) calloc(1, sizeof(callui_sec_call_popup_data_t));
- if (item_data == NULL) {
- elm_genlist_item_class_free(itc);
- return;
- }
+ CALLUI_RETURN_VALUE_IF_FAIL(item_data, __second_call_popup_del(popup));
item_data->index = 1;
- memset(item_data->option_msg, 0x00, 512);
temp_str = _("IDS_CALL_OPT_END_CALL_WITH_PS");
- snprintf(item_data->option_msg, 512, temp_str, unhold_call_name);
- elm_genlist_item_append(genlist, itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __callui_gl_second_call_option_sel, ad);
+ snprintf(item_data->option_msg, CALLUI_BUFF_SIZE_HUG, temp_str, unhold_call_name);
+ elm_genlist_item_append(genlist, &itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __second_call_gl_option_sel_cb, ad);
+
} else if ((unhold_call_data)
&& (unhold_call_data->conf_member_count > 1)
&& (hold_call_data == NULL)) {
dbg("1 active conference call");
+
/* First option */
item_data = (callui_sec_call_popup_data_t *) calloc(1, sizeof(callui_sec_call_popup_data_t));
- if (item_data == NULL) {
- elm_genlist_item_class_free(itc);
- return;
- }
+ CALLUI_RETURN_VALUE_IF_FAIL(item_data, __second_call_popup_del(popup));
item_data->index = 0;
- memset(item_data->option_msg, 0x00, 512);
- strncpy(item_data->option_msg, _("IDS_CALL_BODY_HOLD_ACTIVE_CALL_ABB"), 512-1);
- elm_genlist_item_append(genlist, itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __callui_gl_second_call_option_sel, ad);
+ strncpy(item_data->option_msg, _("IDS_CALL_BODY_HOLD_ACTIVE_CALL_ABB"), CALLUI_BUFF_SIZE_HUG-1);
+ elm_genlist_item_append(genlist, &itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __second_call_gl_option_sel_cb, ad);
/* Second option */
item_data = (callui_sec_call_popup_data_t *) calloc(1, sizeof(callui_sec_call_popup_data_t));
- if (item_data == NULL) {
- elm_genlist_item_class_free(itc);
- return;
- }
+ CALLUI_RETURN_VALUE_IF_FAIL(item_data, __second_call_popup_del(popup));
item_data->index = 1;
- memset(item_data->option_msg, 0x00, 512);
- strncpy(item_data->option_msg, _("IDS_CALL_OPT_END_CONFERENCE_CALL"), 512-1);
- elm_genlist_item_append(genlist, itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __callui_gl_second_call_option_sel, ad);
+ strncpy(item_data->option_msg, _("IDS_CALL_OPT_END_CONFERENCE_CALL"), CALLUI_BUFF_SIZE_HUG-1);
+ elm_genlist_item_append(genlist, &itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __second_call_gl_option_sel_cb, ad);
+
} else if ((unhold_call_data)
&& (hold_call_data) && (unhold_call_data->conf_member_count == 1)
&& (hold_call_data->conf_member_count == 1)) {
dbg("1 active call + 1 held call");
+
/* First option */
item_data = (callui_sec_call_popup_data_t *) calloc(1, sizeof(callui_sec_call_popup_data_t));
- if (item_data == NULL) {
- elm_genlist_item_class_free(itc);
- return;
- }
+ CALLUI_RETURN_VALUE_IF_FAIL(item_data, __second_call_popup_del(popup));
item_data->index = 0;
- memset(item_data->option_msg, 0x00, 512);
temp_str = _("IDS_CALL_OPT_END_CALL_WITH_PS");
- snprintf(item_data->option_msg, 512, temp_str, unhold_call_name);
- elm_genlist_item_append(genlist, itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __callui_gl_second_call_option_sel, ad);
+ snprintf(item_data->option_msg, CALLUI_BUFF_SIZE_HUG, temp_str, unhold_call_name);
+ elm_genlist_item_append(genlist, &itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __second_call_gl_option_sel_cb, ad);
/* Second option */
item_data = (callui_sec_call_popup_data_t *) calloc(1, sizeof(callui_sec_call_popup_data_t));
- if (item_data == NULL) {
- elm_genlist_item_class_free(itc);
- return;
- }
+ CALLUI_RETURN_VALUE_IF_FAIL(item_data, __second_call_popup_del(popup));
item_data->index = 1;
- memset(item_data->option_msg, 0x00, 512);
temp_str = _("IDS_CALL_OPT_END_CALL_WITH_PS");
- snprintf(item_data->option_msg, 512, temp_str, hold_call_name);
- elm_genlist_item_append(genlist, itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __callui_gl_second_call_option_sel, ad);
+ snprintf(item_data->option_msg, CALLUI_BUFF_SIZE_HUG, temp_str, hold_call_name);
+ elm_genlist_item_append(genlist, &itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __second_call_gl_option_sel_cb, ad);
/* Third option */
item_data = (callui_sec_call_popup_data_t *) calloc(1, sizeof(callui_sec_call_popup_data_t));
- if (item_data == NULL) {
- elm_genlist_item_class_free(itc);
- return;
- }
+ CALLUI_RETURN_VALUE_IF_FAIL(item_data, __second_call_popup_del(popup));
item_data->index = 2;
- memset(item_data->option_msg, 0x00, 512);
- strncpy(item_data->option_msg, _("IDS_CALL_OPT_END_ALL_CURRENT_CALLS"), 512-1);
- elm_genlist_item_append(genlist, itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __callui_gl_second_call_option_sel, ad);
+ strncpy(item_data->option_msg, _("IDS_CALL_OPT_END_ALL_CURRENT_CALLS"), CALLUI_BUFF_SIZE_HUG-1);
+ elm_genlist_item_append(genlist, &itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __second_call_gl_option_sel_cb, ad);
+
} else if ((unhold_call_data) && (hold_call_data)
&& (unhold_call_data->conf_member_count > 1)
&& (hold_call_data->conf_member_count == 1)) {
dbg("1 active conf call + 1 held call");
+
/* First option */
item_data = (callui_sec_call_popup_data_t *) calloc(1, sizeof(callui_sec_call_popup_data_t));
- if (item_data == NULL) {
- elm_genlist_item_class_free(itc);
- return;
- }
+ CALLUI_RETURN_VALUE_IF_FAIL(item_data, __second_call_popup_del(popup));
item_data->index = 0;
- memset(item_data->option_msg, 0x00, 512);
- strncpy(item_data->option_msg, "End conference call", 512-1);
- elm_genlist_item_append(genlist, itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __callui_gl_second_call_option_sel, ad);
+ strncpy(item_data->option_msg, "End conference call", CALLUI_BUFF_SIZE_HUG-1);
+ elm_genlist_item_append(genlist, &itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __second_call_gl_option_sel_cb, ad);
/* Second option */
item_data = (callui_sec_call_popup_data_t *) calloc(1, sizeof(callui_sec_call_popup_data_t));
- if (item_data == NULL) {
- elm_genlist_item_class_free(itc);
- return;
- }
+ CALLUI_RETURN_VALUE_IF_FAIL(item_data, __second_call_popup_del(popup));
item_data->index = 1;
- memset(item_data->option_msg, 0x00, 512);
temp_str = _("IDS_CALL_OPT_END_CALL_WITH_PS");
- snprintf(item_data->option_msg, 512, temp_str, hold_call_name);
- elm_genlist_item_append(genlist, itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __callui_gl_second_call_option_sel, ad);
+ snprintf(item_data->option_msg, CALLUI_BUFF_SIZE_HUG, temp_str, hold_call_name);
+ elm_genlist_item_append(genlist, &itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __second_call_gl_option_sel_cb, ad);
/* Third option */
item_data = (callui_sec_call_popup_data_t *) calloc(1, sizeof(callui_sec_call_popup_data_t));
- if (item_data == NULL) {
- elm_genlist_item_class_free(itc);
- return;
- }
+ CALLUI_RETURN_VALUE_IF_FAIL(item_data, __second_call_popup_del(popup));
item_data->index = 2;
- memset(item_data->option_msg, 0x00, 512);
- strncpy(item_data->option_msg, _("IDS_CALL_OPT_END_ALL_CURRENT_CALLS"), 512-1);
- elm_genlist_item_append(genlist, itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __callui_gl_second_call_option_sel, ad);
+ strncpy(item_data->option_msg, _("IDS_CALL_OPT_END_ALL_CURRENT_CALLS"), CALLUI_BUFF_SIZE_HUG-1);
+ elm_genlist_item_append(genlist, &itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __second_call_gl_option_sel_cb, ad);
+
} else if ((unhold_call_data) && (hold_call_data)
&& (unhold_call_data->conf_member_count == 1)
&& (hold_call_data->conf_member_count > 1)) {
dbg("1 active call + 1 held conf call");
+
/* First option */
item_data = (callui_sec_call_popup_data_t *) calloc(1, sizeof(callui_sec_call_popup_data_t));
- if (item_data == NULL) {
- elm_genlist_item_class_free(itc);
- return;
- }
+ CALLUI_RETURN_VALUE_IF_FAIL(item_data, __second_call_popup_del(popup));
item_data->index = 0;
- memset(item_data->option_msg, 0x00, 512);
temp_str = _("IDS_CALL_OPT_END_CALL_WITH_PS");
- snprintf(item_data->option_msg, 512, temp_str, unhold_call_name);
- elm_genlist_item_append(genlist, itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __callui_gl_second_call_option_sel, ad);
+ snprintf(item_data->option_msg, CALLUI_BUFF_SIZE_HUG, temp_str, unhold_call_name);
+ elm_genlist_item_append(genlist, &itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __second_call_gl_option_sel_cb, ad);
/* Second option */
item_data = (callui_sec_call_popup_data_t *) calloc(1, sizeof(callui_sec_call_popup_data_t));
- if (item_data == NULL) {
- elm_genlist_item_class_free(itc);
- return;
- }
+ CALLUI_RETURN_VALUE_IF_FAIL(item_data, __second_call_popup_del(popup));
item_data->index = 1;
- memset(item_data->option_msg, 0x00, 512);
- strncpy(item_data->option_msg, _("IDS_CALL_OPT_END_CONFERENCE_CALL"), 512-1);
- elm_genlist_item_append(genlist, itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __callui_gl_second_call_option_sel, ad);
+ strncpy(item_data->option_msg, _("IDS_CALL_OPT_END_CONFERENCE_CALL"), CALLUI_BUFF_SIZE_HUG-1);
+ elm_genlist_item_append(genlist, &itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __second_call_gl_option_sel_cb, ad);
/* Third option */
item_data = (callui_sec_call_popup_data_t *) calloc(1, sizeof(callui_sec_call_popup_data_t));
- if (item_data == NULL) {
- elm_genlist_item_class_free(itc);
- return;
- }
+ CALLUI_RETURN_VALUE_IF_FAIL(item_data, __second_call_popup_del(popup));
item_data->index = 2;
- memset(item_data->option_msg, 0x00, 512);
- strncpy(item_data->option_msg, _("IDS_CALL_OPT_END_ALL_CURRENT_CALLS"), 512-1);
- elm_genlist_item_append(genlist, itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __callui_gl_second_call_option_sel, ad);
+ strncpy(item_data->option_msg, _("IDS_CALL_OPT_END_ALL_CURRENT_CALLS"), CALLUI_BUFF_SIZE_HUG-1);
+ elm_genlist_item_append(genlist, &itc, (void *)item_data, NULL, ELM_GENLIST_ITEM_NONE, __second_call_gl_option_sel_cb, ad);
+
} else {
err("invalid call data!!");
- elm_genlist_item_class_free(itc);
- return;
+ return __second_call_popup_del(popup);
}
- evas_object_smart_callback_add(ad->second_call_popup, "response",
- __callui_second_call_cancel_btn_response_cb, ad);
- eext_object_event_callback_add(ad->second_call_popup, EEXT_CALLBACK_BACK,
- __callui_second_call_cancel_btn_response_cb, ad);
- evas_object_smart_callback_add(ad->second_call_popup, "block,clicked",
- __callui_second_call_cancel_btn_response_cb, ad);
+ evas_object_smart_callback_add(popup, "response", __second_call_cancel_btn_response_cb, ad);
+ eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, __second_call_cancel_btn_response_cb, ad);
+ evas_object_smart_callback_add(popup, "block,clicked", __second_call_cancel_btn_response_cb, ad);
elm_box_pack_end(box, genlist);
evas_object_show(genlist);
- elm_genlist_item_class_free(itc);
- evas_object_size_hint_min_set(box, ELM_SCALE_SIZE(CALLUI_POPUP_LIST_W), ELM_SCALE_SIZE(CALLUI_POPUP_LIST_ITEM_H * (item_data->index + 1)));
+ evas_object_size_hint_min_set(box,
+ ELM_SCALE_SIZE(CALLUI_POPUP_LIST_W),
+ ELM_SCALE_SIZE(CALLUI_POPUP_LIST_ITEM_H * (item_data->index + 1)));
evas_object_show(box);
- elm_object_content_set(ad->second_call_popup, box);
+ elm_object_content_set(popup, box);
- evas_object_show(ad->second_call_popup);
+ evas_object_show(popup);
+
+ return popup;
}
-static void __callui_unload_bt_popup(callui_app_data_t *ad)
+static Evas_Object *__bt_popup_del(Evas_Object *popup)
{
- dbg("..");
- CALLUI_RETURN_IF_FAIL(ad);
- if (ad->bt_popup) {
- evas_object_del(ad->bt_popup);
- ad->bt_popup = NULL;
+ if (popup) {
+ evas_object_del(popup);
}
- return;
+ return NULL;
}
-static void __callui_bt_popup_cancel_btn_cb(void *data, Evas_Object *obj, void *event_info)
+static void __bt_popup_cancel_btn_cb(void *data, Evas_Object *obj, void *event_info)
{
- dbg("..");
+ CALLUI_RETURN_IF_FAIL(data);
- __callui_unload_bt_popup(data);
- return;
+ Evas_Object *eo = (Evas_Object *)evas_object_data_get(obj, CALLUI_EO_DATA_NAME_POPUP);
+ __bt_popup_del(eo);
}
-static void __callui_bt_popup_ok_btn_cb(void *data, Evas_Object *obj, void *event_info)
+static void __bt_popup_ok_btn_cb(void *data, Evas_Object *obj, void *event_info)
{
- dbg("..");
+ CALLUI_RETURN_IF_FAIL(data);
+
callui_app_data_t *ad = (callui_app_data_t *)data;
CALLUI_RETURN_IF_FAIL(ad);
- __callui_unload_bt_popup(ad);
- /* Launch the BT App Control */
+ evas_object_del((Evas_Object *)evas_object_data_get(obj, CALLUI_EO_DATA_NAME_POPUP));
+
_callui_common_launch_setting_bluetooth(ad);
- return;
}
-void _callui_load_bluetooth_popup(callui_app_data_t *ad)
+Evas_Object *_callui_create_bluetooth_popup(Evas_Object *parent, callui_app_data_t *ad)
{
- Evas_Object *btn_ok = NULL;
- Evas_Object *btn_cancel = NULL;
- CALLUI_RETURN_IF_FAIL(ad);
+ CALLUI_RETURN_NULL_IF_FAIL(parent);
+ CALLUI_RETURN_NULL_IF_FAIL(ad);
- __callui_unload_bt_popup(ad);
- ad->bt_popup = elm_popup_add(_callui_window_get_eo(ad->window));
- elm_popup_align_set(ad->bt_popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
- evas_object_size_hint_weight_set(ad->bt_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ Evas_Object *popup = elm_popup_add(parent);
+ elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
+ evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_object_translatable_part_text_set(ad->bt_popup, "title,text", "IDS_CALL_HEADER_TURN_ON_BLUETOOTH_ABB");
- elm_object_translatable_text_set(ad->bt_popup, "IDS_CALL_POP_TO_SWITCH_TO_USING_YOUR_BLUETOOTH_DEVICE_BLUETOOTH_WILL_BE_TURNED_ON");
+ elm_object_translatable_part_text_set(popup, "title,text", "IDS_CALL_HEADER_TURN_ON_BLUETOOTH_ABB");
+ elm_object_translatable_text_set(popup, "IDS_CALL_POP_TO_SWITCH_TO_USING_YOUR_BLUETOOTH_DEVICE_BLUETOOTH_WILL_BE_TURNED_ON");
- btn_cancel = elm_button_add(ad->bt_popup);
+ Evas_Object *btn_cancel = elm_button_add(popup);
+ CALLUI_RETURN_VALUE_IF_FAIL(btn_cancel, __bt_popup_del(popup));
elm_object_style_set(btn_cancel, "popup");
elm_object_translatable_text_set(btn_cancel, "IDS_COM_SK_CANCEL");
- elm_object_part_content_set(ad->bt_popup, "button1", btn_cancel);
- evas_object_smart_callback_add(btn_cancel, "clicked", __callui_bt_popup_cancel_btn_cb, ad);
+ evas_object_smart_callback_add(btn_cancel, "clicked", __bt_popup_cancel_btn_cb, ad);
+ evas_object_data_set(btn_cancel, CALLUI_EO_DATA_NAME_POPUP, popup);
+ elm_object_part_content_set(popup, "button1", btn_cancel);
- btn_ok = elm_button_add(ad->bt_popup);
+ Evas_Object *btn_ok = elm_button_add(popup);
+ CALLUI_RETURN_VALUE_IF_FAIL(btn_cancel, __bt_popup_del(popup));
elm_object_style_set(btn_ok, "popup");
elm_object_translatable_text_set(btn_ok, "IDS_COM_SK_OK");
- elm_object_part_content_set(ad->bt_popup, "button2", btn_ok);
- evas_object_smart_callback_add(btn_ok, "clicked", __callui_bt_popup_ok_btn_cb, ad);
+ evas_object_smart_callback_add(btn_ok, "clicked", __bt_popup_ok_btn_cb, ad);
+ evas_object_data_set(btn_ok, CALLUI_EO_DATA_NAME_POPUP, popup);
+ elm_object_part_content_set(popup, "button2", btn_ok);
- eext_object_event_callback_add(ad->bt_popup, EEXT_CALLBACK_BACK, __callui_bt_popup_cancel_btn_cb, ad);
+ eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, __bt_popup_cancel_btn_cb, ad);
- evas_object_show(ad->bt_popup);
- return;
+ evas_object_show(popup);
+
+ return popup;
}
-static void __callui_ctxpopup_item_hold_cb(void *data, Evas_Object *obj, void *event_info)
+static void __more_ctxpopup_item_hold_cb(void *data, Evas_Object *obj, void *event_info)
{
CALLUI_RETURN_IF_FAIL(data);
callui_app_data_t *ad = (callui_app_data_t *)data;
- __callui_destroy_more_ctxpopup(obj, ad);
+ __more_ctxpopup_destroy(obj, ad);
callui_result_e res = _callui_manager_hold_call(ad->call_manager);
if (res != CALLUI_RESULT_OK) {
}
}
-static void __callui_ctxpopup_item_unhold_cb(void *data, Evas_Object *obj, void *event_info)
+static void __more_ctxpopup_item_unhold_cb(void *data, Evas_Object *obj, void *event_info)
{
CALLUI_RETURN_IF_FAIL(data);
callui_app_data_t *ad = (callui_app_data_t *)data;
- __callui_destroy_more_ctxpopup(obj, ad);
+ __more_ctxpopup_destroy(obj, ad);
callui_result_e res = _callui_manager_unhold_call(ad->call_manager);
if (res != CALLUI_RESULT_OK) {
}
}
-static void __callui_move_more_ctxpopup(Evas_Object *ctxpopup, callui_app_data_t *ad)
+static void __more_ctxpopup_move(Evas_Object *ctxpopup, callui_app_data_t *ad)
{
Evas_Coord w = 0, h = 0;
_callui_window_get_screen_size(ad->window, NULL, NULL, &w, &h);
}
}
-static void __callui_more_ctxpopup_dismiss_cb(void *data, Evas_Object *obj, void *event_info)
+static void __more_ctxpopup_dismiss_cb(void *data, Evas_Object *obj, void *event_info)
{
CALLUI_RETURN_IF_FAIL(data);
- __callui_destroy_more_ctxpopup(obj, data);
+ __more_ctxpopup_destroy(obj, data);
}
-static void __callui_more_ctxpopup_delete_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+static void __more_ctxpopup_delete_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
CALLUI_RETURN_IF_FAIL(data);
- __callui_destroy_more_ctxpopup(obj, data);
+ __more_ctxpopup_destroy(obj, data);
}
-Evas_Object *_callui_load_more_menu_popup(Evas_Object *parent, callui_app_data_t *ad)
+Evas_Object *_callui_create_more_menu_popup(Evas_Object *parent, callui_app_data_t *ad)
{
CALLUI_RETURN_NULL_IF_FAIL(parent);
CALLUI_RETURN_NULL_IF_FAIL(ad);
CALLUI_RETURN_NULL_IF_FAIL(ctxpopup);
elm_object_style_set(ctxpopup, "more/default");
elm_ctxpopup_auto_hide_disabled_set(ctxpopup, EINA_FALSE);
- evas_object_smart_callback_add(ctxpopup, "dismissed", __callui_more_ctxpopup_dismiss_cb, ad);
- evas_object_event_callback_add(ctxpopup, EVAS_CALLBACK_DEL, __callui_more_ctxpopup_delete_cb, ad);
- eext_object_event_callback_add(ctxpopup, EEXT_CALLBACK_BACK, eext_ctxpopup_back_cb, NULL);
- eext_object_event_callback_add(ctxpopup, EEXT_CALLBACK_MORE, eext_ctxpopup_back_cb, NULL);
Elm_Object_Item *ctxpopup_item = NULL;
if (_callui_stp_get_call_data(ad->state_provider, CALLUI_CALL_DATA_ACTIVE)) {
- ctxpopup_item = elm_ctxpopup_item_append(ctxpopup, "IDS_CALL_BUTTON_HOLD", NULL, __callui_ctxpopup_item_hold_cb, ad);
+ ctxpopup_item = elm_ctxpopup_item_append(ctxpopup, "IDS_CALL_BUTTON_HOLD", NULL, __more_ctxpopup_item_hold_cb, ad);
} else {
- ctxpopup_item = elm_ctxpopup_item_append(ctxpopup, "IDS_CALL_BUTTON_RESUME_ABB", NULL, __callui_ctxpopup_item_unhold_cb, ad);
+ ctxpopup_item = elm_ctxpopup_item_append(ctxpopup, "IDS_CALL_BUTTON_RESUME_ABB", NULL, __more_ctxpopup_item_unhold_cb, ad);
}
+ CALLUI_RETURN_VALUE_IF_FAIL(ctxpopup_item, __more_ctxpopup_del(ctxpopup));
elm_object_item_domain_text_translatable_set(ctxpopup_item, CALLUI_TEXT_DOMAIN, EINA_TRUE);
+ evas_object_smart_callback_add(ctxpopup, "dismissed", __more_ctxpopup_dismiss_cb, ad);
+ evas_object_event_callback_add(ctxpopup, EVAS_CALLBACK_DEL, __more_ctxpopup_delete_cb, ad);
+ eext_object_event_callback_add(ctxpopup, EEXT_CALLBACK_BACK, eext_ctxpopup_back_cb, NULL);
+ eext_object_event_callback_add(ctxpopup, EEXT_CALLBACK_MORE, eext_ctxpopup_back_cb, NULL);
+
elm_ctxpopup_direction_priority_set(ctxpopup, ELM_CTXPOPUP_DIRECTION_UP, ELM_CTXPOPUP_DIRECTION_UNKNOWN,
ELM_CTXPOPUP_DIRECTION_UNKNOWN, ELM_CTXPOPUP_DIRECTION_UNKNOWN);
- __callui_move_more_ctxpopup(ctxpopup, ad);
+ __more_ctxpopup_move(ctxpopup, ad);
evas_object_show(ctxpopup);
return ctxpopup;
}
-static void __callui_destroy_more_ctxpopup(Evas_Object *ctxpopup, callui_app_data_t *ad)
+static Evas_Object *__more_ctxpopup_del(Evas_Object *ctxpopup)
+{
+ if (ctxpopup) {
+ evas_object_del(ctxpopup);
+ }
+ return NULL;
+}
+
+static void __more_ctxpopup_destroy(Evas_Object *ctxpopup, callui_app_data_t *ad)
{
if (ctxpopup) {
- evas_object_smart_callback_del_full(ctxpopup, "dismissed", __callui_more_ctxpopup_dismiss_cb, ad);
- evas_object_event_callback_del_full(ctxpopup, EVAS_CALLBACK_DEL, __callui_more_ctxpopup_delete_cb, ad);
+ evas_object_smart_callback_del_full(ctxpopup, "dismissed", __more_ctxpopup_dismiss_cb, ad);
+ evas_object_event_callback_del_full(ctxpopup, EVAS_CALLBACK_DEL, __more_ctxpopup_delete_cb, ad);
eext_object_event_callback_del(ctxpopup, EEXT_CALLBACK_BACK, eext_ctxpopup_back_cb);
eext_object_event_callback_del(ctxpopup, EEXT_CALLBACK_MORE, eext_ctxpopup_back_cb);
evas_object_del(ctxpopup);
bool is_activated;
Evas_Object *more_ctxpopup;
+ Evas_Object *action_popup;
+ callui_action_popup_type_e action_popup_type;
+
callui_lock_manager_lock_state_e cur_lock_state;
};
typedef struct _callui_vm callui_vm_t;
static call_view_data_base_t *__allocate_view(callui_view_type_e view_type);
static callui_result_e __change_view(callui_vm_h vm, callui_view_type_e type);
static void __update_cur_view(callui_vm_h vm);
+static void __update_vm(callui_vm_h vm);
static callui_result_e __auto_change_view(callui_vm_h vm, callui_call_data_t *call_data, callui_sim_slot_type_e sim_slot);
static void __call_state_event_cb(void *user_data,
callui_call_event_type_e call_event_type,
static void __lock_state_change_cb(void *data, callui_lock_manager_type_e type, callui_lock_manager_lock_state_e lock_state);
static void __more_btn_click_cb(void *data, Evas_Object *obj, void *event_info);
static void __more_menu_popup_delete_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
-static void __close_more_menu_popup(callui_vm_h vm);
+static void __delete_more_menu_popup(callui_vm_h vm);
+static void __action_popup_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void __delete_action_popup(callui_vm_h vm);
-static void __close_more_menu_popup(callui_vm_h vm)
+static void __delete_more_menu_popup(callui_vm_h vm)
{
if (vm->more_ctxpopup) {
- evas_object_del(vm->more_ctxpopup);
+ evas_object_event_callback_del_full(vm->more_ctxpopup, EVAS_CALLBACK_DEL, __more_menu_popup_delete_cb, vm);
+ DELETE_EVAS_OBJECT(vm->more_ctxpopup);
}
}
if ((_callui_common_is_proximity_sensor_supported() ?
_callui_lock_manager_is_lcd_off(vm->ad->lock_manager) :
_callui_lock_manager_is_running(vm->ad->lock_manager))) {
- dbg("Lock screen active. Do not show more menu popup");
+ dbg("Lock screen active. Do not show more menu action popup");
return;
}
if (!(vm->cur_view_type == CALLUI_VIEW_SINGLECALL || vm->cur_view_type == CALLUI_VIEW_MULTICALL_CONF)) {
- dbg("More menu popup not supported for view [%d]", vm->cur_view_type);
+ dbg("More menu action_popup not supported for view [%d]", vm->cur_view_type);
+ return;
+ }
+
+ if (vm->action_popup) {
+ dbg("Action popup [%d] is shown. Can not show more menu popup", vm->action_popup_type);
return;
}
if (vm->more_ctxpopup) {
- dbg("More menu popup already shown. Dismiss popup");
+ dbg("More menu action_popup already shown. Dismiss action popup");
elm_ctxpopup_dismiss(vm->more_ctxpopup);
return;
}
- vm->more_ctxpopup = _callui_load_more_menu_popup(vm->main_ly, vm->ad);
+ vm->more_ctxpopup = _callui_create_more_menu_popup(vm->main_ly, vm->ad);
CALLUI_RETURN_IF_FAIL(vm->more_ctxpopup);
evas_object_event_callback_add(vm->more_ctxpopup, EVAS_CALLBACK_DEL, __more_menu_popup_delete_cb, vm);
}
if (lock_state == CALLUI_LOCK_MNG_STATE_LOCKED) {
if (type == CALLUI_LOCK_MNG_TYPE_TOUCH) {
- __close_more_menu_popup(vm);
+ __delete_more_menu_popup(vm);
}
if (vm->cur_view->lock) {
vm->cur_view_type = CALLUI_VIEW_UNDEFINED;
vm->ad = ad;
vm->paused = true;
+ vm->action_popup_type = CALLUI_ACTION_POPUP_UNDEFINED;
vm->main_ly = __create_eo_layout(_callui_window_get_content_parent(ad->window));
CALLUI_RETURN_VALUE_IF_FAIL(vm->main_ly, CALLUI_RESULT_FAIL);
}
eext_object_event_callback_del(vm->main_ly, EEXT_CALLBACK_MORE, __more_btn_click_cb);
- if (vm->more_ctxpopup) {
- evas_object_event_callback_del_full(vm->more_ctxpopup, EVAS_CALLBACK_DEL, __more_menu_popup_delete_cb, vm);
- DELETE_EVAS_OBJECT(vm->more_ctxpopup);
- }
+ __delete_more_menu_popup(vm);
+ __delete_action_popup(vm);
_callui_lock_manager_remove_state_change_cb(vm->ad->lock_manager, __lock_state_change_cb, vm);
_callui_manager_remove_end_call_called_cb(vm->ad->call_manager, __end_call_called_cb, vm);
} else {
vm->cur_view->update_flags |= CALLUI_UF_DATA_REFRESH;
if (!vm->paused) {
- __update_cur_view(vm);
+ __update_vm(vm);
}
}
return CALLUI_RESULT_OK;
if ((last_view_type != CALLUI_VIEW_UNDEFINED) && (last_view_type != type)) {
dbg("Destroy view [%d]", last_view_type);
- __close_more_menu_popup(vm);
+ __delete_more_menu_popup(vm);
+ __delete_action_popup(vm);
res = __destroy_cur_view(vm);
CALLUI_RETURN_VALUE_IF_FAIL(res == CALLUI_RESULT_OK, res);
}
return __auto_change_view(vm, NULL, CALLUI_SIM_SLOT_DEFAULT);
}
-static void __update_cur_view(callui_vm_h vm)
+static void __update_vm(callui_vm_h vm)
{
- call_view_data_base_t *cur_view = vm->cur_view;
+ if (vm->cur_view_type == CALLUI_VIEW_INCOMING_CALL) {
+ const callui_call_data_t *active = _callui_stp_get_call_data(vm->ad->state_provider, CALLUI_CALL_DATA_ACTIVE);
+ const callui_call_data_t *held = _callui_stp_get_call_data(vm->ad->state_provider, CALLUI_CALL_DATA_HELD);
+ if (vm->action_popup_type == CALLUI_ACTION_POPUP_SECOND_CALL && !active && !held) {
+ __delete_action_popup(vm);
+ }
+ }
+ __update_cur_view(vm);
+}
- if (cur_view && cur_view->update && cur_view->update_flags) {
- cur_view->update(vm->cur_view);
- cur_view->update_flags = 0;
+static void __update_cur_view(callui_vm_h vm)
+{
+ if (vm->cur_view && vm->cur_view->update && vm->cur_view->update_flags) {
+ vm->cur_view->update(vm->cur_view);
+ vm->cur_view->update_flags = 0;
}
}
if (cur_view && cur_view->resume) {
cur_view->resume(vm->cur_view);
}
- __update_cur_view(vm);
+ __update_vm(vm);
return CALLUI_RESULT_OK;
}
if (cur_view) {
cur_view->update_flags |= CALLUI_UF_LANG_CHANGE;
if (!vm->paused) {
- __update_cur_view(vm);
+ __update_vm(vm);
}
}
return CALLUI_RESULT_OK;
}
+
+static void __action_popup_del_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ CALLUI_RETURN_IF_FAIL(data);
+
+ callui_vm_h vm = (callui_vm_h)data;
+ evas_object_event_callback_del_full(vm->action_popup, EVAS_CALLBACK_DEL, __action_popup_del_cb, vm);
+ vm->action_popup = NULL;
+ vm->action_popup_type = CALLUI_ACTION_POPUP_UNDEFINED;
+}
+
+static void __delete_action_popup(callui_vm_h vm)
+{
+ if (vm->action_popup) {
+ evas_object_event_callback_del_full(vm->action_popup, EVAS_CALLBACK_DEL, __action_popup_del_cb, vm);
+ DELETE_EVAS_OBJECT(vm->action_popup);
+ vm->action_popup_type = CALLUI_ACTION_POPUP_UNDEFINED;
+ }
+}
+
+/**
+ * @brief Shows action popup by set type
+ *
+ * @param[in] vm View manager handle
+ * @param[in] type Action popup type
+ *
+ * @return result CALLUI_RESULT_OK on success
+ */
+callui_result_e _callui_vm_show_action_popup(callui_vm_h vm, callui_action_popup_type_e type)
+{
+ CALLUI_RETURN_VALUE_IF_FAIL(vm, CALLUI_RESULT_INVALID_PARAM);
+ CALLUI_RETURN_VALUE_IF_FAIL((type > CALLUI_ACTION_POPUP_UNDEFINED
+ && type <= CALLUI_ACTION_POPUP_BLUETOOTH),
+ CALLUI_RESULT_INVALID_PARAM);
+
+ if (vm->action_popup && type == vm->action_popup_type) {
+ dbg("Ignored. Request on show same popup type [%d]", type);
+ return CALLUI_RESULT_OK;
+ }
+
+ __delete_action_popup(vm);
+
+ Evas_Object *eo = NULL;
+ switch(type) {
+ case CALLUI_ACTION_POPUP_SECOND_CALL:
+ eo = _callui_create_second_call_popup(_callui_window_get_eo(vm->ad->window), vm->ad);
+ break;
+ case CALLUI_ACTION_POPUP_BLUETOOTH:
+ eo = _callui_create_bluetooth_popup(_callui_window_get_eo(vm->ad->window), vm->ad);
+ break;
+ default:
+ return CALLUI_RESULT_FAIL;
+ }
+ CALLUI_RETURN_VALUE_IF_FAIL(eo, CALLUI_RESULT_FAIL);
+
+ vm->action_popup = eo;
+ vm->action_popup_type = type;
+ evas_object_event_callback_add(vm->action_popup, EVAS_CALLBACK_DEL, __action_popup_del_cb, vm);
+
+ return CALLUI_RESULT_OK;
+}
+
+/**
+ * @brief Gets visible action popup type
+ *
+ * @param[in] vm View manager handle
+ *
+ * @return Visible action_popup type or CALLUI_ACTION_POPUP_UNDEFINED if no action popup is shown
+ */
+callui_action_popup_type_e _callui_vm_get_visible_action_popup_type(callui_vm_h vm)
+{
+ CALLUI_RETURN_VALUE_IF_FAIL(vm, CALLUI_ACTION_POPUP_UNDEFINED);
+
+ return vm->action_popup_type;
+}