4e5bb3220552eb3e974dbec84d310d85ca5eae93
[apps/home/message-app.git] / composer / src / ui-composer / msg-ui-composer-body-callback.c
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *    http://floralicense.org/license
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17
18  /* includes */
19 #include "msg-ui-composer-body.h"
20 #include "msg-ui-composer-recipient.h"
21 #include "msg-ui-composer-main.h"
22 #include "msg-ui-composer-body-page.h"
23 #include "msg-ui-composer-body-callback.h"
24 #include "msg-ui-composer-common.h"
25 #include "msg-ui-composer-attachment.h"
26 #include "msg-ui-composer-subject.h"
27 #include "msg-ui-composer-message.h"
28 #include "msg-ui-composer-popup.h"
29 #include "msg-ui-composer-util.h"
30 #include "msg-ui-composer-external.h"
31 #include "syspopup_caller.h"
32 #include <tapi_common.h>
33 #include <ITapiModem.h>
34
35 #define NO_MODEM 38
36 /*==================================================================================================
37 *                                                               FUNCTION IMPLEMENTATIONS
38 *==================================================================================================*/
39 static void __add_list_popup_clicked_cb(void *data, Evas_Object *obj, void *event_info)
40 {
41         D_ENTER;
42
43         if (!data || !event_info) {
44                 D_EMSG("invalid argument, argument data is NULL");
45                 return;
46         }
47
48         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
49
50         if (cd->add_menu_clicked)
51                 return;
52
53         Elm_Object_Item *item = (Elm_Object_Item *)event_info;
54         elm_list_item_selected_set(item, EINA_FALSE);
55
56         const char *label = elm_object_item_text_get(item);
57         if (!label) {
58                 D_EMSG("label is NULL !!");
59                 return;
60         }
61
62         cd->add_menu_clicked = true;
63
64         MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "label = %s", label);
65         if (cd->isAppControl && cd->isEmulator) {
66                 if (!g_strcmp0(label, MSGC_STR_SUBJECT)) {
67                         msg_ui_composer_add_subject(cd);
68                 } else {
69                         D_EMSG("Unknown Menu List Item");
70                 }
71         } else {
72                 if (!g_strcmp0(label, MSGC_STR_SUBJECT)) {
73                         msg_ui_composer_add_subject(cd);
74                 } else if (!g_strcmp0(label, MSGC_STR_GALLERY)) {
75                         msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_GALLERY, NULL);
76                 } else if (!g_strcmp0(label, MSGC_STR_MYFILE)) {
77                         msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_MYFILE, NULL);
78                 } else if (!g_strcmp0(label, _MSGSTR("IDS_MSGC_BODY_TAKE_PICTURE"))) {
79                         msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_CAMERA, NULL);
80                 } else if (!g_strcmp0(label, _MSGSTR("IDS_MSGC_BODY_CAPTURE_VIDEO"))) {
81                         msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_CAMCORDER, NULL);
82                 } else if (!g_strcmp0(label, MSGC_STR_CONTACT)) {
83                         msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_NAMECARD, NULL);
84                 } else if (!g_strcmp0(label, _SYSSTR("IDS_COM_BODY_CALENDAR"))) {
85                         msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_CALENDAR, NULL);
86                 } else if (!g_strcmp0(label, _SYSSTR("IDS_COM_BODY_MEMO"))) {
87                         msg_ui_composer_external_call(cd, COMPOSER_EXT_TYPE_MEMO, NULL);
88                 } else {
89                         D_EMSG("Unknown Menu List Item");
90                 }
91         }
92
93         MSGC_EVAS_OBJECT_DEL(cd->add_popup);
94         cd->add_button_clicked = false;
95         cd->add_menu_clicked = false;
96         D_LEAVE;
97 }
98
99 static void __add_list_popup_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
100 {
101         D_ENTER;
102
103         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
104         D_MSG_RETM_IF(cd == NULL, "composer data is NULL");
105         MSGC_EVAS_OBJECT_DEL(cd->add_popup);
106         cd->add_button_clicked = false;
107         cd->add_menu_clicked = false;
108
109         D_LEAVE;
110 }
111
112 static void __add_list_popup_show(void *data)
113 {
114         D_ENTER;
115
116         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
117         Evas_Object *popup = NULL;
118         Evas_Object *list = NULL;
119         int count = 0;
120         int list_padding = 4;
121
122
123         list = elm_list_add(cd->main_window);
124         D_MSG_RETM_IF(list == NULL, "list is NULL");
125         elm_list_mode_set(list, ELM_LIST_EXPAND);
126
127         Elm_Object_Item *item = NULL;
128
129         if (cd->isAppControl && cd->isEmulator) {
130                 item = elm_list_item_append(list, MSGC_STR_SUBJECT, NULL, NULL, __add_list_popup_clicked_cb, data);
131                 ++count;
132
133                 if (cd->isSubject)
134                         elm_object_item_disabled_set(item, EINA_TRUE);
135         } else {
136                 if (!cd->isSubject) {
137                         elm_list_item_append(list, MSGC_STR_SUBJECT, NULL, NULL, __add_list_popup_clicked_cb, data);
138                         ++count;
139                 }
140
141                 elm_list_item_append(list, MSGC_STR_GALLERY, NULL, NULL, __add_list_popup_clicked_cb, data);
142                 ++count;
143                 elm_list_item_append(list, _MSGSTR("IDS_MSGC_BODY_TAKE_PICTURE"), NULL, NULL, __add_list_popup_clicked_cb, data);
144                 ++count;
145                 elm_list_item_append(list, _MSGSTR("IDS_MSGC_BODY_CAPTURE_VIDEO"), NULL, NULL, __add_list_popup_clicked_cb, data);
146                 ++count;
147                 elm_list_item_append(list, MSGC_STR_MYFILE, NULL, NULL, __add_list_popup_clicked_cb, data);
148                 ++count;
149                 elm_list_item_append(list, MSGC_STR_CONTACT, NULL, NULL, __add_list_popup_clicked_cb, data);
150                 ++count;
151                 elm_list_item_append(list, _SYSSTR("IDS_COM_BODY_CALENDAR"), NULL, NULL, __add_list_popup_clicked_cb, data);
152                 ++count;
153                 elm_list_item_append(list, _SYSSTR("IDS_COM_BODY_MEMO"), NULL, NULL, __add_list_popup_clicked_cb, data);
154                 ++count;
155         }
156
157         elm_list_go(list);
158
159         if (count >= 4) {
160                 count = 4;
161
162                 int popup_height = MSGC_POPUP_LIST_H * count + list_padding;
163                 evas_object_size_hint_max_set(list, -1, popup_height * elm_config_scale_get());
164         }
165
166         popup = msg_ui_composer_list_popup_create(cd, _SYSSTR("IDS_COM_POP_ATTACH"), list, "min_menustyle");
167
168         Evas_Object *btn1 = elm_button_add(popup);
169         elm_object_style_set(btn1, "popup_button/default");
170         elm_object_text_set(btn1, MSGC_STR_BUTTON_CLOSE);
171         elm_object_part_content_set(popup, "button1", btn1);
172         evas_object_smart_callback_add(btn1, "clicked", __add_list_popup_btn_clicked_cb, cd);
173
174         cd->add_popup = popup;
175
176         D_LEAVE;
177 }
178
179 static void __msgc_show_bubble_view(void *data, msg_thread_id_t tid)
180 {
181         D_ENTER;
182         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
183         D_MSG_RETM_IF(cd == NULL, "cd is NULL");
184
185         /* show indicator area */
186         elm_layout_theme_set(cd->base, "layout", "application", "default");
187
188         elm_win_indicator_mode_set(cd->main_window, ELM_WIN_INDICATOR_SHOW);
189
190         msg_ui_composer_change_bubble_view(cd);
191
192         if (tid <= 0) {
193                 D_EMSG("Can not find tid = %d !!", tid);
194                 msg_ui_composer_message_destroy();
195                 ug_destroy_me(cd->ug);
196
197                 return;
198         }
199
200         msg_ui_composer_bubble_data_set(cd, tid);
201         msg_ui_bubble_start_view(cd->bubble_data);
202         msg_ui_composer_navi_title_set((void *)cd);
203
204         /* set recipient list for bubble composer */
205         msg_ui_composer_recipient_set_recipient_list(cd, tid);
206
207         D_LEAVE;
208 }
209
210 static void __nosim_popup_delete_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
211 {
212         D_ENTER;
213
214         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
215         D_MSG_RETM_IF(cd == NULL, "Composer data is NULL");
216
217         if (cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER || cd->composer_mode == MSG_COMPOSER_MODE_FORWARD) {
218                 /* set saved msg flag */
219                 cd->disable_auto_save_mode = true;
220                 ug_destroy_me(cd->ug);
221         }
222
223         D_LEAVE;
224 }
225
226 static void __unsupported_character_popup_yes_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
227 {
228         D_ENTER;
229         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
230         D_MSG_RETM_IF(cd == NULL, "composer data is NULL");
231
232         MSGC_EVAS_OBJECT_DEL(cd->popup_end);
233
234         cd->send_check_exception_type |= SEND_CHECK_EXCEPTION_TYPE_ENCODING_MODE;
235         msg_ui_composer_body_make_and_send_message(cd, cd->send_check_exception_type);
236
237         D_LEAVE;
238 }
239
240 static void __unsupported_character_popup_no_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
241 {
242         D_ENTER;
243         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
244         D_MSG_RETM_IF(cd == NULL, "composer data is NULL");
245
246         MSGC_EVAS_OBJECT_DEL(cd->popup_end);
247
248         if (cd->send_button)
249                 elm_object_disabled_set(cd->send_button, EINA_FALSE);
250
251         msg_ui_composer_last_focus_load(cd);
252
253         D_LEAVE;
254 }
255
256 static void __msgc_flight_mode_tapi_cb(TapiHandle *handle, int result, void *data, void *user_data)
257 {
258         D_ENTER;
259         bool is_success = false;
260
261         switch (result) {
262         case TAPI_POWER_FLIGHT_MODE_RESP_ON:
263                 D_MSG("TAPI_POWER_FLIGHT_MODE_RESP_ON");
264                 break;
265
266         case TAPI_POWER_FLIGHT_MODE_RESP_OFF:
267                 D_MSG("TAPI_POWER_FLIGHT_MODE_RESP_OFF");
268                 is_success = true;
269                 break;
270
271         case TAPI_POWER_FLIGHT_MODE_RESP_FAIL:
272                 D_MSG("TAPI_POWER_FLIGHT_MODE_RESP_FAIL");
273                 break;
274
275         case TAPI_POWER_FLIGHT_MODE_RESP_MAX:
276                 D_MSG("TAPI_POWER_FLIGHT_MODE_RESP_MAX");
277                 break;
278
279         default:
280                 D_MSG("result = %d", result);
281                 if (result == NO_MODEM) {
282                         D_MSG("there is no modem state");
283                         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)user_data;
284                         D_MSG_RETM_IF(cd == NULL, "cd is NULL");
285
286                         if (cd->flight_mode_timer) {
287                                 ecore_timer_del(cd->flight_mode_timer);
288                                 cd->flight_mode_timer = NULL;
289                         }
290                         MSGC_EVAS_OBJECT_DEL(cd->progress_popup);
291
292                         msg_composer_set_flight_mode(false);
293
294                         D_MSG("try to send message");
295                         msg_ui_composer_body_make_and_send_message(cd, SEND_CHECK_EXCEPTION_TYPE_NONE);
296                 }
297                 break;
298         }
299
300         if (!is_success)
301                 D_EMSG("flight mode off is failed");
302
303         D_LEAVE;
304 }
305
306 static Eina_Bool __msgc_flight_mode_enabled_check_timer_cb(void *data)
307 {
308         D_MSG_RETVM_IF(data == NULL, ECORE_CALLBACK_CANCEL, "data is NULL");
309         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
310
311         int network_status = -1;
312         static int count = 0;
313         bool ret = false;
314
315         if (count >= 100) {     /* 0.5 sec * 100 = 50 sec */
316                 D_EMSG("self time expiration");
317                 MSGC_EVAS_OBJECT_DEL(cd->progress_popup);
318                 goto return_end;
319         }
320
321         ++count;
322
323         /* check if call network is enabled - to send message l*/
324         ret = msg_composer_get_network_status(&network_status);
325         if (ret == true) {
326                 if (network_status == VCONFKEY_TELEPHONY_SVCTYPE_NONE ||
327                                 network_status == VCONFKEY_TELEPHONY_SVCTYPE_NOSVC ||
328                                 network_status == VCONFKEY_TELEPHONY_SVCTYPE_EMERGENCY ||
329                                 network_status == VCONFKEY_TELEPHONY_SVCTYPE_SEARCH) {
330                         D_MSG("Cannot send message - check again");
331                         return ECORE_CALLBACK_RENEW;
332                 }
333         } else {
334                 D_EMSG("msg_composer_get_network_status is failed");
335                 return ECORE_CALLBACK_RENEW;
336         }
337
338         MSGC_EVAS_OBJECT_DEL(cd->progress_popup);
339
340         D_MSG("try to send message");
341         msg_ui_composer_body_make_and_send_message(cd, SEND_CHECK_EXCEPTION_TYPE_NONE);
342
343 return_end:
344
345         count = 0;
346         cd->flight_mode_timer = NULL;
347
348         return ECORE_CALLBACK_CANCEL;
349 }
350
351 static void __flight_mode_popup_ok_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
352 {
353         D_ENTER;
354         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
355         D_MSG_RETM_IF(cd == NULL, "composer data is NULL");
356
357         Evas_Object *check = (Evas_Object *)evas_object_data_get(cd->custom_popup, "check_box");
358
359         if (elm_check_state_get(check)) {
360                 /* set flight mode off*/
361                 if (msg_composer_set_flight_mode_by_api(cd->tapi_handle, TAPI_POWER_FLIGHT_MODE_LEAVE, __msgc_flight_mode_tapi_cb, cd) == false) {
362                         D_EMSG("msg_composer_set_flight_mode_by_api is failed");
363                 } else {
364                         /* show progress popup */
365                         MSGC_EVAS_OBJECT_DEL(cd->progress_popup);
366                         cd->progress_popup = msg_ui_composer_progress_popup_show(cd, _MSGSTR("Disabling Flight mode"));
367
368                         /* give focus to back btn to hide keypad */
369                         elm_object_focus_set(cd->back_btn, EINA_TRUE);
370
371                         if (cd->flight_mode_timer) {
372                                 ecore_timer_del(cd->flight_mode_timer);
373                                 cd->flight_mode_timer = NULL;
374                         }
375                         cd->flight_mode_timer = ecore_timer_add(0.5, __msgc_flight_mode_enabled_check_timer_cb, cd);
376                 }
377         } else {
378                 D_MSG("checkbox is not checked");
379         }
380
381         MSGC_EVAS_OBJECT_DEL(cd->custom_popup);
382
383         if (cd->send_button)
384                 elm_object_disabled_set(cd->send_button, EINA_FALSE);
385
386         D_LEAVE;
387 }
388
389 static void __flight_mode_popup_cancel_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
390 {
391         D_ENTER;
392         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
393         D_MSG_RETM_IF(cd == NULL, "composer data is NULL");
394
395         MSGC_EVAS_OBJECT_DEL(cd->custom_popup);
396
397         if (cd->send_button)
398                 elm_object_disabled_set(cd->send_button, EINA_FALSE);
399
400         D_LEAVE;
401 }
402
403 static COMPOSER_RETURN_TYPE_E __msgc_check_condition_to_send_msg(void *data, int check_exption_type)
404 {
405         D_ENTER;
406         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
407         D_MSG_RETVM_IF(cd == NULL, COMPOSER_RETURN_FAIL, "composer data is NULL");
408
409         /* check flight mode */
410         int flight_mode = 0;
411         if (msg_composer_get_flight_mode(&flight_mode) && flight_mode) {
412                 /*get tapi handle */
413                 if (!cd->tapi_handle)
414                         cd->tapi_handle = (void *)tel_init(NULL);
415
416                 if (!cd->tapi_handle) {
417                         D_EMSG("tel_init is failed");
418                 } else {
419                         /* show popup */
420                         Evas_Object *popup = NULL;
421                         Evas_Object *btn1 = NULL;
422                         Evas_Object *btn2 = NULL;
423                         char *popup_msg = _MSGSTR("IDS_MSGC_POP_UNABLE_TO_SEND_MESSAGES_WHILE_IN_FLIGHT_MODE_DISABLE_FLIGHT_MODE_AND_TRY_AGAIN");
424                         char *checkbox_msg = _MSGSTR("IDS_MSGC_HEADER_DISABLE_FLIGHT_MODE_ABB");
425
426                         MSGC_EVAS_OBJECT_DEL(cd->custom_popup);
427
428                         popup = msg_ui_composer_checkbox_popup_create(cd, NULL, popup_msg, checkbox_msg);
429
430                         btn1 = msg_ui_composer_popup_button_create(popup, _SYSSTR("IDS_COM_SK_OK"));
431                         elm_object_part_content_set(popup, "button1", btn1);
432                         evas_object_smart_callback_add(btn1, "clicked", __flight_mode_popup_ok_btn_clicked_cb, cd);
433                         btn2 = msg_ui_composer_popup_button_create(popup, _SYSSTR("IDS_COM_SK_CANCEL"));
434                         elm_object_part_content_set(popup, "button2", btn2);
435                         evas_object_smart_callback_add(btn2, "clicked", __flight_mode_popup_cancel_btn_clicked_cb, cd);
436
437                         cd->custom_popup = popup;
438
439                         elm_object_focus_set(popup, EINA_TRUE);
440                 }
441
442                 return COMPOSER_RETURN_FAIL;
443         }
444
445         /*Check recipient available sending*/
446         RECIPIENT_S *rd = cd->recipient;
447         if (rd) {
448                 /*add recipient, if entry text exist*/
449                 Evas_Object *entry = elm_multibuttonentry_entry_get(rd->mbe);
450                 char *entry_txt = elm_entry_markup_to_utf8(elm_entry_entry_get(entry));
451                 if (entry_txt) {
452                         if (strlen(entry_txt) > 0) {
453                                 if (NULL == elm_multibuttonentry_item_append(rd->mbe, entry_txt, NULL, NULL)) {
454                                         g_free(entry_txt);
455
456                                         if (cd->send_button)
457                                                 elm_object_disabled_set(cd->send_button, EINA_FALSE);
458
459                                         return COMPOSER_RETURN_FAIL;
460                                 }
461                         }
462                         g_free(entry_txt);
463                 }
464
465                 /*check recipient count is zero*/
466                 if (msg_ui_composer_recipient_count_get(rd) == 0) {
467                         D_EMSG("there is no recipient");
468                         //msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_NO_RECIPIENT);
469
470                         /* change focus to recipient */
471                         if (cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER || cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER)
472                                 msg_ui_composer_recipient_focus_set(cd->recipient);
473
474                         if (cd->send_button)
475                                 elm_object_disabled_set(cd->send_button, EINA_FALSE);
476
477                         return COMPOSER_RETURN_FAIL;
478                 }
479         }
480
481         if (!(check_exption_type & SEND_CHECK_EXCEPTION_TYPE_ENCODING_MODE)) {
482                 if (cd->msg_type == COMPOSER_MSG_TYPE_SMS) {
483                         if (cd->body_data.page_list) {
484                                 MSG_COMPOSER_BODY_PAGE_S *page_data = NULL;
485                                 page_data = (MSG_COMPOSER_BODY_PAGE_S *)eina_list_nth(cd->body_data.page_list, 0);
486
487                                 if (page_data && page_data->text_info.encode == COMPOSER_CHAR_ENCODE_GSM7_ABNORMAL) {
488                                         MSGC_EVAS_OBJECT_DEL(cd->popup_end);
489                                         Evas_Object *popup = msg_ui_composer_status_popup_show(cd->navi_bar, cd, _MSGSTR("Some characters may be lost. Continue?"), 0);
490                                         Evas_Object *btn1 = msg_ui_composer_popup_button_create(popup, _SYSSTR("IDS_COM_SK_YES"));
491                                         elm_object_part_content_set(popup, "button1", btn1);
492                                         evas_object_smart_callback_add(btn1, "clicked", __unsupported_character_popup_yes_btn_clicked_cb, cd);
493                                         Evas_Object *btn2 = msg_ui_composer_popup_button_create(popup, _SYSSTR("IDS_COM_SK_NO"));
494                                         elm_object_part_content_set(popup, "button2", btn2);
495                                         evas_object_smart_callback_add(btn2, "clicked", __unsupported_character_popup_no_btn_clicked_cb, cd);
496                                         elm_object_focus_allow_set(popup, EINA_TRUE);
497                                         elm_object_focus_set(popup, EINA_TRUE);
498
499                                         cd->popup_end = popup;
500
501                                         return COMPOSER_RETURN_FAIL;
502                                 }
503                         }
504                 }
505         }
506
507         D_LEAVE;
508         return COMPOSER_RETURN_SUCCESS;
509 }
510
511 void msg_ui_composer_body_make_and_send_message(void *data, int check_exception_type)
512 {
513         D_ENTER;
514         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
515         D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
516         msg_thread_id_t tid = 0;
517
518         if (__msgc_check_condition_to_send_msg(cd, check_exception_type) != COMPOSER_RETURN_SUCCESS) {
519                 D_EMSG("__msgc_check_condition_to_send_msg is failed");
520                 return;
521         }
522
523         /*Make message*/
524         msg_ui_composer_message_init();
525
526         if (msg_ui_composer_recipient_read_data(cd) != COMPOSER_RETURN_SUCCESS) {
527                 D_EMSG("Make recipient data Error");
528                 goto error_return;
529         }
530
531         if (__msg_ui_composer_body_read_data(cd) != COMPOSER_RETURN_SUCCESS) {
532                 D_EMSG("Make body data Error");
533                 goto error_return;
534         }
535
536         /*Send message*/
537         COMPOSER_RETURN_TYPE_E ret = msg_ui_composer_message_make_and_send(cd->msg_handle, cd->msg_id, &tid);
538
539         /* reset region info */
540         MSG_COMPOSER_BODY_S *body_data = &cd->body_data;
541         body_data->region_order = COMPOSER_REGION_ORDER_UNDETERMINDED;
542         cd->send_check_exception_type = SEND_CHECK_EXCEPTION_TYPE_NONE;
543
544         if (ret == COMPOSER_RETURN_SUCCESS) {
545                 D_MSG("Send Success");
546
547                 if (cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER || cd->composer_mode == MSG_COMPOSER_MODE_FORWARD) {
548                         /* set saved msg flag */
549                         cd->disable_auto_save_mode = true;
550                         ug_destroy_me(cd->ug);
551                 } else if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER) {
552                         __msgc_show_bubble_view(cd, tid);
553                         msg_ui_composer_clear(cd);
554
555                         service_h svc_handle;
556                         if (service_create(&svc_handle) < 0 || svc_handle == NULL) {
557                                 D_EMSG("service_create() is failed !!");
558                         } else {
559                                 char buf[DEF_BUF_LEN_S] = {0,};
560                                 snprintf(buf, sizeof(buf), "%d", tid);
561                                 service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_THREAD_ID, buf);
562
563                                 ug_send_result(cd->ug, svc_handle);
564
565                                 service_destroy(svc_handle);
566                         }
567                 } else {
568                         msg_ui_composer_clear(cd);
569                 }
570
571                 cd->composer_mode = MSG_COMPOSER_MODE_NORMAL;
572                 cd->msg_id = 0;
573
574         } else {
575                 bool is_closed = false;
576
577                 if (ret == COMPOSER_RETURN_NO_SIM) {
578                         D_EMSG("Send Fail : NO SIM");
579                         Evas_Object *popup = msg_ui_composer_status_popup_show(cd->main_window, cd, MSGC_STR_POP_NOSIM, 1);
580                         elm_object_focus_set(cd->add_button, EINA_TRUE);
581
582                         if (cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER || cd->composer_mode == MSG_COMPOSER_MODE_FORWARD) {
583                                 is_closed = true;
584                                 evas_object_event_callback_add(popup, EVAS_CALLBACK_DEL, __nosim_popup_delete_cb, cd);
585                         } else if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER) {
586                                 __msgc_show_bubble_view(cd, tid);
587                         }
588
589                         msg_ui_composer_clear(cd);
590                 } else {
591                         D_EMSG("Send Fail : Unable Send");
592                         if ((cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER || cd->composer_mode == MSG_COMPOSER_MODE_FORWARD)) {
593                                 /* set saved msg flag */
594                                 cd->disable_auto_save_mode = true;
595                                 ug_destroy_me(cd->ug);
596                         } else {
597                                 msg_ui_composer_status_popup_show(cd->main_window, cd, MSGC_STR_POP_UNABLE_SEND, COMPOSER_STATUS_POPUP_DEFAULT_TIME);
598                                 elm_object_focus_set(cd->add_button, EINA_TRUE);
599                         }
600                 }
601
602                 if (!is_closed) {
603                         cd->composer_mode = MSG_COMPOSER_MODE_NORMAL;
604                         cd->msg_id = 0;
605                 }
606
607                 goto error_return;
608         }
609
610         msg_ui_composer_set_body_keypad_layout(cd, ELM_INPUT_PANEL_LAYOUT_NORMAL);
611         msg_ui_composer_message_destroy();
612         D_LEAVE;
613         return;
614
615 error_return:
616         msg_ui_composer_set_body_keypad_layout(cd, ELM_INPUT_PANEL_LAYOUT_NORMAL);
617         msg_ui_composer_message_destroy();
618
619         if (cd->send_button)
620                 elm_object_disabled_set(cd->send_button, EINA_FALSE);
621
622         D_LEAVE;
623 }
624
625 void msg_ui_composer_body_send_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
626 {
627         D_ENTER;
628         D_MSG_RETM_IF(data == NULL, "Composer Data is NULL");
629
630         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
631
632         if (cd->send_button)
633                 elm_object_disabled_set(cd->send_button, EINA_TRUE);
634
635         cd->send_check_exception_type = SEND_CHECK_EXCEPTION_TYPE_NONE;
636         msg_ui_composer_body_make_and_send_message(cd, cd->send_check_exception_type);
637
638         D_LEAVE;
639         return;
640 }
641
642 void msg_ui_composer_body_add_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
643 {
644         D_ENTER;
645
646         if (!data) {
647                 MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] error data is NULL");
648                 return;
649         }
650
651         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
652
653         if (cd->add_button_clicked)
654                 return;
655
656         cd->add_button_clicked = true;
657         __add_list_popup_show(cd);
658
659         D_LEAVE;
660 }
661
662 void msg_ui_composer_body_entry_maxlength_reached_cb(void *data, Evas_Object *obj, void *event_info)
663 {
664         D_ENTER;
665         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
666         D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
667
668         msg_ui_composer_common_tickernoti(cd, COMPOSER_TICKERNOTI_MAXLENGHT_CHAR);
669
670         D_LEAVE;
671 }
672
673 void msg_ui_composer_body_entry_changed_cb(void *data, Evas_Object *obj, void *event_info)
674 {
675         D_ENTER;
676         D_MSG_RETM_IF(data == NULL, "Composer Data is NULL");
677         D_MSG_RETM_IF(obj == NULL, "entry obj is NULL");
678
679         MSG_COMPOSER_VIEW_DATA_S *cd = data;
680         MSG_COMPOSER_BODY_PAGE_S *page_data = NULL;
681
682         page_data = evas_object_data_get(obj, "page_data");
683         if (page_data == NULL)
684                 return;
685
686         char *body_text = elm_entry_markup_to_utf8(elm_entry_entry_get(obj));
687         if (body_text == NULL)
688                 return;
689
690         int text_len = strlen(body_text);
691         if (text_len <= 0) {
692                 page_data->text_info.encode = COMPOSER_CHAR_ENCODE_UNICODE;
693                 page_data->text_info.char_count = 0;
694         } else {
695                 page_data->text_info.encode = msg_ui_composer_body_entry_char_count(cd, (const char *)body_text, &page_data->text_info.char_count, &page_data->text_info.page_size);
696         }
697         g_free(body_text);
698
699         msg_ui_composer_message_type_check_and_change(cd);
700
701         msg_ui_composer_body_info_area_update(cd);
702
703         if (msg_ui_composer_common_is_send_possible(cd)) {
704                 elm_object_disabled_set(cd->send_button, EINA_FALSE);
705                 msg_ui_composer_body_update_send_btn_icon(cd, false);
706         } else {
707                 elm_object_disabled_set(cd->send_button, EINA_TRUE);
708                 msg_ui_composer_body_update_send_btn_icon(cd, true);
709         }
710
711         D_LEAVE;
712 }
713
714 void msg_ui_composer_body_entry_press_cb(void *data, Evas_Object *obj, void *event_info)
715 {
716         D_ENTER;
717         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
718         D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
719
720         if (msg_ui_composer_recipient_addr_type_get(cd->recipient) == COMPOSER_RECP_ADDR_INVALID) {
721                 elm_entry_context_menu_disabled_set(obj, EINA_TRUE);
722                 elm_entry_magnifier_disabled_set(obj, EINA_TRUE);
723         } else {
724                 elm_entry_context_menu_disabled_set(obj, EINA_FALSE);
725                 elm_entry_magnifier_disabled_set(obj, EINA_FALSE);
726         }
727
728         D_LEAVE;
729 }
730
731 void msg_ui_composer_body_entry_clicked_cb(void *data, Evas_Object *obj, void *event_info)
732 {
733         D_ENTER;
734         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
735         D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
736
737         int attach_count = msg_ui_composer_get_attach_count(cd);
738
739         if (attach_count > 1)
740                 msg_ui_composer_contract_attach_list(cd);
741
742         D_LEAVE;
743 }
744
745 void msg_ui_composer_body_entry_unfocused_cb(void *data, Evas_Object *obj, void *event_info)
746 {
747         D_ENTER;
748
749         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
750         D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
751
752         if (cd->msg_type == COMPOSER_MSG_TYPE_MMS) {
753                 MSG_COMPOSER_BODY_S *body_data = &cd->body_data;
754
755                 int page_count = body_data->page_count;
756
757                 if (page_count == 1) {
758                         D_MSG("There is 1 page !!!");
759                 } else {
760                         MSG_COMPOSER_BODY_PAGE_S *page_data = evas_object_data_get(obj, "page_data");
761                         if (page_data == NULL) {
762                                 D_EMSG("page_data is NULL");
763                         } else {
764                                 /* hide delete button */
765                                 D_MSG("hide delete button");
766                                 edje_object_signal_emit(_EDJ(page_data->upper_layout), "hide.delete", "*");
767                         }
768                 }
769         }
770
771         D_LEAVE;
772 }
773
774 void msg_ui_composer_body_entry_focused_cb(void *data, Evas_Object *obj, void *event_info)
775 {
776         D_ENTER;
777
778         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
779         D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
780
781         if (msg_ui_composer_recipient_addr_type_get(cd->recipient) == COMPOSER_RECP_ADDR_INVALID) {
782                 /* if focused_cb is called twice becuase of double click, move focus to popup */
783                 if (msg_ui_composer_popup_exist(cd))
784                         msg_ui_composer_popup_focus(cd);
785
786                 return;
787         }
788
789         if (cd->msg_type == COMPOSER_MSG_TYPE_MMS) {
790                 MSG_COMPOSER_BODY_S *body_data = &cd->body_data;
791
792                 Eina_List *page_list = body_data->page_list;
793                 int page_count = body_data->page_count;
794
795                 if (page_count == 1) {
796                         D_MSG("page NO.1 focused !!!");
797                         cd->current_edit_entry = 0;
798                 } else {
799                         MSG_COMPOSER_BODY_PAGE_S *page_data = NULL;
800                         int i = 0;
801
802                         for (i = 0; i < page_count; i++) {
803                                 page_data = (MSG_COMPOSER_BODY_PAGE_S *)eina_list_nth(page_list, i);
804                                 if (page_data->entry == obj) {
805                                         D_MSG("page NO.[%d]/[%d] focused !!!", i + 1, page_count);
806                                         cd->current_edit_entry = i;
807                                         break;
808                                 }
809                         }
810                         page_data = evas_object_data_get(obj, "page_data");
811                         if (page_data == NULL) {
812                                 D_EMSG("page_data is NULL");
813                         } else {
814                                 /* show delete button */
815                                 D_MSG("show delete button");
816                                 edje_object_signal_emit(_EDJ(page_data->upper_layout), "show.delete", "*");
817                         }
818                 }
819         } else if (cd->msg_type == COMPOSER_MSG_TYPE_SMS) {
820                 cd->current_edit_entry = 0;
821         } else {
822                 D_MSG("message composer invalid message type");
823         }
824
825         msg_ui_composer_last_focused_entry_set(data, obj);
826
827         D_LEAVE;
828 }
829
830 void msg_ui_composer_body_page_del_btn_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
831 {
832         D_ENTER;
833         D_MSG_RETM_IF(obj == NULL, "obj is NULL");
834         elm_image_file_set(obj, MSG_IMAGES_EDJ, MSGC_IMG_DEL_BTN_PRESS_ICON);
835 }
836
837 void msg_ui_composer_body_page_del_btn_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
838 {
839         D_ENTER;
840         D_MSG_RETM_IF(obj == NULL, "obj is NULL");
841         elm_image_file_set(obj, MSG_IMAGES_EDJ, MSGC_IMG_PAGE_DEL_ICON);
842 }
843
844 void msg_ui_composer_body_page_del_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
845 {
846         D_ENTER;
847
848         if (!data) {
849                 MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] Callback data is NULL");
850                 return;
851         }
852
853         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
854         Evas_Object *layout = evas_object_data_get(obj, "layout");
855
856         msg_ui_composer_mms_body_remove_page(cd, layout);
857
858         msg_ui_composer_message_type_check_and_change(cd);
859
860         msg_ui_composer_body_info_area_update(cd);
861
862         /* in invalid recipient case, give focus to other widget to call verify_cb of recipient */
863         if (msg_ui_composer_last_focus_is_recipient(cd)) {
864                 const char *recipient = msg_ui_composer_recipient_entry_text_get(cd->recipient);
865
866                 if (recipient && recipient[0] != '\0') {
867                         if (!msg_ui_composer_recipient_vaild_check(recipient))
868                                 elm_object_focus_set(cd->back_btn, EINA_TRUE);
869                 }
870         }
871         D_LEAVE;
872 }
873
874 static void __msg_ui_composer_body_launch_media_item(void *data, Evas_Object *obj)
875 {
876         D_ENTER;
877         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
878         D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
879         D_MSG_RETM_IF(obj == NULL, "obj is NULL");
880
881         Evas_Object *layout = NULL;
882         MSG_COMPOSER_BODY_PAGE_S *page_data = NULL;
883         MSG_COMPOSER_BODY_S *body_data = &cd->body_data;
884         Eina_List *page_list = body_data->page_list;
885         int page_count = body_data->page_count;
886         int i = 0;
887         char file_path[COMPOSER_FILEPATH_LEN_MAX + 1] = {0, };
888
889         layout = evas_object_data_get(obj, "layout");
890
891         if (!layout || !page_list) {
892                 D_EMSG("Invalid data layout = %x, page_list = %x", layout, page_list);
893                 return;
894         }
895
896         for (i = 0; i < page_count; i++) {
897                 page_data = (MSG_COMPOSER_BODY_PAGE_S *)eina_list_nth(page_list, i);
898
899                 if (!page_data) {
900                         D_EMSG("page data is NULL !!!");
901                         return;
902                 }
903
904                 if (page_data->sound_item == layout) {
905                         strncpy(file_path, page_data->sound_file_path, COMPOSER_FILEPATH_LEN_MAX);
906                         break;
907                 } else if (page_data->image_item == layout) {
908                         strncpy(file_path, page_data->image_file_path, COMPOSER_FILEPATH_LEN_MAX);
909                         break;
910                 }
911         }
912
913         if (file_path[0] != '\0') {
914                 COMPOSER_EXT_TYPE_E type = COMPOSER_EXT_TYPE_COMMON;
915                 COMPOSER_MEDIA_TYPE_E media_type = msg_composer_get_media_type(file_path);
916
917                 if (media_type == COMPOSER_MEDIA_TYPE_IMAGE) {
918                         type = COMPOSER_EXT_TYPE_IMAGE;
919                 } else if (media_type == COMPOSER_MEDIA_TYPE_VIDEO) {
920                         type = COMPOSER_EXT_TYPE_COMMON;
921                 } else if (media_type == COMPOSER_MEDIA_TYPE_AUDIO) {
922                         type = COMPOSER_EXT_TYPE_SOUND;
923                 } else {
924                         type = COMPOSER_EXT_TYPE_COMMON;
925                 }
926
927                 msg_ui_composer_external_call(cd, type, file_path);
928         }
929
930         D_LEAVE;
931 }
932
933 void msg_ui_composer_body_media_layout_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
934 {
935         D_ENTER;
936         D_MSG_RETM_IF(data == NULL, "data is NULL");
937         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
938
939         __msg_ui_composer_body_launch_media_item(cd, obj);
940
941         D_LEAVE;
942 }
943
944 void msg_ui_composer_body_media_thumb_icon_clicked_cb(void *data, Evas_Object *obj, void *event_info)
945 {
946         D_ENTER;
947         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
948         D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
949
950         if (!cd->is_default_body_size)
951                 __msg_ui_composer_body_launch_media_item(cd, obj);
952
953         D_LEAVE;
954 }
955
956 void msg_ui_composer_body_media_del_btn_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
957 {
958         D_ENTER;
959         D_MSG_RETM_IF(obj == NULL, "obj is NULL");
960         int media_type = 0;
961
962         media_type = (int)evas_object_data_get(obj, "media_type");
963         D_MSG("media_type = %d", media_type);
964
965         if (media_type == COMPOSER_MEDIA_TYPE_AUDIO)
966                 elm_image_file_set(obj, MSG_IMAGES_EDJ, MSGC_IMG_DEL_BTN_PRESS_ICON);
967         else
968                 elm_image_file_set(obj, MSG_IMAGES_EDJ, MSGC_IMG_INSERT_DEL_PRESS_ICON);
969 }
970
971 void msg_ui_composer_body_media_del_btn_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
972 {
973         D_ENTER;
974         D_MSG_RETM_IF(obj == NULL, "obj is NULL");
975         int media_type = 0;
976
977         media_type = (int)evas_object_data_get(obj, "media_type");
978
979         if (media_type == COMPOSER_MEDIA_TYPE_AUDIO)
980                 elm_image_file_set(obj, MSG_IMAGES_EDJ, MSGC_SOUND_INSERT_DEL_ICON);
981         else
982                 elm_image_file_set(obj, MSG_IMAGES_EDJ, MSGC_IMG_INSERT_DEL_ICON);
983 }
984
985 void msg_ui_composer_body_media_del_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
986 {
987         D_ENTER;
988
989         if (!data || !obj) {
990                 MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] NULL pointer error");
991                 return;
992         }
993
994         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
995         MSG_COMPOSER_BODY_S *body_data = &cd->body_data;
996         MSG_COMPOSER_BODY_PAGE_S *page_data = NULL;
997         Eina_List *page_list = body_data->page_list;
998         int page_count = body_data->page_count;
999         int body_length = 0;
1000
1001         if (!cd->is_default_body_size) {
1002                 Evas_Object *delete_layout = (Evas_Object *)evas_object_data_get(obj, "layout");
1003
1004                 int i = 0;
1005
1006                 for (i = 0; i < page_count; i++) {
1007                         page_data = (MSG_COMPOSER_BODY_PAGE_S *)eina_list_nth(page_list, i);
1008
1009                         if (!page_data) {
1010                                 MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT, "[ASSERT] page data is NULL !!!");
1011                                 return;
1012                         }
1013
1014                         if (page_data->sound_item == delete_layout) {
1015                                 msg_ui_composer_mms_insert_item_remove(cd, delete_layout, COMPOSER_MEDIA_TYPE_AUDIO);
1016
1017                                 char *body_text = elm_entry_markup_to_utf8(elm_entry_entry_get(page_data->entry));
1018                                 if (!body_text)
1019                                         return;
1020
1021                                 body_length = strlen(body_text);
1022
1023                                 if (body_length == 0 && !page_data->is_image_item)
1024                                         msg_ui_composer_mms_body_remove_page(cd, page_data->layout);
1025
1026                                 g_free(body_text);
1027
1028                                 break;
1029                         } else if (page_data->image_item == delete_layout) {
1030
1031                                 char *body_text = elm_entry_markup_to_utf8(elm_entry_entry_get(page_data->entry));
1032                                 if (!body_text)
1033                                         return;
1034
1035                                 body_length = strlen(body_text);
1036
1037                                 if (page_data->isVideo) {
1038                                         msg_ui_composer_mms_insert_item_remove(cd, delete_layout, COMPOSER_MEDIA_TYPE_VIDEO);
1039                                 } else {
1040                                         msg_ui_composer_mms_insert_item_remove(cd, delete_layout, COMPOSER_MEDIA_TYPE_IMAGE);
1041                                 }
1042
1043                                 if (body_length == 0 && !page_data->is_sound_item)
1044                                         msg_ui_composer_mms_body_remove_page(cd, page_data->layout);
1045
1046                                 g_free(body_text);
1047                                 break;
1048                         }
1049                 }
1050
1051                 msg_ui_composer_message_type_check_and_change(cd);
1052         }
1053
1054         /* in invalid recipient case, give focus to other widget to call verify_cb of recipient */
1055         if (msg_ui_composer_last_focus_is_recipient(cd)) {
1056                 const char *recipient = msg_ui_composer_recipient_entry_text_get(cd->recipient);
1057
1058                 if (recipient && recipient[0] != '\0') {
1059                         if (!msg_ui_composer_recipient_vaild_check(recipient))
1060                                 elm_object_focus_set(cd->back_btn, EINA_TRUE);
1061                 }
1062         }
1063
1064         D_LEAVE;
1065 }
1066
1067 void msg_ui_composer_body_body_layout_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
1068 {
1069         D_ENTER;
1070
1071         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
1072         D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
1073         Evas_Coord x = 0;
1074         Evas_Coord y = 0;
1075         Evas_Coord w = 0;
1076         Evas_Coord h = 0;
1077
1078         evas_object_geometry_get(obj, &x, &y, &w, &h);
1079         D_MSG("body layout height = %d", h);
1080
1081         cd->ly_body_h = h;
1082
1083         if (h >= COMPOSER_ENOUGH_TEXT_RENDERING_BODY_HEIGHT)
1084                 msg_ui_composer_body_info_area_update(cd);
1085         else
1086                 edje_object_part_text_set(_EDJ(cd->ly_body), "text.char_count", "");
1087
1088         D_LEAVE;
1089 }
1090
1091 void msg_ui_composer_body_body_layout_clicked_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
1092 {
1093         D_ENTER;
1094         D_MSG_RETM_IF(data == NULL, "data is NULL");
1095         MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
1096
1097         msg_ui_composer_body_focus_set(cd, 0);
1098
1099         evas_object_event_callback_del(cd->body_box, EVAS_CALLBACK_MOUSE_UP, msg_ui_composer_body_body_layout_clicked_cb);
1100
1101         cd->is_default_body_size = false;
1102
1103         D_LEAVE;
1104 }
1105