Fix N_SE-21691, disable more button of composer in case of sms
[apps/core/preloaded/message-app.git] / composer / src / ui-composer / msg-ui-composer-main.c
index 30ee459..1e9626d 100755 (executable)
@@ -5,7 +5,7 @@
  * 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
+ *    http://floralicense.org/license
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
 
 /* includes*/
 #include <Ecore_X.h>
-#include <MapiTransport.h>
+#include <tapi_common.h>
+#include <TapiUtility.h>
+#include <utilX.h>
 
 #include "msg-ui-composer-main.h"
 #include "msg-ui-composer-recipient.h"
 #include "msg-ui-composer-popup.h"
 #include "msg-ui-composer-predictsearch.h"
+#include "msg-ui-composer-subject.h"
 #include "msg-ui-composer-body.h"
-
+#include "msg-ui-composer-pageduration.h"
 #include "msg-ui-composer-message.h"
-#include "msg-ui-composer-core.h"
 #include "msg-ui-composer-common.h"
 #include "msg-ui-composer-external.h"
 #include "msg-ui-composer-bubble.h"
+#include "msg-ui-composer-main.h"      /*for page duration, it should be removed if more option concept is changed*/
+
+#include "msg-ui-common-utility.h"
 
 #define COMPOSER_BUNDLE_ATTACH_TOKEN "\n"
 #define COMPOSER_BUNDLE_RECP_TOKEN ","
 /*==================================================================================================
 *                                                              FUNCTION IMPLEMENTATIONS
 *==================================================================================================*/
-static Eina_Bool __msg_ui_composer_edit_check(MSG_COMPOSER_VIEW_DATA_S *cd)
+static COMPOSER_EDIT_STATE_E __msg_ui_composer_edit_check(MSG_COMPOSER_VIEW_DATA_S *cd)
 {
        D_ENTER;
-       D_MSG_RETVM_IF(cd == NULL, EINA_FALSE, "Composer Data == NULL");
+       D_MSG_RETVM_IF(cd == NULL, COMPOSER_EDIT_NONE, "Composer Data == NULL");
+
+       bool isvalid_address = false;
+       bool iscontent_edited = false;
 
        if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER || cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER) {
                int recipient_count = msg_ui_composer_recipient_count_get(cd->recipient);
                if (recipient_count > 0) {
-                       return EINA_TRUE;
+                       isvalid_address = true;
                }
 
                const char *entry_str = msg_ui_composer_recipient_entry_text_get(cd->recipient);
                if (entry_str && strlen(entry_str)) {
-                       return EINA_TRUE;
+                       if (msg_ui_composer_recipient_vaild_check(entry_str) == EINA_TRUE)
+                               isvalid_address = true;
                }
+       } else if (cd->msg_ug_mode == MSG_UG_MODE_BUBBLE_COMPOSER) {
+               isvalid_address = true;
+       }
+
+       /* valid address & there is body content */
+       if (msg_ui_composer_common_is_send_possible(cd) == true)
+               iscontent_edited = true;
+
+       if (isvalid_address && iscontent_edited)
+               return COMPOSER_EDIT_RECIPIENT_AND_BODY;
+       else if (isvalid_address)
+               return COMPOSER_EDIT_RECIPIENT;
+       else if (iscontent_edited)
+               return COMPOSER_EDIT_BODY;
+       else
+               return COMPOSER_EDIT_NONE;
+}
+
+static void __msgc_vconf_changed_cb(keynode_t *key, 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");
+       D_MSG_RETM_IF(key == NULL, "key is NULL");
+
+       int index = 0;
+       int font_size = 0;
+       int converted_size = 0;
+       char *key_name = NULL;
+
+       key_name = vconf_keynode_get_name(key);
+       if (!key_name) {
+               D_EMSG("key_name is NULL");
+               return;
        }
 
-       if (msg_ui_composer_common_is_send_possible(cd) == true) {
-               return EINA_TRUE;
+       if (!strcmp(key_name, VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE)) {
+               index = vconf_keynode_get_int(key);
+               font_size = msg_common_get_font_size_from_index(index);
+               converted_size = (MSGC_BODY_FONT_SIZE * font_size) / MSG_APP_FONT_SIZE_NORMAL;
+
+               cd->font_size = converted_size;
+
+               /* sync current font size as accessibility font index */
+               if (msg_common_set_font_size(index) == FALSE)
+                       D_EMSG("msg_common_set_font_size(index = %d) is failed !!", index);
+
+               /* sync msg accessibility font size with accessibility font index */
+               if (msg_common_set_access_font_size(index) == FALSE)
+                       D_EMSG("vconf_set_int(VCONFKEY_MSG_APP_ACCESS_FONT_SIZE) is failed !!, [%d]", index);
+       } else if (!strcmp(key_name, VCONFKEY_MSG_APP_FONT_SIZE)) {
+               index = vconf_keynode_get_int(key);
+               font_size = msg_common_get_font_size_from_index(index);
+               converted_size = (MSGC_BODY_FONT_SIZE * font_size) / MSG_APP_FONT_SIZE_NORMAL;
+
+               cd->font_size = converted_size;
+       } else {
+               D_EMSG("key did not match.");
        }
 
-       return EINA_FALSE;
+       D_MSG("font size = %d", font_size);
+       D_MSG("converted font size = %d", converted_size);
+
+       D_LEAVE;
 }
 
-/* function definitions*/
-static void __msg_ui_composer_bundle_data_process(MSG_COMPOSER_VIEW_DATA_S *cd, bundle *b_data)
+static void __msgc_init_font_size(MSG_COMPOSER_VIEW_DATA_S *cd)
 {
        D_ENTER;
        D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
-       D_MSG_RETM_IF(b_data == NULL, "Bundle Data is NULL");
 
-       const char *bundle_txt = NULL;
+       int index = 0;
+       int access_font_index = 0;
+       int msg_access_font_index = 0;
+       int font_size = 0;
+       int converted_size = 0;
 
-       if ((bundle_txt = bundle_get_val(b_data, MSG_BUNDLE_KEY_FORWARD))) {
-               int msg_id = atoi(bundle_txt);
-               msg_ui_composer_message_init();
-               msg_ui_composer_message_load_message(cd->msg_handle, msg_id);
-               msg_ui_composer_message_set_loaded_data(cd);
-               msg_ui_composer_message_destroy();
+       /* get msg accessibility font index */
+       if (msg_common_get_access_font_size(&msg_access_font_index) == FALSE) {
+               D_EMSG("msg_common_get_access_font_size is failed !!");
+               msg_access_font_index = MSG_APP_FONT_SIZE_INDEX_NORMAL; /* 1 */
+       }
+
+       /* get accessibility font index */
+       if (vconf_get_int(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, &access_font_index) < 0) {
+               D_EMSG("vconf_get_int(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE) is failed !!");
+               access_font_index = MSG_SYS_FONT_SIZE_INDEX_NORMAL;     /* 1 */
+       }
+
+       if (msg_common_get_font_size(&index) == FALSE) {
+               D_EMSG("msg_common_get_font_size() is failed");
+               cd->font_size = MSGC_BODY_FONT_SIZE;
+               return;
        } else {
-               if ((bundle_txt = bundle_get_val(b_data, MSG_BUNDLE_KEY_TO))) {
-                       bool bMaxCount = false;
-                       bool bInvalidNum = false;
-                       bool bDup = false;
-                       Eina_List *recipient_list = make_tokenize_list(bundle_txt, ",");
-                       if (recipient_list) {
-                               Eina_List *l = NULL;
-                               char *recipient;
-                               EINA_LIST_FOREACH(recipient_list, l, recipient) {
-                                       if (recipient) {
-                                               D_MSG("TO = %s", recipient);
-                                               if (msg_ui_composer_recipient_count_get(cd->recipient) >= COMPOSER_RECIPIENT_COUNT_MAX) {
-                                                       bMaxCount = true;
-                                                       g_free(recipient);
-                                                       break;
-                                               }
+               D_MSG("selected font_size index = %d", index);
+       }
 
-                                               if (msg_ui_composer_recipient_duplicate_check(cd->recipient, recipient) == COMPOSER_RETURN_RECIPIENT_DUPLICATE) {
-                                                       bDup = true;
-                                                       g_free(recipient);
-                                                       continue;
-                                               }
+       D_MSG("VCONFKEY_MSG_APP_ACCESS_FONT_SIZE = %d", msg_access_font_index);
+       D_MSG("VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE = %d", access_font_index);
 
-                                               if (msg_ui_composer_recipient_vaild_check(recipient) == EINA_FALSE) {
-                                                       bInvalidNum = true;
-                                               }
+       if (msg_access_font_index != access_font_index) {
+               font_size = msg_common_get_font_size_from_index(access_font_index);
 
-                                               msg_ui_composer_recipient_append(cd->recipient, recipient, 0);
-                                               g_free(recipient);
-                                       }
+               /* sync current font size as accessibility font index */
+               if (msg_common_set_font_size(access_font_index) == FALSE)
+                       D_EMSG("msg_common_set_font_size(index = %d) is failed !!", access_font_index);
+
+               /* sync msg accessibility font size with accessibility font index */
+               if (msg_common_set_access_font_size(access_font_index) == FALSE)
+                       D_EMSG("vconf_set_int(VCONFKEY_MSG_APP_ACCESS_FONT_SIZE) is failed !!, [%d]", access_font_index);
+       } else {
+               font_size = msg_common_get_font_size_from_index(index);
+       }
+
+       converted_size = (MSGC_BODY_FONT_SIZE * font_size) / MSG_APP_FONT_SIZE_NORMAL;
+
+       cd->font_size = converted_size;
+       D_MSG("font size = %d, converted_size = %d", font_size, converted_size);
+
+       D_LEAVE;
+}
+
+static void __msgc_parse_recipient_list(MSG_COMPOSER_VIEW_DATA_S *cd, const char *address)
+{
+       D_ENTER;
+       D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+       D_MSG_RETM_IF(address == NULL, "address is NULL");
+
+       bool bMaxCount = false;
+       bool bInvalidNum = false;
+       bool bDup = false;
+
+       Eina_List *recipient_list = make_tokenize_list(address, ",");
+
+       if (recipient_list) {
+               Eina_List *l = NULL;
+               char *recipient;
+               EINA_LIST_FOREACH(recipient_list, l, recipient) {
+                       if (recipient) {
+                               D_MSG("TO = %s", recipient);
+                               if (msg_ui_composer_recipient_count_get(cd->recipient) >= COMPOSER_RECIPIENT_COUNT_MAX) {
+                                       bMaxCount = true;
+                                       g_free(recipient);
+                                       break;
                                }
 
-                               D_MSG("bMaxCount = %d, bInvalidNum = %d, bDup = %d", bMaxCount, bInvalidNum, bDup);
-                               if (bMaxCount) {
-                                       msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_COUNT_MAX);
-                               } else if (bInvalidNum) {
-                                       msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_INVALID_RECP);
-                               } else if (bDup) {
-                                       msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_DUP_RECP);
+                               if (msg_ui_composer_recipient_duplicate_check(cd->recipient, recipient) == COMPOSER_RETURN_RECIPIENT_DUPLICATE) {
+                                       bDup = true;
+                                       g_free(recipient);
+                                       continue;
                                }
-                       }
 
-               } else if ((bundle_txt = bundle_get_val(b_data, MSG_BUNDLE_KEY_NUMBER_INDEX))) {
-                       char *recipient, *index;
-                       char *save_p;
-                       int idx;
+                               if (msg_ui_composer_recipient_vaild_check(recipient) == EINA_FALSE) {
+                                       bInvalidNum = true;
+                               } else {
+                                       msg_ui_composer_recipient_append(cd->recipient, recipient, 0);
+                               }
 
-                       char *copy_string = MSG_STRDUP(bundle_txt);
-                       if (copy_string) {
+                               g_free(recipient);
+                       }
+               }
 
-                               recipient = strtok_r(copy_string, "/", &save_p);
-                               if (recipient) {
-                                       index = strtok_r(NULL, "/", &save_p);
-                                       if (index) {
-                                               D_MSG("NUMBER_INDEX = %s[%s]", recipient, index);
-                                               idx = atoi(index);
-                                       } else {
-                                               idx = 0;
-                                       }
+               D_MSG("bMaxCount = %d, bInvalidNum = %d, bDup = %d", bMaxCount, bInvalidNum, bDup);
+               if (bMaxCount) {
+                       msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_COUNT_MAX);
+               } else if (bInvalidNum) {
+                       msg_ui_composer_status_btn_popup_show(cd, MSGC_STR_NOTI_RECIPIENT_INVALID, 0, MSGC_STR_BUTTON_OK);
+               } else if (bDup) {
+                       msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_DUP_RECP);
+               }
+       }
 
-                                       if (msg_ui_composer_recipient_count_get(cd->recipient) >= COMPOSER_RECIPIENT_COUNT_MAX) {
-                                               msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_COUNT_MAX);
-                                       } else {
-                                               if (msg_ui_composer_recipient_duplicate_check(cd->recipient, recipient) == COMPOSER_RETURN_RECIPIENT_DUPLICATE) {
-                                                       msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_DUP_RECP);
-                                               } else {
-                                                       if (msg_ui_composer_recipient_vaild_check(recipient) == EINA_FALSE) {
-                                                               msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_INVALID_RECP);
-                                                       }
-                                                       msg_ui_composer_recipient_append(cd->recipient, recipient, idx);
-                                               }
-                                       }
-                               }
+       D_LEAVE;
+}
 
-                               g_free(copy_string);
+static void __msgc_ui_parse_mmsto_uri(MSG_COMPOSER_VIEW_DATA_S *cd, service_h svc_handle, const char *uri)
+{
+       D_ENTER;
+       D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+       D_MSG_RETM_IF(svc_handle == NULL, "svc_handle is NULL");
+       D_MSG_RETM_IF(uri == NULL, "uri is NULL");
+
+       char *content = NULL;
+       char *recipient = NULL;
+       char *body_text = NULL;
+       char *subject = NULL;
+       char *attachment = NULL;
+       char *cc = NULL;
+       char *scheme = g_strdup(uri);
+
+       if (scheme) {
+               strtok_r(scheme, ":", &content);
+
+               if (content) {
+                       if (g_ascii_isdigit(content[0]) || (content[0] == '+' && g_ascii_isdigit(content[1]))) {
+                               recipient = strtok_r(NULL, "?", &content);
+                               cc = strtok_r(NULL, "&", &content);
+                               if (cc)
+                                       strtok_r(NULL, "=", &cc);
+
+                               D_MSG("RECIPIENT = [%s]", recipient);
+                               if (recipient)
+                                       __msgc_parse_recipient_list(cd, (const char *)recipient);
                        }
                }
+               g_free(scheme);
+       } else {
+               if ((service_get_extra_data(svc_handle, SERVICE_DATA_TO, &recipient) == SERVICE_ERROR_NONE) && recipient) {
+                       __msgc_parse_recipient_list(cd, (const char *)recipient);
+               }
+       }
+
+       if ((service_get_extra_data(svc_handle, SERVICE_DATA_TEXT, &body_text) == SERVICE_ERROR_NONE) && body_text)
+               msg_ui_composer_body_set_loaded_text(cd, (const char *)body_text, 0);
+
+       if ((service_get_extra_data(svc_handle, SERVICE_DATA_SUBJECT, &subject) == SERVICE_ERROR_NONE) && subject)
+               msg_ui_composer_subject_set_loaded_data(cd, (const char *)subject);
 
-               if ((bundle_txt = bundle_get_val(b_data, MSG_BUNDLE_KEY_BODY))) {
-                       msg_ui_composer_body_set_loaded_text(cd, bundle_txt, 0);
+       if ((service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_ATTACHFILE, &attachment) == SERVICE_ERROR_NONE) && attachment) {
+               cd->attachlist = make_tokenize_list((const char *)attachment, COMPOSER_BUNDLE_ATTACH_TOKEN);
+               if (cd->attachlist)
+                       msg_ui_composer_body_items_add(cd);
+       }
+
+       D_LEAVE;
+}
+
+static void __msgc_ui_parse_file_uri(MSG_COMPOSER_VIEW_DATA_S *cd, service_h svc_handle, const char *uri)
+{
+       D_ENTER;
+       D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+       D_MSG_RETM_IF(uri == NULL, "uri is NULL");
+
+       char *content = NULL;
+       char attachment[DEF_IMG_PATH_LEN + 1] = {0, };
+       int i = 0;
+       int len = 0;
+       char *scheme = g_strdup(uri);
+
+       if (scheme) {
+               strtok_r(scheme, ":", &content);
+               D_MSG("content = [%s]", content);
+
+               if (content) {
+                       len = strlen(content) - 2;
+                       if (len <= 0) {
+                               D_EMSG("len is less than 0 !!");
+                               g_free(scheme);
+                               return;
+                       }
+
+                       /* Remove '//' from content string */
+                       for (i = 0; i < len; i++) {
+                               attachment[i] = content[i+2];
+                       }
+
+                       if (attachment[0] != '\0') {
+                               D_MSG("APPSVC ATTACHMENT = [%s]", attachment);
+                               cd->attachlist = make_tokenize_list((const char *)attachment, COMPOSER_BUNDLE_ATTACH_TOKEN);
+                               if (cd->attachlist)
+                                       msg_ui_composer_body_items_add(cd);
+                       }
                }
+               g_free(scheme);
+       } else {
+               D_EMSG("scheme is NULL!!");
        }
 
        D_LEAVE;
 }
 
-static void __msg_ui_composer_sent_status_cb(MSG_HANDLE_T Handle, MSG_SENT_STATUS_S *pStatus, void *pUserParam)
+static void __msg_ui_parse_sms_uri(MSG_COMPOSER_VIEW_DATA_S *cd, service_h svc_handle, const char *uri)
 {
        D_ENTER;
+       D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+       D_MSG_RETM_IF(svc_handle == NULL, "svc_handle is NULL");
+       D_MSG_RETM_IF(uri == NULL, "uri is NULL");
 
-       return;
+       char *content = NULL;
+       char *recipient = NULL;
+       char *body_text = NULL;
+       char *scheme = g_strdup(uri);
+
+       if (scheme) {
+               strtok_r(scheme, ":", &content);
+
+               if (content) {
+                       if (g_ascii_isdigit(content[0]) || (content[0] == '+' && g_ascii_isdigit(content[1]))) {
+                               recipient = strtok_r(NULL, "?", &content);
+                               D_MSG("RECIPIENT = [%s]", recipient);
+
+                               if (recipient)
+                                       __msgc_parse_recipient_list(cd, (const char *)recipient);
+                       }
+               }
+               g_free(scheme);
+       } else {
+               if ((service_get_extra_data(svc_handle, SERVICE_DATA_TO, &recipient) == SERVICE_ERROR_NONE) && recipient)
+                       __msgc_parse_recipient_list(cd, (const char *)recipient);
+       }
+
+       if ((service_get_extra_data(svc_handle, SERVICE_DATA_TEXT, &body_text) == SERVICE_ERROR_NONE) && body_text)
+               msg_ui_composer_body_set_loaded_text(cd, (const char *)body_text, 0);
+
+       D_LEAVE;
 }
 
-static void __reset_popup_ok_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+static void __msgc_get_service_app_svc_op(MSG_COMPOSER_VIEW_DATA_S *cd, service_h svc_handle, char *operation)
 {
        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(cd == NULL, "Composer Data is NULL");
+       D_MSG_RETM_IF(svc_handle == NULL, "svc_handle is NULL");
+       D_MSG_RETM_IF(operation == NULL, "operation is NULL");
+
+       char *uri = NULL;
+       char *recipient = NULL;
+       char *body_text = NULL;
+       char *attachment = NULL;
+       char *subject = NULL;
+
+       if (g_strcmp0(operation, SERVICE_OPERATION_SEND) == 0) {
+               if (service_get_uri(svc_handle, &uri) == SERVICE_ERROR_NONE)
+                       D_MSG("URI = [%s]", uri);
+
+               if (uri) {
+                       if (g_str_has_prefix(uri, MSG_BUNDLE_VALUE_MMSTO_URI)) { /* MMS URI : mmsto */
+                                __msgc_ui_parse_mmsto_uri(cd, svc_handle, (const char *)uri);
+                       } else if (g_str_has_prefix(uri, MSG_BUNDLE_VALUE_FILE_URI)) { /* URI : file */
+                                __msgc_ui_parse_file_uri(cd, svc_handle, (const char *)uri);
+                       } else if (g_str_has_prefix(uri, "/")) {
+                               cd->attachlist = make_tokenize_list((const char *)uri, COMPOSER_BUNDLE_ATTACH_TOKEN);
+                               if (cd->attachlist)
+                                       msg_ui_composer_body_items_add(cd);
+                       } else {
+                               D_EMSG("Not supported URI type");
+                               return;
+                       }
+               } else {
+                       if ((service_get_extra_data(svc_handle, SERVICE_DATA_TO, &recipient) == SERVICE_ERROR_NONE) && recipient)
+                               __msgc_parse_recipient_list(cd, (const char *)recipient);
 
-       MSGC_EVAS_OBJECT_DEL(cd->popup_end);
+                       if ((service_get_extra_data(svc_handle, SERVICE_DATA_TEXT, &body_text) == SERVICE_ERROR_NONE) && body_text)
+                               msg_ui_composer_body_set_loaded_text(cd, (const char *)body_text, 0);
 
-       msg_ui_composer_reset(cd, cd->msg_bundle);
+                       if ((service_get_extra_data(svc_handle, SERVICE_DATA_SUBJECT, &subject) == SERVICE_ERROR_NONE) && subject)
+                               msg_ui_composer_subject_set_loaded_data(cd, (const char *)subject);
+
+                       if ((service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_ATTACHFILE, &attachment) == SERVICE_ERROR_NONE) && attachment) {
+                               cd->attachlist = make_tokenize_list((const char *)attachment, COMPOSER_BUNDLE_ATTACH_TOKEN);
+                               if (cd->attachlist)
+                                       msg_ui_composer_body_items_add(cd);
+                       }
+               }
+       } else if (g_strcmp0(operation, SERVICE_OPERATION_SEND_TEXT) == 0) {
+               if (service_get_uri(svc_handle, &uri) == SERVICE_ERROR_NONE)
+                       D_MSG("URI = [%s]", uri);
+
+               if (uri) {
+                       if (g_str_has_prefix(uri, MSG_BUNDLE_VALUE_SMS_URI)) {  /* SMS URI : sms */
+                               __msg_ui_parse_sms_uri(cd, svc_handle, (const char *)uri);
+                       } else {
+                               D_EMSG("Not supported mime type");
+                               return;
+                       }
+               } else {
+                       if ((service_get_extra_data(svc_handle, SERVICE_DATA_TO, &recipient) == SERVICE_ERROR_NONE) && recipient)
+                               __msgc_parse_recipient_list(cd, (const char *)recipient);
 
-       if (cd->msg_bundle) {
-               bundle_free(cd->msg_bundle);
-               cd->msg_bundle = NULL;
+                       if ((service_get_extra_data(svc_handle, SERVICE_DATA_TEXT, &body_text) == SERVICE_ERROR_NONE) && body_text)
+                               msg_ui_composer_body_set_loaded_text(cd, (const char *)body_text, 0);
+               }
+       } else {
+               D_EMSG("Invalid operation type !!");
        }
+
+       D_LEAVE;
 }
 
-static void __reset_popup_cancel_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+/* function definitions*/
+static void __msg_ui_composer_bundle_data_process(MSG_COMPOSER_VIEW_DATA_S *cd, service_h svc_handle)
 {
        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(cd == NULL, "Composer Data is NULL");
+       D_MSG_RETM_IF(svc_handle == NULL, "Bundle Data is NULL");
 
-       MSGC_EVAS_OBJECT_DEL(cd->popup_end);
+       char *bundle_txt = NULL;
+
+       if (cd->isAppControl) { /* composer launching from appcontrol */
+               char *operation = NULL;
+
+               service_get_operation(svc_handle, &operation);
+               __msgc_get_service_app_svc_op(cd, svc_handle, operation);
+       } else {
+               if (cd->composer_mode == MSG_COMPOSER_MODE_EDIT || cd->composer_mode == MSG_COMPOSER_MODE_FORWARD) {
+                       if ((service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_MSG_ID, &bundle_txt) == SERVICE_ERROR_NONE) && bundle_txt) {
+                               bool set_recipient = false;
+                               int msg_id = atoi(bundle_txt);
+
+                               if (cd->composer_mode == MSG_COMPOSER_MODE_EDIT)
+                                       set_recipient = true;
+
+                               msg_ui_composer_message_init();
+                               msg_ui_composer_message_load_message(cd->msg_handle, msg_id);
+                               if (msg_ui_composer_message_set_loaded_data(cd, set_recipient) != COMPOSER_RETURN_CREATION_WARINING_MODE_FAIL)
+                                       msg_ui_composer_message_destroy();
+
+                       } else {
+                               D_EMSG("there is no msgid");
+                       }
+               } else {
+                       if ((service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_TO, &bundle_txt) == SERVICE_ERROR_NONE) && bundle_txt) {
+                               __msgc_parse_recipient_list(cd, bundle_txt);
+                       } else {
+                               if ((service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_NUMBER_INDEX, &bundle_txt)== SERVICE_ERROR_NONE) && bundle_txt) {
+                                       char *recipient = NULL;
+                                       char *index  = NULL;
+                                       char *save_p = NULL;
+                                       int idx = 0;
+
+                                       char *copy_string = MSG_STRDUP(bundle_txt);
+                                       if (copy_string) {
+
+                                               recipient = strtok_r(copy_string, "/", &save_p);
+                                               if (recipient) {
+                                                       index = strtok_r(NULL, "/", &save_p);
+                                                       if (index) {
+                                                               D_MSG("NUMBER_INDEX = %s[%s]", recipient, index);
+                                                               idx = atoi(index);
+                                                       } else {
+                                                               idx = 0;
+                                                       }
+
+                                                       if (msg_ui_composer_recipient_count_get(cd->recipient) >= COMPOSER_RECIPIENT_COUNT_MAX) {
+                                                               msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_COUNT_MAX);
+                                                       } else {
+                                                               if (msg_ui_composer_recipient_duplicate_check(cd->recipient, recipient) == COMPOSER_RETURN_RECIPIENT_DUPLICATE) {
+                                                                       msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_DUP_RECP);
+                                                               } else {
+                                                                       if (msg_ui_composer_recipient_vaild_check(recipient) == EINA_FALSE) {
+                                                                               msg_ui_composer_status_btn_popup_show(cd, MSGC_STR_NOTI_RECIPIENT_INVALID, 0, MSGC_STR_BUTTON_OK);
+                                                                       } else {
+                                                                               msg_ui_composer_recipient_append(cd->recipient, recipient, idx);
+                                                                       }
+                                                               }
+                                                       }
+                                               }
+
+                                               g_free(copy_string);
+                                       }
+                               }
+                       }
+
+                       if (SERVICE_ERROR_NONE == service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_SUBJECT, &bundle_txt))
+                               msg_ui_composer_subject_set_loaded_data(cd, bundle_txt);
 
-       if (cd->msg_bundle) {
-               bundle_free(cd->msg_bundle);
-               cd->msg_bundle = NULL;
+                       if (SERVICE_ERROR_NONE == service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_BODY, &bundle_txt))
+                               msg_ui_composer_body_set_loaded_text(cd, bundle_txt, 0);
+
+                       if (SERVICE_ERROR_NONE == service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_ATTACHFILE, &bundle_txt)) {
+                               cd->attachlist = make_tokenize_list(bundle_txt, COMPOSER_BUNDLE_ATTACH_TOKEN);
+                               if (cd->attachlist)
+                                       msg_ui_composer_body_items_add(cd);
+                       }
+               }
        }
+
+       D_LEAVE;
+}
+
+static void __msg_ui_composer_sent_status_cb(msg_handle_t Handle, msg_struct_t pStatus, void *pUserParam)
+{
+       D_ENTER;
+       D_LEAVE;
+
+       return;
 }
 
 static void __end_popup_ok_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
@@ -207,11 +546,6 @@ static void __end_popup_ok_btn_clicked_cb(void *data, Evas_Object *obj, void *ev
 
        MSGC_EVAS_OBJECT_DEL(cd->popup_end);
 
-       if (cd->destroy_req) {
-               bundle_send_to_result(cd, MSG_BUNDLE_KEY_COMPOSER_RESPONSE, MSG_BUNDLE_VALUE_RET_YES);
-               cd->destroy_req = false;
-       }
-
        ug_destroy_me(cd->ug);
 }
 
@@ -223,10 +557,7 @@ static void __end_popup_cancel_btn_clicked_cb(void *data, Evas_Object *obj, void
 
        MSGC_EVAS_OBJECT_DEL(cd->popup_end);
 
-       if (cd->destroy_req) {
-               bundle_send_to_result(cd, MSG_BUNDLE_KEY_COMPOSER_RESPONSE, MSG_BUNDLE_VALUE_RET_NO);
-               cd->destroy_req = false;
-       }
+       cd->isclosed = false;
 
        msg_ui_composer_last_focus_load(cd);
        D_LEAVE;
@@ -236,15 +567,21 @@ static void  __msg_ui_composer_end_popup(MSG_COMPOSER_VIEW_DATA_S *cd)
 {
        D_ENTER;
 
-       Evas_Object *popup = msg_ui_composer_status_popup_show(cd, MSGC_STR_POP_DISCARD_Q, 0);
-       Evas_Object * btn1 = elm_button_add(popup);
+       MSGC_EVAS_OBJECT_DEL(cd->popup_end);
+
+       Evas_Object *popup = msg_ui_composer_status_popup_show(cd->main_window, cd, MSGC_STR_POP_DISCARD_Q, 0);
+       Evas_Object *btn1 = elm_button_add(popup);
+       elm_object_style_set(btn1, "popup_button/default");
        elm_object_text_set(btn1, MSGC_STR_BUTTON_OK);
        elm_object_part_content_set(popup, "button1", btn1);
        evas_object_smart_callback_add(btn1, "clicked", __end_popup_ok_btn_clicked_cb, cd);
-       Evas_Object * btn2 = elm_button_add(popup);
+       Evas_Object *btn2 = elm_button_add(popup);
+       elm_object_style_set(btn2, "popup_button/default");
        elm_object_text_set(btn2, MSGC_STR_BUTTON_CANCEL);
        elm_object_part_content_set(popup, "button2", btn2);
        evas_object_smart_callback_add(btn2, "clicked", __end_popup_cancel_btn_clicked_cb, cd);
+       elm_object_focus_set(popup, EINA_TRUE);
+       evas_object_show(popup);
 
        cd->popup_end = popup;
 
@@ -258,11 +595,55 @@ static void __naviframe_back_btn_clicked_cb(void *data, Evas_Object *obj, void *
        D_MSG_RETM_IF(data == NULL, "Data == NULL");
        MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
 
+       COMPOSER_EDIT_STATE_E edit_state = __msg_ui_composer_edit_check(cd);
+       D_MSG("edit_state = %d", edit_state);
+
        if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER || cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER) {
-               if (__msg_ui_composer_edit_check(cd) == EINA_TRUE) {
+               if (cd->isclosed) {
+                       D_EMSG("back btn is already called");
+                       return;
+               }
+
+               /* isclosed is set to prevent showing invalid popup*/
+               cd->isclosed = true;
+
+               if (edit_state == COMPOSER_EDIT_RECIPIENT || edit_state == COMPOSER_EDIT_BODY) {
                        __msg_ui_composer_end_popup(cd);
                        return;
                }
+       } else if (cd->msg_ug_mode == MSG_UG_MODE_BUBBLE_COMPOSER) {
+               if (edit_state == COMPOSER_EDIT_RECIPIENT) {
+
+                       PMSG_BUBBLE_DATA bubble_data = cd->bubble_data;
+
+                       if (bubble_data->title_menu_opened)
+                               msg_ui_bubble_close_title_menu_genlist(bubble_data);
+
+                       if (bubble_data->bubble_count == 0) {
+                               int err = MSG_SUCCESS;
+
+                               if (bubble_data->isDraft == true)
+                                       err = msg_delete_thread_message_list(bubble_data->msgHandle, bubble_data->threadId, false);
+
+                               if (err == MSG_SUCCESS) {
+                                       service_h svc_handle;
+                                       char buf[DEF_BUF_LEN_S] = {0,};
+
+                                       if (service_create(&svc_handle) < 0 || svc_handle == NULL) {
+                                               D_EMSG("service_create() is failed !!");
+                                       } else {
+                                               service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_RESULT, MSG_BUNDLE_VALUE_DEL_ALL);
+                                               snprintf(buf, sizeof(buf), "%d", bubble_data->threadId);
+                                               service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_THREAD_ID, buf);
+                                               ug_send_result(cd->ug, svc_handle);
+
+                                               service_destroy(svc_handle);
+                                       }
+                               } else {
+                                       D_MSG("msg_delete_thread_message_list failed");
+                               }
+                       }
+               }
        }
 
        ug_destroy_me(cd->ug);
@@ -270,6 +651,156 @@ static void __naviframe_back_btn_clicked_cb(void *data, Evas_Object *obj, void *
        D_LEAVE;
 }
 
+static void __preview_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       D_ENTER;
+       MSG_COMPOSER_VIEW_DATA_S *cd = data;
+       D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+       D_MSG_RETM_IF(cd->navi_it == NULL, "Naviitem is NULL");
+
+       msg_struct_t msgInfo = NULL;
+       msg_ui_composer_message_init();
+       msg_ui_composer_read_preview_message(cd);
+
+       /* make preview message data */
+       msgInfo = msg_ui_composer_message_make_preview(cd->msg_handle);
+
+       if (msgInfo)
+               msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_MSGVIEWER, msgInfo);
+
+       msg_ui_composer_message_destroy();
+
+       if (cd->ctx_popup) {
+               evas_object_del(cd->ctx_popup);
+               cd->ctx_popup = NULL;
+       }
+
+       D_LEAVE;
+}
+
+static void __pageduration_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       D_ENTER;
+       MSG_COMPOSER_VIEW_DATA_S *cd = data;
+       D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+       D_MSG_RETM_IF(cd->navi_it == NULL, "Naviitem is NULL");
+
+       msg_ui_composer_pageduration_popup_create(cd);
+
+       if (cd->ctx_popup) {
+               evas_object_del(cd->ctx_popup);
+               cd->ctx_popup = NULL;
+       }
+
+       D_LEAVE;
+}
+
+static void __msg_ui_composer_ctxpopup_dismissed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       MSG_UI_ENTER();
+       MSG_COMPOSER_VIEW_DATA_S *cd = data;
+
+       if (cd->ctx_popup) {
+               evas_object_del(cd->ctx_popup);
+               cd->ctx_popup = NULL;
+       }
+
+       MSG_UI_LEAVE();
+}
+
+static void msg_composer_naviframe_more_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       MSG_UI_ENTER();
+       MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !data || !obj);
+
+       MSG_COMPOSER_VIEW_DATA_S *cd = data;
+       PMSG_BUBBLE_DATA bubble_data = cd->bubble_data;
+       Evas_Object *ctx_popup = NULL;
+
+       if (cd->popup_end) {
+               evas_object_del(cd->popup_end);
+               cd->popup_end = NULL;
+       }
+
+       if (bubble_data) {
+               if (bubble_data->popup) {
+                       evas_object_del(bubble_data->popup);
+                       bubble_data->popup = NULL;
+               }
+
+               if (bubble_data->title_menu_opened)
+                       msg_ui_bubble_close_title_menu_genlist(bubble_data);
+       }
+
+       /* fix ctx_popup flashing issue because of focus */
+       ctx_popup = elm_ctxpopup_add(cd->main_window);
+       elm_ctxpopup_direction_priority_set(ctx_popup, ELM_CTXPOPUP_DIRECTION_DOWN,
+                                                 ELM_CTXPOPUP_DIRECTION_UNKNOWN,
+                                                 ELM_CTXPOPUP_DIRECTION_UNKNOWN,
+                                                 ELM_CTXPOPUP_DIRECTION_UNKNOWN);
+
+       evas_object_smart_callback_add(ctx_popup, "dismissed", __msg_ui_composer_ctxpopup_dismissed_cb, cd);
+
+       if (cd->msg_ug_mode == MSG_UG_MODE_BUBBLE_COMPOSER)
+               elm_ctxpopup_item_append(ctx_popup, dgettext("sys_string", "IDS_COM_SK_DELETE"), NULL, msg_ui_bubble_more_delete_clicked_cb, cd);
+
+       if (cd->msg_type == COMPOSER_MSG_TYPE_MMS) {
+               /* preview */
+               if (msg_ui_composer_body_has_media(cd))
+                       elm_ctxpopup_item_append(ctx_popup, MSGC_STR_PREVIEW, NULL, __preview_btn_clicked_cb, cd);
+
+               /* page duration */
+               char buf[DEF_BUF_LEN_S + 1] = {0,};
+               char duration[DEF_BUF_LEN_D + 1] = {0,};
+               const char *str = _MSGSTR("IDS_MSGC_OPT2_DURATION_HPS_SEC_ABB");
+               int pageduration = msg_ui_composer_pageduration_value_get(cd);
+
+               snprintf(duration, sizeof(duration)-1, "%d", pageduration);
+               snprintf(buf, sizeof(buf)-1, str, duration);
+               elm_ctxpopup_item_append(ctx_popup, buf, NULL, __pageduration_btn_clicked_cb, cd);
+       }
+
+       if (cd->msg_ug_mode == MSG_UG_MODE_BUBBLE_COMPOSER)
+               elm_ctxpopup_item_append(ctx_popup, dgettext(MESSAGE_PKGNAME, "IDS_MSG_HEADER_BACKUP"), NULL, msg_ui_bubble_backup_clicked_cb, cd);
+
+       Evas_Coord x = 0;
+       Evas_Coord y = 0;
+       Evas_Coord w = 0;
+       Evas_Coord h = 0;
+       evas_object_geometry_get(cd->more_btn, &x, &y, &w, &h);
+       evas_object_move(ctx_popup, (x+(w/2)) , y+h);
+       evas_object_show(ctx_popup);
+
+       cd->ctx_popup = ctx_popup;
+
+       MSG_UI_LEAVE();
+}
+
+static void __naviframe_compose_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       D_ENTER;
+       MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !data || !obj);
+
+       MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+
+       if (cd->bubble_data->popup) {
+               evas_object_del(cd->bubble_data->popup);
+               cd->bubble_data->popup = NULL;
+       }
+
+       service_h svc_handle;
+
+       if (service_create(&svc_handle) < 0 || svc_handle == NULL) {
+               D_EMSG("service_create() is failed !!");
+       } else {
+               service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_MODE, MSG_BUNDLE_VALUE_EDIT);
+               service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_FROM, MSG_BUNDLE_VALUE_INTERNAL);
+               msg_ui_composer_launch_composer_create(cd, svc_handle);
+               service_destroy(svc_handle);
+       }
+       D_LEAVE;
+}
+
 static Evas_Object *__naviframe_back_btn_create(Evas_Object *parent, void *data, bool title)
 {
        D_ENTER;
@@ -277,14 +808,13 @@ static Evas_Object *__naviframe_back_btn_create(Evas_Object *parent, void *data,
        D_MSG_RETVM_IF(data == NULL, NULL, "data == NULL");
        D_MSG("Title type = %d", title);
 
-       Evas_Object *btn;
+       Evas_Object *btn = NULL;
        btn = elm_button_add(parent);
        if (btn == NULL)
                return NULL;
 
        if (title == true) {
-               elm_object_style_set(btn, "naviframe/title/default");
-               elm_object_text_set(btn, MSGC_STR_BUTTON_CANCEL);
+               elm_object_style_set(btn, "naviframe/back_btn/default");
        } else {
                elm_object_style_set(btn, "naviframe/back_btn/default");
        }
@@ -294,81 +824,142 @@ static Evas_Object *__naviframe_back_btn_create(Evas_Object *parent, void *data,
        return btn;
 }
 
-static char *__working_dir_create(void)
+static Evas_Object *__naviframe_more_btn_create(Evas_Object *parent, void *data)
 {
        D_ENTER;
-       char *base_dir = "/tmp/message";
-       char working_path[DEF_PATH_MAX] = {0,};
-       int i = 0;
-
-       /*Create base dir*/
-       if (ecore_file_exists(base_dir) == EINA_FALSE) {
-               if(ecore_file_mkdir(base_dir) == EINA_FALSE) {
-                       return NULL;
-               }
-       }
+       D_MSG_RETVM_IF(parent == NULL, NULL, "parent == NULL");
+       D_MSG_RETVM_IF(data == NULL, NULL, "data == NULL");
 
-       /*Create work dir*/
-       do {
+       Evas_Object *btn = elm_button_add(parent);
+       if (!btn)
+               return NULL;
 
-               bzero(working_path, DEF_PATH_MAX);
-               snprintf(working_path, sizeof(working_path)-1, "%s/composer_%d/", base_dir, i);
-               if (ecore_file_exists(working_path) == EINA_FALSE) {
-                       if (ecore_file_mkdir(working_path) == EINA_FALSE) {
-                               return NULL;
-                       } else {
-                               D_MSG("Success to create working path = %s", working_path);
-                               return strdup(working_path);
-                       }
-                       break;
-               }
-               i++;
-       } while(i < 255);
+       elm_object_style_set(btn, "naviframe/more/default");
 
-       return NULL;
+       evas_object_smart_callback_add(btn, "clicked", msg_composer_naviframe_more_btn_clicked_cb, data);
+       evas_object_show(btn);
+       D_LEAVE;
+       return btn;
 }
 
-static void  __msg_ui_composer_reset_select_popup(MSG_COMPOSER_VIEW_DATA_S *cd)
+static Evas_Object *__naviframe_compose_btn_create(Evas_Object *parent, void *data)
 {
        D_ENTER;
+       D_MSG_RETVM_IF(parent == NULL, NULL, "parent == NULL");
+       D_MSG_RETVM_IF(data == NULL, NULL, "data == NULL");
 
-       Evas_Object *popup = msg_ui_composer_status_popup_show(cd, MSGC_STR_POP_DISCARD_Q, 0);
-       Evas_Object * btn1 = elm_button_add(popup);
-       elm_object_text_set(btn1, MSGC_STR_BUTTON_OK);
-       elm_object_part_content_set(popup, "button1", btn1);
-       evas_object_smart_callback_add(btn1, "clicked", __reset_popup_ok_btn_clicked_cb, cd);
-       Evas_Object * btn2 = elm_button_add(popup);
-       elm_object_text_set(btn2, MSGC_STR_BUTTON_CANCEL);
-       elm_object_part_content_set(popup, "button2", btn2);
-       evas_object_smart_callback_add(btn2, "clicked", __reset_popup_cancel_btn_clicked_cb, cd);
-       cd->popup_end = popup;
-
+       Evas_Object *btn = elm_button_add(parent);
+       if (!btn)
+               return NULL;
+       elm_object_style_set(btn, "naviframe/title_icon");
+
+       Evas_Object *icon = elm_icon_add(btn);
+       elm_image_file_set(icon, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_TITLE_ICON_COMPOSE);
+       elm_image_resizable_set(icon, 1, 1);
+       evas_object_image_smooth_scale_set(icon, 0);
+       elm_object_content_set(btn, icon);
+       evas_object_smart_callback_add(btn, "clicked", __naviframe_compose_btn_clicked_cb, data);
        D_LEAVE;
-       return;
+
+       return btn;
 }
 
-void msg_ui_composer_reset_request(MSG_COMPOSER_VIEW_DATA_S *cd)
+void msg_ui_composer_reset_request(MSG_COMPOSER_VIEW_DATA_S *cd, service_h svc_handle)
 {
        D_ENTER;
 
-       if (!cd) return;
+       if (!cd)
+               return;
+
+       COMPOSER_EDIT_STATE_E edit_state = __msg_ui_composer_edit_check(cd);
+       D_MSG("edit_state = %d", edit_state);
+       D_MSG("composer mode = %d, msg_ug_mode = %d", cd->composer_mode, cd->msg_ug_mode);
 
-       if (__msg_ui_composer_edit_check(cd)) {
-               /*select reset popup show*/
-               __msg_ui_composer_reset_select_popup(cd);
-       } else {
-               /*process reset*/
-               msg_ui_composer_reset(cd, cd->msg_bundle);
-               if (cd->msg_bundle) {
-                       bundle_free(cd->msg_bundle);
-                       cd->msg_bundle = NULL;
+       if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER || cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER) {
+               if (edit_state == COMPOSER_EDIT_RECIPIENT_AND_BODY) {
+                       /* auto saving */
+                       msg_ui_composer_message_init();
+
+                       if (msg_ui_composer_get_message_data(cd) == COMPOSER_RETURN_SUCCESS) {
+                               msg_ui_composer_save_message(cd->msg_handle);
+                       }
+
+                       msg_ui_composer_message_destroy();
                }
+       } else if (cd->msg_ug_mode == MSG_UG_MODE_BUBBLE_COMPOSER) {
+               if (edit_state == COMPOSER_EDIT_RECIPIENT) {
+                       PMSG_BUBBLE_DATA bubble_data = cd->bubble_data;
+
+                       if (bubble_data->title_menu_opened)
+                               msg_ui_bubble_close_title_menu_genlist(bubble_data);
+
+                       if (bubble_data->bubble_count == 0) {
+                               int err = MSG_SUCCESS;
+
+                               if (bubble_data->isDraft == true)
+                                       err = msg_delete_thread_message_list(bubble_data->msgHandle, bubble_data->threadId, false);
+
+                               if (err == MSG_SUCCESS) {
+                                       service_h svc_handle;
+                                       if (service_create(&svc_handle) < 0 || svc_handle == NULL) {
+                                               D_EMSG("service_create() is failed !!");
+                                       } else {
+                                               char buf[DEF_BUF_LEN_S] = {0,};
+                                               service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_RESULT, MSG_BUNDLE_VALUE_DEL_ALL);
+                                               snprintf(buf, sizeof(buf), "%d", bubble_data->threadId);
+                                               service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_THREAD_ID, buf);
+
+                                               ug_send_result(cd->ug, svc_handle);
+
+                                               service_destroy(svc_handle);
+                                       }
+                               } else {
+                                       D_MSG("msg_delete_thread_message_list failed");
+                               }
+                       } else {
+                               /* delete draft message */
+                               msg_struct_list_s msg_list = {0,};
+
+                               if (msg_get_message_list(cd->msg_handle, MSG_DRAFT_ID, bubble_data->threadId, 0, 0, &msg_list) == COMPOSER_RETURN_SUCCESS) {
+                                       int i = 0;
+                                       int msgid = 0;
+
+                                       for (i = 0; i < msg_list.nCount; i++) {
+                                               msg_get_int_value(msg_list.msg_struct_info[i], MSG_MESSAGE_ID_INT, &msgid);
+                                               D_MSG("draft msg_id is %d", msgid);
+                                               if (msg_delete_message(cd->msg_handle, msgid) != COMPOSER_RETURN_SUCCESS)
+                                                       D_EMSG("msg_ui_comp_core_delete_message is failed = %d", msgid);
+                                       }
+                               }
+
+                               msg_release_list_struct(&msg_list);
+                       }
+               } else if (edit_state == COMPOSER_EDIT_RECIPIENT_AND_BODY) {
+                       /* auto saving */
+                       msg_ui_composer_message_init();
+
+                       if (msg_ui_composer_get_message_data(cd) == COMPOSER_RETURN_SUCCESS) {
+                               msg_ui_composer_save_message(cd->msg_handle);
+                       }
+
+                       msg_ui_composer_message_destroy();
+               }
+
+               /* clear recipient_list of bubble composer */
+               msg_ui_composer_recipient_clear_recipient_list(cd);
        }
 
+       /*process reset*/
+       msg_ui_composer_reset(cd, svc_handle);
+
        D_LEAVE;
 }
 
-COMPOSER_RETURN_TYPE_E msg_ui_composer_reset(MSG_COMPOSER_VIEW_DATA_S *cd, bundle *bundle)
+/*
+ *     1. clear all composer editing obj
+ *     2. make composer using bundle val
+*/
+COMPOSER_RETURN_TYPE_E msg_ui_composer_reset(MSG_COMPOSER_VIEW_DATA_S *cd, service_h svc_handle)
 {
        D_ENTER;
        if (!cd)
@@ -378,87 +969,137 @@ COMPOSER_RETURN_TYPE_E msg_ui_composer_reset(MSG_COMPOSER_VIEW_DATA_S *cd, bundl
                ecore_file_recursive_rm(cd->working_path);
                g_free(cd->working_path);
        }
-       cd->working_path = __working_dir_create();
+
+       cd->working_path = msg_composer_create_working_dir();
+
        if (cd->working_path == NULL) {
-               D_EMSG("[ASSERT] Fail of make working dir!!!");
+               D_EMSG("Fail of make working dir!!!");
                return COMPOSER_RETURN_FAIL;
        }
 
-       if (bundle) {
+       if (svc_handle) {
                msg_ui_composer_clear(cd);
+
+               char *thread_id = NULL;
+               char *msg_id = NULL;
+               char *composer_mode = NULL;
+               char *from = NULL;
+
+               service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_THREAD_ID, &thread_id);
+               service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_MSG_ID, &msg_id);
+               service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_MODE, &composer_mode);
+               service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_FROM, &from);
+
+               if (composer_mode) {
+                       if (g_strcmp0(composer_mode, MSG_BUNDLE_VALUE_EDIT) == 0)
+                               cd->composer_mode = MSG_COMPOSER_MODE_EDIT;
+                       else if (g_strcmp0(composer_mode, MSG_BUNDLE_VALUE_FORWARD) == 0)
+                               cd->composer_mode = MSG_COMPOSER_MODE_FORWARD;
+                       else
+                               cd->composer_mode = MSG_COMPOSER_MODE_NORMAL;
+               } else {
+                       cd->composer_mode = MSG_COMPOSER_MODE_NORMAL;
+               }
+
+               if (from && g_strcmp0(from, MSG_BUNDLE_VALUE_INTERNAL) == 0)
+                       cd->isMsgInternal = true;
+               else
+                       cd->isMsgInternal = false;
+
                /*Change to Bubble view*/
-               if (bundle_get_val(bundle, MSG_BUNDLE_KEY_THREAD_ID) || bundle_get_val(bundle, MSG_BUNDLE_KEY_MSG_ID)) {
+               if ((thread_id || msg_id) && cd->composer_mode == MSG_COMPOSER_MODE_NORMAL) {
+                       D_MSG("bubble view composer mode = %d, msg_ug_mode = %d", cd->composer_mode, cd->msg_ug_mode);
+
                        if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER) {
-                               D_MSG("chagne bubble view");
+                               D_MSG("change bubble view");
                                msg_ui_composer_change_bubble_view(cd);
-                               msg_ui_bubble_parse_bubble_data(cd->bubble_data, bundle);
+                               msg_ui_bubble_parse_bubble_data(cd->bubble_data, svc_handle);
                                msg_ui_bubble_start_view(cd->bubble_data);
-                               msg_ui_bubble_composer_navi_title_set((void *)cd);
-                               msg_ui_bubble_add_normal_control_item(cd->bubble_data);
-                               msg_ui_composer_recipient_set_recipient(cd, cd->bubble_data->threadAddr);
+                               msg_ui_composer_navi_title_set((void *)cd);
 
+                               /* set recipient list for bubble composer */
+                               msg_ui_composer_recipient_set_recipient_list(cd, cd->bubble_data->threadId);
                        } else if (cd->msg_ug_mode == MSG_UG_MODE_BUBBLE_COMPOSER) {
                                D_MSG("reload bubble view");
-                               msg_ui_bubble_parse_bubble_data(cd->bubble_data, bundle);
+                               msg_ui_bubble_parse_bubble_data(cd->bubble_data, svc_handle);
                                msg_ui_bubble_list_load(cd->bubble_data);
-                               msg_ui_bubble_composer_navi_title_set((void *)cd);
-                               msg_ui_bubble_add_normal_control_item(cd->bubble_data);
-                               msg_ui_composer_recipient_set_recipient(cd, cd->bubble_data->threadAddr);
+                               msg_ui_composer_navi_title_set((void *)cd);
+
+                               /* set recipient list for bubble composer */
+                               msg_ui_composer_recipient_set_recipient_list(cd, cd->bubble_data->threadId);
+                       } else {
+                               D_EMSG("Invalid type");
                        }
+
+                       cd->msg_ug_mode = MSG_UG_MODE_BUBBLE_COMPOSER;
                } else {
+                       D_MSG("normal composer composer mode = %d, msg_ug_mode = %d", cd->composer_mode, cd->msg_ug_mode);
+
                        if (cd->msg_ug_mode == MSG_UG_MODE_BUBBLE_COMPOSER) {
+                               D_MSG("change composer view");
                                if (cd->bubble_data) {
                                        cd->bubble_data->ug_state = BUBBLE_UG_DESTROY;
-                                       MSGC_EVAS_OBJECT_DEL(cd->bubble_data->toolbar);
                                        msg_ui_bubble_deinit_bubble_data(cd->bubble_data);
                                        cd->bubble_data = NULL;
                                }
+
                                msg_ui_composer_change_composer_view(cd);
                        }
-                       __msg_ui_composer_bundle_data_process(cd, bundle);
+
+                       if (cd->isMsgInternal == true)
+                               cd->msg_ug_mode = MSG_UG_MODE_FULL_COMPOSER;
+                       else
+                               cd->msg_ug_mode = MSG_UG_MODE_ONLY_COMPOSER;
+
+                       __msg_ui_composer_bundle_data_process(cd, svc_handle);
                }
        }
+
        D_LEAVE;
        return COMPOSER_RETURN_SUCCESS;
 }
 
-COMPOSER_RETURN_TYPE_E msg_ui_composer_start(MSG_COMPOSER_VIEW_DATA_S *cd, bundle *bundle)
+COMPOSER_RETURN_TYPE_E msg_ui_composer_start(MSG_COMPOSER_VIEW_DATA_S *cd, service_h svc_handle)
 {
        D_ENTER;
        D_MSG_RETVM_IF(cd == NULL, COMPOSER_RETURN_FAIL, "Composer Data is NULL");
 
-       COMPOSER_RETURN_TYPE_E ret;
+       COMPOSER_RETURN_TYPE_E ret = COMPOSER_RETURN_SUCCESS;
        cd->state = COMPOSER_STATE_TYPE_RUNNING;
 
-       /*bundle data parsing */
-       if (bundle) {
+       /* bundle data parsing */
+       if (svc_handle) {
                if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER || cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER) {
                        cd->isLoad = true;
-                       __msg_ui_composer_bundle_data_process(cd, bundle);
+                       __msg_ui_composer_bundle_data_process(cd, svc_handle);
+
+                       if (cd->attachlist == NULL)
+                               cd->isLoad = false;
 
-                       cd->isLoad = false;
                } else if (cd->msg_ug_mode == MSG_UG_MODE_BUBBLE_COMPOSER) {
                        D_MSG("START BUBBLE COMPOSER");
                        PMSG_BUBBLE_DATA bubble_data = (PMSG_BUBBLE_DATA)cd->bubble_data;
-                       msg_ui_bubble_parse_bubble_data(bubble_data, bundle);
+                       msg_ui_bubble_parse_bubble_data(bubble_data, svc_handle);
                        msg_ui_bubble_start_view(bubble_data);
+                       msg_ui_composer_navi_title_set((void *)cd);
 
-                       msg_ui_bubble_composer_navi_title_set((void *)cd);
-                       msg_ui_bubble_add_normal_control_item(cd->bubble_data);
-                       msg_ui_composer_recipient_set_recipient(cd, bubble_data->threadAddr);
+                       /* set recipient list for bubble composer */
+                       msg_ui_composer_recipient_set_recipient_list(cd, cd->bubble_data->threadId);
                }
        }
 
-       /*First Focus*/
+       /* set first focus*/
        if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER || cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER) {
                if (!msg_ui_composer_popup_exist(cd)) {
 
                        int recipient_count = msg_ui_composer_recipient_count_get(cd->recipient);
 
-                       if (recipient_count > 0)
+                       if (recipient_count > 0) {
                                msg_ui_composer_body_focus_set(cd, 0);
-                       else
+                               msg_ui_composer_recipient_expanded_set(cd->recipient, EINA_FALSE);
+                       } else {
                                msg_ui_composer_recipient_focus_set(cd->recipient);
+                       }
                }
        }
 
@@ -466,30 +1107,107 @@ COMPOSER_RETURN_TYPE_E msg_ui_composer_start(MSG_COMPOSER_VIEW_DATA_S *cd, bundl
        return ret;
 }
 
+static void __msg_composer_auto_save_and_delete_msg(MSG_COMPOSER_VIEW_DATA_S *cd)
+{
+       D_ENTER;
+       D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
+
+       /* save and delete msg */
+       if (!cd->disable_auto_save_mode) {
+               COMPOSER_EDIT_STATE_E edit_state = __msg_ui_composer_edit_check(cd);
+               if (edit_state == COMPOSER_EDIT_RECIPIENT_AND_BODY) {
+                       /* auto save composer data */
+                       msg_ui_composer_message_init();
+
+                       if (msg_ui_composer_get_message_data(cd) == COMPOSER_RETURN_SUCCESS) {
+                               D_MSG("save draft message");
+                               msg_ui_composer_save_message(cd->msg_handle);
+                               /* show saved ticker popup */
+                               msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_AUTO_SAVED);
+                       }
+
+                       msg_ui_composer_message_destroy();
+               } else if (edit_state == COMPOSER_EDIT_RECIPIENT) {
+                       if (cd->msg_ug_mode == MSG_UG_MODE_BUBBLE_COMPOSER) {
+                               /* delete draft message */
+                               MSG_BUBBLE_DATA *bubble_data = cd->bubble_data;
+
+                               if (bubble_data) {
+                                       msg_struct_list_s msg_list = {0,};
+
+                                       if (msg_get_message_list(cd->msg_handle, MSG_DRAFT_ID, bubble_data->threadId, 0, 0, &msg_list) == MSG_SUCCESS) {
+                                               int i = 0;
+                                               int msgid = 0;
+
+                                               D_MSG("delete draft message");
+                                               for (i = 0; i < msg_list.nCount; i++) {
+                                                       msg_get_int_value(msg_list.msg_struct_info[i], MSG_MESSAGE_ID_INT, &msgid);
+                                                       D_MSG("draft msg_id is %d", msgid);
+                                                       if (msg_delete_message(cd->msg_handle, msgid) != COMPOSER_RETURN_SUCCESS)
+                                                               D_EMSG("msg_ui_comp_core_delete_message is failed = %d", msgid);
+                                               }
+                                       }
+                                       msg_release_list_struct(&msg_list);
+                               }
+                       }
+               }
+       }
+
+       D_LEAVE;
+}
+
 COMPOSER_RETURN_TYPE_E msg_ui_composer_destroy(MSG_COMPOSER_VIEW_DATA_S *cd)
 {
        D_ENTER;
 
        COMPOSER_RETURN_TYPE_E ret = COMPOSER_RETURN_SUCCESS;
-       if (!cd) return COMPOSER_RETURN_FAIL;
+       if (!cd)
+               return COMPOSER_RETURN_FAIL;
 
        D_PRINT("===== Composer UG Destroy Start =====");
-       contacts_svc_disconnect();
 
-       if (cd->msg_bundle) {
-               bundle_free(cd->msg_bundle);
-               cd->msg_bundle = NULL;
+       __msg_composer_auto_save_and_delete_msg(cd);
+
+       /* discoonect volume key handler */
+       msg_ui_composer_disconnect_handler(cd);
+
+       contacts_disconnect2();
+
+       D_PRINT("----- Unregister vconf callback -----");
+       if (vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, __msgc_vconf_changed_cb) < 0) {
+               D_EMSG("Fail to unregister vconf CB with [%s]", VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE);
+       }
+       if (vconf_ignore_key_changed(VCONFKEY_MSG_APP_FONT_SIZE, __msgc_vconf_changed_cb) < 0) {
+               D_EMSG("Fail to unregister vconf CB with [%s]", VCONFKEY_MSG_APP_FONT_SIZE);
+       }
+
+       if (cd->tapi_handle) {
+               if (tel_deinit(cd->tapi_handle) != TAPI_API_SUCCESS)
+                       D_EMSG("tel_deinit is failed");
+               cd->tapi_handle = NULL;
+       }
+
+       if(cd->job_thread_end) {
+               D_PRINT("----- Job Delete -----");
+               ecore_job_del(cd->job_thread_end);
+               cd->job_thread_end = NULL;
+       }
+
+       if(cd->attach_thread) {
+               D_PRINT("----- Thread Delete -----");
+               ecore_thread_cancel(cd->attach_thread);
+               cd->attach_thread = NULL;
        }
 
-       if (cd->noti) {
-               D_PRINT("----- Notify Delete -----");
-               evas_object_del(cd->noti);
-               cd->noti = NULL;
+       if (cd->last_focus_idler) {
+               D_PRINT("----- idler Delete -----");
+               ecore_idler_del(cd->last_focus_idler);
+               cd->last_focus_idler = NULL;
        }
 
-       if (cd->popup_conform) {
-               evas_object_del(cd->popup_conform);
-               cd->popup_conform = NULL;
+       if (cd->flight_mode_timer) {
+               ecore_timer_del(cd->flight_mode_timer);
+               cd->flight_mode_timer = NULL;
        }
 
        if (cd->recipient) {
@@ -498,11 +1216,17 @@ COMPOSER_RETURN_TYPE_E msg_ui_composer_destroy(MSG_COMPOSER_VIEW_DATA_S *cd)
                cd->recipient = NULL;
        }
 
+       D_PRINT("----- Recipient list Clear -----");
+       msg_ui_composer_recipient_clear_recipient_list(cd);
+
        D_PRINT("----- Predict Search Delete -----");
        msg_ui_composer_predictsearch_list_delete(cd);
 
+       D_PRINT("----- Body Delete -----");
+       msg_ui_composer_body_delete(cd);
+
        D_PRINT("----- Close Msg Handle -----");
-       msg_ui_comp_core_close_msg_handle(&cd->msg_handle);
+       msg_close_msg_handle(&cd->msg_handle);
 
        D_PRINT("----- Delete Popup  -----");
        msg_ui_composer_popup_delete_all(cd);
@@ -513,26 +1237,148 @@ COMPOSER_RETURN_TYPE_E msg_ui_composer_destroy(MSG_COMPOSER_VIEW_DATA_S *cd)
                cd->working_path = NULL;
        }
 
+       if (cd->th) {
+               elm_theme_extension_del(cd->th, MSG_CUSTOM_WINSET_EDJ);
+               elm_theme_free(cd->th);
+               cd->th = NULL;
+       }
+
+       /* rollback indicator mode to previous mode */
+       elm_win_indicator_mode_set(cd->main_window, cd->indicator_mode);
+
        D_PRINT("===== Composer UG Destroy End =====");
 
        D_LEAVE;
        return ret;
 }
 
-void msg_ui_composer_destroy_request(MSG_COMPOSER_VIEW_DATA_S *cd)
+void msg_ui_composer_change_language(MSG_COMPOSER_VIEW_DATA_S *cd)
+{
+       D_ENTER;
+       D_MSG_RETM_IF(cd == NULL, "cd is NULL");
+
+       if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER || cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER) {
+               /* destroy popup */
+               msg_ui_composer_popup_delete_all(cd);
+
+               if (cd->ctx_popup) {
+                       evas_object_del(cd->ctx_popup);
+                       cd->ctx_popup = NULL;
+               }
+
+               /* title */
+               msg_ui_composer_navi_title_set(cd);
+
+               /* recipient */
+               if (cd->recipient) {
+                       Evas_Object *mbe = cd->recipient->mbe;
+
+                       /* set mbe label */
+                       char label_txt[TO_FIELD_LABEL_SIZE_MAX] = { 0, };
+                       gsize len = 0;
+
+                       len = snprintf(label_txt, (gsize)sizeof(label_txt), "%s:", MSGC_STR_TO);
+                       if (len == -1) {
+                               D_EMSG("len = %d", len);
+                       } else if (len > 0) {
+                               label_txt[len] = '\0';
+                               elm_object_text_set(mbe, label_txt);
+                       } else {
+                               D_EMSG("len = %d", len);
+                       }
+
+                       /* set guide text */
+                       elm_object_part_text_set(mbe, "guide", MSGC_STR_ADD_RECIPIENT);
+               }
+
+               /* subject */
+               if (cd->sub_data.entry)
+                       edje_object_part_text_set(_EDJ(cd->sub_data.layout), "subject.guidetxt", MSGC_STR_SUBJECT);
+
+               /* attachment */
+               if (cd->ly_attach_main) {
+                       char buf[DEF_BUF_LEN_S + 1] = {0,};
+                       const char *str = _MSGSTR("IDS_MSGC_BODY_PD_ATTACHMENTS");
+
+                       snprintf(buf, sizeof(buf), str, cd->attach_data.attachment_Cnt);
+                       edje_object_part_text_set(_EDJ(cd->ly_attach_main), "text.filename", buf);
+               }
+
+               /* mms size */
+               if (cd->msg_type == COMPOSER_MSG_TYPE_MMS)
+                       msg_ui_composer_body_info_area_update(cd);
+       }
+
+       cd->isclosed = false;
+
+       D_LEAVE;
+}
+
+COMPOSER_RETURN_TYPE_E msg_ui_composer_rotate(MSG_COMPOSER_VIEW_DATA_S *cd, COMPOSER_ROTATE_TYPE_E rotate)
 {
        D_ENTER;
-       D_MSG_RETM_IF(cd == NULL, "Composer Data == NULL");
+       D_MSG_RETVM_IF(cd == NULL, COMPOSER_RETURN_FAIL, "cd is NULL");
+
+       cd->rotate = rotate;
+       D_MSG("rotate val [%d]", rotate);
+
+       if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER || cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER) {
+
+               RECIPIENT_S *r = cd->recipient;
+               if (!r) return COMPOSER_RETURN_FAIL;
+
+               if (rotate == COMPOSER_ROTATE_PORTRAIT || rotate == COMPOSER_ROTATE_PORTRAIT_UPSIDEDOWN) {
+                       elm_layout_theme_set(cd->base, "layout", "application", "default");
+
+                       elm_win_indicator_mode_set(cd->main_window, ELM_WIN_INDICATOR_SHOW);
+
+                       elm_box_horizontal_set(r->bx_main, EINA_FALSE);
+                       elm_scroller_content_min_limit(r->sc, EINA_FALSE, EINA_TRUE);
+                       evas_object_size_hint_max_set(r->sc, 9999, COMPOSER_RECIPIENT_PORTRAIT_HEIGHT_MAX);
+               } else if (rotate == COMPOSER_ROTATE_LANDSCAPE || rotate == COMPOSER_ROTATE_LANDSCAPE_UPSIDEDOWN) {
+                       elm_layout_theme_set(cd->base, "layout", "application", "noindicator");/*hide indicator in Landscape*/
+                       elm_win_indicator_mode_set(cd->main_window, ELM_WIN_INDICATOR_HIDE);
+                       D_MSG("hide indicator");
+                       elm_box_horizontal_set(r->bx_main, EINA_TRUE);
+                       elm_scroller_content_min_limit(r->sc, EINA_FALSE, EINA_FALSE);
+                       evas_object_size_hint_max_set(r->sc, 9999, -1);
+               }
+
+               /* change body scroller size */
+               msg_ui_composer_change_body_scroll_size(cd, 0);
+
+       } else if (cd->msg_ug_mode == MSG_UG_MODE_BUBBLE_COMPOSER) {
+               if (rotate == COMPOSER_ROTATE_PORTRAIT || rotate == COMPOSER_ROTATE_PORTRAIT_UPSIDEDOWN) {
+                       if (cd->bubble_data)
+                               cd->bubble_data->isRotate = false;
+
+                       if (cd->compose_btn) {
+                               evas_object_hide(cd->compose_btn);
+                               elm_object_part_content_unset(cd->navi_title_layout, "compose_btn");
+                       }
+               } else if (rotate == COMPOSER_ROTATE_LANDSCAPE || rotate == COMPOSER_ROTATE_LANDSCAPE_UPSIDEDOWN) {
+                       if (cd->bubble_data) {
+                               cd->bubble_data->isRotate = true;
+
+                               if (cd->compose_btn && cd->bubble_data->viewmode == BUBBLE_NORMAL_VIEW) {
+                                       evas_object_show(cd->compose_btn);
+                                       elm_object_part_content_set(cd->navi_title_layout, "compose_btn", cd->compose_btn);
+                               }
+                       }
+               }
+
+               elm_win_indicator_mode_set(cd->main_window, ELM_WIN_INDICATOR_SHOW);
+
+               /* change body scroller size */
+               msg_ui_composer_change_body_scroll_size(cd, 0);
 
-       if (__msg_ui_composer_edit_check(cd) == EINA_TRUE) {
-               cd->destroy_req = true;
-               __msg_ui_composer_end_popup(cd);
        } else {
-               bundle_send_to_result(cd, MSG_BUNDLE_KEY_COMPOSER_RESPONSE, MSG_BUNDLE_VALUE_RET_YES);
-               ug_destroy_me(cd->ug);
+               D_EMSG("Unknown Composer Mode");
+               return COMPOSER_RETURN_FAIL;
        }
 
        D_LEAVE;
+       return COMPOSER_RETURN_SUCCESS;
 }
 
 COMPOSER_RETURN_TYPE_E msg_ui_composer_init(MSG_COMPOSER_VIEW_DATA_S *cd)
@@ -545,44 +1391,82 @@ COMPOSER_RETURN_TYPE_E msg_ui_composer_init(MSG_COMPOSER_VIEW_DATA_S *cd)
        }
 
        /* create message handle */
-       if (msg_ui_comp_core_open_msg_handle(&cd->msg_handle) != COMPOSER_RETURN_SUCCESS) {
+       if (msg_open_msg_handle(&cd->msg_handle) != MSG_SUCCESS) {
                D_EMSG("[ASSERT] msg-server doesn't response !!!");
                return COMPOSER_RETURN_FAIL;
        }
 
        /* set message sent status callback */
-       if (msg_ui_comp_core_reg_sent_status_cb(cd->msg_handle, __msg_ui_composer_sent_status_cb, cd) != COMPOSER_RETURN_SUCCESS) {
+       if (msg_reg_sent_status_callback(cd->msg_handle, &__msg_ui_composer_sent_status_cb, cd) != MSG_SUCCESS) {
                D_EMSG("[ASSERT] sent status callback register error!!!");
                return COMPOSER_RETURN_FAIL;
        }
 
        /* connect contacts svc*/
-       if (contacts_svc_connect() != 0) {
-               D_EMSG("[ASSERT] Fail of contacts_svc_connect !!!");
+       if (contacts_connect2() != 0) {
+               D_EMSG("[ASSERT] Fail of contacts_connect2 !!!");
                return COMPOSER_RETURN_FAIL;
        }
 
-       cd->working_path = __working_dir_create();
+       cd->working_path = msg_composer_create_working_dir();
        if (cd->working_path == NULL) {
                D_EMSG("[ASSERT] Fail of make working dir!!!");
                return COMPOSER_RETURN_FAIL;
        }
 
-
        /* set default message type is SMS */
        cd->msg_type = COMPOSER_MSG_TYPE_SMS;
 
-       /*set currnet_theme */
+       /* get sms setting */
+       msg_struct_t sms_sent_opt = msg_create_struct(MSG_STRUCT_SETTING_SMS_SEND_OPT);
 
-       char *current_theme = msg_common_get_current_theme_name();
-       if (g_strcmp0(current_theme, MSG_THEME_WHITE_HD) == 0)
-               cd->current_theme = MSG_UI_THEME_WHITE;
-       else
-               cd->current_theme = MSG_UI_THEME_BLUE_HD;
+       if (msg_get_sms_send_opt(cd->msg_handle, sms_sent_opt) != MSG_SUCCESS) {
+               D_EMSG("Getting SMS_SEND_OP ERROR");
+       } else {
+               msg_get_int_value(sms_sent_opt, MSG_SMS_SENDOPT_ENCODE_TYPE_INT, &cd->encode_mode);
+               D_MSG("SMS Encode mode is %d", cd->encode_mode);
+       }
+
+       msg_release_struct(&sms_sent_opt);
+
+       if (cd->cms_max_page == 0) {
+               // TODO: get cms max page from msgfw when it is supported by msgfw.
+               cd->cms_max_page = COMPOSER_CMS_MAX_PAGE;
+       }
+
+       /* get mms max size */
+       if (cd->mms_max_size == 0) {
+               msg_struct_t setting = msg_create_struct(MSG_STRUCT_SETTING_MSGSIZE_OPT);
+
+               if (msg_get_msgsize_opt(cd->msg_handle, setting) != MSG_SUCCESS) {
+                       D_EMSG("Getting MMS MAX SIZE ERROR");
+               } else {
+                       if (setting)
+                               msg_get_int_value(setting, MSG_MESSAGE_SIZE_INT, &cd->mms_max_size);
+
+                       D_MSG("msg max size = [%d KB] !!!", cd->mms_max_size);
+                       cd->mms_max_size = cd->mms_max_size * 1024;
+               }
+               msg_release_struct(&setting);
+       }
 
-       if (current_theme)
-               free(current_theme);
+       /* set default font size*/
+       __msgc_init_font_size(cd);
 
+       /* coonect volume key handler */
+       msg_ui_composer_connect_handler(cd);
+
+       /* register vconf callback function */
+       if (vconf_notify_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, __msgc_vconf_changed_cb, cd) < 0) {
+               D_EMSG("Fail to register vconf CB with [%s]", VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE);
+       }
+       if (vconf_notify_key_changed(VCONFKEY_MSG_APP_FONT_SIZE, __msgc_vconf_changed_cb, cd) < 0) {
+               D_EMSG("Fail to register vconf CB with [%s]", VCONFKEY_MSG_APP_FONT_SIZE);
+       }
+
+       cd->th = elm_theme_new();
+       elm_theme_ref_set(cd->th, NULL);
+       elm_theme_extension_add(cd->th, MSG_CUSTOM_WINSET_EDJ);
 
        return COMPOSER_RETURN_SUCCESS;
 }
@@ -598,15 +1482,14 @@ COMPOSER_RETURN_TYPE_E msg_ui_composer_create(MSG_COMPOSER_VIEW_DATA_S *cd)
        D_MSG_RETVM_IF(cd->base == NULL, COMPOSER_RETURN_FAIL, "base layout is NULL");
 
        Evas_Object *navi_frame = NULL;
-
-       /* State Set */
-       cd->state = COMPOSER_STATE_TYPE_CREATE;
+       Evas_Object *more_button = NULL;
+       Evas_Object *compose_button = NULL;
        Evas_Object *content_layout = NULL;
        Elm_Object_Item *navi_it = NULL;
-
-       Evas_Object *conform = NULL;
        Evas_Object *back_btn = NULL;
-       Evas_Object *tool_bar = NULL;
+
+       /* State Set */
+       cd->state = COMPOSER_STATE_TYPE_CREATE;
 
        /* Create naviframe */
        navi_frame = elm_naviframe_add(cd->base);
@@ -642,15 +1525,6 @@ COMPOSER_RETURN_TYPE_E msg_ui_composer_create(MSG_COMPOSER_VIEW_DATA_S *cd)
 
        cd->content_layout = content_layout;
 
-       /*Create conformant */
-       conform = msg_ui_composer_conformant_create(cd->main_window, content_layout);
-       if (!conform) {
-               D_EMSG("Fail to create conformant");
-               goto error_return;
-       }
-
-       cd->conform = conform;
-
        /*Create content*/
        if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER || cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER) {
                cd->recipient = msg_ui_composer_recipient_create(content_layout, 1, cd);
@@ -688,26 +1562,51 @@ COMPOSER_RETURN_TYPE_E msg_ui_composer_create(MSG_COMPOSER_VIEW_DATA_S *cd)
 
        /*Push content to navi frame*/
        if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER || cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER) {
-               back_btn = __naviframe_back_btn_create(navi_frame, (void *)cd, true);
-               navi_it = elm_naviframe_item_push(navi_frame, MSGC_STR_NEW_MESSAGE, NULL, NULL, conform, NULL);
-               elm_object_item_part_content_set(navi_it, "title_right_btn", back_btn);
+               if (cd->isMsgInternal)
+                       back_btn = __naviframe_back_btn_create(navi_frame, (void *)cd, false);
+               else
+                       back_btn = __naviframe_back_btn_create(navi_frame, (void *)cd, true);
        } else {
                back_btn = __naviframe_back_btn_create(navi_frame, (void *)cd, false);
-               navi_it = elm_naviframe_item_push(navi_frame, NULL, back_btn, NULL, conform, NULL);
-               tool_bar = msg_ui_bubble_create_controlbar(navi_frame, cd->bubble_data);
-               elm_object_item_part_content_set(navi_it, "controlbar", tool_bar);
        }
 
+       navi_it = elm_naviframe_item_push(navi_frame, NULL, NULL, NULL, content_layout, "empty");
+
        cd->navi_it = navi_it;
        cd->back_btn = back_btn;
 
+       /* create navi title layout */
+       cd->navi_title_layout = msg_ui_composer_create_navi_title_bar(cd);
+       msg_ui_composer_navi_title_set(cd);
+       elm_object_item_part_content_set(cd->navi_it, "title", cd->navi_title_layout);
+
+       /*Create more button*/
+       more_button = __naviframe_more_btn_create(navi_frame, cd);
+
+       elm_object_part_content_set(cd->navi_title_layout, "more_btn", more_button);
+       elm_object_part_content_set(cd->navi_title_layout, "prev_btn", back_btn);
+
+       cd->more_btn = more_button;
+
+       if (cd->msg_type == COMPOSER_MSG_TYPE_SMS)
+               elm_object_disabled_set(cd->more_btn, EINA_TRUE);
+
+       /*Create compose button*/
+       compose_button = __naviframe_compose_btn_create(navi_frame, cd);
+
+       if (cd->bubble_data != NULL && cd->bubble_data->isRotate == true) {
+               evas_object_show(compose_button);
+               elm_object_part_content_set(cd->navi_title_layout, "compose_btn", compose_button);
+       } else {
+               evas_object_hide(compose_button);
+               elm_object_part_content_unset(cd->navi_title_layout, "compose_btn");
+       }
+
+       cd->compose_btn = compose_button;
+
        /* set navibar to main layout (base) */
        elm_object_part_content_set(cd->base, "elm.swallow.content", navi_frame);
 
-       evas_object_event_callback_add(navi_frame, EVAS_CALLBACK_DEL, msg_ui_composer_evas_object_delete_cb, "navibar");
-       evas_object_event_callback_add(content_layout, EVAS_CALLBACK_DEL, msg_ui_composer_evas_object_delete_cb, "content_layout");
-       evas_object_event_callback_add(conform, EVAS_CALLBACK_DEL, msg_ui_composer_evas_object_delete_cb, "conform");
-
        D_LEAVE;
        return COMPOSER_RETURN_SUCCESS;
 
@@ -715,34 +1614,61 @@ error_return:
        return COMPOSER_RETURN_FAIL;
 }
 
-COMPOSER_RETURN_TYPE_E msg_ui_composer_bubble_data_set(MSG_COMPOSER_VIEW_DATA_S *cd, const char *address, const char *name, int contact_id, int thread_id)
+COMPOSER_RETURN_TYPE_E msg_ui_composer_bubble_data_set(MSG_COMPOSER_VIEW_DATA_S *cd, int thread_id)
 {
        D_ENTER;
        D_MSG_RETVM_IF(cd == NULL, COMPOSER_RETURN_FAIL, "Composer data is NULL");
        D_MSG_RETVM_IF(cd->msg_ug_mode != MSG_UG_MODE_BUBBLE_COMPOSER, COMPOSER_RETURN_FAIL, "msg_ug_mode is NOT BUBBLE TYPE");
        D_MSG_RETVM_IF(thread_id <=  0, COMPOSER_RETURN_FAIL, "Composer mode is Not Full");
-       D_MSG_RETVM_IF(address ==  NULL, COMPOSER_RETURN_FAIL, "address is NULL");
        D_MSG_RETVM_IF(cd->bubble_data == NULL, COMPOSER_RETURN_FAIL, "bubble data is NULL");
 
        PMSG_BUBBLE_DATA bubble_data = cd->bubble_data;
+       msg_struct_t threadInfo = NULL;
+       int err;
 
        /*Create bubble list*/
        bubble_data->threadId = thread_id;
-       MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "Thread ID = %d", bubble_data->threadId);
+       D_MSG("Thread ID = %d", bubble_data->threadId);
 
-       snprintf(bubble_data->threadAddr, DEF_THREAD_ADDR_LEN, "%s", address);
-       MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "Thread Adress =%s", bubble_data->threadAddr);
+       msg_struct_list_s addrList;
+       int i = 0;
+       memset(&addrList, 0x00, sizeof(msg_struct_list_s));
 
-       if (name) {
-               snprintf(bubble_data->threadName, DEF_THREAD_NAME_LEN, "%s", name);
-               MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "Thread Name =%s", bubble_data->threadName);
-       }
+       err = msg_get_address_list(bubble_data->msgHandle, bubble_data->threadId, &addrList);
+
+       if (err == MSG_SUCCESS) {
+               bubble_data->addr_list.addr_cnt = addrList.nCount;
+
+               for (i = 0; i<addrList.nCount; i++) {
+                       int contact_id = 0;
+                       msg_get_int_value(addrList.msg_struct_info[i], MSG_ADDRESS_INFO_CONTACT_ID_INT, &contact_id);
+                       /** addresss */
+                       msg_get_str_value(addrList.msg_struct_info[i], MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, bubble_data->addr_list.addr_info[i].address, DEF_THREAD_ADDR_LEN);
 
-       if (contact_id > 0) {
-               bubble_data->contactId = contact_id;
+                       /** contact ID & display name */
+                       if (contact_id > 0) {
+                               bubble_data->addr_list.addr_info[i].contact_id = contact_id;
+                               msg_get_str_value(addrList.msg_struct_info[i], MSG_ADDRESS_INFO_DISPLAYNAME_STR, bubble_data->addr_list.addr_info[i].name, DEF_THREAD_NAME_LEN);
+                       } else {
+                               bubble_data->addr_list.addr_info[i].contact_id = 0;
+                       }
+               }
+
+               msg_release_list_struct(&addrList);
        } else {
-               bubble_data->contactId = 0;
+               D_MSG("[ERROR] msg_get_address_list returns error [%d]", err);
        }
+
+       threadInfo = msg_create_struct(MSG_STRUCT_THREAD_INFO);
+       err = msg_get_thread(bubble_data->msgHandle, bubble_data->threadId, threadInfo);
+
+       if (err == MSG_SUCCESS)
+               msg_get_str_value(threadInfo, MSG_THREAD_NAME_STR, bubble_data->threadName, DEF_THREAD_NAME_LEN);
+       else
+               D_MSG("[ERROR] msg_get_trhead returns error [%d", err);
+
+       msg_release_struct(&threadInfo);
+
        return COMPOSER_RETURN_SUCCESS;
 }
 
@@ -767,12 +1693,12 @@ COMPOSER_RETURN_TYPE_E msg_ui_composer_change_composer_view(MSG_COMPOSER_VIEW_DA
        elm_object_part_content_set(cd->content_layout, "swl.predictsearch", predict_search_layout);
 
        MSGC_EVAS_OBJECT_DEL(cd->back_btn);
-
        Evas_Object *back_btn = __naviframe_back_btn_create(cd->navi_bar, (void *)cd, true);
-       elm_object_item_part_content_set(cd->navi_it, "title_right_btn", back_btn);
+       elm_object_part_content_set(cd->navi_title_layout, "prev_btn", back_btn);
        cd->back_btn = back_btn;
 
-       elm_object_item_text_set(cd->navi_it, MSGC_STR_NEW_MESSAGE);
+       msg_ui_composer_navi_title_set(cd);
+
        D_LEAVE;
        return COMPOSER_RETURN_SUCCESS;
 }
@@ -801,14 +1727,8 @@ COMPOSER_RETURN_TYPE_E msg_ui_composer_change_bubble_view(MSG_COMPOSER_VIEW_DATA
        cd->bubble_data = (void *)bubble_data;
 
        /*Change naviframe layout for bubble*/
-       Evas_Object *cancel = elm_object_item_part_content_unset(cd->navi_it, "title_right_btn");
-       evas_object_del(cancel);
-
-       Evas_Object *toolbar = msg_ui_bubble_create_controlbar(cd->navi_bar, cd->bubble_data);
-       elm_object_item_part_content_set(cd->navi_it, "controlbar", toolbar);
-
        Evas_Object *cancel_btn = __naviframe_back_btn_create(cd->navi_bar, (void *)cd, false);
-       elm_object_item_part_content_set(cd->navi_it, "prev_btn", cancel_btn);
+       elm_object_part_content_set(cd->navi_title_layout, "prev_btn", cancel_btn);
        cd->back_btn = cancel_btn;
 
        Evas_Object *layout = msg_ui_bubble_create_view(cd->content_layout, cd->bubble_data); // First parameter should be 'content_layout'.
@@ -824,53 +1744,294 @@ COMPOSER_RETURN_TYPE_E msg_ui_composer_change_bubble_view(MSG_COMPOSER_VIEW_DATA
        return COMPOSER_RETURN_SUCCESS;
 }
 
+/*
+ * msg_ui_composer_editable_set
+ * editable == FALSE : hide body content & disable more button & close option header
+ * editable == TRUE : show body content layout
+ * */
 void msg_ui_composer_editable_set(MSG_COMPOSER_VIEW_DATA_S *cd, Eina_Bool editable)
 {
        D_ENTER;
        D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
 
-       if (editable == EINA_FALSE) {
+       if (editable == EINA_FALSE){
                Evas_Object *body_layout = elm_object_part_content_unset(cd->content_layout, "swl.composer.body");
                evas_object_hide(body_layout);
+
+               if (cd->more_btn)
+                       elm_object_disabled_set(cd->more_btn, EINA_TRUE);
        } else {
                elm_object_part_content_set(cd->content_layout, "swl.composer.body", cd->ly_body);
                evas_object_show(cd->ly_body);
+
+               if (cd->more_btn)
+                       elm_object_disabled_set(cd->more_btn, EINA_FALSE);
+
        }
 
        D_LEAVE;
 }
 
-void msg_ui_composer_bubble_del_all(void *data, bundle *b)
+void msg_ui_composer_bubble_del_all(void *data, service_h svc_handle)
 {
        D_ENTER;
 
-       MSG_COMPOSER_VIEW_DATA_S *cd = data;
+       MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
        D_MSG_RETM_IF(cd == NULL, "Composer data is NULL");
 
-       ug_send_result(cd->ug, b);
+       ug_send_result(cd->ug, svc_handle);
+}
+
+Evas_Object *msg_ui_composer_create_navi_title_bar(void *data)
+{
+       D_ENTER;
+
+       if (!data) {
+               D_EMSG("[ERROR] data is NULL");
+               return NULL;
+       }
+
+       MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+
+       Evas_Object *title_layout = elm_layout_add(cd->navi_bar);
+       elm_layout_file_set(title_layout, MSG_COMMON_EDJ, "title");
+       evas_object_size_hint_weight_set(title_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_size_hint_align_set(title_layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       evas_object_show(title_layout);
+
+       return title_layout;
 }
 
-void msg_ui_bubble_composer_navi_title_set(void *data)
+void msg_ui_composer_navi_title_set(void *data)
 {
        D_ENTER;
 
-       if (!data)
+       if (!data) {
+               D_EMSG("data is NULL");
                return;
+       }
 
-       MSG_COMPOSER_VIEW_DATA_S *cd = data;
+       MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
        PMSG_BUBBLE_DATA bubble_data = cd->bubble_data;
 
-       if (bubble_data->contactId > 0) {
-               if (bubble_data->threadName[0] != '\0')
-                       elm_object_item_text_set(cd->navi_it, bubble_data->threadName);
-               else
-                       elm_object_item_text_set(cd->navi_it, dgettext("sys_string", "IDS_COM_BODY_NO_NAME"));
+       if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER || cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER) {
+               elm_object_part_text_set(cd->navi_title_layout, "title_text", MSGC_STR_NEW_MESSAGE);
+       } else if (cd->msg_ug_mode ==  MSG_UG_MODE_BUBBLE_COMPOSER) {
+               Evas_Object *title_button = NULL;
+
+               elm_object_part_text_set(cd->navi_title_layout, "title_text", ""); // text part clear first
+
+               title_button = elm_button_add(cd->navi_bar);
+
+               elm_object_theme_set(title_button, cd->th);
+               elm_object_style_set(title_button, "title_button");
+
+               evas_object_size_hint_weight_set(title_button, 0.0, 0.0);
+               evas_object_size_hint_align_set(title_button, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+               if (bubble_data->addr_list.addr_cnt == 1) {
+                       if (bubble_data->addr_list.addr_info[0].contact_id > 0 && bubble_data->addr_list.addr_info[0].name[0] != '\0')
+                               elm_object_text_set(title_button, bubble_data->addr_list.addr_info[0].name);
+                       else if (bubble_data->addr_list.addr_info[0].address[0] != '\0')
+                               elm_object_text_set(title_button, bubble_data->addr_list.addr_info[0].address);
+                       else
+                               elm_object_text_set(title_button, dgettext("sys_string", "IDS_COM_BODY_UNKNOWN"));
+               } else if (bubble_data->addr_list.addr_cnt > 1) {
+                       char title_text[DEF_BUF_LEN+1] = {0,};
+
+                       if (bubble_data->addr_list.addr_info[0].contact_id > 0 && bubble_data->addr_list.addr_info[0].name[0] != '\0')
+                               snprintf(title_text, sizeof(title_text), "%s +%d", bubble_data->addr_list.addr_info[0].name, bubble_data->addr_list.addr_cnt-1);
+                       else if (bubble_data->addr_list.addr_info[0].address[0] != '\0')
+                               snprintf(title_text, sizeof(title_text), "%s +%d", bubble_data->addr_list.addr_info[0].address, bubble_data->addr_list.addr_cnt-1);
+                       else
+                               snprintf(title_text, sizeof(title_text), "%s +%d", dgettext("sys_string", "IDS_COM_BODY_UNKNOWN"), bubble_data->addr_list.addr_cnt-1);
+
+                       elm_object_text_set(title_button, title_text);
+               } else {
+                       elm_object_text_set(title_button, dgettext("sys_string", "IDS_COM_BODY_UNKNOWN"));
+               }
+
+               evas_object_show(title_button);
+               elm_object_part_content_set(cd->navi_title_layout, "title_btn", title_button);
+               evas_object_smart_callback_add(title_button, "clicked", msg_ui_bubble_title_button_clicked_cb, cd);
+
+               bubble_data->title_button = title_button;
        } else {
-               if (bubble_data->threadAddr[0] != '\0')
-                       elm_object_item_text_set(cd->navi_it, bubble_data->threadAddr);
-               else
-                       elm_object_item_text_set(cd->navi_it, dgettext("sys_string", "IDS_COM_BODY_UNKNOWN"));
+               D_EMSG("Invalid msg_ui_mode [%d]", cd->msg_ug_mode);
+               return;
+       }
+}
+
+static Eina_Bool __msgc_up_key_long_press_cb(void *data)
+{
+       D_ENTER;
+       D_MSG_RETVM_IF(data == NULL, EINA_FALSE, "cd is NULL");
+       MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+
+       if (!msg_common_increase_font_size()) {
+               cd->vol_up_key_longpress = NULL;
+               return EINA_FALSE;
+       }
+
+       /* apply font size */
+       if (cd->msg_ug_mode == MSG_UG_MODE_BUBBLE_COMPOSER)
+               msg_common_apply_font_size("bubble", cd->content_layout);
+
+       msg_ui_composer_apply_font_size(cd, false);
+
+       return EINA_TRUE;
+}
+
+static Eina_Bool __msgc_down_key_long_press_cb(void *data)
+{
+       D_ENTER;
+       D_MSG_RETVM_IF(data == NULL, EINA_FALSE, "cd is NULL");
+       MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+
+       if (!msg_common_decrease_font_size()) {
+               cd->vol_down_key_longpress = NULL;
+               return EINA_FALSE;
+       }
+
+       /* apply font size */
+       if (cd->msg_ug_mode == MSG_UG_MODE_BUBBLE_COMPOSER)
+               msg_common_apply_font_size("bubble", cd->content_layout);
+
+       msg_ui_composer_apply_font_size(cd, false);
+
+       return EINA_TRUE;
+}
+
+Eina_Bool msg_ui_composer_key_release_cb(void *data, int type, void *event)
+{
+       D_ENTER;
+       D_MSG_RETVM_IF(data == NULL, EINA_FALSE, "cd is NULL");
+       D_MSG_RETVM_IF(event == NULL, EINA_FALSE, "event is NULL");
+       MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+       Ecore_Event_Key *ev = (Ecore_Event_Key *)event;
+       int use_volume_key = false;
+
+       vconf_get_bool(VCONFKEY_MSG_APP_USE_VOLUME_KEY, &use_volume_key);
+
+       if (use_volume_key) {
+               if (!g_strcmp0(ev->keyname, KEY_VOLUMEUP)) {    /* KEY_VOLUMEUP */
+                       D_MSG("KEY_VOLUMEUP is released");
+
+                       if (cd->vol_up_key_longpress) {
+                               ecore_timer_del(cd->vol_up_key_longpress);
+                               cd->vol_up_key_longpress = NULL;
+                       }
+               } else if (!g_strcmp0(ev->keyname, KEY_VOLUMEDOWN)) {   /* KEY_VOLUMEDOWN */
+                       D_MSG("KEY_VOLUMEDOWN is released");
+
+                       if (cd->vol_down_key_longpress) {
+                               ecore_timer_del(cd->vol_down_key_longpress);
+                               cd->vol_down_key_longpress = NULL;
+                       }
+               } else {
+                       D_MSG("key_name is not applicable!");
+               }
+       } else {
+               D_MSG("Use volume key setting is not activated. Do volume key action");
+       }
+
+       return EINA_TRUE;
+}
+
+Eina_Bool msg_ui_composer_key_press_cb(void *data, int type, void *event)
+{
+       D_ENTER;
+       D_MSG_RETVM_IF(data == NULL, EINA_FALSE, "cd is NULL");
+       D_MSG_RETVM_IF(event == NULL, EINA_FALSE, "event is NULL");
+       MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
+       Ecore_Event_Key *ev = (Ecore_Event_Key *)event;
+       int use_volume_key = false;
+
+       vconf_get_bool(VCONFKEY_MSG_APP_USE_VOLUME_KEY, &use_volume_key);
+
+       if (use_volume_key) {
+               if (!g_strcmp0(ev->keyname, KEY_VOLUMEUP)) {    /* KEY_VOLUMEUP */
+                       D_MSG("KEY_VOLUMEUP is pressed");
+
+                       msg_common_increase_font_size();
+
+                       /* apply font size */
+                       if (cd->msg_ug_mode == MSG_UG_MODE_BUBBLE_COMPOSER)
+                               msg_common_apply_font_size("bubble", cd->content_layout);
+
+                       msg_ui_composer_apply_font_size(cd, false);
+
+                       cd->vol_up_key_longpress = ecore_timer_add(0.1, (Ecore_Task_Cb) __msgc_up_key_long_press_cb, (void *)cd);
+               } else if (!g_strcmp0(ev->keyname, KEY_VOLUMEDOWN)) {   /* KEY_VOLUMEDOWN */
+                       D_MSG("KEY_VOLUMEDOWN is pressed");
+
+                       msg_common_decrease_font_size();
+
+                       /* apply font size */
+                       if (cd->msg_ug_mode == MSG_UG_MODE_BUBBLE_COMPOSER)
+                               msg_common_apply_font_size("bubble", cd->content_layout);
+
+                       msg_ui_composer_apply_font_size(cd, false);
+
+                       cd->vol_down_key_longpress = ecore_timer_add(0.1, (Ecore_Task_Cb) __msgc_down_key_long_press_cb, (void *)cd);
+               } else {
+                       D_MSG("key_name is not applicable!");
+               }
+       } else {
+               D_MSG("Use volume key setting is not activated. Do volume key action");
+       }
+
+       return EINA_TRUE;
+}
+
+void msg_ui_composer_connect_handler(MSG_COMPOSER_VIEW_DATA_S *cd)
+{
+       D_ENTER;
+       D_MSG_RETM_IF(cd == NULL, "cd is NULL");
+
+       int use_volume_key = 0;
+       vconf_get_bool(VCONFKEY_MSG_APP_USE_VOLUME_KEY, &use_volume_key);
+
+       if (use_volume_key) {
+               msg_ui_composer_grab_key_setting(cd->xdisplay, cd->main_window);
+               /* connect key handler for volume up/down */
+               if (!cd->volkey_press_handler)
+                       cd->volkey_press_handler = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, msg_ui_composer_key_press_cb, (void *)cd);
+
+               if (!cd->volkey_release_handler)
+                       cd->volkey_release_handler = ecore_event_handler_add(ECORE_EVENT_KEY_UP, msg_ui_composer_key_release_cb, (void *)cd);
+       }
+       D_MSG("use_volume_key = %d", use_volume_key);
+
+       D_LEAVE;
+}
+
+void msg_ui_composer_disconnect_handler(MSG_COMPOSER_VIEW_DATA_S *cd)
+{
+       D_ENTER;
+       D_MSG_RETM_IF(cd == NULL, "cd is NULL");
+
+       if (cd->volkey_press_handler) {
+               ecore_event_handler_del(cd->volkey_press_handler);
+               cd->volkey_press_handler = NULL;
+       }
+
+       if (cd->vol_down_key_longpress) {
+               ecore_timer_del(cd->vol_down_key_longpress);
+               cd->vol_down_key_longpress = NULL;
+       }
+
+       if (cd->volkey_release_handler) {
+               ecore_event_handler_del(cd->volkey_release_handler);
+               cd->volkey_release_handler = NULL;
+       }
+
+       if (cd->vol_up_key_longpress) {
+               ecore_timer_del(cd->vol_up_key_longpress);
+               cd->vol_up_key_longpress = NULL;
        }
 
+       msg_ui_composer_ungrab_key_setting(cd->xdisplay, cd->main_window);
+
        D_LEAVE;
 }