-/*\r
- * Copyright 2012 Samsung Electronics Co., Ltd\r
- *\r
- * Licensed under the Flora License, Version 1.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.tizenopensource.org/license\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-\r
- /* includes */\r
-#include "msg-ui-composer-body.h"\r
-#include "msg-ui-composer-recipient.h"\r
-#include "msg-ui-composer-main.h"\r
-#include "msg-ui-composer-body-page.h"\r
-#include "msg-ui-composer-body-callback.h"\r
-#include "msg-ui-composer-common.h"\r
-#include "msg-ui-composer-attachment.h"\r
-#include "msg-ui-composer-subject.h"\r
-#include "msg-ui-composer-message.h"\r
-#include "msg-ui-composer-popup.h"\r
-#include "msg-ui-composer-util.h"\r
-#include "msg-ui-composer-external.h"\r
-#include "syspopup_caller.h"\r
-#include <tapi_common.h>\r
-#include <ITapiModem.h>\r
-\r
-/*==================================================================================================\r
-* FUNCTION IMPLEMENTATIONS\r
-*==================================================================================================*/\r
-static void __add_list_popup_clicked_cb(void *data, Evas_Object *obj, void *event_info)\r
-{\r
- D_ENTER;\r
-\r
- if (!data || !event_info) {\r
- D_EMSG("invalid argument, argument data is NULL");\r
- return;\r
- }\r
-\r
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
-\r
- if (cd->add_menu_clicked)\r
- return;\r
-\r
- Elm_Object_Item *item = (Elm_Object_Item *)event_info;\r
- elm_list_item_selected_set(item, EINA_FALSE);\r
-\r
- const char *label = elm_object_item_text_get(item);\r
- if (!label) {\r
- D_EMSG("label is NULL !!");\r
- return;\r
- }\r
-\r
- cd->add_menu_clicked = true;\r
-\r
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "label = %s", label);\r
- if (cd->isAppControl) {\r
- if (!g_strcmp0(label, MSGC_STR_SUBJECT)) {\r
- msg_ui_composer_add_subject(cd);\r
- } else {\r
- D_EMSG("Unknown Menu List Item");\r
- }\r
- } else {\r
- if (!g_strcmp0(label, MSGC_STR_SUBJECT)) {\r
- msg_ui_composer_add_subject(cd);\r
- } else if (!g_strcmp0(label, MSGC_STR_GALLERY)) {\r
- msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_GALLERY, NULL);\r
- } else if (!g_strcmp0(label, MSGC_STR_MYFILE)) {\r
- msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_MYFILE, NULL);\r
- } else if (!g_strcmp0(label, _MSGSTR("IDS_MSGC_BODY_TAKE_PICTURE"))) {\r
- msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_CAMERA, NULL);\r
- } else if (!g_strcmp0(label, _MSGSTR("IDS_MSGC_BODY_CAPTURE_VIDEO"))) {\r
- msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_CAMCORDER, NULL);\r
- } else if (!g_strcmp0(label, MSGC_STR_CONTACT)) {\r
- msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_NAMECARD, NULL);\r
- } else if (!g_strcmp0(label, _SYSSTR("IDS_COM_BODY_CALENDAR"))) {\r
- msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_CALENDAR, NULL);\r
- } else if (!g_strcmp0(label, _SYSSTR("IDS_COM_BODY_MEMO"))) {\r
- msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_MEMO, NULL);\r
- } else {\r
- D_EMSG("Unknown Menu List Item");\r
- }\r
- }\r
-\r
- MSGC_EVAS_OBJECT_DEL(cd->add_popup);\r
- cd->add_button_clicked = false;\r
- cd->add_menu_clicked = false;\r
- D_LEAVE;\r
-}\r
-\r
-static void __add_list_popup_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)\r
-{\r
- D_ENTER;\r
-\r
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
- D_MSG_RETM_IF(cd == NULL, "composer data is NULL");\r
- MSGC_EVAS_OBJECT_DEL(cd->add_popup);\r
- cd->add_button_clicked = false;\r
- cd->add_menu_clicked = false;\r
-\r
- D_LEAVE;\r
-}\r
-\r
-static void __add_list_popup_show(void *data)\r
-{\r
- D_ENTER;\r
-\r
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
- Evas_Object *popup = NULL;\r
- Evas_Object *list = NULL;\r
- int count = 0;\r
- int list_padding = 4;\r
-\r
-\r
- list = elm_list_add(cd->main_window);\r
- D_MSG_RETM_IF(list == NULL, "list is NULL");\r
- elm_list_mode_set(list, ELM_LIST_EXPAND);\r
-\r
- Elm_Object_Item *item = NULL;\r
-\r
- if (cd->isAppControl) {\r
- item = elm_list_item_append(list, MSGC_STR_SUBJECT, NULL, NULL, __add_list_popup_clicked_cb, data);\r
- ++count;\r
- if (cd->isSubject)\r
- elm_object_item_disabled_set(item, EINA_TRUE);\r
-\r
- } else {\r
- if (!cd->isSubject) {\r
- elm_list_item_append(list, MSGC_STR_SUBJECT, NULL, NULL, __add_list_popup_clicked_cb, data);\r
- ++count;\r
- }\r
-\r
- elm_list_item_append(list, MSGC_STR_GALLERY, NULL, NULL, __add_list_popup_clicked_cb, data);\r
- ++count;\r
- elm_list_item_append(list, _MSGSTR("IDS_MSGC_BODY_TAKE_PICTURE"), NULL, NULL, __add_list_popup_clicked_cb, data);\r
- ++count;\r
- elm_list_item_append(list, _MSGSTR("IDS_MSGC_BODY_CAPTURE_VIDEO"), NULL, NULL, __add_list_popup_clicked_cb, data);\r
- ++count;\r
- elm_list_item_append(list, MSGC_STR_MYFILE, NULL, NULL, __add_list_popup_clicked_cb, data);\r
- ++count;\r
- elm_list_item_append(list, MSGC_STR_CONTACT, NULL, NULL, __add_list_popup_clicked_cb, data);\r
- ++count;\r
- elm_list_item_append(list, _SYSSTR("IDS_COM_BODY_CALENDAR"), NULL, NULL, __add_list_popup_clicked_cb, data);\r
- ++count;\r
- elm_list_item_append(list, _SYSSTR("IDS_COM_BODY_MEMO"), NULL, NULL, __add_list_popup_clicked_cb, data);\r
- ++count;\r
- }\r
-\r
- elm_list_go(list);\r
-\r
- if (count >= 4) {\r
- count = 4;\r
-\r
- int popup_height = MSGC_POPUP_LIST_H * count + list_padding;\r
- evas_object_size_hint_max_set(list, -1, popup_height * elm_scale_get());\r
- }\r
-\r
- popup = msg_ui_composer_list_popup_create(cd, _SYSSTR("IDS_COM_POP_ATTACH"), list, "min_menustyle");\r
-\r
- Evas_Object *btn1 = elm_button_add(popup);\r
- elm_object_style_set(btn1, "popup_button/default");\r
- elm_object_text_set(btn1, MSGC_STR_BUTTON_CLOSE);\r
- elm_object_part_content_set(popup, "button1", btn1);\r
- evas_object_smart_callback_add(btn1, "clicked", __add_list_popup_btn_clicked_cb, cd);\r
-\r
- cd->add_popup = popup;\r
-\r
- D_LEAVE;\r
-}\r
-\r
-static void __msgc_show_bubble_view(void *data, msg_thread_id_t tid)\r
-{\r
- D_ENTER;\r
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
- D_MSG_RETM_IF(cd == NULL, "cd is NULL");\r
-\r
- /* show indicator area */\r
- elm_layout_theme_set(cd->base, "layout", "application", "default");\r
- elm_win_indicator_mode_set(cd->main_window, ELM_WIN_INDICATOR_SHOW);\r
-\r
- msg_ui_composer_change_bubble_view(cd);\r
-\r
- if (tid <= 0) {\r
- D_EMSG("Can not find tid = %d !!", tid);\r
- msg_ui_composer_message_destroy();\r
- ug_destroy_me(cd->ug);\r
-\r
- return;\r
- }\r
-\r
- msg_ui_composer_bubble_data_set(cd, tid);\r
- msg_ui_bubble_start_view(cd->bubble_data);\r
- msg_ui_composer_navi_title_set((void *)cd);\r
-\r
- /* set recipient list for bubble composer */\r
- msg_ui_composer_recipient_set_recipient_list(cd, tid);\r
-\r
- D_LEAVE;\r
-}\r
-\r
-static void __nosim_popup_delete_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)\r
-{\r
- D_ENTER;\r
-\r
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
- D_MSG_RETM_IF(cd == NULL, "Composer data is NULL");\r
-\r
- if (cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER)\r
- ug_destroy_me(cd->ug);\r
-\r
- D_LEAVE;\r
-}\r
-\r
-void msg_ui_composer_body_make_and_send_message(void *data)\r
-{\r
- D_ENTER;\r
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
- D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");\r
- msg_thread_id_t tid = 0;\r
-\r
- /*Make message*/\r
- msg_ui_composer_message_init();\r
-\r
- if (msg_ui_composer_recipient_read_data(cd) != COMPOSER_RETURN_SUCCESS) {\r
- D_EMSG("Make recipient data Error");\r
- goto error_return;\r
- }\r
-\r
- if (__msg_ui_composer_body_read_data(cd) != COMPOSER_RETURN_SUCCESS) {\r
- D_EMSG("Make body data Error");\r
- goto error_return;\r
- }\r
-\r
- /*Send message*/\r
- COMPOSER_RETURN_TYPE_E ret = msg_ui_composer_message_make_and_send(cd->msg_handle, &tid);\r
-\r
- /* reset region info */\r
- MSG_COMPOSER_BODY_S *body_data = &cd->body_data;\r
- body_data->region_order = COMPOSER_REGION_ORDER_UNDETERMINDED;\r
-\r
- if (ret == COMPOSER_RETURN_SUCCESS) {\r
- D_MSG("Send Success");\r
-\r
- if (cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER || cd->composer_mode == MSG_COMPOSER_MODE_FORWARD) {\r
- ug_destroy_me(cd->ug);\r
- } else if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER) {\r
- __msgc_show_bubble_view(cd, tid);\r
- msg_ui_composer_clear(cd);\r
- } else {\r
- msg_ui_composer_clear(cd);\r
- }\r
-\r
- cd->composer_mode = MSG_COMPOSER_MODE_NORMAL;\r
-\r
- } else {\r
- if (ret == COMPOSER_RETURN_NO_SIM) {\r
- D_EMSG("Send Fail : NO SIM");\r
- Evas_Object *popup = msg_ui_composer_status_popup_show(cd, MSGC_STR_POP_NOSIM, 1);\r
-\r
- if (cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER || cd->composer_mode == MSG_COMPOSER_MODE_FORWARD) {\r
- evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, __nosim_popup_delete_cb, cd);\r
- } else if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER) {\r
- __msgc_show_bubble_view(cd, tid);\r
- }\r
-\r
- msg_ui_composer_clear(cd);\r
- } else {\r
- D_EMSG("Send Fail : Unable Send");\r
- if ((cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER || cd->composer_mode == MSG_COMPOSER_MODE_FORWARD))\r
- ug_destroy_me(cd->ug);\r
- else\r
- msg_ui_composer_status_popup_show(cd, MSGC_STR_POP_UNABLE_SEND, COMPOSER_STATUS_POPUP_DEFAULT_TIME);\r
- }\r
-\r
- cd->composer_mode = MSG_COMPOSER_MODE_NORMAL;\r
-\r
- goto error_return;\r
- }\r
-\r
- msg_ui_composer_message_destroy();\r
- D_LEAVE;\r
- return;\r
-\r
-error_return:\r
- msg_ui_composer_message_destroy();\r
-\r
- if (cd->send_button)\r
- elm_object_disabled_set(cd->send_button, EINA_FALSE);\r
-\r
- D_LEAVE;\r
-}\r
-\r
-static void __msgc_flight_mode_tapi_cb(TapiHandle *handle, int result, void *data, void *user_data)\r
-{\r
- D_ENTER;\r
- bool is_success = false;\r
-\r
- switch (result) {\r
- case TAPI_POWER_FLIGHT_MODE_RESP_ON:\r
- D_MSG("TAPI_POWER_FLIGHT_MODE_RESP_ON");\r
- break;\r
-\r
- case TAPI_POWER_FLIGHT_MODE_RESP_OFF:\r
- D_MSG("TAPI_POWER_FLIGHT_MODE_RESP_OFF");\r
- is_success = true;\r
- break;\r
-\r
- case TAPI_POWER_FLIGHT_MODE_RESP_FAIL:\r
- D_MSG("TAPI_POWER_FLIGHT_MODE_RESP_FAIL");\r
- break;\r
-\r
- case TAPI_POWER_FLIGHT_MODE_RESP_MAX:\r
- D_MSG("TAPI_POWER_FLIGHT_MODE_RESP_MAX");\r
- break;\r
- default:\r
- D_MSG("result = %d", result);\r
- break;\r
- }\r
-\r
- if (!is_success)\r
- D_EMSG("flight mode off is failed");\r
-\r
- D_LEAVE;\r
-}\r
-\r
-static Eina_Bool __msgc_flight_mode_enabled_check_timer_cb(void *data)\r
-{\r
- D_MSG_RETVM_IF(data == NULL, ECORE_CALLBACK_CANCEL, "data is NULL");\r
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
-\r
- int network_status = -1;\r
- static int count = 0;\r
- bool ret = false;\r
-\r
- if (count >= 100) { /* 0.5 sec * 100 = 50 sec */\r
- D_EMSG("self time expiration");\r
- MSGC_EVAS_OBJECT_DEL(cd->progress_popup);\r
- goto return_end;\r
- }\r
-\r
- ++count;\r
-\r
- /* check if call network is enabled - to send message l*/\r
- ret = msg_composer_get_network_status(&network_status);\r
- if (ret == true) {\r
- if (network_status == VCONFKEY_TELEPHONY_SVCTYPE_NONE ||\r
- network_status == VCONFKEY_TELEPHONY_SVCTYPE_NOSVC ||\r
- network_status == VCONFKEY_TELEPHONY_SVCTYPE_EMERGENCY ||\r
- network_status == VCONFKEY_TELEPHONY_SVCTYPE_SEARCH) {\r
- D_MSG("Cannot send message - check again");\r
- return ECORE_CALLBACK_RENEW;\r
- }\r
- } else {\r
- D_EMSG("msg_composer_get_network_status is failed");\r
- return ECORE_CALLBACK_RENEW;\r
- }\r
-\r
- MSGC_EVAS_OBJECT_DEL(cd->progress_popup);\r
-\r
- D_MSG("try to send message");\r
- msg_ui_composer_body_send_btn_clicked_cb(cd, NULL, NULL);\r
-\r
-return_end:\r
-\r
- count = 0;\r
- cd->flight_mode_timer = NULL;\r
-\r
- return ECORE_CALLBACK_CANCEL;\r
-}\r
-\r
-static void __flight_mode_popup_ok_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)\r
-{\r
- D_ENTER;\r
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
- D_MSG_RETM_IF(cd == NULL, "composer data is NULL");\r
-\r
- Evas_Object *check = (Evas_Object *)evas_object_data_get(cd->custom_popup, "check_box");\r
-\r
- if (elm_check_state_get(check)) {\r
- /* set flight mode off*/\r
- if (msg_composer_set_flight_mode(cd->tapi_handle, TAPI_POWER_FLIGHT_MODE_LEAVE, __msgc_flight_mode_tapi_cb, NULL) == false) {\r
- D_EMSG("msg_composer_set_flight_mode is failed");\r
- } else {\r
- /* show progress popup */\r
- MSGC_EVAS_OBJECT_DEL(cd->progress_popup);\r
- cd->progress_popup = msg_ui_composer_progress_popup_show(cd, _MSGSTR("Disabling Flight mode"));\r
-\r
- /* give focus to back btn to hide keypad */\r
- elm_object_focus_set(cd->back_btn, EINA_TRUE);\r
-\r
- if (cd->flight_mode_timer) {\r
- ecore_timer_del(cd->flight_mode_timer);\r
- cd->flight_mode_timer = NULL;\r
- }\r
- cd->flight_mode_timer = ecore_timer_add(0.5, __msgc_flight_mode_enabled_check_timer_cb, cd);\r
- }\r
- } else {\r
- D_MSG("checkbox is not checked");\r
- }\r
-\r
- MSGC_EVAS_OBJECT_DEL(cd->custom_popup);\r
-\r
- if (cd->send_button)\r
- elm_object_disabled_set(cd->send_button, EINA_FALSE);\r
-\r
- D_LEAVE;\r
-}\r
-\r
-static void __flight_mode_popup_cancel_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)\r
-{\r
- D_ENTER;\r
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
- D_MSG_RETM_IF(cd == NULL, "composer data is NULL");\r
-\r
- MSGC_EVAS_OBJECT_DEL(cd->custom_popup);\r
-\r
- if (cd->send_button)\r
- elm_object_disabled_set(cd->send_button, EINA_FALSE);\r
-\r
- D_LEAVE;\r
-}\r
-\r
-void msg_ui_composer_body_send_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)\r
-{\r
- D_ENTER;\r
- D_MSG_RETM_IF(data == NULL, "Composer Data is NULL");\r
-\r
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
-\r
- if (cd->send_button)\r
- elm_object_disabled_set(cd->send_button, EINA_TRUE);\r
-\r
- /* check flight mode */\r
- int flight_mode = 0;\r
- if (msg_composer_get_flight_mode(&flight_mode) && flight_mode) {\r
- /*get tapi handle */\r
- if (!cd->tapi_handle)\r
- cd->tapi_handle = (void *)tel_init(NULL);\r
-\r
- if (!cd->tapi_handle) {\r
- D_EMSG("tel_init is failed");\r
- } else {\r
- /* show popup */\r
- Evas_Object *popup = NULL;\r
- Evas_Object *btn1 = NULL;\r
- Evas_Object *btn2 = NULL;\r
- char *popup_msg = _MSGSTR("Unable to send messages while Flight mode is enabled. Disable Flight mode and try again");\r
- char *checkbox_msg = _MSGSTR("Disable Flight mode");\r
-\r
- MSGC_EVAS_OBJECT_DEL(cd->custom_popup);\r
-\r
- popup = msg_ui_composer_checkbox_popup_create(cd, NULL, popup_msg, checkbox_msg);\r
-\r
- btn1 = msg_ui_composer_popup_button_create(popup, _SYSSTR("IDS_COM_SK_OK"));\r
- elm_object_part_content_set(popup, "button1", btn1);\r
- evas_object_smart_callback_add(btn1, "clicked", __flight_mode_popup_ok_btn_clicked_cb, cd);\r
- btn2 = msg_ui_composer_popup_button_create(popup, _SYSSTR("IDS_COM_SK_CANCEL"));\r
- elm_object_part_content_set(popup, "button2", btn2);\r
- evas_object_smart_callback_add(btn2, "clicked", __flight_mode_popup_cancel_btn_clicked_cb, cd);\r
-\r
- cd->custom_popup = popup;\r
-\r
- elm_object_focus_set(popup, EINA_TRUE);\r
- }\r
-\r
- return;\r
- }\r
-\r
- /*Check recipient available sending*/\r
- RECIPIENT_S *rd = cd->recipient;\r
- if (rd) {\r
- /*add recipient, if entry text exist*/\r
- Evas_Object *entry = elm_multibuttonentry_entry_get(rd->mbe);\r
- char *entry_txt = elm_entry_markup_to_utf8(elm_entry_entry_get(entry));\r
- if (entry_txt) {\r
- if (strlen(entry_txt) > 0) {\r
- if (NULL == elm_multibuttonentry_item_append(rd->mbe, entry_txt, NULL, NULL)) {\r
- g_free(entry_txt);\r
-\r
- if (cd->send_button)\r
- elm_object_disabled_set(cd->send_button, EINA_FALSE);\r
-\r
- return;\r
- }\r
- }\r
- g_free(entry_txt);\r
- }\r
-\r
- /*check recipient count is zero*/\r
- if (msg_ui_composer_recipient_count_get(rd) == 0) {\r
- D_EMSG("there is no recipient");\r
- //msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_NO_RECIPIENT);\r
-\r
- /* change focus to recipient */\r
- if (cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER || cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER)\r
- msg_ui_composer_recipient_focus_set(cd->recipient);\r
-\r
- if (cd->send_button)\r
- elm_object_disabled_set(cd->send_button, EINA_FALSE);\r
-\r
- return;\r
- }\r
- }\r
-\r
- msg_ui_composer_body_make_and_send_message(cd);\r
-\r
- D_LEAVE;\r
- return;\r
-}\r
-\r
-void msg_ui_composer_body_add_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)\r
-{\r
- D_ENTER;\r
-\r
- if (!data) {\r
- MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] error data is NULL");\r
- return;\r
- }\r
-\r
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
-\r
- if (cd->add_button_clicked)\r
- return;\r
-\r
- cd->add_button_clicked = true;\r
- __add_list_popup_show(cd);\r
-\r
- D_LEAVE;\r
-}\r
-\r
-void msg_ui_composer_body_entry_maxlength_reached_cb(void *data, Evas_Object *obj, void *event_info)\r
-{\r
- D_ENTER;\r
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
- D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");\r
-\r
- msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_MAXLENGHT_CHAR);\r
-\r
- D_LEAVE;\r
-}\r
-\r
-void msg_ui_composer_body_entry_changed_cb(void *data, Evas_Object *obj, void *event_info)\r
-{\r
- D_ENTER;\r
- D_MSG_RETM_IF(data == NULL, "Composer Data is NULL");\r
- D_MSG_RETM_IF(obj == NULL, "entry obj is NULL");\r
-\r
- MSG_COMPOSER_VIEW_DATA_S *cd = data;\r
- MSG_COMPOSER_BODY_PAGE_S *page_data = NULL;\r
-\r
- page_data = evas_object_data_get(obj, "page_data");\r
- if (page_data == NULL)\r
- return;\r
-\r
- char *body_text = elm_entry_markup_to_utf8(elm_entry_entry_get(obj));\r
- if (body_text == NULL)\r
- return;\r
-\r
- int text_len = strlen(body_text);\r
- if (text_len <= 0) {\r
- page_data->text_info.encode = COMPOSER_CHAR_ENCODE_UNICODE;\r
- page_data->text_info.char_count = 0;\r
- } else {\r
- unsigned char ucs2_text[COMPOSER_MMS_TEXT_MAX_CHAR*2] = {0,};\r
- int ucs2_len = msg_ui_composer_convert_UTF8ToUCS2(ucs2_text, sizeof(ucs2_text), body_text, text_len);\r
- page_data->text_info.encode = msg_ui_composer_body_entry_char_count(cd, ucs2_text, ucs2_len, &page_data->text_info.char_count);\r
- }\r
- g_free(body_text);\r
-\r
- msg_ui_composer_message_type_check_and_change(cd);\r
-\r
- msg_ui_composer_body_info_area_update(cd);\r
-\r
- if (msg_ui_composer_common_is_send_possible(cd)) {\r
- elm_object_disabled_set(cd->send_button, EINA_FALSE);\r
- msg_ui_composer_body_update_send_btn_icon(cd, false);\r
- } else {\r
- elm_object_disabled_set(cd->send_button, EINA_TRUE);\r
- msg_ui_composer_body_update_send_btn_icon(cd, true);\r
- }\r
-\r
- D_LEAVE;\r
-}\r
-\r
-void msg_ui_composer_body_entry_press_cb(void *data, Evas_Object *obj, void *event_info)\r
-{\r
- D_ENTER;\r
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
- D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");\r
-\r
- if (msg_ui_composer_recipient_addr_type_get(cd->recipient) == COMPOSER_RECP_ADDR_INVALID) {\r
- elm_entry_context_menu_disabled_set(obj, EINA_TRUE);\r
- elm_entry_magnifier_disabled_set(obj, EINA_TRUE);\r
- } else {\r
- elm_entry_context_menu_disabled_set(obj, EINA_FALSE);\r
- elm_entry_magnifier_disabled_set(obj, EINA_FALSE);\r
- }\r
-\r
- D_LEAVE;\r
-}\r
-\r
-void msg_ui_composer_body_entry_clicked_cb(void *data, Evas_Object *obj, void *event_info)\r
-{\r
- D_ENTER;\r
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
- D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");\r
-\r
- int attach_count = msg_ui_composer_get_attach_count(cd);\r
-\r
- if (attach_count > 1)\r
- msg_ui_composer_contract_attach_list(cd);\r
-\r
- D_LEAVE;\r
-}\r
-\r
-void msg_ui_composer_body_entry_unfocused_cb(void *data, Evas_Object *obj, void *event_info)\r
-{\r
- D_ENTER;\r
-\r
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
- D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");\r
-\r
- if (cd->msg_type == COMPOSER_MSG_TYPE_MMS) {\r
- MSG_COMPOSER_BODY_S *body_data = &cd->body_data;\r
-\r
- int page_count = body_data->page_count;\r
-\r
- if (page_count == 1) {\r
- D_MSG("There is 1 page !!!");\r
- } else {\r
- MSG_COMPOSER_BODY_PAGE_S *page_data = evas_object_data_get(obj, "page_data");\r
- if (page_data == NULL) {\r
- D_EMSG("page_data is NULL");\r
- } else {\r
- /* hide delete button */\r
- D_MSG("hide delete button");\r
- edje_object_signal_emit(_EDJ(page_data->upper_layout), "hide.delete", "*");\r
- }\r
- }\r
- }\r
-\r
- D_LEAVE;\r
-}\r
-\r
-void msg_ui_composer_body_entry_focused_cb(void *data, Evas_Object *obj, void *event_info)\r
-{\r
- D_ENTER;\r
-\r
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
- D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");\r
-\r
- if (msg_ui_composer_recipient_addr_type_get(cd->recipient) == COMPOSER_RECP_ADDR_INVALID) {\r
- /* if focused_cb is called twice becuase of double click, move focus to popup */\r
- if (msg_ui_composer_popup_exist(cd))\r
- msg_ui_composer_popup_focus(cd);\r
-\r
- return;\r
- }\r
-\r
- if (cd->msg_type == COMPOSER_MSG_TYPE_MMS) {\r
- MSG_COMPOSER_BODY_S *body_data = &cd->body_data;\r
-\r
- Eina_List *page_list = body_data->page_list;\r
- int page_count = body_data->page_count;\r
-\r
- if (page_count == 1) {\r
- D_MSG("page NO.1 focused !!!");\r
- cd->current_edit_entry = 0;\r
- } else {\r
- MSG_COMPOSER_BODY_PAGE_S *page_data = NULL;\r
- int i = 0;\r
-\r
- for (i = 0; i < page_count; i++) {\r
- page_data = (MSG_COMPOSER_BODY_PAGE_S *)eina_list_nth(page_list, i);\r
- if (page_data->entry == obj) {\r
- D_MSG("page NO.[%d]/[%d] focused !!!", i + 1, page_count);\r
- cd->current_edit_entry = i;\r
- break;\r
- }\r
- }\r
- page_data = evas_object_data_get(obj, "page_data");\r
- if (page_data == NULL) {\r
- D_EMSG("page_data is NULL");\r
- } else {\r
- /* show delete button */\r
- D_MSG("show delete button");\r
- edje_object_signal_emit(_EDJ(page_data->upper_layout), "show.delete", "*");\r
- }\r
- }\r
- } else if (cd->msg_type == COMPOSER_MSG_TYPE_SMS) {\r
- cd->current_edit_entry = 0;\r
- } else {\r
- D_MSG("message composer invalid message type");\r
- }\r
-\r
- msg_ui_composer_last_focused_entry_set(data, obj);\r
-\r
- if (cd->msg_type == COMPOSER_MSG_TYPE_MMS)\r
- msg_ui_composer_toolbar_top_update(cd);\r
-\r
- D_LEAVE;\r
-}\r
-\r
-void msg_ui_composer_body_page_del_btn_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)\r
-{\r
- D_ENTER;\r
- D_MSG_RETM_IF(obj == NULL, "obj is NULL");\r
- elm_icon_file_set(obj, MSGC_IMG_DEL_BTN_PRESS_ICON, NULL);\r
-}\r
-\r
-void msg_ui_composer_body_page_del_btn_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)\r
-{\r
- D_ENTER;\r
- D_MSG_RETM_IF(obj == NULL, "obj is NULL");\r
- elm_icon_file_set(obj, MSGC_IMG_PAGE_DEL_ICON, NULL);\r
-}\r
-\r
-void msg_ui_composer_body_page_del_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)\r
-{\r
- D_ENTER;\r
-\r
- if (!data) {\r
- MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] Callback data is NULL");\r
- return;\r
- }\r
-\r
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
- Evas_Object *layout = evas_object_data_get(obj, "layout");\r
-\r
- msg_ui_composer_mms_body_remove_page(cd, layout);\r
-\r
- msg_ui_composer_message_type_check_and_change(cd);\r
-\r
- msg_ui_composer_body_info_area_update(cd);\r
-\r
- /* in invalid recipient case, give focus to other widget to call verify_cb of recipient */\r
- if (msg_ui_composer_last_focus_is_recipient(cd)) {\r
- const char *recipient = msg_ui_composer_recipient_entry_text_get(cd->recipient);\r
-\r
- if (recipient && recipient[0] != '\0') {\r
- if (!msg_ui_composer_recipient_vaild_check(recipient))\r
- elm_object_focus_set(cd->back_btn, EINA_TRUE);\r
- }\r
- }\r
- D_LEAVE;\r
-}\r
-\r
-static void __msg_ui_composer_body_launch_media_item(void *data, Evas_Object *obj)\r
-{\r
- D_ENTER;\r
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
- D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");\r
- D_MSG_RETM_IF(obj == NULL, "obj is NULL");\r
-\r
- Evas_Object *layout = NULL;\r
- MSG_COMPOSER_BODY_PAGE_S *page_data = NULL;\r
- MSG_COMPOSER_BODY_S *body_data = &cd->body_data;\r
- Eina_List *page_list = body_data->page_list;\r
- int page_count = body_data->page_count;\r
- int i = 0;\r
- char file_path[COMPOSER_FILEPATH_LEN_MAX + 1] = {0, };\r
-\r
- layout = evas_object_data_get(obj, "layout");\r
-\r
- if (!layout || !page_list) {\r
- D_EMSG("Invalid data layout = %x, page_list = %x", layout, page_list);\r
- return;\r
- }\r
-\r
- for (i = 0; i < page_count; i++) {\r
- page_data = (MSG_COMPOSER_BODY_PAGE_S *)eina_list_nth(page_list, i);\r
-\r
- if (!page_data) {\r
- D_EMSG("page data is NULL !!!");\r
- return;\r
- }\r
-\r
- if (page_data->sound_item == layout) {\r
- strncpy(file_path, page_data->sound_file_path, COMPOSER_FILEPATH_LEN_MAX);\r
- break;\r
- } else if (page_data->image_item == layout) {\r
- strncpy(file_path, page_data->image_file_path, COMPOSER_FILEPATH_LEN_MAX);\r
- break;\r
- }\r
- }\r
-\r
- if (file_path[0] != '\0')\r
- msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_COMMON, file_path);\r
-\r
- D_LEAVE;\r
-}\r
-\r
-void msg_ui_composer_body_media_layout_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source)\r
-{\r
- D_ENTER;\r
- D_MSG_RETM_IF(data == NULL, "data is NULL");\r
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
-\r
- __msg_ui_composer_body_launch_media_item(cd, obj);\r
-\r
- D_LEAVE;\r
-}\r
-\r
-void msg_ui_composer_body_media_thumb_icon_clicked_cb(void *data, Evas_Object *obj, void *event_info)\r
-{\r
- D_ENTER;\r
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
- D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");\r
-\r
- if (!cd->is_default_body_size)\r
- __msg_ui_composer_body_launch_media_item(cd, obj);\r
-\r
- D_LEAVE;\r
-}\r
-\r
-void msg_ui_composer_body_media_del_btn_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)\r
-{\r
- D_ENTER;\r
- D_MSG_RETM_IF(obj == NULL, "obj is NULL");\r
- int media_type = 0;\r
-\r
- media_type = (int)evas_object_data_get(obj, "media_type");\r
- D_MSG("media_type = %d", media_type);\r
-\r
- if (media_type == COMPOSER_MEDIA_TYPE_AUDIO)\r
- elm_icon_file_set(obj, MSGC_IMG_DEL_BTN_PRESS_ICON, NULL);\r
- else\r
- elm_icon_file_set(obj, MSGC_IMG_INSERT_DEL_PRESS_ICON, NULL);\r
-}\r
-\r
-void msg_ui_composer_body_media_del_btn_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)\r
-{\r
- D_ENTER;\r
- D_MSG_RETM_IF(obj == NULL, "obj is NULL");\r
- int media_type = 0;\r
-\r
- media_type = (int)evas_object_data_get(obj, "media_type");\r
-\r
- if (media_type == COMPOSER_MEDIA_TYPE_AUDIO)\r
- elm_icon_file_set(obj, MSGC_SOUND_INSERT_DEL_ICON, NULL);\r
- else\r
- elm_icon_file_set(obj, MSGC_IMG_INSERT_DEL_ICON, NULL);\r
-}\r
-\r
-void msg_ui_composer_body_media_del_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)\r
-{\r
- D_ENTER;\r
-\r
- if (!data || !obj) {\r
- MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] NULL pointer error");\r
- return;\r
- }\r
-\r
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
- MSG_COMPOSER_BODY_S *body_data = &cd->body_data;\r
- MSG_COMPOSER_BODY_PAGE_S *page_data = NULL;\r
- Eina_List *page_list = body_data->page_list;\r
- int page_count = body_data->page_count;\r
- int body_length = 0;\r
-\r
- if (!cd->is_default_body_size) {\r
- Evas_Object *delete_layout = (Evas_Object *)evas_object_data_get(obj, "layout");\r
-\r
- int i = 0;\r
-\r
- for (i = 0; i < page_count; i++) {\r
- page_data = (MSG_COMPOSER_BODY_PAGE_S *)eina_list_nth(page_list, i);\r
-\r
- if (!page_data) {\r
- MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] page data is NULL !!!");\r
- return;\r
- }\r
-\r
- if (page_data->sound_item == delete_layout) {\r
- msg_ui_composer_mms_insert_item_remove(cd, delete_layout, COMPOSER_MEDIA_TYPE_AUDIO);\r
-\r
- char *body_text = elm_entry_markup_to_utf8(elm_entry_entry_get(page_data->entry));\r
- if (!body_text)\r
- return;\r
-\r
- body_length = strlen(body_text);\r
-\r
- if (body_length == 0 && !page_data->is_image_item)\r
- msg_ui_composer_mms_body_remove_page(cd, page_data->layout);\r
-\r
- g_free(body_text);\r
-\r
- break;\r
- } else if (page_data->image_item == delete_layout) {\r
-\r
- char *body_text = elm_entry_markup_to_utf8(elm_entry_entry_get(page_data->entry));\r
- if (!body_text)\r
- return;\r
-\r
- body_length = strlen(body_text);\r
-\r
- if (page_data->isVideo) {\r
- msg_ui_composer_mms_insert_item_remove(cd, delete_layout, COMPOSER_MEDIA_TYPE_VIDEO);\r
- } else {\r
- msg_ui_composer_mms_insert_item_remove(cd, delete_layout, COMPOSER_MEDIA_TYPE_IMAGE);\r
- }\r
-\r
- if (body_length == 0 && !page_data->is_sound_item)\r
- msg_ui_composer_mms_body_remove_page(cd, page_data->layout);\r
-\r
- g_free(body_text);\r
- break;\r
- }\r
- }\r
-\r
- msg_ui_composer_message_type_check_and_change(cd);\r
- }\r
-\r
- /* in invalid recipient case, give focus to other widget to call verify_cb of recipient */\r
- if (msg_ui_composer_last_focus_is_recipient(cd)) {\r
- const char *recipient = msg_ui_composer_recipient_entry_text_get(cd->recipient);\r
-\r
- if (recipient && recipient[0] != '\0') {\r
- if (!msg_ui_composer_recipient_vaild_check(recipient))\r
- elm_object_focus_set(cd->back_btn, EINA_TRUE);\r
- }\r
- }\r
-\r
- D_LEAVE;\r
-}\r
-\r
-void msg_ui_composer_body_body_layout_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)\r
+/*
+ * Copyright 2012 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.tizenopensource.org/license
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+ /* includes */
+#include "msg-ui-composer-body.h"
+#include "msg-ui-composer-recipient.h"
+#include "msg-ui-composer-main.h"
+#include "msg-ui-composer-body-page.h"
+#include "msg-ui-composer-body-callback.h"
+#include "msg-ui-composer-common.h"
+#include "msg-ui-composer-attachment.h"
+#include "msg-ui-composer-subject.h"
+#include "msg-ui-composer-message.h"
+#include "msg-ui-composer-popup.h"
+#include "msg-ui-composer-util.h"
+#include "msg-ui-composer-external.h"
+#include "syspopup_caller.h"
+
+/*==================================================================================================
+* FUNCTION IMPLEMENTATIONS
+*==================================================================================================*/
+static void __add_list_popup_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+
+ if (!data || !event_info) {
+ D_EMSG("invalid argument, argument data is NULL");
+ return;
+ }
+
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+
+ if (cd->add_menu_clicked)
+ return;
+
+ Elm_Object_Item *item = (Elm_Object_Item *)event_info;
+ elm_list_item_selected_set(item, EINA_FALSE);
+
+ const char *label = elm_object_item_text_get(item);
+ if (!label) {
+ D_EMSG("label is NULL !!");
+ return;
+ }
+
+ cd->add_menu_clicked = true;
+
+ MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "label = %s", label);
+ if (cd->isAppControl) {
+ if (!g_strcmp0(label, MSGC_STR_SUBJECT)) {
+ msg_ui_composer_add_subject(cd);
+ } else {
+ D_EMSG("Unknown Menu List Item");
+ }
+ } else {
+ if (!g_strcmp0(label, MSGC_STR_SUBJECT)) {
+ msg_ui_composer_add_subject(cd);
+ } else if (!g_strcmp0(label, MSGC_STR_GALLERY)) {
+ msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_GALLERY, NULL);
+ } else if (!g_strcmp0(label, MSGC_STR_MYFILE)) {
+ msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_MYFILE, NULL);
+ } else if (!g_strcmp0(label, _MSGSTR("IDS_MSGC_BODY_TAKE_PICTURE"))) {
+ msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_CAMERA, NULL);
+ } else if (!g_strcmp0(label, _MSGSTR("IDS_MSGC_BODY_CAPTURE_VIDEO"))) {
+ msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_CAMCORDER, NULL);
+ } else if (!g_strcmp0(label, MSGC_STR_CONTACT)) {
+ msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_NAMECARD, NULL);
+ } else if (!g_strcmp0(label, _SYSSTR("IDS_COM_BODY_CALENDAR"))) {
+ msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_CALENDAR, NULL);
+ } else if (!g_strcmp0(label, _SYSSTR("IDS_COM_BODY_MEMO"))) {
+ msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_MEMO, NULL);
+ } else {
+ D_EMSG("Unknown Menu List Item");
+ }
+ }
+
+ MSGC_EVAS_OBJECT_DEL(cd->add_popup);
+ cd->add_button_clicked = false;
+ cd->add_menu_clicked = false;
+ D_LEAVE;
+}
+
+static void __add_list_popup_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ D_MSG_RETM_IF(cd == NULL, "composer data is NULL");
+ MSGC_EVAS_OBJECT_DEL(cd->add_popup);
+ cd->add_button_clicked = false;
+ cd->add_menu_clicked = false;
+
+ D_LEAVE;
+}
+
+static void __add_list_popup_show(void *data)
+{
+ D_ENTER;
+
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ Evas_Object *popup = NULL;
+ Evas_Object *list = NULL;
+ int count = 0;
+ int list_padding = 4;
+
+
+ list = elm_list_add(cd->main_window);
+ D_MSG_RETM_IF(list == NULL, "list is NULL");
+ elm_list_mode_set(list, ELM_LIST_EXPAND);
+
+ Elm_Object_Item *item = NULL;
+
+ if (cd->isAppControl) {
+ item = elm_list_item_append(list, MSGC_STR_SUBJECT, NULL, NULL, __add_list_popup_clicked_cb, data);
+ ++count;
+ if (cd->isSubject)
+ elm_object_item_disabled_set(item, EINA_TRUE);
+
+ } else {
+ if (!cd->isSubject) {
+ elm_list_item_append(list, MSGC_STR_SUBJECT, NULL, NULL, __add_list_popup_clicked_cb, data);
+ ++count;
+ }
+
+ elm_list_item_append(list, MSGC_STR_GALLERY, NULL, NULL, __add_list_popup_clicked_cb, data);
+ ++count;
+ elm_list_item_append(list, _MSGSTR("IDS_MSGC_BODY_TAKE_PICTURE"), NULL, NULL, __add_list_popup_clicked_cb, data);
+ ++count;
+ elm_list_item_append(list, _MSGSTR("IDS_MSGC_BODY_CAPTURE_VIDEO"), NULL, NULL, __add_list_popup_clicked_cb, data);
+ ++count;
+ elm_list_item_append(list, MSGC_STR_MYFILE, NULL, NULL, __add_list_popup_clicked_cb, data);
+ ++count;
+ elm_list_item_append(list, MSGC_STR_CONTACT, NULL, NULL, __add_list_popup_clicked_cb, data);
+ ++count;
+ elm_list_item_append(list, _SYSSTR("IDS_COM_BODY_CALENDAR"), NULL, NULL, __add_list_popup_clicked_cb, data);
+ ++count;
+ elm_list_item_append(list, _SYSSTR("IDS_COM_BODY_MEMO"), NULL, NULL, __add_list_popup_clicked_cb, data);
+ ++count;
+ }
+
+ elm_list_go(list);
+
+ if (count >= 4) {
+ count = 4;
+
+ int popup_height = MSGC_POPUP_LIST_H * count + list_padding;
+ evas_object_size_hint_max_set(list, -1, popup_height * elm_scale_get());
+ }
+
+ popup = msg_ui_composer_list_popup_create(cd, _SYSSTR("IDS_COM_POP_ATTACH"), list, "min_menustyle");
+
+ Evas_Object *btn1 = elm_button_add(popup);
+ elm_object_style_set(btn1, "popup_button/default");
+ elm_object_text_set(btn1, MSGC_STR_BUTTON_CLOSE);
+ elm_object_part_content_set(popup, "button1", btn1);
+ evas_object_smart_callback_add(btn1, "clicked", __add_list_popup_btn_clicked_cb, cd);
+
+ cd->add_popup = popup;
+
+ D_LEAVE;
+}
+
+static void __msgc_show_bubble_view(void *data, msg_thread_id_t tid)
{
D_ENTER;
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ D_MSG_RETM_IF(cd == NULL, "cd is NULL");
+
+ /* show indicator area */
+ elm_layout_theme_set(cd->base, "layout", "application", "default");
+ elm_win_indicator_mode_set(cd->main_window, ELM_WIN_INDICATOR_SHOW);
+
+ msg_ui_composer_change_bubble_view(cd);
+
+ if (tid <= 0) {
+ D_EMSG("Can not find tid = %d !!", tid);
+ msg_ui_composer_message_destroy();
+ ug_destroy_me(cd->ug);
+
+ return;
+ }
+
+ msg_ui_composer_bubble_data_set(cd, tid);
+ msg_ui_bubble_start_view(cd->bubble_data);
+ msg_ui_composer_navi_title_set((void *)cd);
+
+ /* set recipient list for bubble composer */
+ msg_ui_composer_recipient_set_recipient_list(cd, tid);
+
+ D_LEAVE;
+}
+
+static void __nosim_popup_delete_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ D_MSG_RETM_IF(cd == NULL, "Composer data is NULL");
+
+ if (cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER)
+ ug_destroy_me(cd->ug);
+
+ D_LEAVE;
+}
+
+void msg_ui_composer_body_make_and_send_message(void *data)
+{
+ D_ENTER;
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+ msg_thread_id_t tid = 0;
+
+ /*Make message*/
+ msg_ui_composer_message_init();
+
+ if (msg_ui_composer_recipient_read_data(cd) != COMPOSER_RETURN_SUCCESS) {
+ D_EMSG("Make recipient data Error");
+ goto error_return;
+ }
+
+ if (__msg_ui_composer_body_read_data(cd) != COMPOSER_RETURN_SUCCESS) {
+ D_EMSG("Make body data Error");
+ goto error_return;
+ }
+
+ /*Send message*/
+ COMPOSER_RETURN_TYPE_E ret = msg_ui_composer_message_make_and_send(cd->msg_handle, &tid);
+
+ /* reset region info */
+ MSG_COMPOSER_BODY_S *body_data = &cd->body_data;
+ body_data->region_order = COMPOSER_REGION_ORDER_UNDETERMINDED;
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
- D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");\r
- Evas_Coord x = 0;\r
+ if (ret == COMPOSER_RETURN_SUCCESS) {
+ D_MSG("Send Success");
+
+ if (cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER || cd->composer_mode == MSG_COMPOSER_MODE_FORWARD) {
+ ug_destroy_me(cd->ug);
+ } else if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER) {
+ __msgc_show_bubble_view(cd, tid);
+ msg_ui_composer_clear(cd);
+ } else {
+ msg_ui_composer_clear(cd);
+ }
+
+ cd->composer_mode = MSG_COMPOSER_MODE_NORMAL;
+
+ } else {
+ if (ret == COMPOSER_RETURN_NO_SIM) {
+ D_EMSG("Send Fail : NO SIM");
+ Evas_Object *popup = msg_ui_composer_status_popup_show(cd, MSGC_STR_POP_NOSIM, 1);
+
+ if (cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER || cd->composer_mode == MSG_COMPOSER_MODE_FORWARD) {
+ evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, __nosim_popup_delete_cb, cd);
+ } else if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER) {
+ __msgc_show_bubble_view(cd, tid);
+ }
+
+ msg_ui_composer_clear(cd);
+ } else {
+ D_EMSG("Send Fail : Unable Send");
+ if ((cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER || cd->composer_mode == MSG_COMPOSER_MODE_FORWARD))
+ ug_destroy_me(cd->ug);
+ else
+ msg_ui_composer_status_popup_show(cd, MSGC_STR_POP_UNABLE_SEND, COMPOSER_STATUS_POPUP_DEFAULT_TIME);
+ }
+
+ cd->composer_mode = MSG_COMPOSER_MODE_NORMAL;
+
+ goto error_return;
+ }
+
+ msg_ui_composer_message_destroy();
+ D_LEAVE;
+ return;
+
+error_return:
+ msg_ui_composer_message_destroy();
+
+ if (cd->send_button)
+ elm_object_disabled_set(cd->send_button, EINA_FALSE);
+
+ D_LEAVE;
+}
+
+void msg_ui_composer_body_send_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ D_MSG_RETM_IF(data == NULL, "Composer Data is NULL");
+
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+
+ if (cd->send_button)
+ elm_object_disabled_set(cd->send_button, EINA_TRUE);
+
+ /*Check recipient available sending*/
+ RECIPIENT_S *rd = cd->recipient;
+ if (rd) {
+ /*add recipient, if entry text exist*/
+ Evas_Object *entry = elm_multibuttonentry_entry_get(rd->mbe);
+ char *entry_txt = elm_entry_markup_to_utf8(elm_entry_entry_get(entry));
+ if (entry_txt) {
+ if (strlen(entry_txt) > 0) {
+ if (NULL == elm_multibuttonentry_item_append(rd->mbe, entry_txt, NULL, NULL)) {
+ g_free(entry_txt);
+
+ if (cd->send_button)
+ elm_object_disabled_set(cd->send_button, EINA_FALSE);
+
+ return;
+ }
+ }
+ g_free(entry_txt);
+ }
+
+ /*check recipient count is zero*/
+ if (msg_ui_composer_recipient_count_get(rd) == 0) {
+ D_EMSG("there is no recipient");
+ //msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_NO_RECIPIENT);
+
+ /* change focus to recipient */
+ if (cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER || cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER)
+ msg_ui_composer_recipient_focus_set(cd->recipient);
+
+ if (cd->send_button)
+ elm_object_disabled_set(cd->send_button, EINA_FALSE);
+
+ return;
+ }
+ }
+
+ msg_ui_composer_body_make_and_send_message(cd);
+
+ D_LEAVE;
+ return;
+}
+
+void msg_ui_composer_body_add_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+
+ if (!data) {
+ MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] error data is NULL");
+ return;
+ }
+
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+
+ if (cd->add_button_clicked)
+ return;
+
+ cd->add_button_clicked = true;
+ __add_list_popup_show(cd);
+
+ D_LEAVE;
+}
+
+void msg_ui_composer_body_entry_maxlength_reached_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+
+ msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_MAXLENGHT_CHAR);
+
+ D_LEAVE;
+}
+
+void msg_ui_composer_body_entry_changed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ D_MSG_RETM_IF(data == NULL, "Composer Data is NULL");
+ D_MSG_RETM_IF(obj == NULL, "entry obj is NULL");
+
+ MSG_COMPOSER_VIEW_DATA_S *cd = data;
+ MSG_COMPOSER_BODY_PAGE_S *page_data = NULL;
+
+ page_data = evas_object_data_get(obj, "page_data");
+ if (page_data == NULL)
+ return;
+
+ char *body_text = elm_entry_markup_to_utf8(elm_entry_entry_get(obj));
+ if (body_text == NULL)
+ return;
+
+ int text_len = strlen(body_text);
+ if (text_len <= 0) {
+ page_data->text_info.encode = COMPOSER_CHAR_ENCODE_UNICODE;
+ page_data->text_info.char_count = 0;
+ } else {
+ unsigned char ucs2_text[COMPOSER_MMS_TEXT_MAX_CHAR*2] = {0,};
+ int ucs2_len = msg_ui_composer_convert_UTF8ToUCS2(ucs2_text, sizeof(ucs2_text), body_text, text_len);
+ page_data->text_info.encode = msg_ui_composer_body_entry_char_count(cd, ucs2_text, ucs2_len, &page_data->text_info.char_count);
+ }
+ g_free(body_text);
+
+ msg_ui_composer_message_type_check_and_change(cd);
+
+ msg_ui_composer_body_info_area_update(cd);
+
+ if (msg_ui_composer_common_is_send_possible(cd)) {
+ elm_object_disabled_set(cd->send_button, EINA_FALSE);
+ msg_ui_composer_body_update_send_btn_icon(cd, false);
+ } else {
+ elm_object_disabled_set(cd->send_button, EINA_TRUE);
+ msg_ui_composer_body_update_send_btn_icon(cd, true);
+ }
+
+ D_LEAVE;
+}
+
+void msg_ui_composer_body_entry_press_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+
+ if (msg_ui_composer_recipient_addr_type_get(cd->recipient) == COMPOSER_RECP_ADDR_INVALID) {
+ elm_entry_context_menu_disabled_set(obj, EINA_TRUE);
+ elm_entry_magnifier_disabled_set(obj, EINA_TRUE);
+ } else {
+ elm_entry_context_menu_disabled_set(obj, EINA_FALSE);
+ elm_entry_magnifier_disabled_set(obj, EINA_FALSE);
+ }
+
+ D_LEAVE;
+}
+
+void msg_ui_composer_body_entry_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+
+ int attach_count = msg_ui_composer_get_attach_count(cd);
+
+ if (attach_count > 1)
+ msg_ui_composer_contract_attach_list(cd);
+
+ D_LEAVE;
+}
+
+void msg_ui_composer_body_entry_unfocused_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+
+ if (cd->msg_type == COMPOSER_MSG_TYPE_MMS) {
+ MSG_COMPOSER_BODY_S *body_data = &cd->body_data;
+
+ int page_count = body_data->page_count;
+
+ if (page_count == 1) {
+ D_MSG("There is 1 page !!!");
+ } else {
+ MSG_COMPOSER_BODY_PAGE_S *page_data = evas_object_data_get(obj, "page_data");
+ if (page_data == NULL) {
+ D_EMSG("page_data is NULL");
+ } else {
+ /* hide delete button */
+ D_MSG("hide delete button");
+ edje_object_signal_emit(_EDJ(page_data->upper_layout), "hide.delete", "*");
+ }
+ }
+ }
+
+ D_LEAVE;
+}
+
+void msg_ui_composer_body_entry_focused_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+
+ if (msg_ui_composer_recipient_addr_type_get(cd->recipient) == COMPOSER_RECP_ADDR_INVALID) {
+ /* if focused_cb is called twice becuase of double click, move focus to popup */
+ if (msg_ui_composer_popup_exist(cd))
+ msg_ui_composer_popup_focus(cd);
+
+ return;
+ }
+
+ if (cd->msg_type == COMPOSER_MSG_TYPE_MMS) {
+ MSG_COMPOSER_BODY_S *body_data = &cd->body_data;
+
+ Eina_List *page_list = body_data->page_list;
+ int page_count = body_data->page_count;
+
+ if (page_count == 1) {
+ D_MSG("page NO.1 focused !!!");
+ cd->current_edit_entry = 0;
+ } else {
+ MSG_COMPOSER_BODY_PAGE_S *page_data = NULL;
+ int i = 0;
+
+ for (i = 0; i < page_count; i++) {
+ page_data = (MSG_COMPOSER_BODY_PAGE_S *)eina_list_nth(page_list, i);
+ if (page_data->entry == obj) {
+ D_MSG("page NO.[%d]/[%d] focused !!!", i + 1, page_count);
+ cd->current_edit_entry = i;
+ break;
+ }
+ }
+ page_data = evas_object_data_get(obj, "page_data");
+ if (page_data == NULL) {
+ D_EMSG("page_data is NULL");
+ } else {
+ /* show delete button */
+ D_MSG("show delete button");
+ edje_object_signal_emit(_EDJ(page_data->upper_layout), "show.delete", "*");
+ }
+ }
+ } else if (cd->msg_type == COMPOSER_MSG_TYPE_SMS) {
+ cd->current_edit_entry = 0;
+ } else {
+ D_MSG("message composer invalid message type");
+ }
+
+ msg_ui_composer_last_focused_entry_set(data, obj);
+
+ if (cd->msg_type == COMPOSER_MSG_TYPE_MMS)
+ msg_ui_composer_toolbar_top_update(cd);
+
+ D_LEAVE;
+}
+
+void msg_ui_composer_body_page_del_btn_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ D_MSG_RETM_IF(obj == NULL, "obj is NULL");
+ elm_icon_file_set(obj, MSGC_IMG_DEL_BTN_PRESS_ICON, NULL);
+}
+
+void msg_ui_composer_body_page_del_btn_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ D_MSG_RETM_IF(obj == NULL, "obj is NULL");
+ elm_icon_file_set(obj, MSGC_IMG_PAGE_DEL_ICON, NULL);
+}
+
+void msg_ui_composer_body_page_del_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+
+ if (!data) {
+ MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] Callback data is NULL");
+ return;
+ }
+
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ Evas_Object *layout = evas_object_data_get(obj, "layout");
+
+ msg_ui_composer_mms_body_remove_page(cd, layout);
+
+ msg_ui_composer_message_type_check_and_change(cd);
+
+ msg_ui_composer_body_info_area_update(cd);
+
+ /* in invalid recipient case, give focus to other widget to call verify_cb of recipient */
+ if (msg_ui_composer_last_focus_is_recipient(cd)) {
+ const char *recipient = msg_ui_composer_recipient_entry_text_get(cd->recipient);
+
+ if (recipient && recipient[0] != '\0') {
+ if (!msg_ui_composer_recipient_vaild_check(recipient))
+ elm_object_focus_set(cd->back_btn, EINA_TRUE);
+ }
+ }
+ D_LEAVE;
+}
+
+static void __msg_ui_composer_body_launch_media_item(void *data, Evas_Object *obj)
+{
+ D_ENTER;
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+ D_MSG_RETM_IF(obj == NULL, "obj is NULL");
+
+ Evas_Object *layout = NULL;
+ MSG_COMPOSER_BODY_PAGE_S *page_data = NULL;
+ MSG_COMPOSER_BODY_S *body_data = &cd->body_data;
+ Eina_List *page_list = body_data->page_list;
+ int page_count = body_data->page_count;
+ int i = 0;
+ char file_path[COMPOSER_FILEPATH_LEN_MAX + 1] = {0, };
+
+ layout = evas_object_data_get(obj, "layout");
+
+ if (!layout || !page_list) {
+ D_EMSG("Invalid data layout = %x, page_list = %x", layout, page_list);
+ return;
+ }
+
+ for (i = 0; i < page_count; i++) {
+ page_data = (MSG_COMPOSER_BODY_PAGE_S *)eina_list_nth(page_list, i);
+
+ if (!page_data) {
+ D_EMSG("page data is NULL !!!");
+ return;
+ }
+
+ if (page_data->sound_item == layout) {
+ strncpy(file_path, page_data->sound_file_path, COMPOSER_FILEPATH_LEN_MAX);
+ break;
+ } else if (page_data->image_item == layout) {
+ strncpy(file_path, page_data->image_file_path, COMPOSER_FILEPATH_LEN_MAX);
+ break;
+ }
+ }
+
+ if (file_path[0] != '\0')
+ msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_COMMON, file_path);
+
+ D_LEAVE;
+}
+
+void msg_ui_composer_body_media_layout_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+ D_ENTER;
+ D_MSG_RETM_IF(data == NULL, "data is NULL");
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+
+ __msg_ui_composer_body_launch_media_item(cd, obj);
+
+ D_LEAVE;
+}
+
+void msg_ui_composer_body_media_thumb_icon_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+
+ if (!cd->is_default_body_size)
+ __msg_ui_composer_body_launch_media_item(cd, obj);
+
+ D_LEAVE;
+}
+
+void msg_ui_composer_body_media_del_btn_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ D_MSG_RETM_IF(obj == NULL, "obj is NULL");
+ int media_type = 0;
+
+ media_type = (int)evas_object_data_get(obj, "media_type");
+ D_MSG("media_type = %d", media_type);
+
+ if (media_type == COMPOSER_MEDIA_TYPE_AUDIO)
+ elm_icon_file_set(obj, MSGC_IMG_DEL_BTN_PRESS_ICON, NULL);
+ else
+ elm_icon_file_set(obj, MSGC_IMG_INSERT_DEL_PRESS_ICON, NULL);
+}
+
+void msg_ui_composer_body_media_del_btn_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ D_MSG_RETM_IF(obj == NULL, "obj is NULL");
+ int media_type = 0;
+
+ media_type = (int)evas_object_data_get(obj, "media_type");
+
+ if (media_type == COMPOSER_MEDIA_TYPE_AUDIO)
+ elm_icon_file_set(obj, MSGC_SOUND_INSERT_DEL_ICON, NULL);
+ else
+ elm_icon_file_set(obj, MSGC_IMG_INSERT_DEL_ICON, NULL);
+}
+
+void msg_ui_composer_body_media_del_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+
+ if (!data || !obj) {
+ MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] NULL pointer error");
+ return;
+ }
+
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ MSG_COMPOSER_BODY_S *body_data = &cd->body_data;
+ MSG_COMPOSER_BODY_PAGE_S *page_data = NULL;
+ Eina_List *page_list = body_data->page_list;
+ int page_count = body_data->page_count;
+ int body_length = 0;
+
+ if (!cd->is_default_body_size) {
+ Evas_Object *delete_layout = (Evas_Object *)evas_object_data_get(obj, "layout");
+
+ int i = 0;
+
+ for (i = 0; i < page_count; i++) {
+ page_data = (MSG_COMPOSER_BODY_PAGE_S *)eina_list_nth(page_list, i);
+
+ if (!page_data) {
+ MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] page data is NULL !!!");
+ return;
+ }
+
+ if (page_data->sound_item == delete_layout) {
+ msg_ui_composer_mms_insert_item_remove(cd, delete_layout, COMPOSER_MEDIA_TYPE_AUDIO);
+
+ char *body_text = elm_entry_markup_to_utf8(elm_entry_entry_get(page_data->entry));
+ if (!body_text)
+ return;
+
+ body_length = strlen(body_text);
+
+ if (body_length == 0 && !page_data->is_image_item)
+ msg_ui_composer_mms_body_remove_page(cd, page_data->layout);
+
+ g_free(body_text);
+
+ break;
+ } else if (page_data->image_item == delete_layout) {
+
+ char *body_text = elm_entry_markup_to_utf8(elm_entry_entry_get(page_data->entry));
+ if (!body_text)
+ return;
+
+ body_length = strlen(body_text);
+
+ if (page_data->isVideo) {
+ msg_ui_composer_mms_insert_item_remove(cd, delete_layout, COMPOSER_MEDIA_TYPE_VIDEO);
+ } else {
+ msg_ui_composer_mms_insert_item_remove(cd, delete_layout, COMPOSER_MEDIA_TYPE_IMAGE);
+ }
+
+ if (body_length == 0 && !page_data->is_sound_item)
+ msg_ui_composer_mms_body_remove_page(cd, page_data->layout);
+
+ g_free(body_text);
+ break;
+ }
+ }
+
+ msg_ui_composer_message_type_check_and_change(cd);
+ }
+
+ /* in invalid recipient case, give focus to other widget to call verify_cb of recipient */
+ if (msg_ui_composer_last_focus_is_recipient(cd)) {
+ const char *recipient = msg_ui_composer_recipient_entry_text_get(cd->recipient);
+
+ if (recipient && recipient[0] != '\0') {
+ if (!msg_ui_composer_recipient_vaild_check(recipient))
+ elm_object_focus_set(cd->back_btn, EINA_TRUE);
+ }
+ }
+
+ D_LEAVE;
+}
+
+void msg_ui_composer_body_body_layout_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+ D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+ Evas_Coord x = 0;
Evas_Coord y = 0;
Evas_Coord w = 0;
Evas_Coord h = 0;
- evas_object_geometry_get(obj, &x, &y, &w, &h);\r
- D_MSG("body layout height = %d", h);\r
+ evas_object_geometry_get(obj, &x, &y, &w, &h);
+ D_MSG("body layout height = %d", h);
cd->ly_body_h = h;
- if (h >= COMPOSER_ENOUGH_TEXT_RENDERING_BODY_HEIGHT)\r
+ if (h >= COMPOSER_ENOUGH_TEXT_RENDERING_BODY_HEIGHT)
msg_ui_composer_body_info_area_update(cd);
else
edje_object_part_text_set(_EDJ(cd->ly_body), "text.char_count", "");
-\r
+
D_LEAVE;
-}\r
-\r
-void msg_ui_composer_body_body_layout_clicked_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)\r
-{\r
- D_ENTER;\r
- D_MSG_RETM_IF(data == NULL, "data is NULL");\r
- MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;\r
-\r
- msg_ui_composer_body_focus_set(cd, 0);\r
-\r
- evas_object_event_callback_del(cd->body_box, EVAS_CALLBACK_MOUSE_UP, msg_ui_composer_body_body_layout_clicked_cb);\r
-\r
- cd->is_default_body_size = false;\r
-\r
- D_LEAVE;\r
-}\r
-\r
+}
+
+void msg_ui_composer_body_body_layout_clicked_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ D_ENTER;
+ D_MSG_RETM_IF(data == NULL, "data is NULL");
+ MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+
+ msg_ui_composer_body_focus_set(cd, 0);
+
+ evas_object_event_callback_del(cd->body_box, EVAS_CALLBACK_MOUSE_UP, msg_ui_composer_body_body_layout_clicked_cb);
+
+ cd->is_default_body_size = false;
+
+ D_LEAVE;
+}
+