2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include "msg-ui-composer-recipient.h"
20 #include "msg-ui-composer-util.h"
21 #include "msg-ui-composer-common.h"
22 #include "msg-ui-composer-recipient-callback.h"
23 #include "msg-ui-composer-message.h"
24 #include "msg-ui-composer-popup.h"
25 #include "msg-ui-composer-external.h"
27 #define CONTACT_NAME_IS_NOT_SUPPORT
28 /*==================================================================================================
29 * FUNCTION IMPLEMENTATIONS
30 *==================================================================================================*/
31 void msg_ui_composer_recipient_create_change_number_popup(void *data)
34 MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
35 D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
37 RECIPIENT_S *rd = cd->recipient;
38 D_MSG_RETM_IF(rd == NULL, "Recipient Data is NULL");
40 Evas_Object *popup = NULL;
41 Evas_Object *genlist = NULL;
42 int ct_err = CONTACTS_ERROR_NONE;
44 RECIPIENT_ITEM_S *r_item = NULL;
45 CONTACT_ITEM_S *ct_item = NULL;
47 contacts_list_h list = NULL;
48 contacts_query_h query = NULL;
49 contacts_filter_h filter = NULL;
51 r_item = msg_ui_composer_recipient_selected_item_data_get(cd);
52 D_MSG_RETM_IF(r_item == NULL, "Selected Data is NULL");
53 D_MSG_RETM_IF(r_item->index <= 0, "Selected index <= 0");
55 rd->change_number_itc.item_style = "2text.3";
56 rd->change_number_itc.func.text_get = msg_ui_recipient_change_number_gl_text_get;
57 rd->change_number_itc.func.content_get = NULL;
58 rd->change_number_itc.func.state_get = NULL;
59 rd->change_number_itc.func.del = msg_ui_recipient_change_number_gl_del;
61 genlist = elm_genlist_add(cd->main_window);
62 evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
63 evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
64 evas_object_data_set(genlist, "selected_item", r_item);
66 /* create query and get list for numbers */
67 contacts_query_create(_contacts_person_number._uri, &query);
68 contacts_filter_create(_contacts_person_number._uri, &filter);
69 contacts_filter_add_int(filter, _contacts_person_number.person_id, CONTACTS_MATCH_EXACTLY, r_item->index);
70 contacts_query_set_filter(query, filter);
72 ct_err = contacts_db_get_records_with_query(query, 0, 0, &list);
73 contacts_filter_destroy(filter);
74 contacts_query_destroy(query);
78 if (ct_err != CONTACTS_ERROR_NONE) {
79 D_EMSG("contacts_db_get_records_with_query is failed error_code = %d", ct_err);
80 contacts_list_destroy(list, true);
84 while (CONTACTS_ERROR_NONE == ct_err) {
85 contacts_record_h ct_value = NULL;
88 contacts_list_get_current_record_p(list, &ct_value);
91 contacts_record_get_int(ct_value, _contacts_person_number.type, &type);
93 if (type != CONTACTS_NUMBER_TYPE_ASSISTANT) {
96 contacts_record_get_str_p(ct_value, _contacts_person_number.number, &content);
97 D_MSG("[%d][%d]%s", r_item->index, type, content);
100 if (strcmp(r_item->recipient, content)) {
101 ct_item = (CONTACT_ITEM_S *)calloc(1, sizeof(CONTACT_ITEM_S));
103 ct_item->type = COMPOSER_ADDR_TYPE_NUMBER;
104 ct_item->contact_type = type;
105 strncpy(ct_item->recipient, content, sizeof(ct_item->recipient) - 1);
107 elm_genlist_item_append(genlist, &rd->change_number_itc, ct_item, NULL, ELM_GENLIST_ITEM_NONE, msg_ui_recipient_change_number_popup_list_clicked_cb, cd);
111 D_EMSG("calloc is failed");
118 ct_err = contacts_list_next(list);
121 contacts_list_destroy(list, true);
124 /* create query and get list for emails */
125 contacts_query_create(_contacts_person_email._uri, &query);
126 contacts_filter_create(_contacts_person_email._uri, &filter);
127 contacts_filter_add_int(filter, _contacts_person_email.person_id, CONTACTS_MATCH_EXACTLY, r_item->index);
128 contacts_query_set_filter(query, filter);
130 ct_err = contacts_db_get_records_with_query(query, 0, 0, &list);
131 contacts_filter_destroy(filter);
132 contacts_query_destroy(query);
134 if (ct_err != CONTACTS_ERROR_NONE) {
135 D_EMSG("contacts_db_get_records_with_query is failed error_code = %d", ct_err);
136 contacts_list_destroy(list, true);
140 while (CONTACTS_ERROR_NONE == ct_err) {
141 contacts_record_h ct_value = NULL;
144 contacts_list_get_current_record_p(list, &ct_value);
147 char *content = NULL;
149 contacts_record_get_int(ct_value, _contacts_person_email.type, &type);
150 contacts_record_get_str_p(ct_value, _contacts_person_email.email, &content);
152 D_MSG("[%d][%d]%s", r_item->index, type, content);
155 if (strcmp(r_item->recipient, content)) {
156 ct_item = (CONTACT_ITEM_S *)calloc(1, sizeof(CONTACT_ITEM_S));
158 ct_item->type = COMPOSER_ADDR_TYPE_EMAIL;
159 ct_item->contact_type = type;
160 strncpy(ct_item->recipient, (char *)content, sizeof(ct_item->recipient) - 1);
162 elm_genlist_item_append(genlist, &rd->change_number_itc, ct_item, NULL, ELM_GENLIST_ITEM_NONE, msg_ui_recipient_change_number_popup_list_clicked_cb, cd);
166 D_EMSG("calloc is failed");
172 ct_err = contacts_list_next(list);
175 contacts_list_destroy(list, true);
180 Evas_Object *box = elm_box_add(cd->main_window);
181 evas_object_size_hint_min_set(box, 0, MSGC_POPUP_GENLIST_H * count * elm_config_scale_get());
182 evas_object_show(genlist);
183 elm_box_pack_end(box, genlist);
184 popup = msg_ui_composer_list_popup_create(cd, _SYSSTR("IDS_COM_SK_SELECT"), box, "min_menustyle");
186 Evas_Object *btn1 = elm_button_add(popup);
187 elm_object_style_set(btn1, "popup_button/default");
188 elm_object_text_set(btn1, _SYSSTR("IDS_COM_SK_CANCEL"));
189 elm_object_part_content_set(popup, "button1", btn1);
190 evas_object_smart_callback_add(btn1, "clicked", msg_ui_recipient_change_number_popup_btn_clicked_cb, cd);
192 elm_object_focus_allow_set(popup, EINA_TRUE);
193 elm_object_focus_set(popup, EINA_TRUE);
195 rd->popup_change_number = popup;
200 Eina_Bool msg_ui_composer_recipient_show_invalid_address_popup(void *data)
203 MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
204 D_MSG_RETVM_IF(cd == NULL, EINA_FALSE, "Composer Data is NULL");
206 RECIPIENT_S *rd = cd->recipient;
207 D_MSG_RETVM_IF(rd == NULL, EINA_FALSE, "recipient data is NULL");
209 rd->notify_popup_idler = NULL;
211 if (!msg_ui_composer_popup_exist(cd) && !cd->loaded_ug && !cd->loaded_aul) {
212 /* show popup when message window has a top focus.(active state of app) */
213 if (elm_win_focus_get(cd->main_window) == EINA_TRUE) {
214 if (cd->isclosed == false) {
215 if (cd->hide_keypad_op == false) {
216 msg_ui_composer_status_btn_popup_show(cd, MSGC_STR_NOTI_RECIPIENT_INVALID, 0, MSGC_STR_BUTTON_OK);
218 /* skip showing invalid popup if back btn of composer should be worked for hiding keypad operation - sip concept */
219 /* move focus to MBE */
220 msg_ui_composer_last_focus_load(cd);
222 Evas_Object *last_focus_eo = msg_ui_composer_last_focused_entry_get(cd);
223 Evas_Object *entry = elm_multibuttonentry_entry_get(last_focus_eo);
224 elm_entry_input_panel_hide(entry);
226 /* reset hide_keypad_op */
227 cd->hide_keypad_op = false;
238 RECIPIENT_ITEM_S *msg_ui_composer_recipient_selected_item_data_get(MSG_COMPOSER_VIEW_DATA_S *cd)
241 D_MSG_RETVM_IF(cd == NULL, NULL, "Composer Data is NULL");
243 RECIPIENT_S *rd = cd->recipient;
244 D_MSG_RETVM_IF(rd == NULL, NULL, "Recipient Data is NULL");
246 RECIPIENT_ITEM_S *r_item = NULL;
248 r_item = rd->sel_r_item;
250 D_EMSG("No data in Selected MBE item");
259 void msg_ui_composer_recipient_selected_delete(MSG_COMPOSER_VIEW_DATA_S *cd)
262 D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
264 RECIPIENT_S *rd = cd->recipient;
265 D_MSG_RETM_IF(rd == NULL, "Recipient Data is NULL");
267 Elm_Object_Item *mbe_item = NULL;
268 mbe_item = rd->sel_mbe_item;
270 D_EMSG("There is no Selected MBE item");
274 elm_object_item_del(mbe_item);
275 msg_ui_composer_message_type_check_and_change(cd);
280 void msg_ui_composer_recipient_selected_edit(MSG_COMPOSER_VIEW_DATA_S *cd)
283 D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
285 RECIPIENT_S *rd = cd->recipient;
286 D_MSG_RETM_IF(rd == NULL, "Recipient Data is NULL");
288 Elm_Object_Item *mbe_item = NULL;
289 Evas_Object *sc_entry = NULL;
290 #ifdef CONTACT_NAME_IS_NOT_SUPPORT
291 RECIPIENT_ITEM_S *r_item = NULL;
293 const char *label_selected_bt = NULL;
296 mbe_item = rd->sel_mbe_item;
298 D_EMSG("There is no Selected MBE item");
302 #ifdef CONTACT_NAME_IS_NOT_SUPPORT
303 r_item = msg_ui_composer_recipient_selected_item_data_get(cd);
304 D_MSG_RETM_IF(r_item == NULL, "Selected Data is NULL");
306 sc_entry = elm_multibuttonentry_entry_get(rd->mbe);
307 elm_entry_entry_set(sc_entry, r_item->recipient);
308 elm_entry_cursor_line_end_set(sc_entry);
310 label_selected_bt = elm_object_item_text_get(mbe_item);
312 sc_entry = elm_multibuttonentry_entry_get(rd->mbe);
313 elm_entry_entry_set(sc_entry, label_selected_bt);
314 elm_entry_cursor_line_end_set(sc_entry);
316 elm_object_item_del(mbe_item);
317 msg_ui_composer_message_type_check_and_change(cd);
322 void msg_ui_composer_recipient_select_popup_create(void *data)
325 D_MSG_RETM_IF(data == NULL, "data param is NULL");
326 MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
327 RECIPIENT_S *rd = cd->recipient;
328 D_MSG_RETM_IF(rd == NULL, "recipient data is NULL");
330 Evas_Object *popup = NULL;
331 Evas_Object *list = NULL;
332 Evas_Object *btn1 = NULL;
333 RECIPIENT_ITEM_S *r_item = NULL;
334 char title_str[DEF_BUF_LEN + 1] = {0,};
335 char *markup_title_str = NULL;
337 r_item = msg_ui_composer_recipient_selected_item_data_get(cd);
339 D_EMSG("r_item is NULL");
344 list = elm_list_add(cd->main_window);
345 elm_list_mode_set(list, ELM_LIST_EXPAND);
347 elm_list_item_append(list, _SYSSTR("IDS_COM_OPT_DELETE"), NULL, NULL, msg_ui_recipient_select_popup_list_clicked_cb, cd);
348 elm_list_item_append(list, _SYSSTR("IDS_COM_BODY_EDIT"), NULL, NULL, msg_ui_recipient_select_popup_list_clicked_cb, cd);
350 if (cd->isAppControl && cd->isEmulator) {
351 snprintf(title_str, sizeof(title_str), "%s", r_item->recipient);
353 if (r_item->index > 0) {
354 if (IsMultipleNumber(r_item->index)) {
355 elm_list_item_append(list, _MSGSTR("IDS_MSGC_OPT_USE_OTHER_CONTACT_INFO_ABB"), NULL, NULL, msg_ui_recipient_select_popup_list_clicked_cb, cd);
357 elm_list_item_append(list, _MSGSTR("IDS_MSGC_OPT_VIEW_CONTACT"), NULL, NULL, msg_ui_recipient_select_popup_list_clicked_cb, cd);
360 if (r_item->display_name[0] != '\0')
361 snprintf(title_str, sizeof(title_str), "%s <%s>", r_item->display_name, r_item->recipient);
363 snprintf(title_str, sizeof(title_str), "%s", r_item->recipient);
365 elm_list_item_append(list, _SYSSTR("IDS_COM_OPT_ADD_TO_CONTACTS"), NULL, NULL, msg_ui_recipient_select_popup_list_clicked_cb, cd);
366 snprintf(title_str, sizeof(title_str), "%s", r_item->recipient);
372 markup_title_str = elm_entry_utf8_to_markup(title_str);
373 popup = msg_ui_composer_list_popup_create(data, markup_title_str, list, "min_menustyle");
375 if (markup_title_str)
376 g_free(markup_title_str);
378 btn1 = elm_button_add(popup);
379 elm_object_style_set(btn1, "popup_button/default");
380 elm_object_text_set(btn1, _SYSSTR("IDS_COM_BODY_CLOSE"));
381 elm_object_part_content_set(popup, "button1", btn1);
382 evas_object_smart_callback_add(btn1, "clicked", msg_ui_recipient_select_popup_btn_clicked_cb, cd);
384 elm_object_focus_allow_set(popup, EINA_TRUE);
385 elm_object_focus_set(popup, EINA_TRUE);
387 rd->popup_selected = popup;
392 static Evas_Object *__mbe_create(RECIPIENT_S *rd)
395 Evas_Object *mbe = NULL;
396 Evas_Object *entry = NULL;
397 Ecore_IMF_Context *context = NULL;
398 Elm_Entry_Filter_Limit_Size limit_filter;
400 char label_txt[TO_FIELD_LABEL_SIZE_MAX] = { 0, };
403 mbe = elm_multibuttonentry_add(rd->parent);
404 evas_object_size_hint_weight_set(mbe, EVAS_HINT_EXPAND, 0.0);
405 evas_object_size_hint_align_set(mbe, EVAS_HINT_FILL, 0.0);
406 evas_object_show(mbe);
409 len = snprintf(label_txt, (gsize)sizeof(label_txt), "%s:", MSGC_STR_TO);
411 D_EMSG("len = %d", len);
412 } else if (len > 0) {
413 label_txt[len] = '\0';
414 elm_object_text_set(mbe, label_txt);
416 D_EMSG("len = %d", len);
420 elm_object_part_text_set(mbe, "guide", MSGC_STR_ADD_RECIPIENT);
422 /* set mbe callback */
423 evas_object_smart_callback_add(mbe, "item,added", msg_ui_recipient_mbe_item_added_cb, rd->cd);
424 evas_object_smart_callback_add(mbe, "item,deleted", msg_ui_recipient_mbe_item_deleted_cb, rd->cd);
425 evas_object_smart_callback_add(mbe, "item,clicked", msg_ui_recipient_mbe_item_clicked_cb, rd->cd);
426 evas_object_smart_callback_add(mbe, "expanded", msg_ui_recipient_mbe_expanded_cb, rd);
427 evas_object_smart_callback_add(mbe, "contracted", msg_ui_recipient_mbe_contracted_cb, rd);
429 evas_object_smart_callback_add(mbe, "focused", msg_ui_recipient_mbe_focused_cb, rd->cd);
430 evas_object_smart_callback_add(mbe, "clicked", msg_ui_recipient_mbe_clicked_cb, rd->cd);
431 evas_object_smart_callback_add(mbe, "unfocused", msg_ui_recipient_mbe_unfocused_cb, rd->cd);
432 evas_object_event_callback_add(mbe, EVAS_CALLBACK_DEL, msg_ui_recipient_mbe_delete_cb, rd->cd);
434 elm_multibuttonentry_item_filter_append(mbe, msg_ui_recipient_mbe_item_verify_cb, rd->cd);
436 entry = elm_multibuttonentry_entry_get(mbe);
437 evas_object_smart_callback_add(entry, "changed", msg_ui_recipient_entry_changed_cb, rd->cd);
438 evas_object_smart_callback_add(entry, "preedit,changed", msg_ui_recipient_entry_changed_cb, rd->cd);
439 /* activated is added for enter key of keypad */
440 evas_object_smart_callback_add(entry, "activated", msg_ui_recipient_entry_activated_cb, rd->cd);
442 elm_entry_markup_filter_prepend(entry, msg_ui_recipient_entry_filter_cb, rd->cd);
444 /* set entry max character count*/
445 limit_filter.max_char_count = COMPOSER_RECIPIENT_ADDRESS_VAL_LEN_MAX;
446 elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, &limit_filter);
448 context = elm_entry_imf_context_get(entry);
449 ecore_imf_context_input_panel_event_callback_add((Ecore_IMF_Context *)context, ECORE_IMF_INPUT_PANEL_STATE_EVENT, msg_ui_composer_entry_imf_state_cb, rd->cd);
450 ecore_imf_context_input_panel_event_callback_add((Ecore_IMF_Context *)context, ECORE_IMF_INPUT_PANEL_GEOMETRY_EVENT, msg_ui_composer_entry_imf_resize_cb, rd->cd);
456 static Evas_Object *__scroller_create(Evas_Object *parent)
459 Evas_Object *scroller;
460 scroller = elm_scroller_add(parent);
461 evas_object_size_hint_weight_set(scroller, EVAS_HINT_EXPAND, 0.0);
462 evas_object_size_hint_align_set(scroller, EVAS_HINT_FILL, EVAS_HINT_FILL);
463 elm_scroller_bounce_set(scroller, EINA_FALSE, EINA_FALSE);
464 elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
465 evas_object_show(scroller);
471 static Evas_Object *__msg_ui_composer_recipient_to_layout_create(RECIPIENT_S *rd)
477 Evas_Object *layout = NULL;
478 Evas_Object *parent = rd->parent;
480 layout = msg_ui_composer_load_edj(parent, MSGC_UI_DEFAULT_EDJ, MSGC_EDJ_GRP_RECIPIENT_TO_FIELD);
482 D_EMSG("layout is NULL");
486 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
487 evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
488 evas_object_show(layout);
490 Evas_Object *to_sc = __scroller_create(parent);
493 Evas_Object *box = elm_box_add(parent);
494 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
495 evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
496 evas_object_show(box);
498 Evas_Object *box2 = elm_box_add(parent);
499 evas_object_size_hint_weight_set(box2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
500 evas_object_size_hint_align_set(box2, EVAS_HINT_FILL, 0.0);
501 evas_object_show(box2);
503 elm_box_pack_end(box, box2);
505 Evas_Object *mbe = __mbe_create(rd);
508 elm_object_content_set(to_sc, box);
509 elm_box_pack_end(box2, mbe);
510 elm_object_part_content_set(layout, "swl.mbe_scroll", to_sc);
512 MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)rd->cd;
514 if (!cd->isAppControl || !cd->isEmulator) {
515 Evas_Object *contact_btn = elm_button_add(rd->parent);
516 elm_object_theme_set(contact_btn, cd->th);
517 elm_object_style_set(contact_btn, "msg/contact_btn");
519 Evas_Object *icon = elm_icon_add(contact_btn);
520 elm_image_file_set(icon, MSG_IMAGES_EDJ, MSGC_IMG_CONTACT_BUTTON_ICON);
522 evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
523 elm_image_resizable_set(icon, EINA_TRUE, EINA_TRUE);
525 elm_object_part_content_set(contact_btn, "icon", icon);
527 evas_object_smart_callback_add(contact_btn, "clicked", msg_ui_recipient_contact_btn_clicked_cb, rd->cd);
528 elm_object_part_content_set(layout, "swl.closed_btn", contact_btn);
530 edje_object_signal_emit(_EDJ(layout), "hide.ct_button", "*");
537 static void __msg_ui_composer_recipient_layout_create(RECIPIENT_S *r)
540 D_MSG_RETM_IF(r->parent == NULL, "r->parent is NULL");
544 bx = elm_box_add(r->parent);
545 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0);
546 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
547 evas_object_show(bx);
551 r->ly_to = __msg_ui_composer_recipient_to_layout_create(r);
552 elm_box_pack_end(r->bx_main, r->ly_to);
554 evas_object_event_callback_add(r->bx_main, EVAS_CALLBACK_RESIZE, msg_ui_recipient_resize_cb, r);
559 static RECIPIENT_ITEM_S *__msg_ui_composer_recipient_item_make(
560 COMPOSER_RECP_ADDR_E type,
562 const char *display_name,
563 const char *recipient,
564 const char *image_path)
566 RECIPIENT_ITEM_S *recipient_item;
567 RECIPIENT_ITEM_S r_item;
569 bzero(&r_item, sizeof(r_item));
572 r_item.index = index;
575 strncpy(r_item.recipient, recipient, sizeof(r_item.recipient) - 1);
578 strncpy(r_item.display_name, display_name, sizeof(r_item.display_name) - 1);
581 strncpy(r_item.image_path, image_path, sizeof(r_item.image_path) - 1);
583 recipient_item = calloc(1, sizeof(RECIPIENT_ITEM_S));
584 if (!recipient_item) return NULL;
586 memcpy(recipient_item, &r_item, sizeof(RECIPIENT_ITEM_S));
588 D_MSG("---------- make item start----------");
589 D_MSG(">>type = %d", r_item.type);
590 D_MSG(">>index = %d", r_item.index);
591 D_MSG(">>displayname = %s", r_item.display_name);
592 D_MSG(">>recipient = %s", r_item.recipient);
593 D_MSG(">>image path = %s", r_item.image_path);
594 D_MSG("---------- make item end----------");
595 return recipient_item;
598 RECIPIENT_ITEM_S *msg_ui_composer_recipient_item_make_by_string(const char *str)
600 D_MSG_RETVM_IF(str == NULL, NULL, "str is NULL");
602 COMPOSER_UTIL_ADDRTYPE_E type;
603 RECIPIENT_ITEM_S r_item;
604 RECIPIENT_ITEM_S *recipient_item;
605 #ifndef CONTACT_NAME_IS_NOT_SUPPORT
607 char tmp_display_name1[COMPOSER_RECIPIENT_ADDRESS_VAL_LEN_MAX+1] = {0,};
608 char tmp_display_name2[COMPOSER_RECIPIENT_ADDRESS_VAL_LEN_MAX+1] = {0,};
611 bzero(&r_item, sizeof(r_item));
613 type = get_address_type(str);
614 if (type == COMPOSER_UTIL_ADDRTYPE_NUMBER || type == COMPOSER_UTIL_ADDRTYPE_EMAIL) {
616 strncpy(r_item.recipient, str, sizeof(r_item.recipient)-1);
617 r_item.type = msg_ui_composer_recipient_type_get(r_item.recipient);
618 r_item.index = get_contact_index_by_recipient(str);
619 if (r_item.index <= 0 || get_contact_display_name_by_index(r_item.index, r_item.display_name, sizeof(r_item.display_name))) {
620 strncpy(r_item.display_name, str, sizeof(r_item.display_name)-1);
624 #ifdef CONTACT_NAME_IS_NOT_SUPPORT
625 /* contact name is not supported */
626 r_item.type = COMPOSER_RECP_ADDR_INVALID;
627 strncpy(r_item.recipient, str, sizeof(r_item.recipient)-1);
628 strncpy(r_item.display_name, str, sizeof(r_item.display_name)-1);
630 /*IF string is name*/
631 r_item.index = get_contact_index_by_name(str);
632 if (r_item.index > 0) {
633 ret = get_contact_display_name_by_index(r_item.index, r_item.display_name, sizeof(r_item.display_name)-1);
634 if (COMPOSER_RETURN_SUCCESS != ret){
638 remove_space(r_item.display_name, tmp_display_name1, sizeof(tmp_display_name1)-1);
639 remove_space(str, tmp_display_name2, sizeof(tmp_display_name2)-1);
640 if (g_ascii_strncasecmp(tmp_display_name1, tmp_display_name2, strlen(tmp_display_name1))==0){
641 D_MSG("Contact's name %s = Inputted name %s", r_item.display_name, str);
642 ret = get_contact_default_recipient_by_index(r_item.index, r_item.recipient ,sizeof(r_item.recipient)-1);
643 if (CONTACTS_ERROR_NONE != ret){
647 r_item.type = msg_ui_composer_recipient_type_get(r_item.recipient);
649 D_MSG("Contact's name %s != Inputted name %s", r_item.display_name, str);
650 r_item.type = COMPOSER_RECP_ADDR_INVALID;
652 bzero(r_item.display_name, sizeof(r_item.display_name));
653 strncpy(r_item.display_name, str, sizeof(r_item.display_name)-1);
658 r_item.type = COMPOSER_RECP_ADDR_INVALID;
659 strncpy(r_item.display_name, str, sizeof(r_item.display_name)-1);
664 /*make recipient Item*/
665 recipient_item = __msg_ui_composer_recipient_item_make(r_item.type, r_item.index, r_item.display_name, r_item.recipient, NULL);
666 if (!recipient_item) {
667 D_MSG("Fail of msg_ui_composer_recipient_item_make");
671 return recipient_item;
674 COMPOSER_RETURN_TYPE_E msg_ui_composer_recipient_duplicate_check(RECIPIENT_S *rd, const char *recipient)
677 D_MSG_RETVM_IF(rd == NULL, COMPOSER_RETURN_FAIL, "rd is NULL");
678 D_MSG_RETVM_IF(recipient == NULL, COMPOSER_RETURN_FAIL, "recipient is NULL");
680 RECIPIENT_ITEM_S *recipient_item;
681 Elm_Object_Item *mbe_item;
682 COMPOSER_UTIL_ADDRTYPE_E inp_type;
683 COMPOSER_UTIL_ADDRTYPE_E tmp_type;
685 char inp_str[COMPOSER_RECIPIENT_ADDRESS_VAL_LEN_MAX + 1] = { 0, };
686 char tmp_str[COMPOSER_RECIPIENT_ADDRESS_VAL_LEN_MAX + 1] = { 0, };
691 len = strlen(recipient);
692 inp_type = get_address_type(recipient);
694 mbe_item = elm_multibuttonentry_first_item_get(rd->mbe);
696 recipient_item = elm_object_item_data_get(mbe_item);
698 if (recipient_item) {
699 tmp_type = get_address_type(recipient_item->recipient);
701 if (inp_type == tmp_type) {
702 if (inp_type == COMPOSER_UTIL_ADDRTYPE_NUMBER) {
703 int tlen = strlen(recipient_item->recipient);
705 if (len >= COMPARE_STRING_NUM && tlen >= COMPARE_STRING_NUM) {
706 strncpy(inp_str, recipient, sizeof(inp_str) - 1);
707 strncpy(tmp_str, recipient_item->recipient, sizeof(tmp_str) - 1);
709 g_strreverse(inp_str);
710 g_strreverse(tmp_str);
712 if (!strncmp(inp_str, tmp_str, COMPARE_STRING_NUM)) {
716 } else if (len == tlen) {
717 if (!g_strcmp0(recipient_item->recipient, recipient)) {
723 } else if (inp_type == COMPOSER_UTIL_ADDRTYPE_EMAIL){
724 if (!g_strcmp0(recipient_item->recipient, recipient)) {
729 D_EMSG("Unknown type recipient TODO check recipient");
735 mbe_item = elm_multibuttonentry_item_next_get(mbe_item);
739 D_MSG("Found dup recipient = [%s(%d)] with [%s(%d)]", recipient, strlen(recipient), recipient_item->recipient, strlen(recipient_item->recipient));
740 return COMPOSER_RETURN_RECIPIENT_DUPLICATE;
743 return COMPOSER_RETURN_SUCCESS;
746 int msg_ui_composer_recipient_count_get(RECIPIENT_S *rd)
749 D_MSG_RETVM_IF(rd == NULL, 0, "recipient data is NULL");
750 D_MSG_RETVM_IF(rd->mbe == NULL, 0, "mbe is NULL");
753 Elm_Object_Item *mbe_item;
755 mbe_item = elm_multibuttonentry_first_item_get(rd->mbe);
758 mbe_item = elm_multibuttonentry_item_next_get(mbe_item);
761 D_MSG("recipient count ---------->[%d]", r_count);
766 void msg_ui_composer_recipient_addr_type_set(RECIPIENT_S *rd, COMPOSER_RECP_ADDR_E type)
769 D_MSG_RETM_IF(rd == NULL, "recipient data is NULL");
774 COMPOSER_RECP_ADDR_E msg_ui_composer_recipient_addr_type_get(RECIPIENT_S *rd)
777 D_MSG_RETVM_IF(rd == NULL, COMPOSER_RECP_ADDR_NONE, "recipient data is NULL");
778 D_MSG("rd->type = [%d]", rd->type);
783 COMPOSER_RECP_ADDR_E msg_ui_composer_recipient_type_get(const char *recipient)
786 COMPOSER_RECP_ADDR_E ret = COMPOSER_RECP_ADDR_INVALID;
787 COMPOSER_UTIL_ADDRTYPE_E type;
790 D_PRINT("No Input recipient");
794 len = strlen(recipient);
796 D_PRINT("input recipient length is [%d]", len);
800 type = get_address_type(recipient);
801 if (type == COMPOSER_UTIL_ADDRTYPE_NUMBER) {
803 if (len >= COMPOSER_RECIPIENT_PHONE_NUMBER_LEN_MIN
804 && len <= COMPOSER_RECIPIENT_PHONE_NUMBER_LEN_MAX) {
806 ret = COMPOSER_RECP_ADDR_VALID_NUMBER;
809 } else if (type == COMPOSER_UTIL_ADDRTYPE_EMAIL) {
810 if (len <= COMPOSER_RECIPIENT_ADDRESS_VAL_LEN_MAX ) {
812 ret = COMPOSER_RECP_ADDR_VALID_EMAIL;
819 Eina_Bool msg_ui_composer_recipient_vaild_check(const char *recipient)
824 COMPOSER_UTIL_ADDRTYPE_E type;
827 D_PRINT("No Input recipient");
831 type = get_address_type(recipient);
832 len = strlen(recipient);
835 D_PRINT("input recipient length is [%d]", len);
839 if (type == COMPOSER_UTIL_ADDRTYPE_NUMBER) {
840 if (len > COMPOSER_RECIPIENT_PHONE_NUMBER_LEN_MAX) {
841 D_PRINT("NUMBER type recipient Too Long [%d]", len);
845 if (len < COMPOSER_RECIPIENT_PHONE_NUMBER_LEN_MIN) {
846 D_PRINT("NUMBER type recipient Too Short [%d]", len);
849 } else if (type == COMPOSER_UTIL_ADDRTYPE_EMAIL) {
850 if (len > COMPOSER_RECIPIENT_ADDRESS_VAL_LEN_MAX) {
851 D_PRINT("Email type recipient Too Long [%d]", len);
855 if (len < COMPOSER_RECIPIENT_PHONE_NUMBER_LEN_MIN) {
856 D_PRINT("Email type recipient Too Short [%d]", len);
860 D_PRINT("Unknown type recipient[%d]", type);
868 Eina_Bool msg_ui_composer_recipient_is_mms(MSG_COMPOSER_VIEW_DATA_S *cd)
871 D_MSG_RETVM_IF(cd == NULL, EINA_FALSE, "composer data is NULL");
873 RECIPIENT_ITEM_S *recipient_item = NULL;
874 Elm_Object_Item *mbe_item = NULL;
875 Eina_Bool is_mms = EINA_FALSE;
876 COMPOSER_UTIL_ADDRTYPE_E addrtype;
877 RECIPIENT_S *rd = cd->recipient;
880 D_EMSG("cd is NULL");
884 if (cd->msg_ug_mode == MSG_UG_MODE_FULL_COMPOSER || cd->msg_ug_mode == MSG_UG_MODE_ONLY_COMPOSER) {
886 mbe_item = elm_multibuttonentry_first_item_get(rd->mbe);
889 recipient_item = elm_object_item_data_get(mbe_item);
891 if (recipient_item) {
892 addrtype = get_address_type(recipient_item->recipient);
894 if (addrtype == COMPOSER_UTIL_ADDRTYPE_EMAIL) {
900 mbe_item = elm_multibuttonentry_item_next_get(mbe_item);
903 } else if (cd->msg_ug_mode == MSG_UG_MODE_BUBBLE_COMPOSER) {
904 Eina_List *list = NULL;
905 RECIPIENT_ITEM_S *r_item = NULL;
907 EINA_LIST_FOREACH(cd->recipient_list, list, r_item) {
909 addrtype = get_address_type(r_item->recipient);
911 if (addrtype == COMPOSER_UTIL_ADDRTYPE_EMAIL) {
918 D_EMSG("Invalid composer ug mode = %d", cd->msg_ug_mode);
925 void msg_ui_composer_recipient_focus_set(RECIPIENT_S *rd)
931 elm_object_focus_set(rd->mbe, EINA_TRUE);
935 void msg_ui_composer_recipient_expanded_set(RECIPIENT_S *rd, Eina_Bool expanded)
938 D_MSG_RETM_IF(rd == NULL, "rd is NULL");
943 elm_multibuttonentry_expanded_set(rd->mbe, expanded);
947 Eina_List *msg_ui_composer_recipient_invalid_recipient_list_get(RECIPIENT_S *rd)
950 RECIPIENT_ITEM_S *r_item;
951 Elm_Object_Item *mbe_item;
952 Eina_List *invalid_list = NULL;
958 mbe_item = elm_multibuttonentry_first_item_get(rd->mbe);
960 r_item = elm_object_item_data_get(mbe_item);
962 D_EMSG("elm_multibuttonentry data is null");
966 if (msg_ui_composer_recipient_vaild_check(r_item->recipient) == EINA_FALSE) {
967 invalid_list = eina_list_append(invalid_list, r_item);
970 mbe_item = elm_multibuttonentry_item_next_get(mbe_item);
973 } /*else if (rd->mode == 0) {
974 r_item = &cd->recipient_frame;
975 if (msg_ui_composer_recipient_vaild_check(r_item->recipient) == EINA_FALSE) {
976 invalid_list = eina_list_append(invalid_list,r_item);
985 const char *msg_ui_composer_recipient_entry_text_get(RECIPIENT_S *rd)
988 D_MSG_RETVM_IF(rd == NULL, NULL, "recipient data is NULL");
989 D_MSG_RETVM_IF(rd->mbe == NULL, NULL, "mbe is NULL");
991 Evas_Object *entry = elm_multibuttonentry_entry_get(rd->mbe);
995 const char *str = elm_entry_entry_get(entry);
997 D_MSG("string = %s", str);
1003 void msg_ui_composer_recipient_entry_text_set(RECIPIENT_S *rd, const char *str)
1007 if (rd->mbe == NULL)
1010 Evas_Object *entry = elm_multibuttonentry_entry_get(rd->mbe);
1011 elm_entry_entry_set(entry, str);
1016 RECIPIENT_S *msg_ui_composer_recipient_create(Evas_Object *p, int mode, void *data)
1021 rd = calloc(1, sizeof(RECIPIENT_S));
1030 __msg_ui_composer_recipient_layout_create(rd);
1036 void msg_ui_composer_recipient_delete(RECIPIENT_S *rd)
1043 if (rd->scroll_down_idler) {
1044 ecore_idler_del(rd->scroll_down_idler);
1045 rd->scroll_down_idler = NULL;
1048 if (rd->notify_popup_idler) {
1049 ecore_idler_del(rd->notify_popup_idler);
1050 rd->notify_popup_idler = NULL;
1053 MSGC_EVAS_OBJECT_DEL(rd->mbe);
1054 MSGC_EVAS_OBJECT_DEL(rd->ly_to);
1055 MSGC_EVAS_OBJECT_DEL(rd->bx_main);
1056 MSGC_EVAS_OBJECT_DEL(rd->popup_change_number);
1062 void msg_ui_composer_recipient_clear(RECIPIENT_S *rd)
1065 D_MSG_RETM_IF(rd == NULL, "recipient data is NULL");
1066 D_MSG_RETM_IF(rd->mbe == NULL, "Multibuttonentry is NULL");
1068 RECIPIENT_ITEM_S *r_item;
1069 Elm_Object_Item * mbe_item;
1071 mbe_item = elm_multibuttonentry_first_item_get(rd->mbe);
1073 r_item = elm_object_item_data_get(mbe_item);
1076 elm_object_item_data_set(mbe_item, NULL);
1079 mbe_item = elm_multibuttonentry_item_next_get(mbe_item);
1082 elm_multibuttonentry_clear(rd->mbe);
1084 MSGC_EVAS_OBJECT_DEL(rd->popup_change_number);
1088 void msg_ui_composer_recipient_update(RECIPIENT_S *rd)
1091 D_MSG_RETM_IF(rd == NULL, "recipient data is NULL");
1092 D_MSG_RETM_IF(rd->mbe == NULL, "Multibuttonentry is NULL");
1094 RECIPIENT_ITEM_S *r_item;
1095 Elm_Object_Item *mbe_item;
1097 mbe_item = elm_multibuttonentry_first_item_get(rd->mbe);
1099 r_item = elm_object_item_data_get(mbe_item);
1101 D_EMSG("elm_multibuttonentry data is null");
1102 mbe_item = elm_multibuttonentry_item_next_get(mbe_item);
1106 /*Check changed contact && change display name && recipient*/
1107 if (strlen(r_item->recipient) > 0) {
1109 bzero(r_item->display_name, sizeof(r_item->display_name));
1110 r_item->index = get_contact_index_by_recipient(r_item->recipient);
1111 if (r_item->index > 0) {
1112 if (get_contact_display_name_by_index(r_item->index, r_item->display_name, sizeof(r_item->display_name)-1) != COMPOSER_RETURN_SUCCESS) {
1113 strncpy(r_item->display_name, r_item->recipient, sizeof(r_item->display_name)-1);
1116 strncpy(r_item->display_name, r_item->recipient, sizeof(r_item->display_name)-1);
1118 elm_object_item_text_set(mbe_item, r_item->display_name);
1120 } else if (strlen(r_item->display_name) > 0) {
1122 bzero(r_item->recipient, sizeof(r_item->recipient));
1123 r_item->index = get_contact_index_by_name(r_item->display_name);
1124 if (r_item->index > 0) {
1125 char tmp_display_name1[COMPOSER_RECIPIENT_ADDRESS_VAL_LEN_MAX+1] = {0,};
1126 char tmp_display_name2[COMPOSER_RECIPIENT_ADDRESS_VAL_LEN_MAX+1] = {0,};
1128 get_contact_display_name_by_index(r_item->index, tmp_display_name1, sizeof(tmp_display_name1)-1);
1129 D_MSG("display_name = %s, get contact displayname = %s", r_item->display_name, tmp_display_name1);
1130 remove_space(r_item->display_name, tmp_display_name2, sizeof(tmp_display_name2)-1);
1131 remove_space(tmp_display_name1, tmp_display_name1, sizeof(tmp_display_name1)-1);
1132 if (g_ascii_strncasecmp(tmp_display_name1, tmp_display_name2, strlen(tmp_display_name1)) == 0) {
1133 get_contact_default_recipient_by_index(r_item->index, r_item->recipient ,sizeof(r_item->recipient)-1);
1134 r_item->type = msg_ui_composer_recipient_type_get(r_item->recipient);
1136 r_item->type = COMPOSER_RECP_ADDR_INVALID;
1140 D_EMSG("No contact id of %s", r_item->display_name);
1144 D_MSG("type [%d]", r_item->type);
1145 D_MSG("index [%d]", r_item->index);
1146 D_MSG("recipient [%s]", r_item->recipient);
1147 D_MSG("display_name [%s]", r_item->display_name);
1149 mbe_item = elm_multibuttonentry_item_next_get(mbe_item);
1155 COMPOSER_RETURN_TYPE_E msg_ui_composer_recipient_append(RECIPIENT_S *rd, const char *recipient, int index)
1158 D_MSG_RETVM_IF(rd == NULL, COMPOSER_RETURN_FAIL, "recipient data is NULL");
1159 D_MSG_RETVM_IF(rd->mbe == NULL, COMPOSER_RETURN_FAIL, "mbe is NULL");
1160 D_MSG_RETVM_IF(recipient == NULL, COMPOSER_RETURN_FAIL, "recipient is NULL");
1161 D_MSG("Recipient Append Parameter [recipient = %s, index = %d]", recipient, index);
1163 RECIPIENT_ITEM_S *recipient_item;
1164 COMPOSER_RECP_ADDR_E type;
1166 char tmp_recipient[COMPOSER_RECIPIENT_ADDRESS_VAL_LEN_MAX+1] = {0,};
1167 char tmp_displayname[COMPOSER_RECIPIENT_ADDRESS_VAL_LEN_MAX+1] = {0,};
1170 strncpy(tmp_recipient, recipient, sizeof(tmp_recipient)-1);
1173 type = msg_ui_composer_recipient_type_get(tmp_recipient);
1179 tmp_index = get_contact_index_by_recipient(tmp_recipient);
1182 /*get display name*/
1183 if (tmp_index > 0) {
1184 if (get_contact_display_name_by_index(tmp_index, tmp_displayname, sizeof(tmp_displayname)) != COMPOSER_RETURN_SUCCESS) {
1185 strncpy(tmp_displayname, tmp_recipient, sizeof(tmp_displayname)-1);
1188 strncpy(tmp_displayname, tmp_recipient, sizeof(tmp_displayname)-1);
1191 /*make recipient item*/
1192 recipient_item = __msg_ui_composer_recipient_item_make(type, tmp_index, tmp_displayname, tmp_recipient, NULL);
1193 if (recipient_item == NULL) {
1194 D_MSG("Fail of msg_ui_composer_recipient_item_make");
1195 return COMPOSER_RETURN_FAIL;
1198 /*append recipient item to mbe*/
1199 if (elm_multibuttonentry_item_append(rd->mbe, recipient_item->display_name, NULL, recipient_item) == NULL) {
1200 D_EMSG("error elm_multibuttonentry_item_add!!");
1201 return COMPOSER_RETURN_FAIL;
1205 return COMPOSER_RETURN_SUCCESS;
1208 COMPOSER_RETURN_TYPE_E msg_ui_composer_recipient_read_data(MSG_COMPOSER_VIEW_DATA_S *cd)
1212 RECIPIENT_ITEM_S *r_item;
1213 Elm_Object_Item *mbe_item;
1216 return COMPOSER_RETURN_FAIL;
1218 if (cd->msg_ug_mode == MSG_UG_MODE_BUBBLE_COMPOSER) {
1219 Eina_List *recipient_list = cd->recipient_list;
1221 if (recipient_list) {
1222 int recipient_cnt = eina_list_count(recipient_list);
1224 RECIPIENT_ITEM_S *r_item = NULL;
1225 D_MSG("recipient_cnt = %d", recipient_cnt);
1227 for (i = 0; i < recipient_cnt; i++) {
1228 r_item = (RECIPIENT_ITEM_S *)eina_list_nth(recipient_list, i);
1230 D_MSG("r_item->recipient = %s", r_item->recipient);
1231 if (msg_ui_composer_message_add_address(r_item->recipient) == COMPOSER_RETURN_SUCCESS)
1234 D_EMSG("r_item is null");
1238 D_EMSG("There is no recipient address");
1243 return COMPOSER_RETURN_FAIL;
1245 mbe_item = elm_multibuttonentry_first_item_get(r->mbe);
1247 r_item = elm_object_item_data_get(mbe_item);
1249 D_MSG("[%s]", r_item->recipient);
1250 if (msg_ui_composer_message_add_address(r_item->recipient) == COMPOSER_RETURN_SUCCESS)
1253 mbe_item = elm_multibuttonentry_item_next_get(mbe_item);
1258 return COMPOSER_RETURN_FAIL;
1261 return COMPOSER_RETURN_SUCCESS;
1264 COMPOSER_RETURN_TYPE_E msg_ui_composer_recipient_set_recipient_list(MSG_COMPOSER_VIEW_DATA_S *cd, msg_thread_id_t thread_id)
1267 D_MSG_RETVM_IF(cd == NULL, COMPOSER_RETURN_FAIL, "param is NULL");
1269 /* set recipient list for bubble composer */
1270 msg_struct_list_s addrList;
1273 memset(&addrList, 0x00, sizeof(msg_struct_list_s));
1275 if (msg_get_address_list(cd->msg_handle, thread_id, &addrList) != COMPOSER_RETURN_SUCCESS)
1276 return COMPOSER_RETURN_FAIL;
1278 char address[MAX_ADDRESS_VAL_LEN + 1] = {0,};
1279 int address_len = sizeof(address);
1281 for (i = 0; i < addrList.nCount; i++) {
1282 memset(&address, 0, address_len);
1283 msg_get_str_value(addrList.msg_struct_info[i], MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, address, address_len);
1284 if (msg_ui_composer_recipient_add_recipient_list(cd, address) != COMPOSER_RETURN_SUCCESS) {
1285 msg_release_list_struct(&addrList);
1286 return COMPOSER_RETURN_FAIL;
1290 msg_release_list_struct(&addrList);
1293 return COMPOSER_RETURN_SUCCESS;
1296 COMPOSER_RETURN_TYPE_E msg_ui_composer_recipient_add_recipient_list(MSG_COMPOSER_VIEW_DATA_S *cd, const char *recipient)
1299 D_MSG_RETVM_IF(cd == NULL, COMPOSER_RETURN_FAIL, "param is NULL");
1300 D_MSG_RETVM_IF(recipient == NULL, COMPOSER_RETURN_FAIL, "param is NULL");
1301 D_MSG_RETVM_IF(!strlen(recipient), COMPOSER_RETURN_FAIL, "strlen(recipient) is 0");
1303 RECIPIENT_ITEM_S *r_item = NULL;
1305 r_item = (RECIPIENT_ITEM_S *)calloc(1, sizeof(RECIPIENT_ITEM_S));
1307 D_EMSG("calloc is failed");
1308 return COMPOSER_RETURN_FAIL;
1310 strncpy(r_item->recipient, recipient, sizeof(r_item->recipient)-1);
1312 cd->recipient_list = eina_list_append(cd->recipient_list, r_item);
1315 return COMPOSER_RETURN_SUCCESS;
1318 COMPOSER_RETURN_TYPE_E msg_ui_composer_recipient_clear_recipient_list(MSG_COMPOSER_VIEW_DATA_S *cd)
1321 D_MSG_RETVM_IF(cd == NULL, COMPOSER_RETURN_FAIL, "param is NULL");
1322 D_MSG_RETVM_IF(cd->recipient_list == NULL, COMPOSER_RETURN_FAIL, "cd->recipient_list is NULL");
1324 RECIPIENT_ITEM_S *r_item = NULL;
1325 D_MSG("recipient_cnt = %d", eina_list_count(cd->recipient_list));
1327 EINA_LIST_FREE(cd->recipient_list, r_item) {
1331 D_EMSG("r_item is null");
1334 cd->recipient_list = NULL;
1337 return COMPOSER_RETURN_SUCCESS;
1340 COMPOSER_RETURN_TYPE_E msg_ui_composer_recipient_set_loaded_data(void *data, const char *recipient, int index)
1342 D_MSG_RETVM_IF(data == NULL, COMPOSER_RETURN_FAIL, "data is NULL");
1343 D_MSG_RETVM_IF(recipient == NULL, COMPOSER_RETURN_FAIL, "recipient is NULL");
1344 MSG_COMPOSER_VIEW_DATA_S *cd = (MSG_COMPOSER_VIEW_DATA_S *)data;
1346 if (msg_ui_composer_recipient_count_get(cd->recipient) >= COMPOSER_RECIPIENT_COUNT_MAX)
1347 return COMPOSER_RETURN_RECIPIENT_COUNTMAX;
1349 if (msg_ui_composer_recipient_duplicate_check(cd->recipient, recipient) == COMPOSER_RETURN_RECIPIENT_DUPLICATE)
1350 return COMPOSER_RETURN_RECIPIENT_DUPLICATE;
1352 if (msg_ui_composer_recipient_vaild_check(recipient) == EINA_FALSE)
1353 return COMPOSER_RETURN_RECIPIENT_INVALID;
1355 return msg_ui_composer_recipient_append(cd->recipient, recipient, index);
1358 void msg_ui_composer_recipient_apply_font_size(MSG_COMPOSER_VIEW_DATA_S *cd, const char *font_sytle)
1361 D_MSG_RETM_IF(cd == NULL, "Composer Data is NULL");
1362 D_MSG_RETM_IF(font_sytle == NULL, "font_sytle is NULL");
1364 Evas_Object* entry = NULL;
1366 if (cd->recipient && cd->recipient->mbe) {
1367 entry = elm_multibuttonentry_entry_get(cd->recipient->mbe);
1368 elm_entry_text_style_user_push(entry, font_sytle);