scale: 1;
description {
state: "default" 0.0;
- min : 16 0;
+ min : 36 0;
fixed: 1 0;
- align: 1.0 0.0;
+ align: 0.0 0.0;
rel1.relative: 1.0 0.0;
rel2.relative: 1.0 1.0;
color: 0 0 0 0;
repeat_events: 1;
description {
state: "default" 0.0;
- align: 0.5 0.0;
- min: 0 20;
- fixed: 0 1;
- rel1 { relative: 1.0 0.0; to_x: "pad_left"; }
+ align: 0.0 0.0;
+ min: 0 70;
+ fixed: 1 0;
+ rel1 { relative: 0.0 0.0; to_x: "pad_left"; }
rel2 { relative: 0.0 0.0; to_x: "pad_right"; }
color: 0 0 0 0;
}
description {
state: "default" 0.0;
align: 0.5 1.0;
- min: 0 66;
+ min: 0 40;
fixed: 0 1;
- rel1 { relative: 1.0 1.0; to_x: "pad_left"; }
+ rel1 { relative: 0.0 1.0; to_x: "pad_left"; }
rel2 { relative: 0.0 1.0; to_x: "pad_right"; }
color: 0 0 0 0;
}
scale : 1;
description {
state: "default" 0.0;
- min: 574 0;
- align: 0.5 0.5;
+ min: 648 0;
+ align: 0 0;
fixed: 1 0;
rel1 { relative: 0.5 1.0; to: "pad_top"; }
rel2 { relative: 0.5 0.0; to: "pad_bottom"; }
fixed: 0 1;
text {
font: "SLP:style=Medium";
+ size: 40;
+ min: 0 0;
+ align: 0 0;
+ }
+ color: 0 0 0 255;
+ align: 0 0;
+ rel1 { relative: 0.0 0.0; to: "pad_top"; }
+ rel2 { relative: 1.0 0.0; to: "pad_bottom"; }
+ }
+ }
+ part {
+ name: "elm.text.check";
+ type: TEXT;
+ scale : 1;
+ description {
+ state: "default" 0.0;
+ min: 0 0;
+ fixed: 0 1;
+ text {
+ font: "SLP:style=Medium";
size: 24;
min: 0 0;
align: 0 0.5;
}
color: 0 0 0 255;
align: 0 0.5;
- rel1 { relative: 0.11 0.5; to: "pad_bottom"; }
+ rel1 { relative: 0.1 0.0; to: "pad_bottom"; }
rel2 { relative: 1.0 1.0; to: "pad_bottom"; }
}
}
description {
state: "default" 0.0;
align: 1.0 0.5;
- rel1 { relative: 0.0 0.0; to: "elm.text"; }
- rel2 { relative: 0.0 1.0; to: "elm.text"; }
+ rel1 { relative: 0.0 0.0; to: "elm.text.check"; }
+ rel2 { relative: 0.0 1.0; to: "elm.text.check"; }
}
}
}
RESOURCE_IMAGE("M01_icon_attach_voice.png");
RESOURCE_IMAGE("M01_icon_block.png");
RESOURCE_IMAGE("M01_icon_broadcasting.png");
+ RESOURCE_IMAGE("M01_icon_broadcasting_press.png");
RESOURCE_IMAGE("M01_icon_DRM_64x64.png");
RESOURCE_IMAGE("M01_icon_message_status_mms_read_n.png");
+ RESOURCE_IMAGE("M01_icon_message_status_mms_read_p.png");
RESOURCE_IMAGE("M01_icon_message_status_mms_sent_n.png");
+ RESOURCE_IMAGE("M01_icon_message_status_mms_sent_p.png");
RESOURCE_IMAGE("M01_icon_message_status_mms_unread_n.png");
+ RESOURCE_IMAGE("M01_icon_message_status_mms_unread_p.png");
RESOURCE_IMAGE("M01_icon_message_status_sms_read_n.png");
+ RESOURCE_IMAGE("M01_icon_message_status_sms_read_p.png");
RESOURCE_IMAGE("M01_icon_message_status_sms_sent_n.png");
+ RESOURCE_IMAGE("M01_icon_message_status_sms_sent_p.png");
RESOURCE_IMAGE("M01_icon_message_status_sms_unread_n.png");
+ RESOURCE_IMAGE("M01_icon_message_status_sms_unread_p.png");
RESOURCE_IMAGE("M01_icon_OTA.png");
+ RESOURCE_IMAGE("M01_icon_OTA_press.png");
RESOURCE_IMAGE("M01_icon_Push.png");
- RESOURCE_IMAGE("M01_icon_save.png");
+ RESOURCE_IMAGE("M01_icon_Push_press.png");
+ RESOURCE_IMAGE("M02_button_save.png");
+ RESOURCE_IMAGE("M01_icon_SOS.png");
+ RESOURCE_IMAGE("M01_icon_SOS_press.png");
+ RESOURCE_IMAGE("M01_icon_failed.png");
+ RESOURCE_IMAGE("M01_icon_failed_press.png");
+ RESOURCE_IMAGE("M01_icon_draft.png");
+ RESOURCE_IMAGE("M01_icon_draft_press.png");
RESOURCE_IMAGE("M01_icon_unblock.png");
RESOURCE_IMAGE("M01_icon_video_call.png");
RESOURCE_IMAGE("M01_icon_view_contact.png");
RESOURCE_IMAGE("M01_icon_DRM.png");
RESOURCE_IMAGE("M01_title_icon_compose.png");
RESOURCE_IMAGE("M01_title_icon_search.png");
- RESOURCE_IMAGE("M01_title_icon_search_dim.png");
RESOURCE_IMAGE("M01_title_icon_attach.png");
- RESOURCE_IMAGE("M01_title_icon_attach_dim.png");
RESOURCE_IMAGE("M01_contact_default_image.png");
RESOURCE_IMAGE("00_icon_plus.png");
RESOURCE_IMAGE("00_slider_btn_volume01.png");
RESOURCE_IMAGE("00_slider_btn_volume02.png");
+ RESOURCE_IMAGE("B15_direct_call_01.png");
+ RESOURCE_IMAGE("B15_direct_call_02.png");
+ RESOURCE_IMAGE("B15_direct_call_03.png");
+ RESOURCE_IMAGE("00_icon_Back.png");
+ RESOURCE_IMAGE("00_icon_select_all.png");
+ RESOURCE_IMAGE("00_icon_more.png");
+ RESOURCE_IMAGE("M01_btn_add_plus.png");
+ RESOURCE_IMAGE("00_field_btn_clear.png");
}
#define MSG_BUNDLE_KEY_THREAD_NAME "threadName"
#define MSG_BUNDLE_KEY_THREAD_ADDRESS "threadAddr"
#define MSG_BUNDLE_KEY_CONTACT_ID "contactId"
+#define MSG_BUNDLE_KEY_STORAGE_ID "storageId"
#define MSG_BUNDLE_KEY_COMPOSER "composer"
#define MSG_BUNDLE_KEY_TO "TO"
#define MSG_BUNDLE_KEY_REQUEST_TYPE "request_type"
#define MSG_BUNDLE_KEY_FILE_TYPE "file_type"
+#define MSG_BUNDLE_KEY_GALLERY_FILE_TYPE "file-type"
#define MSG_BUNDLE_KEY_SELECT_TYPE "select_type"
#define MSG_BUNDLE_KEY_PREVIEW_DATA "preview_data"
+#define MSG_BUNDLE_KEY_LAYOUT_ADDRESS "layout_address"
#define MSG_BUNDLE_KEY_GET_SEL_LIST "get_select_list"
#define MSG_BUNDLE_KEY_NAMECARD_INDEX "id"
#define MSG_BUNDLE_KEY_DRMTYPE "drm_type"
#define MSG_BUNDLE_KEY_SYSPOPUP_CONTENT "_SYSPOPUP_CONTENT_"
+#define MSG_BUNDLE_KEY_UNGRAB_KEY "UNGRAB_KEY"
+#define MSG_BUNDLE_KEY_CHECK_PID "CHECK_PID"
+
/* contact bundle key */
#define MSG_CT_UG_BUNDLE_TYPE "type"
#define MSG_CT_UG_BUNDLE_MAX "ct_max"
#define MSG_CT_UG_BUNDLE_EMAIL "ct_email"
#define MSG_CT_UG_BUNDLE_NUM "ct_num"
#define MSG_CT_UG_BUNDLE_ID "person_id"
+#define MSG_CT_UG_BUNDLE_PERSON_INFO "person_info"
/* Bundle value name */
#define MSG_BUNDLE_VALUE_COMPOSE "compose"
#define MSG_BUNDLE_VALUE_SMS_URI "sms"
#define MSG_BUNDLE_VALUE_MMSTO_URI "mmsto"
#define MSG_BUNDLE_VALUE_FILE_URI "file"
+#define MSG_BUNDLE_VALUE_BODY_URI "body"
#define MSG_BUNDLE_VALUE_NEW_MSG "new_msg"
#define MSG_BUNDLE_VALUE_MSG_ID "msg_id"
#define MSG_BUNDLE_VALUE_INTERNAL "internal"
#define MSG_BUNDLE_VALUE_DELETE_MSG "delete_msg"
#define MSG_BUNDLE_VALUE_REFRESH_CONV "refresh_conv"
#define MSG_BUNDLE_VALUE_NORMAL "normal"
+#define MSG_BUNDLE_VALUE_REPORT "report"
+#define MSG_BUNDLE_VALUE_ADD_RECIPIENT "add_recipient"
+#define MSG_BUNDLE_VALUE_BUBBLE "bubble"
#define MSG_BUNDLE_VALUE_IMAGE "IMAGE"
#define MSG_BUNDLE_VALUE_VIDEO "VIDEO"
#define MSG_BUNDLE_VALUE_MULTI_FILE "MULTI_FILE"
#define MSG_BUNDLE_VALUE_OTHERS "OTHERS"
#define MSG_BUNDLE_VALUE_FILE "file"
+#define MSG_BUNDLE_VALUE_TEXT "text"
#define MSG_BUNDLE_VALUE_SELECT "select"
+#define MSG_BUNDLE_VALUE_TEXTONLY "textonly"
#define MSG_BUNDLE_VALUE_SELECT_MULTIPLE "select-multiple"
#define MSG_BUNDLE_VALUE_GET "get"
#define MSG_BUNDLE_VALUE_NO_CONTENT "no_content"
#define MSG_BUNDLE_VALUE_DEL_ALL "del_all"
+#define MSG_BUNDLE_VALUE_DEL_BUBBLE "bubble_delete"
#define MSG_BUNDLE_VALUE_FORWARDED "forwarded"
#define MSG_BUNDLE_VALUE_DESTROY "destroy"
#define MSG_BUNDLE_VALUE_INDICATOR "indicator"
#define MSG_BUNDLE_VALUE_NO_INDICATOR "no_indicator"
+#define MSG_BUNDLE_VALUE_YES "YES" /* YES : ungrab key when UG is destroyed */
+
+#define MSG_BUNDLE_VALUE_KEYPAD_SHOW "KEYPAD_SHOW"
+#define MSG_BUNDLE_VALUE_KEYPAD_HIDE "KEYPAD_HIDE"
+
/* contact bundle value */
#define MSG_CT_UG_REQUEST_DETAIL 0
#define MSG_CT_UG_REQUEST_SELECT_CONTACT 11
#define MSG_CT_UG_REQUEST_SELECT_NUMBER 12
#define MSG_CT_UG_REQUEST_UPDATE_WITH_NUM 21
#define MSG_CT_UG_REQUEST_UPDATE_WITH_EMAIL 22
+#define MSG_CT_UG_REQUEST_CHECK_FOR_NUMBER 32
#define MSG_CT_UG_REQUEST_CHECK_FOR_NUMBER_OR_EMAIL 34
+#define MSG_CT_UG_REQUEST_SHARE_CONTACT_INFO 61
/* contact result */
/* viewer image resources */
#define MSG_VIEWER_IMAGE_ATTACH_ICON "attach_icon.png"
#define MSG_VIEWER_IMAGE_DRM_SMALL_ICON "M01_icon_DRM_64x64.png"
-#define MSG_VIEWER_IMAGE_SAVE_ICON "M01_icon_save.png"
+#define MSG_VIEWER_IMAGE_SAVE_ICON "M02_button_save.png"
#define MSG_VIEWER_IMAGE_UNSUPPORT_ICON "M01_icon_Unsupported.png"
#define MSG_VIEWER_IMAGE_DRM_ICON "M01_icon_DRM.png"
#define MSG_VIEWER_IMAGE_ATTACH_LIST_ICON "M01_title_icon_attach.png"
-#define MSG_VIEWER_IMAGE_ATTACH_LIST_DIM_ICON "M01_title_icon_attach_dim.png"
#define MSG_VIEWER_VOLUME_MIN "00_slider_btn_volume01.png"
#define MSG_VIEWER_VOLUME_MAX "00_slider_btn_volume02.png"
#define MSGC_IMG_DEL_BTN_PRESS_ICON "M01_btn_delete_press.png"
#define MSGC_IMG_CONTACT_BUTTON_ICON "M01_contact_default_image.png"
+/* bubble image resources */
+#define MSG_UI_BUBBLE_DIRECT_IMG_01 "B15_direct_call_01.png"
+#define MSG_UI_BUBBLE_DIRECT_IMG_02 "B15_direct_call_02.png"
+#define MSG_UI_BUBBLE_DIRECT_IMG_03 "B15_direct_call_03.png"
+
/* thread list image resources */
+#define MSG_UI_THREAD_LIST_SOS_ICON "M01_icon_SOS.png"
+#define MSG_UI_THREAD_LIST_SOS_ICON_P "M01_icon_SOS_press.png"
#define MSG_UI_THREAD_LIST_PUSH_ICON "M01_icon_Push.png"
+#define MSG_UI_THREAD_LIST_PUSH_ICON_P "M01_icon_Push_press.png"
#define MSG_UI_THREAD_LIST_OTA_ICON "M01_icon_OTA.png"
+#define MSG_UI_THREAD_LIST_OTA_ICON_P "M01_icon_OTA_press.png"
#define MSG_UI_THREAD_LIST_CB_ICON "M01_icon_broadcasting.png"
+#define MSG_UI_THREAD_LIST_CB_ICON_P "M01_icon_broadcasting_press.png"
+#define MSG_UI_THREAD_LIST_FAILED_ICON "M01_icon_failed.png"
+#define MSG_UI_THREAD_LIST_FAILED_ICON_P "M01_icon_failed_press.png"
+#define MSG_UI_THREAD_LIST_DRAFT_ICON "M01_icon_draft.png"
+#define MSG_UI_THREAD_LIST_DRAFT_ICON_P "M01_icon_draft_press.png"
/* thread list message status icon*/
#define MSG_UI_THREAD_LIST_STATUS_MMS_READ "M01_icon_message_status_mms_read_n.png"
+#define MSG_UI_THREAD_LIST_STATUS_MMS_READ_P "M01_icon_message_status_mms_read_p.png"
#define MSG_UI_THREAD_LIST_STATUS_MMS_UNREAD "M01_icon_message_status_mms_unread_n.png"
+#define MSG_UI_THREAD_LIST_STATUS_MMS_UNREAD_P "M01_icon_message_status_mms_unread_p.png"
#define MSG_UI_THREAD_LIST_STATUS_MMS_SENT "M01_icon_message_status_mms_sent_n.png"
+#define MSG_UI_THREAD_LIST_STATUS_MMS_SENT_P "M01_icon_message_status_mms_sent_p.png"
#define MSG_UI_THREAD_LIST_STATUS_SMS_READ "M01_icon_message_status_sms_read_n.png"
+#define MSG_UI_THREAD_LIST_STATUS_SMS_READ_P "M01_icon_message_status_sms_read_p.png"
#define MSG_UI_THREAD_LIST_STATUS_SMS_UNREAD "M01_icon_message_status_sms_unread_n.png"
+#define MSG_UI_THREAD_LIST_STATUS_SMS_UNREAD_P "M01_icon_message_status_sms_unread_p.png"
#define MSG_UI_THREAD_LIST_STATUS_SMS_SENT "M01_icon_message_status_sms_sent_n.png"
+#define MSG_UI_THREAD_LIST_STATUS_SMS_SENT_P "M01_icon_message_status_sms_sent_p.png"
-#define MSG_UI_THREAD_LIST_TITLE_ICON_COMPOSE "M01_title_icon_compose.png"
-#define MSG_UI_THREAD_LIST_TITLE_ICON_SEARCH "M01_title_icon_search.png"
-#define MSG_UI_THREAD_LIST_TITLE_ICON_SEARCH_DIM "M01_title_icon_search_dim.png"
+#define MSG_UI_THREAD_LIST_TITLE_ICON_COMPOSE "M01_title_icon_compose.png"
+#define MSG_UI_THREAD_LIST_TITLE_ICON_SEARCH "M01_title_icon_search.png"
+#define MSG_UI_THREAD_LIST_TITLE_ICON_BACK "00_icon_Back.png"
+#define MSG_UI_THREAD_LIST_TITLE_ICON_SEL_ALL "00_icon_select_all.png"
+#define MSG_UI_THREAD_LIST_TITLE_ICON_MORE "00_icon_more.png"
/* common image resources */
#define MSG_COMMON_FILE_ETC_ICON "myfile_icon_etc.png"
#define MSG_COMMON_FILE_VNOTE_ICON "myfile_icon_text.png"
#define MSG_COMMON_FILE_RSS_ICON "myfile_icon_rss.png"
#define MSG_COMMON_FILE_JAVA_ICON "myfile_icon_java.png"
-#define MSG_COMMON_FILE_PLUS_ICON "00_icon_plus.png"
+/* setting image resources */
+#define MSG_UI_SETTING_TITLE_ICON_PLUS "00_icon_plus.png"
#endif /*__MSG_UI_IMAGE_RESOURCE__*/
#define MSG_TITLE_ICON_ADD_TO_CONTACT "01_controllbar_icon_add_to_contact.png"
#define MSG_TITLE_ICON_BLOCK "M01_icon_block.png"
#define MSG_TITLE_ICON_UNBLOCK "M01_icon_unblock.png"
-#define MSG_CONTROLBAR_ICON_VIEW_CONTACT "M01_icon_view_contact.png"
-
-/* Controlbar Icon */
-#define MSG_CONTROLBAR_IMG_PATH IMGDIR"/controlbar/"
-
-#define MSG_CONTROLBAR_ICON_COMPOSE MSG_CONTROLBAR_IMG_PATH"01_controlbar_icon_compose.png"
-#define MSG_CONTROLBAR_ICON_CANCEL MSG_CONTROLBAR_IMG_PATH"01_controllbar_icon_close.png"
-#define MSG_CONTROLBAR_ICON_DELETE MSG_CONTROLBAR_IMG_PATH"01_controlbar_icon_delete.png"
-#define MSG_CONTROLBAR_ICON_FORWARD MSG_CONTROLBAR_IMG_PATH"01_controlbar_icon_forward.png"
-#define MSG_CONTROLBAR_ICON_MORE MSG_CONTROLBAR_IMG_PATH"M01_controlbar_icon_more.png"
-#define MSG_CONTROLBAR_ICON_SETTINGS MSG_CONTROLBAR_IMG_PATH"01_controlbar_icon_settings.png"
-#define MSG_CONTROLBAR_ICON_EDIT MSG_CONTROLBAR_IMG_PATH"01_controlbar_icon_edit.png"
-#define MSG_CONTROLBAR_ICON_MESSAGEBOX MSG_CONTROLBAR_IMG_PATH"M01_controlbar_icon_message_boxes.png"
-#define MSG_CONTROLBAR_ICON_PROTECTION_OFF MSG_CONTROLBAR_IMG_PATH"M01_controlbar_icon_protection_off.png"
-#define MSG_CONTROLBAR_ICON_CANCEL_MSG MSG_CONTROLBAR_IMG_PATH"M01_controlbar_icon_cancel_message.png"
-#define MSG_CONTROLBAR_ICON_COPY_PHONE MSG_CONTROLBAR_IMG_PATH"M01_controlbar_icon_copy_to_phone.png"
-#define MSG_CONTROLBAR_ICON_RESTORE MSG_CONTROLBAR_IMG_PATH"M01_controlbar_icon_restore.png"
-
-/* viewer */
-#define MSG_CONTROLBAR_ICON_PLAY MSG_CONTROLBAR_IMG_PATH"01_controlbar_icon_Play.png"
-#define MSG_CONTROLBAR_ICON_ATTACH MSG_CONTROLBAR_IMG_PATH"M01_controlbar_icon_attach.png"
-#define MSG_CONTROLBAR_ICON_REPLY MSG_CONTROLBAR_IMG_PATH"M01_controlbar_icon_reply.png"
-#define MSG_CONTROLBAR_ICON_RESEND MSG_CONTROLBAR_IMG_PATH"M01_controlbar_icon_resend.png"
-
-/* setting */
-#define MSG_CONTROLBAR_ICON_CREATE MSG_CONTROLBAR_IMG_PATH"01_controlbar_icon_create.png"
-
typedef enum {
MSG_TIME_FORMAT_12H = 0,
#include <ui-gadget-module.h>
#include <sound_manager.h>
#include <system_info.h>
+#include <contacts.h>
#include "msg-ui-thread-main.h"
#include "msg-ui-common-utility.h"
static void __rotate(app_device_orientation_e orientation, void *data)
{
+ D_ENTER;
+
struct appdata *ad = data;
int ret = 0;
int rot = THREAD_ROTATE_ANGLE_UNKNOWN;
msg_ui_thread_rotation_set(ad->thread_data, rot);
elm_win_rotation_with_resize_set(ad->win_main, rot);
}
+ D_LEAVE;
}
static void _block_clicked_cb(void *data, Evas_Object *obj, void *event_info)
char *content = NULL;
char *recipient = NULL;
+ char *tmp = NULL;
char *body_text = NULL;
service_h svc_handle = NULL;
if (content) {
if (g_ascii_isdigit(content[0]) || (content[0] == '+' && g_ascii_isdigit(content[1]))) {
recipient = strtok_r(NULL, "?", &content);
- D_MSG("APPSVC RECIPIENT = [%s]", recipient);
-
- if (recipient)
+ if (recipient) {
+ D_MSG("APPSVC RECIPIENT = [%s]", recipient);
service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_TO, recipient);
+ }
+
+ if (content) {
+ if (g_str_has_prefix(content, MSG_BUNDLE_VALUE_BODY_URI)) {
+ tmp = strtok_r(NULL, "=", &content);
+
+ if (content && strlen(content)) {
+ char *unescape_string = g_uri_unescape_string(content, NULL);
+ if (unescape_string) {
+ D_MSG("APPSVC BODY = [%s]", unescape_string);
+ service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_BODY, unescape_string);
+ free(unescape_string);
+ }
+ }
+ }
+ }
}
}
g_free(scheme);
service_get_extra_data(service, MSG_BUNDLE_KEY_TYPE, &key_type);
if (g_strcmp0(key_type, MSG_BUNDLE_VALUE_MSG_ID) == 0) {
msg_error_t err = MSG_SUCCESS;
- msg_struct_t count_info = msg_create_struct(MSG_STRUCT_COUNT_INFO);
- int unread_cnt = 0;
+ msg_struct_t sort_rule_t = msg_create_struct(MSG_STRUCT_SORT_RULE);
+ msg_struct_list_s peerList;
+ bool oneThread = true;
- err = msg_count_message(gAppData->msgHandle, MSG_INBOX_ID, count_info);
- if (err != MSG_SUCCESS) {
- msg_release_struct(&count_info);
- return NULL;
+ msg_set_int_value(sort_rule_t, MSG_SORT_RULE_SORT_TYPE_INT, MSG_SORT_BY_READ_STATUS);
+ msg_set_bool_value(sort_rule_t, MSG_SORT_RULE_ACSCEND_BOOL, false);
+
+ err = msg_get_thread_view_list(gAppData->msgHandle, sort_rule_t, &peerList);
+ msg_release_struct(&sort_rule_t);
+
+ if (peerList.nCount > 1) {
+ int unreadCnt = 0;
+ msg_get_int_value(peerList.msg_struct_info[1], MSG_THREAD_UNREAD_COUNT_INT, &unreadCnt);
+ if (unreadCnt > 0)
+ oneThread = false;
}
+ msg_release_list_struct(&peerList);
- msg_get_int_value(count_info, MSG_COUNT_INFO_UNREAD_INT, &unread_cnt);
- if (unread_cnt == 1)
+ if (oneThread == true)
svc_handle = __get_service_with_msg_id(gAppData, service);
-
- msg_release_struct(&count_info);
+ } else if (g_strcmp0(key_type, MSG_BUNDLE_VALUE_REPORT) == 0) {
+ svc_handle = __get_service_with_msg_id(gAppData, service);
+ } else if (g_strcmp0(key_type, MSG_BUNDLE_VALUE_BUBBLE) == 0) {
+ svc_handle = __get_service_with_msg_id(gAppData, service);
}
}
D_LEAVE;
-
return svc_handle;
}
int thread_id = 0;
int contact_id = 0;
char buf_thread[DEF_BUF_LEN_S] = {0,};
+ char buf_storage[DEF_BUF_LEN_S] = {0,};
char buf_contact[DEF_BUF_LEN_S] = {0,};
msg_struct_list_s *addr_list = NULL;
service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_THREAD_NAME, strName);
service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_THREAD_ADDRESS, strNumber);
service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_CONTACT_ID, buf_contact);
+ service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_STORAGE_ID, buf_storage);
msg_release_struct(&msgInfo);
msg_release_struct(&sendOpt);
D_ENTER;
struct appdata *ad;
- Evas_Object *base, *win;
+ Evas_Object *base;
if (!ug || !priv)
return;
return;
}
- win = ug_get_window();
-
switch (mode) {
case UG_MODE_FULLVIEW:
evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
service_get_extra_data(result, MSG_BUNDLE_KEY_RESULT, &str_result);
if (pData == NULL) {
if (!g_strcmp0(str_result, MSG_BUNDLE_VALUE_DEL_ALL))
- ug_destroy(ug);
+ msg_ui_destroy_composer_ug(ug, false);
elm_exit();
return;
if (!g_strcmp0(str_result, MSG_BUNDLE_VALUE_DEL_ALL)) {
elm_object_focus_set(pListData->genlist, EINA_TRUE);
- ug_destroy(ug);
+ msg_ui_destroy_composer_ug(ug, false);
if (pListData) {
int del_id = 0;
- if (pListData->app_data_type == THREAD_LIST_APP_DATA_MSG) {
- service_get_extra_data(result, MSG_BUNDLE_KEY_MSG_ID, &buf);
- if (buf) {
- del_id = atoi(buf);
- msg_ui_thread_list_msg_item_delete(pListData, del_id);
- }
- } else {
- service_get_extra_data(result, MSG_BUNDLE_KEY_THREAD_ID, &buf);
- if (buf) {
- del_id = atoi(buf);
- msg_ui_thread_list_item_delete(pListData, del_id);
- }
+ service_get_extra_data(result, MSG_BUNDLE_KEY_MSG_ID, &buf);
+ if (buf && pListData->app_data_type != THREAD_LIST_APP_DATA_CONV) {
+ del_id = atoi(buf);
+ buf = NULL;
+ msg_ui_thread_list_msg_item_delete(pListData, del_id);
+ }
+
+ service_get_extra_data(result, MSG_BUNDLE_KEY_THREAD_ID, &buf);
+ if (buf && pListData->app_data_type != THREAD_LIST_APP_DATA_MSG) {
+ del_id = atoi(buf);
+ buf = NULL;
+ msg_ui_thread_list_item_delete(pListData, del_id);
}
if (pListData->item_cnt <= 0 && pListData->search_mode == THREAD_SEARCH_ON)
pListData->sel_gen_item = NULL;
pListData->sel_thread_id = 0;
pListData->sel_msg_id = 0;
- ad->composer_ug = NULL;
- ad->ug_type = MSG_COMPOSER_UG_TYPE_NONE;
+ }
+ } else if (!g_strcmp0(str_result, MSG_BUNDLE_VALUE_DEL_BUBBLE)) {
+ service_get_extra_data(result, MSG_BUNDLE_KEY_THREAD_ID, &buf);
+ if (buf && pListData->app_data_type != THREAD_LIST_APP_DATA_MSG) {
+ int thread_id = 0;
+ thread_id = atoi(buf);
+ buf = NULL;
+ msg_ui_thread_list_item_update(pListData, thread_id);
+ }
+ } else if (!g_strcmp0(str_result, MSG_BUNDLE_VALUE_KEYPAD_SHOW)) {
+ pData->keypadIsShown = true;
+ if (pData->isRotate == true) {
+ elm_panes_content_left_size_set(pData->panes, 0.0);
+ elm_object_signal_emit(pData->panes, "elm,panes,unpair", "");
+ }
+ } else if (!g_strcmp0(str_result, MSG_BUNDLE_VALUE_KEYPAD_HIDE)) {
+ pData->keypadIsShown = false;
+ if (pData->isRotate == true) {
+ elm_panes_content_left_size_set(pData->panes, 0.4);
+ elm_object_signal_emit(pData->panes, "elm,panes,pair", "");
}
} else {
int update_id = 0;
- if (pListData->app_data_type == THREAD_LIST_APP_DATA_MSG) {
- service_get_extra_data(result, MSG_BUNDLE_KEY_MSG_ID, &buf);
- if (buf) {
- update_id = atoi(buf);
- msg_ui_thread_list_msg_item_update(pListData, update_id);
- }
- } else {
- service_get_extra_data(result, MSG_BUNDLE_KEY_THREAD_ID, &buf);
- if (buf) {
- update_id = atoi(buf);
- msg_ui_thread_list_item_update(pListData, update_id);
- pListData->sel_thread_id = update_id;
- }
+ service_get_extra_data(result, MSG_BUNDLE_KEY_MSG_ID, &buf);
+ if (buf && pListData->app_data_type != THREAD_LIST_APP_DATA_CONV) {
+ update_id = atoi(buf);
+ buf = NULL;
+ msg_ui_thread_list_msg_item_update(pListData, update_id);
+ }
+
+ service_get_extra_data(result, MSG_BUNDLE_KEY_THREAD_ID, &buf);
+ if (buf && pListData->app_data_type != THREAD_LIST_APP_DATA_MSG) {
+ update_id = atoi(buf);
+ buf = NULL;
+ msg_ui_thread_list_item_update(pListData, update_id);
}
}
MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !ug || !priv);
struct appdata *ad = (struct appdata *)priv;
- int ug_type = ad->ug_type;
- PMSG_THREAD_LIST_DATA pListData = NULL;
-
- pListData = msg_ui_thread_get_current_list();
-
- if (ug == ad->composer_ug) {
- if (pListData && pListData->genlist)
- elm_object_focus_set(pListData->genlist, EINA_TRUE);
-
- ug_destroy(ug);
- ad->composer_ug = NULL;
- ad->ug_type = MSG_COMPOSER_UG_TYPE_NONE;
- }
+ int ug_type = msg_ui_get_composer_ug_type(ug);
+ PMSG_THREAD_LIST_DATA pListData = msg_ui_thread_get_current_list();
if (ad->layout_main) {
PMSG_THREAD_DATA pData = (PMSG_THREAD_DATA)ad->thread_data;
if (pListData == NULL) {
+ msg_ui_destroy_composer_ug(ug, false);
elm_exit();
return;
}
if (pData) {
- if (pData->isRotate == true) {
- if (!pData->split_data) {
- msg_ui_thread_create_split_data();
- msg_ui_thread_splitview_launch(pData, pData->split_data);
- }
- if (ug_type == MSG_COMPOSER_UG_TYPE_VIEWER) {
- msg_ui_thread_cancel_search_mode(pListData);
- elm_win_lower(pData->win_main);
+ pData->keypadIsShown = false;
+
+ if (ug_type == MSG_COMPOSER_UG_TYPE_VIEWER) {
+ if (pData->isRotate == true) {
+ if (!pData->split_data) {
+ msg_ui_thread_create_split_data();
+ msg_ui_thread_splitview_launch(pData, pData->split_data);
+ }
+
+ if (pListData->search_mode == THREAD_SEARCH_ON)
+ msg_ui_thread_cancel_search_mode(pListData);
+ else
+ elm_win_lower(pData->win_main);
+ } else {
+ elm_object_part_content_set(pData->panes, "left", pData->layout_main);
+ elm_object_part_content_unset(pData->panes, "right");
+ elm_panes_content_left_size_set(pData->panes, 1.0);
}
- } else {
- elm_object_part_content_set(pData->panes, "left", pData->layout_main);
- elm_object_part_content_unset(pData->panes, "right");
- elm_panes_content_left_size_set(pData->panes, 1.0);
}
+ pListData->view_mode = THREAD_NORMAL_VIEW;
}
-
- if (pListData->sel_thread_id > 0)
- msg_ui_thread_list_item_update(pListData, pListData->sel_thread_id);
-
- if (pListData->sel_msg_id > 0)
- msg_ui_thread_list_msg_item_update(pListData, pListData->sel_msg_id);
-
- pListData->sel_gen_item = NULL;
- pListData->sel_thread_id = 0;
- pListData->sel_msg_id = 0;
-
- pListData->view_mode = THREAD_NORMAL_VIEW;
+ msg_ui_destroy_composer_ug(ug, false);
} else {
+ msg_ui_destroy_composer_ug(ug, false);
elm_exit();
}
}
-int msg_ui_load_composer_ug(service_h svc_handle, MessageComposerUgType ug_type)
+int msg_ui_load_composer_ug(service_h svc_handle, MessageComposerUgType ug_type, bool isListItem)
{
D_ENTER;
if (!gAppData)
return MSG_UI_RET_ERR;
- if (gAppData->composer_ug) {
- if (ug_type == MSG_COMPOSER_UG_TYPE_COMPOSER && gAppData->ug_type == MSG_COMPOSER_UG_TYPE_VIEWER) {
- ug_destroy(gAppData->composer_ug);
- gAppData->composer_ug = NULL;
- gAppData->ug_type = MSG_COMPOSER_UG_TYPE_NONE;
+ ugdata *composer_data = NULL;
+ ui_gadget_h ug_h = NULL;
+ bool bReset = false;
+ ugdata *exist_data = gAppData->composer_data;
+ PMSG_THREAD_LIST_DATA pListData = msg_ui_thread_get_current_list();
- service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_FROM, MSG_BUNDLE_VALUE_INTERNAL);
- if (ug_type == MSG_COMPOSER_UG_TYPE_COMPOSER)
- gAppData->composer_ug = ug_create(NULL, MSG_COMPOSER_UG_NAME, UG_MODE_FULLVIEW, svc_handle, &gAppData->cbs);
- else
- gAppData->composer_ug = ug_create(NULL, MSG_COMPOSER_UG_NAME, UG_MODE_FRAMEVIEW, svc_handle, &gAppData->cbs);
+ if (ug_type == MSG_COMPOSER_UG_TYPE_VIEWER) {
+ while (exist_data) {
+ if (exist_data->ug_type == MSG_COMPOSER_UG_TYPE_VIEWER) {
+ bReset = true;
+ break;
+ }
+ exist_data = exist_data->next_ug;
+ }
+
+ if (exist_data && bReset) {
+ ug_send_message(exist_data->ug_h, svc_handle);
+ ug_h = exist_data->ug_h;
} else {
- ug_send_message(gAppData->composer_ug, svc_handle);
+ service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_FROM, MSG_BUNDLE_VALUE_INTERNAL);
+ ug_h = ug_create(NULL, MSG_COMPOSER_UG_NAME, UG_MODE_FRAMEVIEW, svc_handle, &gAppData->cbs);
}
} else {
service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_FROM, MSG_BUNDLE_VALUE_INTERNAL);
- if (ug_type == MSG_COMPOSER_UG_TYPE_COMPOSER)
- gAppData->composer_ug = ug_create(NULL, MSG_COMPOSER_UG_NAME, UG_MODE_FULLVIEW, svc_handle, &gAppData->cbs);
- else
- gAppData->composer_ug = ug_create(NULL, MSG_COMPOSER_UG_NAME, UG_MODE_FRAMEVIEW, svc_handle, &gAppData->cbs);
+ ug_h = ug_create(NULL, MSG_COMPOSER_UG_NAME, UG_MODE_FULLVIEW, svc_handle, &gAppData->cbs);
}
- if (!gAppData->composer_ug)
+ if (!ug_h)
return MSG_UI_RET_ERR;
- gAppData->ug_type = ug_type;
+ if (bReset == false) {
+ composer_data = (ugdata *)calloc(1, sizeof(ugdata));
+ composer_data->ug_h = ug_h;
+ composer_data->ug_type = ug_type;
+
+ exist_data = gAppData->composer_data;
+ if (exist_data) {
+ while (exist_data) {
+ if (exist_data->next_ug == NULL) {
+ exist_data->next_ug = composer_data;
+ composer_data->prev_ug = exist_data;
+ break;
+ }
+ exist_data = exist_data->next_ug;
+ }
+ } else {
+ gAppData->composer_data = composer_data;
+ }
+
+ if (pListData && isListItem) {
+ composer_data->sel_gen_item = pListData->sel_gen_item;
+ composer_data->sel_thread_id = pListData->sel_thread_id;
+ composer_data->sel_msg_id = pListData->sel_msg_id;
+ }
+ } else if (exist_data && pListData && isListItem) {
+ exist_data->sel_gen_item = pListData->sel_gen_item;
+ exist_data->sel_thread_id = pListData->sel_thread_id;
+ exist_data->sel_msg_id = pListData->sel_msg_id;
+ }
if (ug_type == MSG_COMPOSER_UG_TYPE_VIEWER) {
PMSG_THREAD_DATA pData = (PMSG_THREAD_DATA)gAppData->thread_data;
- Evas_Object * layout = (Evas_Object *)ug_get_layout(gAppData->composer_ug);
+ Evas_Object * layout = (Evas_Object *)ug_get_layout(ug_h);
elm_object_part_content_set(pData->panes, "right", layout);
msg_ui_thread_destroy_split_data(pData->split_data);
if (pData->isRotate == false) {
- elm_object_part_content_unset(pData->panes, "left");
elm_panes_content_left_size_set(pData->panes, 0.0);
evas_object_hide(pData->layout_main);
}
}
+
D_LEAVE;
return MSG_UI_RET_SUCCESS;
}
-Evas_Object *msg_ui_get_composer_ug_viewer_layout(void)
+Evas_Object *msg_ui_get_main_layout(void)
{
D_ENTER;
- if (!gAppData || !gAppData->composer_ug)
+ if (!gAppData)
return NULL;
- if (gAppData->ug_type != MSG_COMPOSER_UG_TYPE_VIEWER)
+ return gAppData->layout_main;
+}
+
+ugdata *msg_ui_get_composer_ug_data(ui_gadget_h ug)
+{
+ D_ENTER;
+ ugdata *composer_data = NULL;
+
+ if (!gAppData || !gAppData->composer_data)
return NULL;
- Evas_Object * layout = (Evas_Object *)ug_get_layout(gAppData->composer_ug);
+ composer_data = gAppData->composer_data;
+ while (composer_data) {
+ if (composer_data->ug_h == ug)
+ return composer_data;
+
+ composer_data = composer_data->next_ug;
+ }
D_LEAVE;
+ return NULL;
+}
+
+Evas_Object *msg_ui_get_composer_ug_viewer_layout(void)
+{
+ D_ENTER;
+ ugdata *composer_data = NULL;
+ Evas_Object * layout = NULL;
+
+ if (!gAppData || !gAppData->composer_data)
+ return NULL;
+
+ composer_data = gAppData->composer_data;
+ while (composer_data) {
+ if (composer_data->ug_type == MSG_COMPOSER_UG_TYPE_VIEWER) {
+ layout = (Evas_Object *)ug_get_layout(composer_data->ug_h);
+ break;
+ }
+ composer_data = composer_data->next_ug;
+ }
+ D_LEAVE;
return layout;
}
-void msg_ui_destroy_composer_ug(void)
+void msg_ui_destroy_composer_ug(ui_gadget_h ug, bool bDeleteAll)
{
- if (!gAppData || !gAppData->composer_ug)
- return;
+ D_ENTER;
+ ugdata *composer_data = NULL;
+ PMSG_THREAD_LIST_DATA pListData = NULL;
- ug_destroy(gAppData->composer_ug);
+ pListData = msg_ui_thread_get_current_list();
- PMSG_THREAD_DATA pData = (PMSG_THREAD_DATA)gAppData->thread_data;
- PMSG_THREAD_LIST_DATA pListData = msg_ui_thread_get_current_list();
+ composer_data = gAppData->composer_data;
+ if (bDeleteAll) {
+ while (composer_data) {
+ if (composer_data->ug_h)
+ ug_destroy(composer_data->ug_h);
- if (pListData) {
- if (pData->isRotate == true) {
- if (!pData->split_data) {
- msg_ui_thread_create_split_data();
- msg_ui_thread_splitview_launch(pData, pData->split_data);
+ free(composer_data);
+ composer_data = composer_data->next_ug;
+ }
+ gAppData->composer_data = NULL;
+ } else {
+ while (composer_data) {
+ if (ug == NULL)
+ break;
+
+ if (ug == composer_data->ug_h) {
+ if (pListData) {
+ if (pListData->genlist)
+ elm_object_focus_set(pListData->genlist, EINA_TRUE);
+
+ if ((pListData->sel_thread_id > 0) && (pListData->sel_thread_id == composer_data->sel_thread_id)) {
+ int thread_id = pListData->sel_thread_id;
+
+ pListData->sel_thread_id = 0;
+ msg_ui_thread_list_item_update(pListData, thread_id);
+ }
+
+ if ((pListData->sel_msg_id > 0) && (pListData->sel_msg_id == composer_data->sel_msg_id)) {
+ int msg_id = pListData->sel_msg_id;
+
+ pListData->sel_msg_id = 0;
+ msg_ui_thread_list_msg_item_update(pListData, msg_id);
+ }
+
+ if (pListData->sel_gen_item == composer_data->sel_gen_item)
+ pListData->sel_gen_item = NULL;
+
+ msg_ui_thread_set_title_unread_cnt(pListData);
+ }
+
+ ug_destroy(ug);
+ if (composer_data->prev_ug) {
+ if (composer_data->next_ug)
+ composer_data->prev_ug->next_ug = composer_data->next_ug;
+ else
+ composer_data->prev_ug->next_ug = NULL;
+ } else {
+ gAppData->composer_data = NULL;
+ }
+ free(composer_data);
+ break;
}
+ composer_data = composer_data->next_ug;
}
+ }
+ D_LEAVE;
+}
+
+int msg_ui_get_composer_ug_type(ui_gadget_h ug)
+{
+ D_ENTER;
+ ugdata *composer_data = NULL;
+ int ug_type = MSG_COMPOSER_UG_TYPE_NONE;
+
+ if (!gAppData || !gAppData->composer_data)
+ return MSG_COMPOSER_UG_TYPE_NONE;
- pListData->sel_gen_item = NULL;
- pListData->sel_thread_id = 0;
- pListData->sel_msg_id = 0;
- gAppData->composer_ug = NULL;
- gAppData->ug_type = MSG_COMPOSER_UG_TYPE_NONE;
+ composer_data = gAppData->composer_data;
+ while (composer_data) {
+ if (composer_data->ug_h == ug) {
+ ug_type = composer_data->ug_type;
+ break;
+ }
+ composer_data = composer_data->next_ug;
}
+
+ D_LEAVE;
+ return ug_type;
}
static bool app_create(void *data)
struct appdata *ad = data;
Evas_Object *win;
- sound_manager_error_e err = SOUND_MANAGER_ERROR_NONE;
+ sound_manager_error_e snd_err = SOUND_MANAGER_ERROR_NONE;
+ contacts_error_e ct_err = CONTACTS_ERROR_NONE;
/* create window */
win = create_win(MESSAGE_PKGNAME);
elm_win_resize_object_add(win, ad->conform);
evas_object_show(ad->conform);
- err = sound_manager_set_session_type(SOUND_SESSION_TYPE_SHARE);
- if (err != SOUND_MANAGER_ERROR_NONE)
- D_MSG("sound_manager_set_session_type is failed, ret = [%d]", err);
+ snd_err = sound_manager_set_session_type(SOUND_SESSION_TYPE_SHARE);
+ if (snd_err != SOUND_MANAGER_ERROR_NONE)
+ D_MSG("sound_manager_set_session_type is failed, snd_err = [%d]", snd_err);
+
+ ct_err = contacts_connect2();
+ if (ct_err != CONTACTS_ERROR_NONE)
+ D_EMSG("contacts_svc_connect2 failed : ct_err = [%d]", ct_err);
UG_INIT_EFL(ad->win_main, UG_OPT_INDICATOR_ENABLE);
elm_win_indicator_mode_set(ad->win_main, ELM_WIN_INDICATOR_SHOW);
struct appdata *ad = data;
msg_error_t err;
+ contacts_error_e ct_err = CONTACTS_ERROR_NONE;
ug_destroy_all();
+ ct_err = contacts_disconnect2();
+ if (ct_err != CONTACTS_ERROR_NONE)
+ D_EMSG("contacts_svc_disconnect2 failed : ct_err = [%d]", ct_err);
+
if (ad->thread_data)
msg_ui_thread_deinit_thread_data(ad->thread_data);
svc_handle = __get_service_with_new_msg(ad);
} else if (g_strcmp0(key_type, MSG_BUNDLE_VALUE_MSG_ID) == 0) {
svc_handle = __get_service_with_msg_id(ad, service);
+ } else if (g_strcmp0(key_type, MSG_BUNDLE_VALUE_REPORT) == 0) {
+ svc_handle = __get_service_with_msg_id(ad, service);
+ } else if (g_strcmp0(key_type, MSG_BUNDLE_VALUE_BUBBLE) == 0) {
+ svc_handle = __get_service_with_msg_id(ad, service);
} else {
char *mime_type = NULL;
}
}
- if (!svc_handle)
+ if (!svc_handle) {
isDefaultView = true;
+ } else {
+ int storge_id = 0;
+ char *buf = NULL;
+
+ service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_STORAGE_ID, &buf);
+ if (buf != NULL)
+ storge_id = atoi(buf);
+
+ if (storge_id == MSG_STORAGE_SIM)
+ isDefaultView = true;
+ }
} else {
isDefaultView = true;
}
if (isDefaultView) {
MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "show DefaultView");
- if (ad->composer_ug) {
- ug_destroy(ad->composer_ug);
- ad->composer_ug = NULL;
- ad->ug_type = MSG_COMPOSER_UG_TYPE_NONE;
+ if (ad->composer_data) {
+ ugdata *composer_data = ad->composer_data;
+
+ while (composer_data) {
+ service_h composer_svc_handle = NULL;
+ if (service_create(&composer_svc_handle) < 0 || composer_svc_handle == NULL)
+ D_EMSG("service_create() is failed !!");
+
+ composer_data = composer_data->next_ug;
+ }
+ msg_ui_destroy_composer_ug(NULL, true);
}
if (!ad->thread_data)
ad->thread_data = msg_ui_thread_init_thread_data(ad);
- if (!ad->layout_main) {
- ad->layout_main = msg_ui_thread_create_layout_main(ad->thread_data);
- evas_object_size_hint_weight_set(ad->layout_main, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_object_content_set(ad->conform, ad->layout_main);
+ if (svc_handle) {
+ /*sim message viewer*/
+ MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "show sim message viewer");
+
+ if (!ad->layout_main) {
+ ad->layout_main = msg_ui_thread_create_layout_main(ad->thread_data);
+ evas_object_size_hint_weight_set(ad->layout_main, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_object_content_set(ad->conform, ad->layout_main);
+ } else {
+ PMSG_THREAD_DATA pData = (PMSG_THREAD_DATA)ad->thread_data;
+ int i = 0;
+
+ if (pData->detail_layout) {
+ if (pData->isRotate == true)
+ elm_object_item_del(elm_naviframe_top_item_get(pData->split_data->navi_frame));
+ else
+ elm_object_item_del(elm_naviframe_top_item_get(pData->navi_frame));
+ pData->detail_layout = NULL;
+ }
+
+ for (i = MSG_THREAD_LIST_MAX_COUNT-1; i >= 0; i--) {
+ if (pData->list_data[i] != NULL) {
+ if (pData->list_data[i]->loaded_ug) {
+ ug_destroy(pData->list_data[i]->loaded_ug);
+ pData->list_data[i]->loaded_ug = NULL;
+ }
+ elm_object_item_del(elm_naviframe_top_item_get(pData->navi_frame));
+ elm_genlist_clear(pData->list_data[i]->genlist);
+ msg_ui_thread_destroy_thread_list_data(pData->list_data[i]);
+ }
+ }
+
+ if (pData->split_data)
+ msg_ui_thread_destroy_split_data(pData->split_data);
+ }
+ elm_win_conformant_set(ad->win_main, 1);
+
+ int msg_id = 0;
+ char *buf = NULL;
+ PMSG_APP_THREAD_ADDR_INFO_S* addr_info = NULL;
+
+ char* strNumber = NULL;
+ char* strName = NULL;
+
+ service_get_extra_data(service, MSG_BUNDLE_KEY_MSG_ID, &buf);
+ if (buf != NULL) {
+ msg_id = atoi(buf);
+ buf = NULL;
+ }
+
+ addr_info = (PMSG_APP_THREAD_ADDR_INFO_S *)calloc(1, sizeof(PMSG_APP_THREAD_ADDR_INFO_S));
+ addr_info[0] = (PMSG_APP_THREAD_ADDR_INFO_S)calloc(1, sizeof(MSG_APP_THREAD_ADDR_INFO_S));
+
+ service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_CONTACT_ID, &buf);
+ if (buf != NULL) {
+ addr_info[0]->contact_id = atoi(buf);
+ buf = NULL;
+ }
+
+ service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_THREAD_ADDRESS, &strNumber);
+ if (strNumber && strlen(strNumber) > 0)
+ strncpy(addr_info[0]->address, strNumber, DEF_THREAD_ADDR_LEN);
+ else
+ strncpy(addr_info[0]->address, "", DEF_THREAD_ADDR_LEN);
- msg_ui_thread_load_thread_view(ad->thread_data, service);
+ service_get_extra_data(svc_handle, MSG_BUNDLE_KEY_THREAD_NAME, &strName);
+ if (strName && strlen(strName) > 0)
+ strncpy(addr_info[0]->display_name, strName, DEF_THREAD_NAME_LEN);
+ else
+ strncpy(addr_info[0]->display_name, "", DEF_THREAD_NAME_LEN);
+
+ msg_update_read_status(ad->msgHandle, msg_id, true);
+ msg_ui_thread_launch_msg_detail_view(NULL, msg_id, 1, addr_info);
+ free(addr_info[0]);
+ free(addr_info);
} else {
- msg_ui_thread_reset_thread_view(ad->thread_data, service);
+ if (!ad->layout_main) {
+ ad->layout_main = msg_ui_thread_create_layout_main(ad->thread_data);
+ evas_object_size_hint_weight_set(ad->layout_main, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_object_content_set(ad->conform, ad->layout_main);
+
+ msg_ui_thread_load_thread_view(ad->thread_data, service);
+ } else {
+ msg_ui_thread_reset_thread_view(ad->thread_data, service);
+ }
+ __rotate(app_get_device_orientation(), ad);
}
- __rotate(app_get_device_orientation(), ad);
} else {
MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "show app-service view");
/* If message app is called by app-service to display composer view,
if (g_strcmp0(operation, SERVICE_OPERATION_SEND) == 0 ||
g_strcmp0(operation, SERVICE_OPERATION_SEND_TEXT) == 0) {
if (ad->layout_main) {
- /* content unset composer */
- if (ad->ug_type == MSG_COMPOSER_UG_TYPE_VIEWER) {
- if (pData)
+ if (pData) {
+ /* content unset composer */
+ if (elm_object_part_content_get(pData->panes, "right") != NULL)
elm_object_part_content_unset(pData->panes, "right");
- }
- if (pData) {
for (i = MSG_THREAD_LIST_MAX_COUNT-1; i >= 0; i--) {
if (pData->list_data[i] != NULL) {
+ elm_object_item_del(elm_naviframe_top_item_get(pData->navi_frame));
+ elm_genlist_clear(pData->list_data[i]->genlist);
msg_ui_thread_destroy_thread_list_data(pData->list_data[i]);
}
}
+
+ if (pData->split_data)
+ msg_ui_thread_destroy_split_data(pData->split_data);
}
evas_object_del(ad->layout_main);
ad->layout_main = NULL;
char *key_type = NULL;
service_get_extra_data(service, MSG_BUNDLE_KEY_TYPE, &key_type);
- if (g_strcmp0(key_type, MSG_BUNDLE_VALUE_MSG_ID) == 0) {
+ if (g_strcmp0(key_type, MSG_BUNDLE_VALUE_MSG_ID) == 0 || g_strcmp0(key_type, MSG_BUNDLE_VALUE_REPORT) == 0 || g_strcmp0(key_type, MSG_BUNDLE_VALUE_BUBBLE) == 0) {
if (ad->layout_main) {
- /* content unset composer */
- if (ad->ug_type == MSG_COMPOSER_UG_TYPE_VIEWER) {
- if (pData)
+ if (pData) {
+ /* content unset composer */
+ if (elm_object_part_content_get(pData->panes, "right") != NULL)
elm_object_part_content_unset(pData->panes, "right");
- }
- if (pData) {
for (i = MSG_THREAD_LIST_MAX_COUNT-1; i >= 0; i--) {
if (pData->list_data[i] != NULL) {
+ elm_object_item_del(elm_naviframe_top_item_get(pData->navi_frame));
+ elm_genlist_clear(pData->list_data[i]->genlist);
msg_ui_thread_destroy_thread_list_data(pData->list_data[i]);
}
}
+
+ if (pData->split_data)
+ msg_ui_thread_destroy_split_data(pData->split_data);
}
evas_object_del(ad->layout_main);
ad->layout_main = NULL;
}
}
- if (ad->composer_ug) {
- ug_destroy(ad->composer_ug);
- ad->composer_ug = NULL;
- ad->ug_type = MSG_COMPOSER_UG_TYPE_NONE;
+ if (ad->composer_data) {
+ ugdata *composer_data = ad->composer_data;
+
+ while (composer_data) {
+ service_h composer_svc_handle = NULL;
+ if (service_create(&composer_svc_handle) < 0 || composer_svc_handle == NULL)
+ D_EMSG("service_create() is failed !!");
+
+ composer_data = composer_data->next_ug;
+ }
+ msg_ui_destroy_composer_ug(NULL, true);
}
- ad->composer_ug = ug_create(NULL, MSG_COMPOSER_UG_NAME, UG_MODE_FULLVIEW, svc_handle, &ad->cbs);
- ad->ug_type = ug_type;
+ ugdata *composer_data = NULL;
+
+ composer_data = (ugdata*)calloc(1, sizeof(ugdata));
+ composer_data->ug_h = ug_create(NULL, MSG_COMPOSER_UG_NAME, UG_MODE_FULLVIEW, svc_handle, &ad->cbs);
+ composer_data->ug_type = ug_type;
+ ad->composer_data = composer_data;
}
if (svc_handle)
elm_win_activate(ad->win_main);
}
- if (ad->layout_main == NULL && ad->composer_ug == NULL)
+ if (ad->layout_main == NULL && ad->composer_data == NULL)
elm_exit();
D_LEAVE;
#include <ui-gadget-module.h>
#include <utilX.h>
#include "msg-ui-util.h"
+
#include <aul.h>
#include <appsvc.h>
MSG_COMPOSER_UG_TYPE_VIEWER,
} MessageComposerUgType;
+typedef struct _ugdata
+{
+ ui_gadget_h ug_h;
+ MessageComposerUgType ug_type;
+ Elm_Object_Item *sel_gen_item;
+ int sel_thread_id;
+ int sel_msg_id;
+
+ struct _ugdata *prev_ug;
+ struct _ugdata *next_ug;
+}ugdata;
+
struct appdata
{
Evas_Object *win_main;
Evas_Object *layout_main;
struct ug_cbs cbs;
- ui_gadget_h composer_ug;
- MessageComposerUgType ug_type;
-
+ ugdata *composer_data;
msg_handle_t msgHandle;
void *thread_data;
};
-int msg_ui_load_composer_ug(service_h svc_handle, MessageComposerUgType ug_type);
+int msg_ui_load_composer_ug(service_h svc_handle, MessageComposerUgType ug_type, bool isListItem);
+Evas_Object *msg_ui_get_main_layout(void);
+ugdata *msg_ui_get_composer_ug_data(ui_gadget_h ug);
Evas_Object *msg_ui_get_composer_ug_viewer_layout(void);
-void msg_ui_destroy_composer_ug(void);
+void msg_ui_destroy_composer_ug(ui_gadget_h ug, bool bDeleteAll);
+int msg_ui_get_composer_ug_type(ui_gadget_h ug);
#endif /* __DEF_message_H__ */
if (strcmp(text, dgettext("sys_string", "IDS_COM_SK_DONE")) == 0 || strcmp(text, dgettext("sys_string", "IDS_COM_SK_SAVE")) == 0) {
Evas_Object *icon = elm_icon_add(button);
- elm_image_file_set(icon, MSG_IMAGES_EDJ, MSG_COMMON_FILE_PLUS_ICON);
+ elm_image_file_set(icon, MSG_IMAGES_EDJ, MSG_UI_SETTING_TITLE_ICON_PLUS);
evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1 , 1);
elm_image_resizable_set(icon, EINA_TRUE, EINA_TRUE);
elm_object_content_set(button, icon);
typedef struct _MSG_THREAD_LIST_DATA MSG_THREAD_LIST_DATA, *PMSG_THREAD_LIST_DATA;
typedef struct _MSG_THREAD_SPLIT_DATA MSG_THREAD_SPLIT_DATA, *PMSG_THREAD_SPLIT_DATA;
-typedef struct _MSG_APP_THREAD_DATA_S MSG_APP_THREAD_DATA_S, *PMSG_APP_THREAD_DATA_S;
+typedef struct _MSG_APP_THREAD_CONV_DATA_S MSG_APP_THREAD_CONV_DATA_S, *PMSG_APP_THREAD_CONV_DATA_S;
typedef struct _MSG_APP_THREAD_MSG_DATA_S MSG_APP_THREAD_MSG_DATA_S, *PMSG_APP_THREAD_MSG_DATA_S;
-typedef struct _MSG_APP_THREAD_DATELINE_DATA_S MSG_APP_THREAD_DATELINE_DATA_S, *PMSG_APP_THREAD_DATELINE_DATA_S;
typedef struct _MSG_APP_THREAD_ADDR_INFO_S MSG_APP_THREAD_ADDR_INFO_S, *PMSG_APP_THREAD_ADDR_INFO_S;
-typedef struct _THREAD_MORE_VIEW_DATA THREAD_MORE_VIEW_DATA, *PTHREAD_MORE_VIEW_DATA;
+typedef struct _MSG_APP_THREAD_SEARCH_TITLE_S MSG_APP_THREAD_SEARCH_TITLE_S, *PMSG_APP_THREAD_SEARCH_TITLE_S;
+
+typedef struct _MSG_APP_THREAD_POPUP MSG_APP_THREAD_POPUP, *PMSG_APP_THREAD_POPUP;
+typedef struct _MSG_APP_THREAD_POPUP_PROGRESS MSG_APP_THREAD_POPUP_PROGRESS, *PMSG_APP_THREAD_POPUP_PROGRESS;
+typedef struct _MSG_APP_THREAD_POPUP_ADDRESS MSG_APP_THREAD_POPUP_ADDRESS, *PMSG_APP_THREAD_POPUP_ADDRESS;
+typedef struct _MSG_APP_THREAD_POPUP_ACTION MSG_APP_THREAD_POPUP_ACTION, *PMSG_APP_THREAD_POPUP_ACTION;
typedef enum {
THREAD_NORMAL_VIEW = 0,
} ThreadMsgListType;
typedef enum {
- THREAD_LIST_APP_DATA_THREAD = 0,
+ THREAD_LIST_APP_DATA_CONV = 0,
THREAD_LIST_APP_DATA_MSG,
-} ThreadMsgListAppDataType;
+ THREAD_LIST_APP_DATA_SEARCH,
+} ThreadAppDataType;
typedef enum {
THREAD_SEARCH_OFF = 0,
typedef enum {
THREAD_ITC_EMPTY = 0,
- THREAD_ITC_SEARCH,
+ THREAD_ITC_SEARCH_TITLE,
THREAD_ITC_BLANK,
THREAD_ITC_POPUP,
- THREAD_ITC_DATE,
} ThreadItcType;
typedef enum {
THREAD_ACTION_UNBLOCK,
} ThreadActionType;
+typedef enum {
+ THREAD_POPUP_NONE = 0,
+ THREAD_POPUP_PROGRESS,
+ THREAD_POPUP_ADDRESS,
+ THREAD_POPUP_ACTION,
+} ThreadPopupType;
+
+typedef enum {
+ THREAD_SEARCH_CONV = 0,
+ THREAD_SEARCH_MSG,
+} ThreadSearchType;
+
enum {
THREAD_ROTATE_ANGLE_PORTRAIT = 0,
THREAD_ROTATE_ANGLE_PORTRAIT_UPSIDEDOWN = 180,
Elm_Object_Item *detail_nf_it;
Elm_Genlist_Item_Class itc_empty;
- Elm_Genlist_Item_Class itc_search;
+ Elm_Genlist_Item_Class itc_search_title;
Elm_Genlist_Item_Class itc_blank;
Elm_Genlist_Item_Class itc_popup;
- Elm_Genlist_Item_Class itc_date;
char *time_12h_ptn;
char *time_24h_ptn;
- char *date_ptn_default;
- char *date_ptn_year;
msg_time_format time_fmt;
char locale[DEF_BUF_LEN];
bool isRotate; /* Rotation state */
bool handlerIsPressed; /*pressed status of panes's handler*/
+ bool keypadIsShown; /*bubble's keypad status */
bool isIncomingMsg; /* Check there is new incoming message when it back from edit mode to normal. */
PMSG_THREAD_LIST_DATA list_data[MSG_THREAD_LIST_MAX_COUNT];
Evas_Object *genlist;
Evas_Object *content_ly;
Evas_Object *noc_ly;
+ Evas_Object *noc_ly_search;
Elm_Object_Item *nf_it; //title, control bar naviframe item
+
Evas_Object *toolbar_btn[CONTROLBAR_ITEM_MAX];
Evas_Object *back_btn;
+ Evas_Object *composer_btn;
Evas_Object *search_btn;
Evas_Object *searchbar;
Ecore_Timer *search_timer;
- Elm_Genlist_Item_Class itc_default;
+ Elm_Genlist_Item_Class itc_conv;
Elm_Genlist_Item_Class itc_unread;
+ Elm_Genlist_Item_Class itc_msg;
ThreadViewMode view_mode;
ThreadMsgListType list_type;
- ThreadMsgListAppDataType app_data_type;
+ ThreadAppDataType app_data_type;
ThreadSearchMode search_mode;
ThreadActionType action_type;
Evas_Object *select_info; //%d item selected
Evas_Object *selectioninfo_layout;
- Evas_Object *sel_all_ly;
- Evas_Object *sel_all_box;
+ Evas_Object *sel_all_btn;
Eina_Bool sel_all_checked;
Eina_List *chk_list;
- Ecore_Thread *multi_action_thread;
+ Eina_List *search_thread_bubble_list;
+ Eina_List *search_msg_bubble_list;
int sel_index;
+ int unread_cnt;
int item_cnt;
int check_cnt;
- Evas_Object *popup;
- Evas_Object *progressbar;
- Ecore_Job *job_popup_end;
- bool include_protected_msg;
+ PMSG_APP_THREAD_POPUP pPopup;
Ecore_Idler *launch_idler;
int loaded_cnt;
Evas_Object *content_ly;
Evas_Object *navi_frame;
Elm_Object_Item *nf_it;
- Evas_Object *title_layout;
Evas_Object *noc_ly;
Evas_Object *back_btn;
- Evas_Object *composer_btn;
+ Evas_Object *more_btn;
} _MSG_THREAD_SPLIT_DATA;
-typedef struct _MSG_APP_THREAD_DATA_S {
+typedef struct _MSG_APP_THREAD_CONV_DATA_S {
+ int app_data_type;
msg_thread_id_t thread_id;
char thread_name[DEF_THREAD_NAME_LEN+1];
char thread_data[DEF_BUF_LEN_S+1];
int mms_cnt;
int msg_type;
+ bool bProtected;
+ bool bDraft;
+ bool bFailed;
+ bool bHighlight;
+
Evas_Object *chk;
Eina_Bool is_check;
-} _MSG_APP_THREAD_DATA_S;
+} _MSG_APP_THREAD_CONV_DATA_S;
typedef struct _MSG_APP_THREAD_MSG_DATA_S {
+ int app_data_type;
int msg_id;
+ int thread_id;
int msg_type;
bool is_read;
+ bool is_protected;
int direction;
PMSG_APP_THREAD_ADDR_INFO_S *addr_info;
Evas_Object *chk;
Eina_Bool is_check;
+
+ bool bHighlight;
} _MSG_APP_THREAD_MSG_DATA_S;
-typedef struct _MSG_APP_THREAD_DATELINE_DATA_S {
- Elm_Object_Item *date_it;
- time_t *thread_time;
- int subitem_cnt;
-} _MSG_APP_THREAD_DATELINE_DATA_S;
+typedef struct _MSG_APP_THREAD_SEARCH_TITLE_S {
+ Elm_Object_Item *title_it;
+ ThreadSearchType nType;
+ int subitem_cnt;
+} _MSG_APP_THREAD_SEARCH_TITLE_S;
typedef struct _MSG_APP_THREAD_ADDR_INFO_S {
int contact_id;
+ int addr_type;
char display_name[DEF_THREAD_NAME_LEN+1];
char address[DEF_THREAD_ADDR_LEN+1];
} _MSG_APP_THREAD_ADDR_INFO_S;
+/* thread list popup*/
+typedef struct _MSG_APP_THREAD_POPUP {
+ int popup_type;
+ Evas_Object *popup_object;
+} _MSG_APP_THREAD_POPUP;
+
+typedef struct _MSG_APP_THREAD_POPUP_PROGRESS {
+ int popup_type;
+ Evas_Object *popup_object;
+
+ bool include_protected_msg;
+ Evas_Object *progressbar;
+ Ecore_Thread *multi_action_thread;
+} _MSG_APP_THREAD_POPUP_PROGRESS;
+
+typedef struct _MSG_APP_THREAD_POPUP_ADDRESS {
+ int popup_type;
+ Evas_Object *popup_object;
+
+ Ecore_Job *job_popup_end;
+} _MSG_APP_THREAD_POPUP_ADDRESS;
+
+typedef struct _MSG_APP_THREAD_POPUP_ACTION {
+ int popup_type;
+ Evas_Object *popup_object;
+
+ bool include_protected_msg;
+ bool all_protected;
+ Evas_Object *btn_ok;
+} _MSG_APP_THREAD_POPUP_ACTION;
#define MSG_THREAD_POPUP_DATA "popup_data"
void *msg_ui_thread_init_thread_data(struct appdata *ad);
void msg_ui_thread_deinit_thread_data(void *data);
-PMSG_THREAD_LIST_DATA msg_ui_thread_create_thread_list_data(ThreadMsgListType list_type, ThreadMsgListAppDataType app_data_type);
+PMSG_THREAD_LIST_DATA msg_ui_thread_create_thread_list_data(ThreadMsgListType list_type, ThreadAppDataType app_data_type);
PMSG_THREAD_SPLIT_DATA msg_ui_thread_create_split_data(void);
void msg_ui_thread_destroy_thread_list_data(PMSG_THREAD_LIST_DATA pListData);
void msg_ui_thread_destroy_split_data(PMSG_THREAD_SPLIT_DATA pSplitData);
void msg_ui_thread_fullview_launch(PMSG_THREAD_DATA pData, PMSG_THREAD_LIST_DATA pListData);
void msg_ui_thread_splitview_launch(PMSG_THREAD_DATA pData, PMSG_THREAD_SPLIT_DATA pSplitData);
Evas_Object *msg_ui_thread_create_content_layout(Evas_Object *parent);
-Evas_Object *msg_ui_thread_create_nocontent_layout(Evas_Object *parent);
+Evas_Object *msg_ui_thread_create_nocontent_layout(Evas_Object *parent, ThreadSearchMode search_mode);
Evas_Object *msg_ui_thread_create_layout_main(PMSG_THREAD_DATA pData);
Evas_Object *msg_ui_thread_create_genlist(Evas_Object *parent, PMSG_THREAD_LIST_DATA pListData);
Evas_Object *msg_ui_thread_create_searchbar_layout(Evas_Object *parent, PMSG_THREAD_LIST_DATA pListData);
void msg_ui_thread_reg_msg_cb_func(PMSG_THREAD_DATA pData);
-void msg_ui_thread_set_navi_toolbar_item(PMSG_THREAD_LIST_DATA pListData);
+void msg_ui_thread_set_navi_toolbar_item(PMSG_THREAD_LIST_DATA pListData, bool bReset);
+void msg_ui_thread_set_title_unread_cnt(PMSG_THREAD_LIST_DATA pListData);
+void msg_ui_thread_set_title_status(PMSG_THREAD_LIST_DATA pListData);
void msg_ui_thread_show_toolbar(PMSG_THREAD_LIST_DATA pListData);
void msg_ui_thread_hide_toolbar(PMSG_THREAD_LIST_DATA pListData, bool bDeleteBtn);
void msg_ui_thread_rotation_set(void *data, int rot);
/* THREAD LIST */
-void msg_ui_thread_set_thread_data(PMSG_THREAD_LIST_DATA pListData, PMSG_APP_THREAD_DATA_S thread_data, msg_struct_t msgThreadInfo);
+void msg_ui_thread_set_conv_data(PMSG_THREAD_LIST_DATA pListData, PMSG_APP_THREAD_CONV_DATA_S thread_data, msg_struct_t msgThreadInfo);
void msg_ui_thread_set_msg_data(PMSG_APP_THREAD_MSG_DATA_S msg_data, msg_struct_t msgInfo);
char *msg_ui_thread_msg_gl_text_get(void *data, Evas_Object *obj, const char *part);
-char *msg_ui_thread_search_msg_gl_text_get(void *data, Evas_Object *obj, const char *part);
+char *msg_ui_thread_search_title_gl_text_get(void *data, Evas_Object *obj, const char *part);
Evas_Object *msg_ui_thread_msg_gl_content_get(void *data, Evas_Object *obj, const char *part);
void msg_ui_thread_msg_gl_del(void *data, Evas_Object *obj);
+void msg_ui_search_title_gl_del(void *data, Evas_Object *obj);
void msg_ui_thread_msg_gl_sel(void *data, Evas_Object *obj, void *event_info);
char *msg_ui_thread_gl_empty_get(void *data, Evas_Object *obj, const char *part);
-void msg_ui_thread_gl_empty_sel(void *data, Evas_Object *obj, void *event_info);
-char *msg_ui_thread_date_gl_text_get(void *data, Evas_Object *obj, const char *part);
-void msg_ui_thread_date_gl_del(void *data, Evas_Object *obj);
-PMSG_APP_THREAD_DATELINE_DATA_S msg_ui_thread_list_insert_dateline(PMSG_THREAD_LIST_DATA pListData, time_t* cur_time, time_t* prev_time);
void msg_ui_thread_list_load(PMSG_THREAD_LIST_DATA pListData, Eina_Bool bLaunch);
void msg_ui_thread_list_update(PMSG_THREAD_LIST_DATA pListData);
+void msg_ui_thread_list_item_insert(PMSG_THREAD_LIST_DATA pListData);
Eina_Bool msg_ui_thread_list_item_update(PMSG_THREAD_LIST_DATA pListData, msg_thread_id_t thread_id);
void msg_ui_thread_list_item_delete(PMSG_THREAD_LIST_DATA pListData, msg_thread_id_t thread_id);
void msg_ui_thread_msg_list_load(PMSG_THREAD_LIST_DATA pListData, int listType);
void msg_ui_thread_list_msg_list_update(PMSG_THREAD_LIST_DATA pListData);
-void msg_ui_thread_list_msg_item_delete(PMSG_THREAD_LIST_DATA pListData, msg_message_id_t msg_id);
Eina_Bool msg_ui_thread_list_msg_item_update(PMSG_THREAD_LIST_DATA pListData, msg_message_id_t msg_id);
-Eina_Bool msg_ui_thread_search_msg_list_load(void *data);
+void msg_ui_thread_list_msg_item_delete(PMSG_THREAD_LIST_DATA pListData, msg_message_id_t msg_id);
+
+Eina_Bool msg_ui_thread_search_list_load(void *data);
void msg_ui_thread_common_style_set(PMSG_THREAD_DATA pData);
-void msg_ui_thread_genlist_style_set(PMSG_THREAD_LIST_DATA pListData);
+void msg_ui_thread_genlist_style_set(PMSG_THREAD_LIST_DATA pListData, ThreadAppDataType nType);
/* THREAD CALLBACK */
void msg_ui_thread_storage_change_cb(msg_handle_t handle, msg_storage_change_type_t storageChangeType, msg_id_list_s *pMsgIdList, void *user_param);
void msg_ui_thread_multi_action_thread_fn(void *data, Ecore_Thread *thread);
void msg_ui_thread_multi_action_thread_feedback_fn(void *data, Ecore_Thread *thread, void *msg_data);
void msg_ui_thread_ctlbar_checkbox_cb(void *data, Evas_Object *obj, void *event_info);
-void msg_ui_thread_ctlbar_spam_setting_cb(void *data, Evas_Object *obj, void *event_info);
+void msg_ui_thread_ctlbar_setting_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_thread_ctlbar_compose_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_thread_ctlbar_message_box_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_thread_sel_all_clicked_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_thread_list_checked_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_thread_back_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info);
+void msg_ui_thread_detail_view_back_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_thread_search_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_thread_searchbar_entry_focus_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_thread_searchbar_entry_unfocus_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_thread_timezone_change_cb(keynode_t *key, void *data);
void msg_ui_thread_gl_mode_right(void *data, Evas_Object *obj, void *event_info);
void msg_ui_thread_gl_mode_left(void *data, Evas_Object *obj, void *event_info);
+void msg_ui_thread_gl_highlighted(void *data, Evas_Object *obj, void *event_info);
+void msg_ui_thread_gl_unhighlighted(void *data, Evas_Object *obj, void *event_info);
void msg_ui_thread_panes_handler_press_cb(void *data, Evas_Object *obj, void *event_info);
void msg_ui_thread_panes_handler_unpress_cb(void *data, Evas_Object *obj, void *event_info);
/* THREAD UTILS */
int msg_ui_thread_launch_voice_call(const char *call_num);
void msg_ui_thread_launch_video_call(const char *call_num);
-void msg_ui_thread_launch_spam_setting(PMSG_THREAD_LIST_DATA pListData);
+void msg_ui_thread_launch_setting(PMSG_THREAD_LIST_DATA pListData);
void msg_ui_thread_launch_viewer_ug(PMSG_THREAD_LIST_DATA pListData, int nMsgId);
-void msg_ui_thread_launch_msg_detail_view(PMSG_THREAD_LIST_DATA pListData, PMSG_APP_THREAD_MSG_DATA_S item_data);
-void msg_ui_thread_update_msg_detail_view(PMSG_APP_THREAD_MSG_DATA_S item_data);
+void msg_ui_thread_launch_msg_detail_view(PMSG_THREAD_LIST_DATA pListData, int msgID, int addrCnt, PMSG_APP_THREAD_ADDR_INFO_S *addr_info);
+void msg_ui_thread_update_msg_detail_view(int msgID, int addrCnt, PMSG_APP_THREAD_ADDR_INFO_S *addr_info);
+void msg_ui_thread_launch_search_detail_view(PMSG_THREAD_LIST_DATA pListData, char *search_str);
void msg_ui_thread_get_time_format(PMSG_THREAD_DATA pData);
void msg_ui_thread_get_locale(PMSG_THREAD_DATA pData);
-void msg_ui_thread_get_bubble_data(PMSG_APP_THREAD_DATA_S item_data, service_h svc_handle);
+void msg_ui_thread_get_bubble_data(PMSG_APP_THREAD_CONV_DATA_S item_data, service_h svc_handle);
void msg_ui_thread_get_composer_data(int msg_id, service_h svc_handle);
void msg_ui_thread_cancel_edit_mode(PMSG_THREAD_LIST_DATA pListData);
void msg_ui_thread_show_normal_mode(PMSG_THREAD_LIST_DATA pListData);
-void msg_ui_thread_select_item_by_thread_id(PMSG_THREAD_LIST_DATA pListData, int thread_id);
+void msg_ui_thread_select_item_by_thread_id(PMSG_THREAD_LIST_DATA pListData, int thread_id, bool bTopItem);
void msg_ui_thread_select_item_by_msg_id(PMSG_THREAD_LIST_DATA pListData, int msg_id);
void msg_ui_thread_show_notify(PMSG_THREAD_LIST_DATA pListData, const char *msg);
void msg_ui_thread_show_action_popup(PMSG_THREAD_LIST_DATA pListData, int actionType, const char *msg);
-Evas_Object* msg_ui_thread_show_notify_with_progressbar(PMSG_THREAD_LIST_DATA pListData, int count);
+void msg_ui_thread_show_notify_with_progressbar(PMSG_THREAD_LIST_DATA pListData, int count, bool include_protected_msg);
void msg_ui_thread_show_select_info(PMSG_THREAD_LIST_DATA pListData);
void msg_ui_thread_show_action_finish_info(PMSG_THREAD_LIST_DATA pListData, int actionType, void *pData);
void msg_ui_thread_addr_select_popup(PMSG_THREAD_LIST_DATA pListData, const char *title, msg_struct_list_s *addrList);
void msg_ui_thread_set_app_state(int app_state);
int msg_ui_thread_get_app_state(PMSG_THREAD_DATA pData);
void msg_ui_thread_cancel_search_mode(PMSG_THREAD_LIST_DATA pListData);
-void msg_ui_thread_button_disabled_set(PMSG_THREAD_LIST_DATA pListData, Eina_Bool disabled, int controlbar_btn);
+void msg_ui_thread_button_disabled_set(PMSG_THREAD_LIST_DATA pListData, Eina_Bool disabled);
void msg_ui_thread_get_title_text(PMSG_THREAD_LIST_DATA pListData, char *label, int label_len);
+void msg_ui_thread_create_bubble_by_msgid(PMSG_THREAD_LIST_DATA pListData, int msg_id, bool isListItem);
const char *msg_ui_thread_make_search_result_string(const char *string, char *searchword, bool *result);
void msg_ui_thread_make_time_string(time_t *msg_t, char *buf, int buf_len);
#endif /* __DEF_MSG_UI_THREAD_MAIN_H__ */
#include "msg-ui-thread-main.h"
-static void __msg_ui_thread_insert_and_select_gen_item(PMSG_THREAD_LIST_DATA pListData);
-static void __msg_ui_thread_add_navi_select_all_ly(PMSG_THREAD_LIST_DATA pListData);
-static void __msg_ui_thread_sel_all_ly_mouse_down_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info);
static void __msg_ui_thread_multi_action_finish(PMSG_THREAD_LIST_DATA pListData);
static Eina_Bool __msg_ui_thread_searchbar_entry_timer_cb(void *data);
for (list_idx = MSG_THREAD_LIST_MAX_COUNT-1; list_idx >= 0; list_idx--) {
if (pData->list_data[list_idx] != NULL) {
+ Ecore_Thread *multi_action_thread = NULL;
+
pListData = pData->list_data[list_idx];
- if (pListData->multi_action_thread != NULL || multiple_action == true) {
+
+ if (pListData->pPopup && pListData->pPopup->popup_type == THREAD_POPUP_PROGRESS) {
+ PMSG_APP_THREAD_POPUP_PROGRESS pPopup = (PMSG_APP_THREAD_POPUP_PROGRESS)pListData->pPopup;
+ multi_action_thread = pPopup->multi_action_thread;
+ }
+
+ if (multi_action_thread != NULL || multiple_action == true) {
multiple_action = true;
break; //finish multi action, reload msg list
}
if (type == MSG_STORAGE_CHANGE_CONTACT) {
- if (pListData->app_data_type == THREAD_LIST_APP_DATA_THREAD)
- msg_ui_thread_list_update(pListData);
- else
+ if (pListData->app_data_type == THREAD_LIST_APP_DATA_SEARCH) {
+ msg_ui_thread_search_list_load(pListData);
+ elm_genlist_realized_items_update(pListData->genlist);
+ } else if (pListData->app_data_type == THREAD_LIST_APP_DATA_MSG) {
msg_ui_thread_list_msg_list_update(pListData);
+ } else {
+ msg_ui_thread_list_update(pListData);
+ }
} else if (type == MSG_STORAGE_CHANGE_INSERT) {
if (pListData->view_mode == THREAD_EDIT_VIEW) {
pData->isIncomingMsg = true;
D_MSG("Current mode is EDIT.");
return;
}
- __msg_ui_thread_insert_and_select_gen_item(pListData);
+
+ if (pListData->item_cnt == 0) {
+ if (pData->isRotate == true) {
+ elm_panes_content_left_size_set(pData->panes, 0.4);
+ elm_object_signal_emit(pData->panes, "elm,panes,pair", "");
+ }
+ elm_object_disabled_set(pListData->search_btn, EINA_FALSE);
+ }
+ msg_ui_thread_list_item_insert(pListData);
} else if (type == MSG_STORAGE_CHANGE_DELETE) {
- if (pListData->app_data_type == THREAD_LIST_APP_DATA_MSG) {
+ if (pListData->app_data_type != THREAD_LIST_APP_DATA_CONV) {
int idx = 0;
for (idx = 0; idx < pMsgIdList->nCount; idx++) {
msg_ui_thread_list_msg_item_delete(pListData, pMsgIdList->msgIdList[idx]);
}
- } else {
- Elm_Object_Item *gen_item = NULL;
- PMSG_APP_THREAD_DATA_S item_data = NULL;
- msg_struct_t threadInfo = msg_create_struct(MSG_STRUCT_THREAD_INFO);
- int smsCnt = 0;
- int mmsCnt = 0;
- msg_error_t err = MSG_SUCCESS;
-
- gen_item = elm_genlist_first_item_get(pListData->genlist);
- while (gen_item) {
- if (elm_genlist_item_parent_get(gen_item) == NULL) {
- gen_item = elm_genlist_item_next_get(gen_item);
- continue;
- }
-
- item_data = (PMSG_APP_THREAD_DATA_S) elm_object_item_data_get(gen_item);
+ }
- err = msg_get_thread(msg_ui_thread_get_data_handle(), item_data->thread_id, threadInfo);
- if (err != MSG_SUCCESS) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "msg_get_thread() is failed : err = %d", err);
- msg_ui_thread_list_item_delete(pListData, item_data->thread_id);
- break;
+ if (pListData->item_cnt <= 0) {
+ if (pData->isRotate == true) {
+ if (pListData->search_mode == THREAD_SEARCH_OFF) {
+ elm_panes_content_left_size_set(pData->panes, 0.0);
+ elm_object_signal_emit(pData->panes, "elm,panes,unpair", "");
}
-
- msg_get_int_value(threadInfo, MSG_THREAD_MMS_COUNT_INT, &mmsCnt);
- msg_get_int_value(threadInfo, MSG_THREAD_SMS_COUNT_INT, &smsCnt);
-
- if (smsCnt+mmsCnt == 0)
- msg_ui_thread_list_item_delete(pListData, item_data->thread_id);
- else if ((item_data->sms_cnt + item_data->mms_cnt) != (smsCnt+mmsCnt))
- msg_ui_thread_list_item_update(pListData, item_data->thread_id);
-
- gen_item = elm_genlist_item_next_get(gen_item);
+ } else {
+ elm_object_disabled_set(pListData->search_btn, EINA_TRUE);
}
- msg_release_struct(&threadInfo);
}
} else if (type == MSG_STORAGE_CHANGE_UPDATE) {
int idx = 0;
for (idx = 0; idx < pMsgIdList->nCount; idx++) {
- if (pListData->app_data_type == THREAD_LIST_APP_DATA_THREAD) {
+ if (pListData->app_data_type != THREAD_LIST_APP_DATA_MSG) {
msg_struct_t msgInfo = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
msg_struct_t sendOpt = msg_create_struct(MSG_STRUCT_SENDOPT);
msg_error_t err = MSG_SUCCESS;
msg_release_struct(&sendOpt);
if (msg_ui_thread_list_item_update(pListData, thread_id) == EINA_FALSE)
- __msg_ui_thread_insert_and_select_gen_item(pListData);
- } else {
+ msg_ui_thread_list_item_insert(pListData);
+ }
+
+ if (pListData->app_data_type != THREAD_LIST_APP_DATA_CONV) {
if (msg_ui_thread_list_msg_item_update(pListData, pMsgIdList->msgIdList[idx]) == EINA_FALSE)
- __msg_ui_thread_insert_and_select_gen_item(pListData);
+ msg_ui_thread_list_item_insert(pListData);
}
}
}
MSG_UI_LEAVE();
}
-static void __msg_ui_thread_insert_and_select_gen_item(PMSG_THREAD_LIST_DATA pListData)
-{
- MSG_UI_ENTER();
-
- int sel_thread_id = 0, sel_msg_id = 0;
-
- if (pListData->sel_gen_item) {
- sel_thread_id = pListData->sel_thread_id;
- sel_msg_id = pListData->sel_msg_id;
- }
-
- if (pListData->app_data_type == THREAD_LIST_APP_DATA_MSG) {
- if (pListData->search_mode == THREAD_SEARCH_ON)
- msg_ui_thread_search_msg_list_load(pListData);
- else
- msg_ui_thread_msg_list_load(pListData, pListData->list_type);
- msg_ui_thread_select_item_by_msg_id(pListData, sel_msg_id);
- } else {
- msg_ui_thread_list_load(pListData, FALSE);
- msg_ui_thread_select_item_by_thread_id(pListData, sel_thread_id);
- }
-
- if (pListData->sel_gen_item)
- elm_genlist_item_selected_set(pListData->sel_gen_item, true);
-
- MSG_UI_LEAVE();
-}
-
void msg_ui_thread_ctlbar_multi_action_cb(void *data, Evas_Object *obj, void *event_info)
{
D_ENTER;
MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !data || !obj);
PMSG_THREAD_LIST_DATA pListData = (PMSG_THREAD_LIST_DATA)data;
- MSG_UI_RET_IF(MSG_UI_LEVEL_DEBUG, pListData->multi_action_thread);
- if (pListData->popup) {
- evas_object_del(pListData->popup);
- pListData->popup = NULL;
+ if (pListData->pPopup) {
+ evas_object_del(pListData->pPopup->popup_object);
+ free(pListData->pPopup);
+ pListData->pPopup = NULL;
}
- if (obj == pListData->toolbar_btn[CONTROLBAR_ITEM_1]) {
- pListData->action_type = THREAD_ACTION_DELETE;
+ if (pListData->action_type == THREAD_ACTION_DELETE)
msg_ui_thread_show_action_popup(pListData, THREAD_ACTION_DELETE, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_OPT_DELETE_Q"));
- } else if (obj == pListData->toolbar_btn[CONTROLBAR_ITEM_2]) {
- if (pListData->list_type == THREAD_SPAM_LIST_TYPE) {
- pListData->action_type = THREAD_ACTION_RESTORE;
- msg_ui_thread_show_action_popup(pListData, THREAD_ACTION_RESTORE, dgettext(MESSAGE_PKGNAME, "IDS_MSG_BODY_MESSAGE_WILL_BE_RESTORED"));
- } else if (pListData->list_type == THREAD_SIM_LIST_TYPE) {
- pListData->action_type = THREAD_ACTION_COPY_TO_PHONE;
- }
- }
+ else if (pListData->action_type == THREAD_ACTION_RESTORE)
+ msg_ui_thread_show_action_popup(pListData, THREAD_ACTION_RESTORE, dgettext(MESSAGE_PKGNAME, "IDS_MSG_BODY_MESSAGE_WILL_BE_RESTORED"));
- if (pListData->popup == NULL) {
- pListData->popup = msg_ui_thread_show_notify_with_progressbar(pListData, pListData->check_cnt);
- pListData->multi_action_thread = ecore_thread_feedback_run(msg_ui_thread_multi_action_thread_fn, msg_ui_thread_multi_action_thread_feedback_fn, NULL, NULL, (void *)pListData, EINA_TRUE);
- }
+ if (pListData->pPopup == NULL)
+ msg_ui_thread_show_notify_with_progressbar(pListData, pListData->check_cnt, false);
}
void msg_ui_thread_multi_action_thread_feedback_fn(void *data, Ecore_Thread *thread, void *msg_data)
int *ret = msg_data;
if (*ret == MSG_SUCCESS) {
- if (pListData->progressbar)
- elm_progressbar_value_set(pListData->progressbar, (double)(pListData->sel_index+1)/pListData->check_cnt);
+ if (pListData->pPopup && pListData->pPopup->popup_type == THREAD_POPUP_PROGRESS) {
+ PMSG_APP_THREAD_POPUP_PROGRESS pPopup = (PMSG_APP_THREAD_POPUP_PROGRESS)pListData->pPopup;
+
+ if (pPopup->progressbar)
+ elm_progressbar_value_set(pPopup->progressbar, (double)(pListData->sel_index+1)/pListData->check_cnt);
+ }
} else {
MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "fail action. %d", *ret);
msg_ui_thread_show_notify(pListData, dgettext("sys_string", "IDS_COM_POP_MOVING_FAILED"));
pListData->action_type = THREAD_ACTION_NONE;
- pListData->include_protected_msg = false;
if (ret)
free(ret);
return;
Eina_List *list;
void* item_data = NULL;
+ bool include_protected_msg = false;
+
+ if (pListData->pPopup) {
+ if (pListData->pPopup->popup_type == THREAD_POPUP_ACTION) {
+ PMSG_APP_THREAD_POPUP_ACTION pPopup = (PMSG_APP_THREAD_POPUP_ACTION)pListData->pPopup;
+ include_protected_msg = pPopup->include_protected_msg;
+ } else if (pListData->pPopup->popup_type == THREAD_POPUP_PROGRESS) {
+ PMSG_APP_THREAD_POPUP_PROGRESS pPopup = (PMSG_APP_THREAD_POPUP_PROGRESS)pListData->pPopup;
+ include_protected_msg = pPopup->include_protected_msg;
+ }
+ MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "include_protected_msg = %d", include_protected_msg);
+ }
EINA_LIST_FOREACH(pListData->chk_list, list, item_data) {
int *ret = calloc(1, sizeof(int));
if (item_data) {
if (pListData->action_type == THREAD_ACTION_DELETE) {
if (pListData->list_type == THREAD_NORMAL_LIST_TYPE) {
- PMSG_APP_THREAD_DATA_S data = (PMSG_APP_THREAD_DATA_S)item_data;
- *ret = msg_delete_thread_message_list(msg_ui_thread_get_data_handle(), data->thread_id, pListData->include_protected_msg);
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "pListData->include_protected_msg = %d", pListData->include_protected_msg);
+ PMSG_APP_THREAD_CONV_DATA_S data = (PMSG_APP_THREAD_CONV_DATA_S)item_data;
+ *ret = msg_delete_thread_message_list(msg_ui_thread_get_data_handle(), data->thread_id, include_protected_msg);
} else {
PMSG_APP_THREAD_MSG_DATA_S data = (PMSG_APP_THREAD_MSG_DATA_S)item_data;
- if (pListData->include_protected_msg == false) {
- msg_struct_t msgInfo = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
- msg_struct_t sendOpt = msg_create_struct(MSG_STRUCT_SENDOPT);
- bool bProtect = false;
- msg_error_t err = MSG_SUCCESS;
-
- err = msg_get_message(msg_ui_thread_get_data_handle(), (msg_message_id_t)data->msg_id, msgInfo, sendOpt);
- if (err != MSG_SUCCESS) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "msg_get_message() is failed : err = %d", err);
- msg_release_struct(&msgInfo);
- msg_release_struct(&sendOpt);
- goto MSG_FAIL;
- }
-
- msg_get_bool_value(msgInfo, MSG_MESSAGE_PROTECTED_BOOL, &bProtect);
- if (bProtect == true) {
- msg_release_struct(&msgInfo);
- msg_release_struct(&sendOpt);
+ if (include_protected_msg == false) {
+ if (data->is_protected == true) {
*ret = MSG_SUCCESS;
ecore_thread_feedback(thread, (void *)ret);
continue;
}
-
*ret = msg_delete_message(msg_ui_thread_get_data_handle(), data->msg_id);
-
- msg_release_struct(&msgInfo);
- msg_release_struct(&sendOpt);
} else {
*ret = msg_delete_message(msg_ui_thread_get_data_handle(), data->msg_id);
}
{
D_ENTER;
- if (pListData->popup) {
- evas_object_del(pListData->popup);
- pListData->popup = NULL;
+ if (pListData->pPopup) {
+ evas_object_del(pListData->pPopup->popup_object);
+ free(pListData->pPopup);
+ pListData->pPopup = NULL;
}
msg_ui_thread_show_action_finish_info(pListData, pListData->action_type, NULL);
-
- pListData->multi_action_thread = NULL;
pListData->action_type = THREAD_ACTION_NONE;
- pListData->include_protected_msg = false;
if (pListData->list_type == THREAD_NORMAL_LIST_TYPE) {
msg_ui_thread_list_load(pListData, FALSE);
} else {
- PMSG_THREAD_LIST_DATA pDefaultListData = msg_ui_thread_get_default_list();
+ PMSG_THREAD_LIST_DATA pDefaultList = msg_ui_thread_get_default_list();
msg_ui_thread_msg_list_load(pListData, pListData->list_type);
- if (pDefaultListData)
- msg_ui_thread_list_load(pDefaultListData, FALSE); //might be changed
+ if (pDefaultList)
+ msg_ui_thread_list_load(pDefaultList, FALSE); //might be changed
}
-
msg_ui_thread_show_normal_mode(pListData);
}
PMSG_THREAD_LIST_DATA pListData = (PMSG_THREAD_LIST_DATA)data;
Elm_Object_Item* it_sweep = NULL;
- char buf[DEF_BUF_LEN_S] = {0};
+ PMSG_THREAD_DATA pData = msg_ui_thread_get_data();
+
+ const char *label = elm_object_item_text_get((Elm_Object_Item *)event_info);
+
+ if (label) {
+ if (strcmp(label, dgettext("sys_string", "IDS_COM_SK_DELETE")) == 0) {
+ pListData->action_type = THREAD_ACTION_DELETE;
+ } else if (strcmp(label, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_SK_RESTORE")) == 0) {
+ pListData->action_type = THREAD_ACTION_RESTORE;
+ } else if (strcmp(label, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_COPY_TO_PHONE")) == 0) {
+ pListData->action_type = THREAD_ACTION_COPY_TO_PHONE;
+ } else {
+ D_EMSG("invalid type");
+ return;
+ }
+ } else {
+ pListData->action_type = THREAD_ACTION_DELETE;
+ }
pListData->view_mode = THREAD_EDIT_VIEW;
pListData->check_cnt = 0;
pListData->sel_index = 0;
- if (pListData->popup) {
- evas_object_del(pListData->popup);
- pListData->popup = NULL;
+ if (pListData->action_type == THREAD_ACTION_NONE)
+ pListData->action_type = THREAD_ACTION_DELETE;
+
+ if (pListData->pPopup) {
+ PMSG_APP_THREAD_POPUP pPopup = (PMSG_APP_THREAD_POPUP)pListData->pPopup;
+
+ if (pPopup->popup_object)
+ evas_object_del(pPopup->popup_object);
+
+ free(pPopup);
+ pListData->pPopup = NULL;
+ }
+
+ if (pData->split_data) {
+ elm_panes_content_left_size_set(pData->panes, 1.0);
+ elm_object_signal_emit(pData->panes, "elm,panes,unpair", "");
+
+ elm_object_part_content_unset(pData->panes, "right");
+ msg_ui_thread_destroy_split_data(pData->split_data);
}
it_sweep = (Elm_Object_Item *)elm_genlist_decorated_item_get(pListData->genlist);
elm_genlist_decorate_mode_set(pListData->genlist, EINA_TRUE);
elm_genlist_select_mode_set(pListData->genlist, ELM_OBJECT_SELECT_MODE_ALWAYS);
- if (pListData->list_type == THREAD_SIM_LIST_TYPE || pListData->list_type == THREAD_SPAM_LIST_TYPE)
- snprintf(buf, sizeof(buf), "%s", dgettext("sys_string", "IDS_COM_SK_EDIT"));
- else
- snprintf(buf, sizeof(buf), "%s", dgettext("sys_string", "IDS_COM_SK_DELETE"));
-
- elm_object_item_text_set(pListData->nf_it, buf);
-
- __msg_ui_thread_add_navi_select_all_ly(pListData);
- msg_ui_thread_set_navi_toolbar_item(pListData);
-
- evas_object_hide(pListData->search_btn);
- elm_object_item_part_content_unset(pListData->nf_it, "title_right_btn");
+ msg_ui_thread_set_title_status(pListData);
+ msg_ui_thread_set_navi_toolbar_item(pListData, true);
MSG_UI_LEAVE();
}
-static void __msg_ui_thread_add_navi_select_all_ly(PMSG_THREAD_LIST_DATA pListData)
-{
- if (!pListData) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ASSERT,"[ASSERT] pListData is NULL");
- return;
- }
-
- if (!pListData->sel_all_ly) {
- pListData->sel_all_ly = elm_layout_add(pListData->content_ly);
- elm_layout_theme_set(pListData->sel_all_ly, "genlist", "item", "select_all/default");
- evas_object_size_hint_weight_set(pListData->sel_all_ly, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
- evas_object_size_hint_align_set(pListData->sel_all_ly, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_event_callback_add(pListData->sel_all_ly, EVAS_CALLBACK_MOUSE_DOWN, __msg_ui_thread_sel_all_ly_mouse_down_cb, pListData);
-
- pListData->sel_all_box = elm_check_add(pListData->sel_all_ly);
- elm_check_state_pointer_set(pListData->sel_all_box, &pListData->sel_all_checked);
- evas_object_propagate_events_set(pListData->sel_all_box, EINA_FALSE);
- evas_object_smart_callback_add(pListData->sel_all_box, "changed", msg_ui_thread_sel_all_clicked_cb, pListData);
- evas_object_show(pListData->sel_all_box);
-
- elm_object_part_content_set(pListData->sel_all_ly, "elm.icon", pListData->sel_all_box);
- elm_object_part_text_set(pListData->sel_all_ly, "elm.text", dgettext("sys_string", "IDS_COM_BODY_SELECT_ALL"));
- }
-
- if (msg_ui_thread_rotation_get() == true) {
- elm_object_part_content_unset(pListData->content_ly, "sel_all");
- evas_object_hide(pListData->searchbar);
- } else {
- edje_object_signal_emit(_EDJ(pListData->content_ly), "show_searchbar", "sel_all");
- }
- evas_object_show(pListData->sel_all_ly);
- elm_object_part_content_set(pListData->content_ly, "sel_all", pListData->sel_all_ly);
-}
-
-static void __msg_ui_thread_sel_all_ly_mouse_down_cb(void *data, Evas *evas, Evas_Object *obj, void *event_info)
-{
- MSG_UI_ENTER();
-
- PMSG_THREAD_LIST_DATA pListData = (PMSG_THREAD_LIST_DATA)data;
-
- pListData->sel_all_checked = !pListData->sel_all_checked;
- elm_check_state_pointer_set(pListData->sel_all_box, &pListData->sel_all_checked);
-
- msg_ui_thread_sel_all_clicked_cb(pListData, NULL, NULL);
-
- MSG_UI_LEAVE();
-}
-
-void msg_ui_thread_ctlbar_spam_setting_cb(void *data, Evas_Object *obj, void *event_info)
+void msg_ui_thread_ctlbar_setting_cb(void *data, Evas_Object *obj, void *event_info)
{
PMSG_THREAD_LIST_DATA pListData = (PMSG_THREAD_LIST_DATA)data;
Elm_Object_Item* it_sweep = NULL;
elm_genlist_item_select_mode_set(it_sweep, ELM_OBJECT_SELECT_MODE_DEFAULT);
}
- msg_ui_thread_launch_spam_setting(pListData);
+ if (pListData->pPopup) {
+ PMSG_APP_THREAD_POPUP pPopup = (PMSG_APP_THREAD_POPUP)pListData->pPopup;
+
+ if (pPopup->popup_object)
+ evas_object_del(pPopup->popup_object);
+
+ free(pPopup);
+ pListData->pPopup = NULL;
+ }
+
+ msg_ui_thread_launch_setting(pListData);
}
Elm_Object_Item* it_sweep = NULL;
service_h svc_handle = NULL;
+ if (pListData->pPopup) {
+ PMSG_APP_THREAD_POPUP pPopup = (PMSG_APP_THREAD_POPUP)pListData->pPopup;
+
+ if (pPopup->popup_object)
+ evas_object_del(pPopup->popup_object);
+
+ free(pPopup);
+ pListData->pPopup = NULL;
+ }
+
if (service_create(&svc_handle) < 0 || svc_handle == NULL) {
D_EMSG("service_create() is failed !!");
return;
elm_genlist_item_select_mode_set(it_sweep, ELM_OBJECT_SELECT_MODE_DEFAULT);
}
- if (msg_ui_load_composer_ug(svc_handle, MSG_COMPOSER_UG_TYPE_COMPOSER) == MSG_UI_RET_ERR)
+ if (msg_ui_load_composer_ug(svc_handle, MSG_COMPOSER_UG_TYPE_COMPOSER, false) == MSG_UI_RET_ERR)
D_MSG("Failed to load composer ug");
service_destroy(svc_handle);
PMSG_THREAD_DATA pData = msg_ui_thread_get_data();
Elm_Object_Item* it_sweep = NULL;
- if (pListData->popup) {
- evas_object_del(pListData->popup);
- pListData->popup = NULL;
+ if (pListData->pPopup) {
+ evas_object_del(pListData->pPopup->popup_object);
+ free(pListData->pPopup);
+ pListData->pPopup = NULL;
}
it_sweep = (Elm_Object_Item *)elm_genlist_decorated_item_get(pListData->genlist);
// Create pop-up ( Spam / SIM (it will be extended) )
Evas_Object *ctx_popup = NULL;
- ctx_popup = elm_ctxpopup_add(pData->navi_frame);
+ ctx_popup = elm_ctxpopup_add(pData->panes);
evas_object_smart_callback_add(ctx_popup, "dismissed", __msg_ui_thread_ctxpopup_dismissed_cb, pListData);
- if (pListData->item_cnt > 0)
- elm_ctxpopup_item_append(ctx_popup, dgettext("sys_string", "IDS_COM_SK_DELETE"), NULL, msg_ui_thread_ctlbar_checkbox_cb, pListData);
-
+ switch (pListData->list_type) {
+ case THREAD_NORMAL_LIST_TYPE:
+ if (pListData->item_cnt > 0) {
+ elm_ctxpopup_item_append(ctx_popup, dgettext("sys_string", "IDS_COM_SK_DELETE"), NULL, msg_ui_thread_ctlbar_checkbox_cb, pListData);
+ } else {
+ if (msg_ui_thread_rotation_get() == true)
+ elm_ctxpopup_item_append(ctx_popup, dgettext("sys_string", "IDS_COM_SK3_COMPOSE"), NULL, msg_ui_thread_ctlbar_compose_cb, pListData);
+ }
- elm_ctxpopup_item_append(ctx_popup, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_CB_MESSAGES"), NULL, __msg_ui_thread_ctxpopup_clicked_cb, pListData);
- elm_ctxpopup_item_append(ctx_popup, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_SIM_CARD_MESSAGES"), NULL, __msg_ui_thread_ctxpopup_clicked_cb, pListData);
- elm_ctxpopup_item_append(ctx_popup, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_SPAM_MESSAGES"), NULL, __msg_ui_thread_ctxpopup_clicked_cb, pListData);
+ elm_ctxpopup_item_append(ctx_popup, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_CB_MESSAGES"), NULL, __msg_ui_thread_ctxpopup_clicked_cb, pListData);
+ elm_ctxpopup_item_append(ctx_popup, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_SIM_CARD_MESSAGES"), NULL, __msg_ui_thread_ctxpopup_clicked_cb, pListData);
+ elm_ctxpopup_item_append(ctx_popup, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_SPAM_MESSAGES"), NULL, __msg_ui_thread_ctxpopup_clicked_cb, pListData);
+ elm_ctxpopup_item_append(ctx_popup, dgettext("sys_string", "IDS_COM_BODY_SETTINGS"), NULL, msg_ui_thread_ctlbar_setting_cb, pListData);
+ break;
+
+ case THREAD_SPAM_LIST_TYPE:
+ if (pListData->item_cnt > 0) {
+ if (msg_ui_thread_rotation_get() == true)
+ elm_ctxpopup_item_append(ctx_popup, dgettext("sys_string", "IDS_COM_SK_DELETE"), NULL, msg_ui_thread_ctlbar_checkbox_cb, pListData);
+ elm_ctxpopup_item_append(ctx_popup, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_SK_RESTORE"), NULL, msg_ui_thread_ctlbar_checkbox_cb, pListData);
+ }
+ elm_ctxpopup_item_append(ctx_popup, dgettext("sys_string", "IDS_COM_BODY_SETTINGS"), NULL, msg_ui_thread_ctlbar_setting_cb, pListData);
+ break;
+
+ case THREAD_SIM_LIST_TYPE:
+ if (msg_ui_thread_rotation_get() == true)
+ elm_ctxpopup_item_append(ctx_popup, dgettext("sys_string", "IDS_COM_SK_DELETE"), NULL, msg_ui_thread_ctlbar_checkbox_cb, pListData);
+ elm_ctxpopup_item_append(ctx_popup, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_COPY_TO_PHONE"), NULL, msg_ui_thread_ctlbar_checkbox_cb, pListData);
+ break;
+
+ case THREAD_CBMSG_LIST_TYPE:
+ if (msg_ui_thread_rotation_get() == true)
+ elm_ctxpopup_item_append(ctx_popup, dgettext("sys_string", "IDS_COM_SK_DELETE"), NULL, msg_ui_thread_ctlbar_checkbox_cb, pListData);
+ break;
+
+ default:
+ D_EMSG("invalid viewmode");
+ break;
+ }
// move ctx popup
Evas_Coord x, y, w, h;
evas_object_geometry_get(obj, &x, &y, &w, &h);
- evas_object_move(ctx_popup, x , y);
+ evas_object_move(ctx_popup, x+w/2, y+h/2);
evas_object_show(ctx_popup);
- pListData->popup = ctx_popup;
+
+ PMSG_APP_THREAD_POPUP pPopup = (PMSG_APP_THREAD_POPUP)calloc(1, sizeof(MSG_APP_THREAD_POPUP));
+ pPopup->popup_object = ctx_popup;
+ pPopup->popup_type = THREAD_POPUP_NONE;
+ pListData->pPopup = pPopup;
MSG_UI_LEAVE();
}
MSG_UI_ENTER();
PMSG_THREAD_LIST_DATA pListData = (PMSG_THREAD_LIST_DATA)data;
- if (pListData->popup) {
- evas_object_del(pListData->popup);
- pListData->popup = NULL;
+ if (pListData->pPopup) {
+ PMSG_APP_THREAD_POPUP pPopup = (PMSG_APP_THREAD_POPUP)pListData->pPopup;
+
+ if (pPopup->popup_object)
+ evas_object_del(pPopup->popup_object);
+
+ free(pPopup);
+ pListData->pPopup = NULL;
}
+ pListData->action_type = THREAD_ACTION_NONE;
MSG_UI_LEAVE();
}
} else if (strcmp(label, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_CB_MESSAGES")) == 0) {
list_type = THREAD_CBMSG_LIST_TYPE;
} else {
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "[ERROR] invalid list type");
+ D_EMSG("invalid list type");
return;
}
- if (pListData->popup) {
- evas_object_del(pListData->popup);
- pListData->popup = NULL;
+ if (pListData->pPopup) {
+ PMSG_APP_THREAD_POPUP pPopup = (PMSG_APP_THREAD_POPUP)pListData->pPopup;
+
+ if (pPopup->popup_object)
+ evas_object_del(pPopup->popup_object);
+
+ free(pPopup);
+ pListData->pPopup = NULL;
}
msg_ui_thread_load_message_box(list_type);
void* item_data = NULL;
+ pListData->sel_all_checked = !pListData->sel_all_checked;
+
if (pListData->sel_all_checked) {
pListData->check_cnt = pListData->item_cnt;
} else {
it = elm_genlist_first_item_get(pListData->genlist);
while (it) {
- if (elm_genlist_item_parent_get(it) == NULL) {
- it = elm_genlist_item_next_get(it);
- continue;
- }
-
item_data = elm_object_item_data_get(it);
if (item_data) {
- if (pListData->app_data_type == THREAD_LIST_APP_DATA_THREAD) {
- PMSG_APP_THREAD_DATA_S data = (PMSG_APP_THREAD_DATA_S)item_data;
+ if (pListData->app_data_type == THREAD_LIST_APP_DATA_CONV) {
+ PMSG_APP_THREAD_CONV_DATA_S data = (PMSG_APP_THREAD_CONV_DATA_S)item_data;
data->is_check = pListData->sel_all_checked;
} else {
PMSG_APP_THREAD_MSG_DATA_S data = (PMSG_APP_THREAD_MSG_DATA_S)item_data;
item_data = evas_object_data_get(obj, "item_data");
- if (pListData->app_data_type == THREAD_LIST_APP_DATA_THREAD) {
- PMSG_APP_THREAD_DATA_S data = (PMSG_APP_THREAD_DATA_S)item_data;
+ if (pListData->app_data_type == THREAD_LIST_APP_DATA_CONV) {
+ PMSG_APP_THREAD_CONV_DATA_S data = (PMSG_APP_THREAD_CONV_DATA_S)item_data;
is_check = data->is_check;
} else {
PMSG_APP_THREAD_MSG_DATA_S data = (PMSG_APP_THREAD_MSG_DATA_S)item_data;
}
if (pListData->item_cnt == pListData->check_cnt)
- elm_check_state_set(pListData->sel_all_box, EINA_TRUE);
+ pListData->sel_all_checked = true;
else
- elm_check_state_set(pListData->sel_all_box, EINA_FALSE);
+ pListData->sel_all_checked = false;
msg_ui_thread_show_select_info(pListData);
MSG_UI_LEAVE();
PMSG_THREAD_LIST_DATA pListData = (PMSG_THREAD_LIST_DATA)data;
PMSG_THREAD_DATA pData = msg_ui_thread_get_data();
- if (pData->detail_layout) {
- if (pData->isRotate == true)
- elm_naviframe_item_pop(pData->split_data->navi_frame);
- else
- elm_naviframe_item_pop(pData->navi_frame);
- pData->detail_layout = NULL;
-
- if (pListData->sel_msg_id) {
- msg_ui_thread_list_msg_item_update(pListData, pListData->sel_msg_id);
-
- pListData->sel_gen_item = NULL;
- pListData->sel_msg_id = 0;
- }
-
- if (pData->isRotate == false)
- return;
- }
-
- if (pListData->search_mode == THREAD_SEARCH_ON) {
+ if (pListData->search_mode == THREAD_SEARCH_ON && pData->isRotate == false) {
msg_ui_thread_cancel_search_mode(pListData);
return;
}
elm_win_lower(pData->win_main);
} else {
PMSG_THREAD_LIST_DATA pPrevList = msg_ui_thread_get_prev_list(pListData);
- msg_ui_thread_set_navi_toolbar_item(pPrevList);
+ msg_ui_thread_set_navi_toolbar_item(pPrevList, false);
+ msg_ui_thread_set_title_status(pPrevList);
- elm_naviframe_item_pop(pData->navi_frame);
+ if (pData->isRotate == true)
+ elm_object_item_del(elm_naviframe_top_item_get(pData->navi_frame));
+ else
+ elm_naviframe_item_pop(pData->navi_frame);
elm_genlist_clear(pListData->genlist);
msg_ui_thread_destroy_thread_list_data(pListData);
MSG_UI_LEAVE();
}
+void msg_ui_thread_detail_view_back_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ MSG_UI_ENTER();
+ PMSG_THREAD_LIST_DATA pListData = (PMSG_THREAD_LIST_DATA)data;
+
+ if (pListData) {
+ PMSG_THREAD_DATA pData = msg_ui_thread_get_data();
+
+ if (pData->isRotate == true && pData->split_data)
+ elm_naviframe_item_pop(pData->split_data->navi_frame);
+ else
+ elm_naviframe_item_pop(pData->navi_frame);
+ pData->detail_layout = NULL;
+
+ if (pListData->sel_msg_id) {
+ msg_ui_thread_list_msg_item_update(pListData, pListData->sel_msg_id);
+
+ pListData->sel_gen_item = NULL;
+ pListData->sel_msg_id = 0;
+ }
+
+ if (pData->isRotate == true)
+ msg_ui_thread_back_btn_clicked_cb(data, obj, event_info);
+ } else {
+ elm_exit();
+ }
+
+ MSG_UI_LEAVE();
+}
+
void msg_ui_thread_search_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
MSG_UI_ENTER();
if (pListData->item_cnt <= 0)
return;
- edje_object_signal_emit(_EDJ(pListData->content_ly), "show_searchbar", "sel_all");
- elm_object_part_content_set(pListData->content_ly, "sel_all", pListData->searchbar);
+ if (msg_ui_thread_rotation_get() == true)
+ elm_naviframe_item_title_visible_set(pListData->nf_it, EINA_FALSE);
+
+ if (!pListData->searchbar)
+ pListData->searchbar = msg_ui_thread_create_searchbar_layout(pListData->content_ly, pListData);
+
+ edje_object_signal_emit(_EDJ(pListData->content_ly), "show_searchbar", "search");
+ elm_object_part_content_set(pListData->content_ly, "search", pListData->searchbar);
entry = elm_object_part_content_get(pListData->searchbar, "elm.swallow.content");
elm_object_focus_set(entry, EINA_TRUE);
+ pListData->search_mode = THREAD_SEARCH_ON;
- evas_object_hide(pListData->search_btn);
- elm_object_item_part_content_unset(pListData->nf_it, "title_right_btn");
- msg_ui_thread_set_navi_toolbar_item(pListData);
+ msg_ui_thread_set_title_status(pListData);
+ msg_ui_thread_set_navi_toolbar_item(pListData, true);
MSG_UI_LEAVE();
}
PMSG_THREAD_LIST_DATA pListData = (PMSG_THREAD_LIST_DATA)data;
Elm_Object_Item* it_sweep = NULL;
- pListData->search_mode = THREAD_SEARCH_ON;
elm_genlist_mode_set(pListData->genlist, ELM_LIST_COMPRESS);
it_sweep = (Elm_Object_Item *)elm_genlist_decorated_item_get(pListData->genlist);
elm_object_signal_emit(pListData->searchbar, "elm,state,guidetext,hide", "elm");
elm_object_signal_emit(pListData->searchbar, "cancel,in", "");
- evas_object_smart_callback_add(obj, "changed", msg_ui_thread_searchbar_entry_change_cb, pListData);
- evas_object_smart_callback_add(obj, "preedit,changed", msg_ui_thread_searchbar_entry_change_cb, pListData);
-
D_LEAVE;
}
{
D_ENTER;
- evas_object_smart_callback_del(obj, "changed", msg_ui_thread_searchbar_entry_change_cb);
-
if (!data)
return;
PMSG_THREAD_LIST_DATA pListData = (PMSG_THREAD_LIST_DATA)data;
elm_object_signal_emit(pListData->searchbar, "elm,state,eraser,hide", "elm");
- msg_ui_thread_set_navi_toolbar_item(pListData);
+ if (msg_ui_thread_rotation_get() == false)
+ msg_ui_thread_show_toolbar(pListData);
if (elm_entry_is_empty(obj)) {
elm_object_signal_emit(pListData->searchbar, "elm,state,guidetext,show", "elm");
pListData->search_timer = NULL;
}
- pListData->search_timer = ecore_timer_add(0.2, __msg_ui_thread_searchbar_entry_timer_cb, pListData);
+ pListData->search_timer = ecore_timer_add(0.3, __msg_ui_thread_searchbar_entry_timer_cb, pListData);
if (elm_object_focus_get(obj)) {
if (elm_entry_is_empty(obj))
elm_object_signal_emit(pListData->searchbar, "elm,state,eraser,hide", "elm");
else
elm_object_signal_emit(pListData->searchbar, "elm,state,eraser,show", "elm");
+ } else {
+ if (elm_genlist_mode_get(pListData->genlist) == ELM_LIST_SCROLL) {
+ /* already unfocused and no search string at unfocused time*/
+ Evas_Object *entry = NULL;
+
+ entry = elm_object_part_content_get(pListData->searchbar, "elm.swallow.content");
+ elm_object_text_set(entry, "");
+ }
}
D_LEAVE;
{
PMSG_THREAD_LIST_DATA pListData = (PMSG_THREAD_LIST_DATA)data;
- msg_ui_thread_search_msg_list_load(pListData);
+ msg_ui_thread_search_list_load(pListData);
if (pListData->search_timer) {
ecore_timer_del(pListData->search_timer);
pListData->search_timer = NULL;
return;
PMSG_THREAD_LIST_DATA pListData = (PMSG_THREAD_LIST_DATA)data;
-
- if (pListData->search_timer) {
- ecore_timer_del(pListData->search_timer);
- pListData->search_timer = NULL;
- }
+ elm_object_focus_set(pListData->genlist, EINA_TRUE);
evas_object_hide(obj);
msg_ui_thread_cancel_search_mode(pListData);
return;
}
- if (pListData->app_data_type == THREAD_LIST_APP_DATA_THREAD) {
- PMSG_APP_THREAD_DATA_S sel_peer_item = NULL;
- sel_peer_item = (PMSG_APP_THREAD_DATA_S)evas_object_data_get(obj, "sel_peer_data");
+ if (pListData->app_data_type == THREAD_LIST_APP_DATA_CONV) {
+ PMSG_APP_THREAD_CONV_DATA_S sel_peer_item = NULL;
+ sel_peer_item = (PMSG_APP_THREAD_CONV_DATA_S)evas_object_data_get(obj, "sel_peer_data");
msg_struct_list_s addrList;
msg_get_str_value(addrList.msg_struct_info[0], MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, DEF_THREAD_ADDR_LEN);
strncpy(address, strNumber, DEF_THREAD_ADDR_LEN);
- if (g_strcmp0(label, dgettext("sys_string", "IDS_COM_BODY_CALL")) == 0)
+ if (g_strcmp0(label, dgettext("sys_string", "IDS_COM_BODY_CALL")) == 0) {
msg_ui_thread_launch_voice_call(address);
- else if (g_strcmp0(label, dgettext("sys_string", "IDS_COM_BODY_VIDEO_CALL")) == 0)
- msg_ui_thread_launch_video_call(address);
- else if (g_strcmp0(label, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_OPT_BLOCK")) == 0) {
+ } else if (g_strcmp0(label, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_OPT_BLOCK")) == 0) {
char *szbuf = dgettext(MESSAGE_PKGNAME, "IDS_MSGF_POP_BLOCK_PS_Q");
char *text = g_strdup_printf(szbuf, strNumber);
strncpy(address, strNumber, DEF_THREAD_ADDR_LEN);
if (sel_peer_item->addr_cnt == 1) {
- if (g_strcmp0(label, dgettext("sys_string", "IDS_COM_BODY_CALL")) == 0)
+ if (g_strcmp0(label, dgettext("sys_string", "IDS_COM_BODY_CALL")) == 0) {
msg_ui_thread_launch_voice_call(address);
- else if (g_strcmp0(label, dgettext("sys_string", "IDS_COM_BODY_VIDEO_CALL")) == 0)
- msg_ui_thread_launch_video_call(address);
- else if (g_strcmp0(label, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_OPT_BLOCK")) == 0) {
+ } else if (g_strcmp0(label, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_OPT_BLOCK")) == 0) {
char *szbuf = dgettext(MESSAGE_PKGNAME, "IDS_MSGF_POP_BLOCK_PS_Q");
char *text = g_strdup_printf(szbuf, strNumber);
msg_ui_thread_get_locale(pData);
msg_ui_thread_get_time_format(pData);
- if (pData->date_ptn_default) {
- free(pData->date_ptn_default);
- pData->date_ptn_default = NULL;
- }
-
- if (pData->date_ptn_year) {
- free(pData->date_ptn_year);
- pData->date_ptn_year = NULL;
- }
-
if (pData->time_12h_ptn) {
free(pData->time_12h_ptn);
pData->time_12h_ptn = NULL;
pData->time_12h_ptn = msg_common_get_date_best_pattern(pData->locale, MSG_UI_TIME_PATTERN_12H);
pData->time_24h_ptn = msg_common_get_date_best_pattern(pData->locale, MSG_UI_TIME_PATTERN_24H);
- pData->date_ptn_default = msg_common_get_date_best_pattern(pData->locale, MSG_UI_DATE_PATTERN_DEFAULT);
- pData->date_ptn_year = msg_common_get_date_best_pattern(pData->locale, MSG_UI_DATE_PATTERN_YEAR);
for (i = 0; i < MSG_THREAD_LIST_MAX_COUNT; i++) {
if (pData->list_data[i] != NULL) {
MSG_UI_LEAVE();
}
+void msg_ui_thread_gl_highlighted(void *data, Evas_Object *obj, void *event_info)
+{
+ MSG_UI_RET_IF(MSG_UI_LEVEL_DEBUG, !data || !event_info);
+
+ Elm_Object_Item *gen_item = event_info;
+ PMSG_APP_THREAD_CONV_DATA_S item_data = (PMSG_APP_THREAD_CONV_DATA_S) elm_object_item_data_get(gen_item);
+
+ if (item_data == NULL)
+ return;
+
+ if (item_data->app_data_type == THREAD_LIST_APP_DATA_CONV) {
+ item_data->bHighlight = true;
+ elm_genlist_item_fields_update(gen_item, "elm.icon.1", ELM_GENLIST_ITEM_FIELD_CONTENT);
+ } else {
+ PMSG_APP_THREAD_MSG_DATA_S msg_data = (PMSG_APP_THREAD_MSG_DATA_S)item_data;
+ msg_data->bHighlight = true;
+ elm_genlist_item_fields_update(gen_item, "elm.icon", ELM_GENLIST_ITEM_FIELD_CONTENT);
+ }
+}
+
+void msg_ui_thread_gl_unhighlighted(void *data, Evas_Object *obj, void *event_info)
+{
+ MSG_UI_RET_IF(MSG_UI_LEVEL_DEBUG, !data || !event_info);
+
+ Elm_Object_Item *gen_item = event_info;
+ PMSG_APP_THREAD_CONV_DATA_S item_data = (PMSG_APP_THREAD_CONV_DATA_S) elm_object_item_data_get(gen_item);
+
+ if (item_data == NULL)
+ return;
+
+ if (item_data->app_data_type == THREAD_LIST_APP_DATA_CONV) {
+ item_data->bHighlight = false;
+ elm_genlist_item_fields_update(gen_item, "elm.icon.1", ELM_GENLIST_ITEM_FIELD_CONTENT);
+ } else {
+ PMSG_APP_THREAD_MSG_DATA_S msg_data = (PMSG_APP_THREAD_MSG_DATA_S)item_data;
+ msg_data->bHighlight = false;
+ elm_genlist_item_fields_update(gen_item, "elm.icon", ELM_GENLIST_ITEM_FIELD_CONTENT);
+ }
+}
+
void msg_ui_thread_panes_handler_press_cb(void *data, Evas_Object *obj, void *event_info)
{
MSG_UI_RET_IF(MSG_UI_LEVEL_DEBUG, !data);
static void __msg_ui_thread_gl_del(void *data, Evas_Object *obj);
static void __msg_ui_thread_gl_sel(void *data, Evas_Object *obj, void *event_info);
Eina_Bool __msg_ui_thread_list_load_remain_item(void *data);
-void __msg_ui_thread_create_bubble_by_msgid(PMSG_THREAD_LIST_DATA pListData, PMSG_APP_THREAD_MSG_DATA_S item_data);
+PMSG_APP_THREAD_SEARCH_TITLE_S __msg_ui_thread_insert_search_title(void *data, ThreadSearchType nType, int nCount);
static int __msg_ui_thread_init_genlist(PMSG_THREAD_LIST_DATA pListData)
{
- MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
-
- if (pListData->genlist)
- elm_genlist_clear(pListData->genlist);
+ D_ENTER;
- MSG_UI_LEAVE(MSG_UI_LEVEL_DEBUG);
+ if (pListData && pListData->genlist) {
+ if (elm_genlist_items_count(pListData->genlist) > 0)
+ elm_genlist_clear(pListData->genlist);
+ }
+ D_LEAVE;
return MSG_UI_RET_SUCCESS;
}
-void msg_ui_thread_set_thread_data(PMSG_THREAD_LIST_DATA pListData, PMSG_APP_THREAD_DATA_S thread_data, msg_struct_t msgThreadInfo)
+void msg_ui_thread_set_conv_data(PMSG_THREAD_LIST_DATA pListData, PMSG_APP_THREAD_CONV_DATA_S thread_data, msg_struct_t msgThreadInfo)
{
if (thread_data == NULL || msgThreadInfo == NULL)
return;
int thread_id = 0, unreadCnt = 0, msgType = 0, direction = 0, smsCnt = 0, mmsCnt = 0;
char name[DEF_THREAD_NAME_LEN+1] = {0,};
char threadData[DEF_BUF_LEN_S+1] = {0,};
+ msg_struct_list_s draft_list;
+ bool bProtect = false;
+
+ thread_data->app_data_type = THREAD_LIST_APP_DATA_CONV;
msg_get_int_value(msgThreadInfo, MSG_THREAD_ID_INT, &thread_id);
thread_data->thread_id = thread_id;
thread_data->sms_cnt = smsCnt;
msg_get_int_value(msgThreadInfo, MSG_THREAD_DIRECTION_INT, &direction);
thread_data->direction = direction;
+ msg_get_bool_value(msgThreadInfo, MSG_THREAD_PROTECTED_BOOL, &bProtect);
+ thread_data->bProtected = bProtect;
+ thread_data->bHighlight = false;
+
+ msg_get_message_list(msg_ui_thread_get_data_handle(), MSG_DRAFT_ID, thread_id, 0, MSG_STORAGE_PHONE, &draft_list);
+ if (draft_list.nCount > 0) {
+ thread_data->bDraft = true;
+ } else {
+ msg_struct_list_s outbox_list;
+ msg_get_message_list(msg_ui_thread_get_data_handle(), MSG_OUTBOX_ID, thread_id, 0, MSG_STORAGE_PHONE, &outbox_list);
+ if (outbox_list.nCount > 0) {
+ int row = 0;
+ int status;
+
+ for (row = outbox_list.nCount-1; row >= 0; row-- ) {
+ msg_get_int_value(outbox_list.msg_struct_info[row], MSG_MESSAGE_NETWORK_STATUS_INT, &status);
+ if (status == MSG_NETWORK_SEND_FAIL) {
+ thread_data->bFailed = true;
+ break;
+ }
+ }
+ }
+
+ msg_release_list_struct(&outbox_list);
+ }
+ msg_release_list_struct(&draft_list);
if (pListData && pListData->sel_thread_id == thread_data->thread_id) {
thread_data->unread_cnt = 0;
return;
int msgId = 0;
+ int threadId = 0;
int msgType = 0;
int direction = 0;
bool read_status = 0;
+ bool protect_status = 0;
msg_struct_list_s *addr_list = NULL;
char strNumber[DEF_THREAD_ADDR_LEN+1] = {0,};
char strName[DEF_THREAD_NAME_LEN+1] = {0,};
int contact_id = 0;
+ int addressType = 0;
int i = 0;
+ msg_data->app_data_type = THREAD_LIST_APP_DATA_MSG;
+
/* msg_id */
msg_get_int_value(msgInfo, MSG_MESSAGE_ID_INT, &msgId);
msg_data->msg_id = msgId;
+ /* thread_id */
+ msg_get_int_value(msgInfo, MSG_MESSAGE_THREAD_ID_INT, &threadId);
+ msg_data->thread_id = threadId;
/* msg_type */
msg_get_int_value(msgInfo, MSG_MESSAGE_TYPE_INT, &msgType);
msg_data->msg_type = msgType;
/* read status */
msg_get_bool_value(msgInfo, MSG_MESSAGE_READ_BOOL, &read_status);
msg_data->is_read = read_status;
+ /* protect status */
+ msg_get_bool_value(msgInfo, MSG_MESSAGE_PROTECTED_BOOL, &protect_status);
+ msg_data->is_protected = protect_status;
msg_get_int_value(msgInfo, MSG_MESSAGE_DIRECTION_INT, &direction);
msg_data->direction = direction;
msg_get_int_value(addr_list->msg_struct_info[i], MSG_ADDRESS_INFO_CONTACT_ID_INT, &contact_id);
msg_data->addr_info[i]->contact_id = contact_id;
+ msg_data->addr_info[i]->addr_type = addressType;
if (strlen(strName) > 0)
strncpy(msg_data->addr_info[i]->display_name, strName, sizeof(msg_data->addr_info[i]->display_name) -1);
msg_get_int_value(msgInfo, MSG_MESSAGE_DISPLAY_TIME_INT, &msgTime);
memcpy(msg_data->msg_time, &msgTime, sizeof(time_t));
}
+ msg_data->bHighlight = false;
}
static char *__msg_ui_thread_gl_text_get(void *data, Evas_Object *obj, const char *part)
{
- PMSG_APP_THREAD_DATA_S item_data = (PMSG_APP_THREAD_DATA_S) data;
+ PMSG_APP_THREAD_CONV_DATA_S item_data = (PMSG_APP_THREAD_CONV_DATA_S) data;
char buf[DEF_BUF_LEN] = { 0, };
MSG_UI_RETV_IF(MSG_UI_LEVEL_ERR, !item_data, NULL);
if (g_strcmp0(part, "elm.text.1") == 0) {
- if (item_data->thread_name[0] != '\0')
+ if (item_data->thread_name[0] != '\0') {
+ PMSG_THREAD_LIST_DATA pListData = msg_ui_thread_get_current_list();
snprintf(buf, sizeof(buf), "%s", item_data->thread_name);
- else
+
+ if (pListData && pListData->search_mode == THREAD_SEARCH_ON) {
+ Evas_Object *entry = elm_object_part_content_get( pListData->searchbar, "elm.swallow.content");
+ char *search_str = elm_entry_markup_to_utf8(elm_entry_entry_get(entry));
+ bool result = false;
+
+ if (search_str) {
+ if (strlen(search_str) > 0) {
+ const char *str = msg_ui_thread_make_search_result_string(buf, search_str, &result);
+ free(search_str);
+ return strdup(str);
+ }
+ free(search_str);
+ }
+ }
+ } else {
snprintf(buf, sizeof(buf), dgettext("sys_string", "IDS_COM_BODY_UNKNOWN"));
+ }
} else if (g_strcmp0(part, "elm.text.2") == 0) {
msg_ui_thread_make_time_string(item_data->thread_time, buf, sizeof(buf));
} else if (g_strcmp0(part, "elm.text.3") == 0) {
} else if (g_strcmp0(part, "elm.text.4") == 0) {
if (item_data->unread_cnt > 0) {
if (item_data->unread_cnt > 999)
- snprintf(buf, sizeof(buf), "...");
+ snprintf(buf, sizeof(buf), "999");
else
snprintf(buf, sizeof(buf), "%d", item_data->unread_cnt);
- } else {
- msg_struct_list_s draft_list;
- msg_error_t err = MSG_SUCCESS;
-
- err = msg_get_message_list(msg_ui_thread_get_data_handle(), MSG_DRAFT_ID, item_data->thread_id, 0, MSG_STORAGE_PHONE, &draft_list);
-
- if (err != MSG_SUCCESS) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "msg_get_message_list() is failed = %d", err);
- return NULL;
- }
-
- if (draft_list.nCount > 0)
- snprintf(buf, sizeof(buf), "%s", dgettext(MESSAGE_PKGNAME, "IDS_MSGF_HEADER_DRAFT_ABB"));
-
- msg_release_list_struct(&draft_list);
}
}
static Evas_Object *__msg_ui_thread_gl_content_get(void *data, Evas_Object *obj, const char *part)
{
- PMSG_APP_THREAD_DATA_S item_data = (PMSG_APP_THREAD_DATA_S) data;
+ PMSG_APP_THREAD_CONV_DATA_S item_data = (PMSG_APP_THREAD_CONV_DATA_S) data;
PMSG_THREAD_LIST_DATA pListData = NULL;
MSG_UI_RETV_IF(MSG_UI_LEVEL_ERR, !item_data, NULL);
if (g_strcmp0(part, "elm.icon.1") == 0) {
if (item_data->msg_type == MSG_TYPE_SMS_CB) {
ic = elm_icon_add(obj);
- elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_CB_ICON);
+ if (item_data->bHighlight)
+ elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_CB_ICON_P);
+ else
+ elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_CB_ICON);
} else if (item_data->msg_type == MSG_TYPE_SMS_WAPPUSH) {
ic = elm_icon_add(obj);
- elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_PUSH_ICON);
+ if (item_data->bHighlight)
+ elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_PUSH_ICON_P);
+ else
+ elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_PUSH_ICON);
} else if (item_data->msg_type == MSG_TYPE_SMS_SYNCML) {
ic = elm_icon_add(obj);
- elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_OTA_ICON);
+ if (item_data->bHighlight)
+ elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_OTA_ICON_P);
+ else
+ elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_OTA_ICON);
+ } else if (item_data->bDraft) {
+ ic = elm_icon_add(obj);
+ if (item_data->bHighlight)
+ elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_DRAFT_ICON_P);
+ else
+ elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_DRAFT_ICON);
+ } else if (item_data->bFailed) {
+ ic = elm_icon_add(obj);
+ if (item_data->bHighlight)
+ elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_FAILED_ICON_P);
+ else
+ elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_FAILED_ICON);
}
if (ic) {
} else if (g_strcmp0(part, "elm.slide.swallow.2") == 0) {
ic = elm_button_add(obj);
elm_object_style_set(ic, "sweep/multiline");
- elm_object_text_set(ic, dgettext("sys_string", "IDS_COM_SK_VIDEO_CALL"));
- evas_object_data_set(ic, "sel_peer_data", (void *) item_data);
- evas_object_smart_callback_add(ic, "clicked", msg_ui_thread_sweep_btn_cb, (void *) pListData);
-
- if (bNumExist == false)
- elm_object_disabled_set(ic, EINA_TRUE);
- } else if (g_strcmp0(part, "elm.slide.swallow.3") == 0) {
- ic = elm_button_add(obj);
- elm_object_style_set(ic, "sweep/multiline");
if (isBlock == false)
elm_object_text_set(ic, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_OPT_BLOCK"));
if (bNumExist == false)
elm_object_disabled_set(ic, EINA_TRUE);
- } else if (g_strcmp0(part, "elm.slide.swallow.4") == 0) {
+ } else if (g_strcmp0(part, "elm.slide.swallow.3") == 0) {
ic = elm_button_add(obj);
elm_object_style_set(ic, "sweep/delete");
- elm_object_text_set(ic, dgettext("sys_string", "IDS_COM_SK_DELETE"));
+ elm_object_text_set(ic, dgettext("sys_string", "IDS_COM_SK_DELETE"));
evas_object_data_set(ic, "sel_peer_data", (void *) item_data);
evas_object_smart_callback_add(ic, "clicked", msg_ui_thread_sweep_btn_cb, (void *) pListData);
}
static void __msg_ui_thread_gl_del(void *data, Evas_Object *obj)
{
- PMSG_APP_THREAD_DATA_S del_data = (PMSG_APP_THREAD_DATA_S) data;
+ PMSG_APP_THREAD_CONV_DATA_S del_data = (PMSG_APP_THREAD_CONV_DATA_S) data;
if (del_data) {
if (del_data->thread_time) {
PMSG_THREAD_LIST_DATA pListData = (PMSG_THREAD_LIST_DATA) data;
Elm_Object_Item *item = NULL;
Elm_Object_Item* it_sweep = NULL;
- PMSG_APP_THREAD_DATA_S item_data = NULL;
+ PMSG_APP_THREAD_CONV_DATA_S item_data = NULL;
service_h svc_handle = NULL;
item = (Elm_Object_Item *) event_info;
MSG_UI_RETM_IF(MSG_UI_LEVEL_DEBUG, !item, "Item is NULL or Item is not Message item\n");
- item_data = (PMSG_APP_THREAD_DATA_S) elm_object_item_data_get(item);
+ item_data = (PMSG_APP_THREAD_CONV_DATA_S) elm_object_item_data_get(item);
MSG_UI_RETM_IF(MSG_UI_LEVEL_ERR, item_data == NULL, "item_data is NULL");
MSG_UI_RETM_IF(MSG_UI_LEVEL_DEBUG, pListData->sel_thread_id == item_data->thread_id, "Already selected item.");
elm_genlist_item_select_mode_set(it_sweep, ELM_OBJECT_SELECT_MODE_DEFAULT);
}
- if (pListData->search_mode == THREAD_SEARCH_ON && msg_ui_thread_rotation_get() == FALSE)
- msg_ui_thread_show_toolbar(pListData);
-
switch (pListData->view_mode) {
case THREAD_NORMAL_VIEW:
case THREAD_UNLOAD_VIEW:
if (service_create(&svc_handle) < 0 || svc_handle == NULL) {
D_EMSG("service_create() is failed !!");
} else {
- msg_struct_list_s draft_list;
- int draft_id = 0;
- msg_error_t err = MSG_SUCCESS;
MessageComposerUgType ug_type = MSG_COMPOSER_UG_TYPE_NONE;
+ msg_struct_list_s draft_list;
- err = msg_get_message_list(msg_ui_thread_get_data_handle(), MSG_DRAFT_ID, item_data->thread_id, 0, MSG_STORAGE_PHONE, &draft_list);
- if (err != MSG_SUCCESS) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "msg_get_message_list() is failed = %d", err);
- service_destroy(svc_handle);
- return;
- }
+ msg_get_message_list(msg_ui_thread_get_data_handle(), MSG_DRAFT_ID, item_data->thread_id, 0, MSG_STORAGE_PHONE, &draft_list);
+ if (item_data->bDraft && (item_data->sms_cnt + item_data->mms_cnt) == draft_list.nCount) {
+ int draft_id = 0;
- if (draft_list.nCount > 0 && (item_data->sms_cnt + item_data->mms_cnt) == 1) {
msg_get_int_value(draft_list.msg_struct_info[0], MSG_MESSAGE_ID_INT, &draft_id);
msg_ui_thread_get_composer_data(draft_id, svc_handle);
ug_type = MSG_COMPOSER_UG_TYPE_COMPOSER;
msg_ui_thread_get_bubble_data(item_data, svc_handle);
ug_type = MSG_COMPOSER_UG_TYPE_VIEWER;
}
-
msg_release_list_struct(&draft_list);
- if (msg_ui_load_composer_ug(svc_handle, ug_type) == MSG_UI_RET_ERR) {
+ if (msg_ui_load_composer_ug(svc_handle, ug_type, true) == MSG_UI_RET_ERR) {
D_MSG("Failed to load composer ug");
pListData->sel_gen_item = NULL;
service_destroy(svc_handle);
}
- item_data->unread_cnt = 0;
- elm_genlist_item_item_class_update(item, &pListData->itc_default);
+ elm_genlist_item_item_class_update(item, &pListData->itc_conv);
elm_genlist_item_update(item);
break;
case THREAD_EDIT_VIEW:
int i = 0;
char str_name[DEF_BUF_LEN+1] = { 0, };
char temp[DEF_BUF_LEN+1] = { 0, };
+ PMSG_THREAD_LIST_DATA pListData = msg_ui_thread_get_current_list();
for (i = 0; i < item_data->addr_cnt; i++) {
if (item_data->addr_info[i]->contact_id > 0 && item_data->addr_info[i]->display_name[0] != '\0') {
snprintf(buf, sizeof(buf), "%s, %s", temp, str_name);
else
snprintf(buf, sizeof(buf), "%s", str_name);
+
+ if (pListData && pListData->search_mode == THREAD_SEARCH_ON && pListData->list_type != THREAD_NORMAL_LIST_TYPE ) {
+ Evas_Object *entry = elm_object_part_content_get(pListData->searchbar, "elm.swallow.content");
+ char *search_str = elm_entry_markup_to_utf8(elm_entry_entry_get(entry));
+ bool result = false;
+
+ if (search_str) {
+ if (strlen(search_str) > 0) {
+ const char *str = msg_ui_thread_make_search_result_string(buf, search_str, &result);
+ free(search_str);
+ return strdup(str);
+ }
+ free(search_str);
+ }
+ }
}
} else if (g_strcmp0(part, "elm.text.2") == 0) {
+ PMSG_THREAD_LIST_DATA pListData = msg_ui_thread_get_current_list();
char msg[DEF_BUF_LEN] = { 0, };
int idx = 0;
snprintf(msg, sizeof(msg), "(%s)", dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_NO_SUBJECT"));
}
snprintf(buf, sizeof(buf), "%s", msg);
+
+ if (pListData && pListData->search_mode == THREAD_SEARCH_ON) {
+ Evas_Object *entry = elm_object_part_content_get(pListData->searchbar, "elm.swallow.content");
+ char *search_str = elm_entry_markup_to_utf8(elm_entry_entry_get(entry));
+ bool result = false;
+
+ if (search_str) {
+ if (strlen(search_str) > 0) {
+ const char *str = msg_ui_thread_make_search_result_string(buf, search_str, &result);
+ free(search_str);
+ return strdup(str);
+ }
+ free(search_str);
+ }
+ }
} else if (g_strcmp0(part, "elm.text.3") == 0) {
msg_ui_thread_make_time_string(item_data->msg_time, buf, sizeof(buf));
} else {
return strdup(buf);
}
-char *msg_ui_thread_search_msg_gl_text_get(void *data, Evas_Object *obj, const char *part)
+char *msg_ui_thread_search_title_gl_text_get(void *data, Evas_Object *obj, const char *part)
{
PMSG_THREAD_LIST_DATA pListData = NULL;
- PMSG_APP_THREAD_MSG_DATA_S item_data = (PMSG_APP_THREAD_MSG_DATA_S)data;
char buf[DEF_BUF_LEN+1] = { 0, };
- bool result = false;
-
- MSG_UI_RETV_IF(MSG_UI_LEVEL_ERR, !item_data, NULL);
+ PMSG_APP_THREAD_SEARCH_TITLE_S searchtitle_data = (PMSG_APP_THREAD_SEARCH_TITLE_S)data;
pListData = msg_ui_thread_get_current_list();
- MSG_UI_RETV_IF(MSG_UI_LEVEL_ERR, !pListData, NULL);
-
- if (!strcmp(part, "elm.text.1")) {
- bool search = true;
- if (item_data->addr_info[0]->contact_id > 0 && item_data->addr_info[0]->display_name[0] != '\0') {
- snprintf(buf, sizeof(buf), "%s", item_data->addr_info[0]->display_name);
- } else {
- if (item_data->addr_info[0]->address[0] != '\0') {
- snprintf(buf, sizeof(buf), "%s", item_data->addr_info[0]->address);
- } else {
- snprintf(buf, sizeof(buf), dgettext("sys_string", "IDS_COM_BODY_UNKNOWN"));
- search =false;
- }
- }
-
- if (search == true) {
- Evas_Object *entry = elm_object_part_content_get( pListData->searchbar, "elm.swallow.content");
- char *search_str = elm_entry_markup_to_utf8(elm_entry_entry_get(entry));
- if (search_str) {
- if (strlen(search_str) > 0) {
- const char *str = msg_ui_thread_make_search_result_string(buf, search_str, &result);
- free(search_str);
- return strdup(str);
- }
- free(search_str);
- }
- }
- } else if (g_strcmp0(part, "elm.text.2") == 0) {
- char msg[DEF_BUF_LEN] = { 0, };
- int idx = 0;
+ MSG_UI_RETV_IF(MSG_UI_LEVEL_ERR, !pListData || !searchtitle_data, NULL);
- if (item_data->msg_body[0] != '\0') {
- strncpy(msg, item_data->msg_body, sizeof(msg) - 1);
- while (msg[idx]) {
- if (g_ascii_iscntrl(msg[idx]))
- msg[idx] = ' ';
- idx++;
- }
- } else if ((item_data->msg_type >= MSG_TYPE_MMS && item_data->msg_type <= MSG_TYPE_MMS_NOTI)) {
- snprintf(msg, sizeof(msg), "(%s)", dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_NO_SUBJECT"));
- }
- snprintf(buf, sizeof(buf), "%s", msg);
+ if (0 == strcmp(part, "elm.text")) {
+ const char *str = NULL;
+ if (searchtitle_data->nType == THREAD_SEARCH_CONV)
+ str = dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_PD_CONVERSATIONS");
+ else
+ str = dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_PD_MESSAGES");
- Evas_Object *entry = elm_object_part_content_get( pListData->searchbar, "elm.swallow.content");
- char *search_str = elm_entry_markup_to_utf8(elm_entry_entry_get(entry));
- if (search_str) {
- if (strlen(search_str) > 0) {
- const char *str = msg_ui_thread_make_search_result_string(buf, search_str, &result);
- free(search_str);
- return strdup(str);
- }
- free(search_str);
- }
- } else if (g_strcmp0(part, "elm.text.3") == 0) {
- msg_ui_thread_make_time_string(item_data->msg_time, buf, sizeof(buf));
- } else {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "Invalid part = %s", part);
- return NULL;
+ snprintf(buf, sizeof(buf), str, searchtitle_data->subitem_cnt);
}
return strdup(buf);
if (item_data->msg_type >= MSG_TYPE_MMS && item_data->msg_type <= MSG_TYPE_MMS_NOTI) {
ic = elm_icon_add(obj);
- if (item_data->direction == MSG_DIRECTION_TYPE_MO)
- elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_STATUS_MMS_SENT);
- else if (item_data->is_read == 0)
- elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_STATUS_MMS_UNREAD);
- else
- elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_STATUS_MMS_READ);
+ if (item_data->direction == MSG_DIRECTION_TYPE_MO) {
+ if (item_data->bHighlight)
+ elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_STATUS_MMS_SENT_P);
+ else
+ elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_STATUS_MMS_SENT);
+ } else if (item_data->is_read == false) {
+ if (item_data->bHighlight)
+ elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_STATUS_MMS_UNREAD_P);
+ else
+ elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_STATUS_MMS_UNREAD);
+ } else {
+ if (item_data->bHighlight)
+ elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_STATUS_MMS_READ_P);
+ else
+ elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_STATUS_MMS_READ);
+ }
} else {
ic = elm_icon_add(obj);
- if (item_data->direction == MSG_DIRECTION_TYPE_MO)
- elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_STATUS_SMS_SENT);
- else if (item_data->is_read == 0)
- elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_STATUS_SMS_UNREAD);
- else
- elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_STATUS_SMS_READ);
+ if (item_data->direction == MSG_DIRECTION_TYPE_MO) {
+ if (item_data->bHighlight)
+ elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_STATUS_SMS_SENT_P);
+ else
+ elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_STATUS_SMS_SENT);
+ } else if (item_data->is_read == false) {
+ if (item_data->bHighlight)
+ elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_STATUS_SMS_UNREAD_P);
+ else
+ elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_STATUS_SMS_UNREAD);
+ } else {
+ if (item_data->bHighlight)
+ elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_STATUS_SMS_READ_P);
+ else
+ elm_image_file_set(ic, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_STATUS_SMS_READ);
+ }
}
if (ic) {
}
}
+void msg_ui_search_title_gl_del(void *data, Evas_Object *obj)
+{
+ PMSG_APP_THREAD_SEARCH_TITLE_S del_data = (PMSG_APP_THREAD_SEARCH_TITLE_S) data;
+ if (del_data) {
+ free(del_data);
+ del_data = NULL;
+ }
+}
+
void msg_ui_thread_msg_gl_sel(void *data, Evas_Object *obj, void *event_info)
{
PMSG_THREAD_LIST_DATA pListData = (PMSG_THREAD_LIST_DATA) data;
elm_genlist_item_select_mode_set(it_sweep, ELM_OBJECT_SELECT_MODE_DEFAULT);
}
- if (pListData->search_mode == THREAD_SEARCH_ON && msg_ui_thread_rotation_get() == FALSE)
- msg_ui_thread_show_toolbar(pListData);
-
switch (pListData->view_mode) {
case THREAD_NORMAL_VIEW:
case THREAD_UNLOAD_VIEW:
ug_destroy(pListData->loaded_ug);
pListData->loaded_ug = NULL;
}
- msg_ui_thread_launch_msg_detail_view(pListData, item_data);
+ msg_ui_thread_launch_msg_detail_view(pListData, item_data->msg_id, item_data->addr_cnt, item_data->addr_info);
}
/** update read status */
pListData->sel_gen_item = item;
pListData->sel_msg_id = item_data->msg_id;
- __msg_ui_thread_create_bubble_by_msgid(pListData, item_data);
+ msg_ui_thread_create_bubble_by_msgid(pListData, item_data->msg_id, true);
}
- item_data->is_read = true;
- elm_genlist_item_item_class_update(item, &pListData->itc_default);
+ elm_genlist_item_item_class_update(item, &pListData->itc_msg);
elm_genlist_item_update(item);
break;
case THREAD_EDIT_VIEW:
MSG_UI_LEAVE(MSG_UI_LEVEL_DEBUG);
}
-void __msg_ui_thread_create_bubble_by_msgid(PMSG_THREAD_LIST_DATA pListData, PMSG_APP_THREAD_MSG_DATA_S item_data)
+void msg_ui_thread_create_bubble_by_msgid(PMSG_THREAD_LIST_DATA pListData, int msg_id, bool isListItem)
{
msg_struct_t msgInfo = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
msg_struct_t sendOpt = msg_create_struct(MSG_STRUCT_SENDOPT);
msg_struct_t threadInfo = NULL;
- PMSG_APP_THREAD_DATA_S thread_data = NULL;
+ PMSG_APP_THREAD_CONV_DATA_S thread_data = NULL;
msg_error_t err = MSG_SUCCESS;
int thread_id = 0;
service_h svc_handle = NULL;
- err = msg_get_message(msg_ui_thread_get_data_handle(), (msg_message_id_t)item_data->msg_id, msgInfo, sendOpt);
+ err = msg_get_message(msg_ui_thread_get_data_handle(), (msg_message_id_t)msg_id, msgInfo, sendOpt);
if (err != MSG_SUCCESS) {
MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "msg_get_message() is failed : err = %d", err);
msg_release_struct(&msgInfo);
return;
}
- thread_data = (PMSG_APP_THREAD_DATA_S) calloc(1, sizeof(MSG_APP_THREAD_DATA_S));
- msg_ui_thread_set_thread_data(pListData, thread_data, threadInfo);
+ thread_data = (PMSG_APP_THREAD_CONV_DATA_S) calloc(1, sizeof(MSG_APP_THREAD_CONV_DATA_S));
+ msg_ui_thread_set_conv_data(pListData, thread_data, threadInfo);
if (service_create(&svc_handle) < 0 || svc_handle == NULL) {
D_EMSG("service_create() is failed !!");
} else {
MessageComposerUgType ug_type = MSG_COMPOSER_UG_TYPE_NONE;
- msg_ui_thread_get_bubble_data(thread_data, svc_handle);
- ug_type = MSG_COMPOSER_UG_TYPE_VIEWER;
+ int folder_id = 0;
+ msg_struct_list_s draft_list;
+
+ msg_get_int_value(msgInfo, MSG_MESSAGE_FOLDER_ID_INT, &folder_id);
+ msg_get_message_list(msg_ui_thread_get_data_handle(), MSG_DRAFT_ID, thread_data->thread_id, 0, MSG_STORAGE_PHONE, &draft_list);
+
+ if (folder_id == MSG_DRAFT_ID && (thread_data->sms_cnt + thread_data->mms_cnt) == draft_list.nCount) {
+ msg_ui_thread_get_composer_data(msg_id, svc_handle);
+ ug_type = MSG_COMPOSER_UG_TYPE_COMPOSER;
+ } else {
+ msg_ui_thread_get_bubble_data(thread_data, svc_handle);
+ ug_type = MSG_COMPOSER_UG_TYPE_VIEWER;
+ }
+ msg_release_list_struct(&draft_list);
- if (msg_ui_load_composer_ug(svc_handle, ug_type) == MSG_UI_RET_ERR) {
+ if (msg_ui_load_composer_ug(svc_handle, ug_type, isListItem) == MSG_UI_RET_ERR) {
D_MSG("Failed to load composer ug");
- pListData->sel_gen_item = NULL;
- pListData->sel_msg_id = 0;
+ if (isListItem) {
+ pListData->sel_gen_item = NULL;
+ pListData->sel_msg_id = 0;
+ }
}
service_destroy(svc_handle);
return strdup(buf);
}
-void msg_ui_thread_gl_empty_sel(void *data, Evas_Object *obj, void *event_info)
-{
- MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
-
- Elm_Object_Item *item = NULL;
-
- item = (Elm_Object_Item *) event_info;
- MSG_UI_RETM_IF(MSG_UI_LEVEL_DEBUG, !item, "Item is NULL or Item is not Message item\n");
-
- elm_genlist_item_selected_set(item, false);
-
- MSG_UI_LEAVE(MSG_UI_LEVEL_DEBUG);
-}
-
-char *msg_ui_thread_date_gl_text_get(void *data, Evas_Object *obj, const char *part)
-{
- PMSG_THREAD_DATA pData = msg_ui_thread_get_data();
- PMSG_APP_THREAD_DATELINE_DATA_S item_data = (PMSG_APP_THREAD_DATELINE_DATA_S) data;
- char *date_str = NULL;
- char buf[DEF_BUF_LEN] = { 0, };
-
- MSG_UI_RETV_IF(MSG_UI_LEVEL_ERR, !pData || !item_data, NULL);
-
- if (0 == strcmp(part, "elm.text")) {
- date_str = msg_common_get_display_date(pData->locale, pData->date_ptn_default, pData->date_ptn_year, item_data->thread_time);
-
- if (date_str) {
- snprintf(buf, sizeof(buf), "%s", date_str);
- free(date_str);
- }
- return strdup(buf);
- } else {
- return NULL;
- }
-}
-
-void msg_ui_thread_date_gl_del(void *data, Evas_Object *obj)
-{
- PMSG_APP_THREAD_DATELINE_DATA_S del_data = (PMSG_APP_THREAD_DATELINE_DATA_S) data;
-
- if (del_data) {
- if (del_data->thread_time) {
- free(del_data->thread_time);
- del_data->thread_time = NULL;
- }
- free(del_data);
- del_data = NULL;
- }
-}
-
-PMSG_APP_THREAD_DATELINE_DATA_S msg_ui_thread_list_insert_dateline(PMSG_THREAD_LIST_DATA pListData, time_t* cur_time, time_t* prev_time)
-{
- PMSG_THREAD_DATA pData = msg_ui_thread_get_data();
- PMSG_APP_THREAD_DATELINE_DATA_S dateline_data = NULL;
-
- char *date_str = NULL;
- char cur_date_buf[DEF_BUF_LEN+1] = { 0, };
- char prev_date_buf[DEF_BUF_LEN+1] = { 0, };
-
- date_str = msg_common_get_display_date(pData->locale, pData->date_ptn_default, pData->date_ptn_year, cur_time);
- if (date_str) {
- snprintf(cur_date_buf, sizeof(cur_date_buf), " %s ", date_str);
- free(date_str);
- date_str = NULL;
- }
-
- if (prev_time != NULL) {
- date_str = msg_common_get_display_date(pData->locale, pData->date_ptn_default, pData->date_ptn_year, prev_time);
- if (date_str) {
- snprintf(prev_date_buf, sizeof(prev_date_buf), " %s ", date_str);
- free(date_str);
- date_str = NULL;
- }
- }
-
- if (!prev_time ||g_strcmp0(cur_date_buf, prev_date_buf) != 0) {
- dateline_data = (PMSG_APP_THREAD_DATELINE_DATA_S) calloc(1, sizeof(MSG_APP_THREAD_DATELINE_DATA_S));
- MSG_UI_RETV_IF(MSG_UI_LEVEL_ERR, !dateline_data, NULL);
- bzero(dateline_data, sizeof(MSG_APP_THREAD_DATELINE_DATA_S));
-
- dateline_data->thread_time = (time_t *) calloc(1, sizeof(time_t));
- bzero(dateline_data->thread_time, sizeof(time_t));
- memcpy(dateline_data->thread_time, cur_time, sizeof(time_t));
-
- dateline_data->subitem_cnt = 0;
- dateline_data->date_it = elm_genlist_item_append(pListData->genlist, msg_ui_thread_get_itc_type(THREAD_ITC_DATE), dateline_data, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
- elm_genlist_item_select_mode_set(dateline_data->date_it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
- }
-
- return dateline_data;
-}
-
void msg_ui_thread_list_load(PMSG_THREAD_LIST_DATA pListData, Eina_Bool bLaunch)
{
- MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
+ D_ENTER;
PMSG_THREAD_DATA pData = msg_ui_thread_get_data();
pListData->item_cnt = peerList.nCount;
Evas_Object *swl_ly = elm_object_part_content_get(pListData->content_ly, "thread_list");
-
- pListData->app_data_type = THREAD_LIST_APP_DATA_THREAD;
- msg_ui_thread_genlist_style_set(pListData);
+ pListData->app_data_type = THREAD_LIST_APP_DATA_CONV;
if (peerList.nCount <= 0 || err != MSG_SUCCESS) {
+ msg_ui_thread_button_disabled_set(pListData, EINA_TRUE);
+
if (!pListData->noc_ly)
- pListData->noc_ly = msg_ui_thread_create_nocontent_layout(pData->navi_frame);
+ pListData->noc_ly = msg_ui_thread_create_nocontent_layout(pData->navi_frame, pListData->search_mode);
if (swl_ly != pListData->noc_ly) {
evas_object_hide(swl_ly);
elm_object_part_content_unset(pListData->content_ly, "thread_list");
elm_object_part_content_set(pListData->content_ly, "thread_list", pListData->noc_ly);
}
-
- msg_ui_thread_button_disabled_set(pListData, EINA_TRUE, CONTROLBAR_ITEM_2);
} else {
+ msg_ui_thread_button_disabled_set(pListData, EINA_FALSE);
+ msg_ui_thread_genlist_style_set(pListData, THREAD_LIST_APP_DATA_CONV);
+
if (swl_ly != pListData->genlist) {
evas_object_hide(swl_ly);
elm_object_part_content_unset(pListData->content_ly, "thread_list");
elm_object_part_content_set(pListData->content_ly, "thread_list", pListData->genlist);
}
- msg_ui_thread_button_disabled_set(pListData, EINA_FALSE, CONTROLBAR_ITEM_2);
-
- PMSG_APP_THREAD_DATELINE_DATA_S dateline_data = NULL;
- PMSG_APP_THREAD_DATA_S cur_thread = NULL;
- PMSG_APP_THREAD_DATA_S prev_thread = NULL;
+ PMSG_APP_THREAD_CONV_DATA_S cur_thread = NULL;
int row = 0;
int load_cnt = 0;
}
for (row = 0; row < load_cnt; row++) {
- PMSG_APP_THREAD_DATELINE_DATA_S tmp_date_line = NULL;
- Elm_Object_Item *item = NULL;
-
- cur_thread = (PMSG_APP_THREAD_DATA_S) calloc(1, sizeof(MSG_APP_THREAD_DATA_S));
- msg_ui_thread_set_thread_data(pListData, cur_thread, peerList.msg_struct_info[row]);
-
- if (prev_thread)
- tmp_date_line = msg_ui_thread_list_insert_dateline(pListData, cur_thread->thread_time, prev_thread->thread_time);
- else
- tmp_date_line = msg_ui_thread_list_insert_dateline(pListData, cur_thread->thread_time, NULL);
-
- if (tmp_date_line != NULL)
- dateline_data = tmp_date_line;
-
- if (dateline_data != NULL)
- item = dateline_data->date_it;
+ cur_thread = (PMSG_APP_THREAD_CONV_DATA_S) calloc(1, sizeof(MSG_APP_THREAD_CONV_DATA_S));
+ msg_ui_thread_set_conv_data(pListData, cur_thread, peerList.msg_struct_info[row]);
if (cur_thread->unread_cnt > 0)
- elm_genlist_item_append(pListData->genlist, &pListData->itc_unread, cur_thread, item, ELM_GENLIST_ITEM_NONE, __msg_ui_thread_gl_sel, pListData);
+ elm_genlist_item_append(pListData->genlist, &pListData->itc_unread, cur_thread, NULL, ELM_GENLIST_ITEM_NONE, __msg_ui_thread_gl_sel, pListData);
else
- elm_genlist_item_append(pListData->genlist, &pListData->itc_default, cur_thread, item, ELM_GENLIST_ITEM_NONE, __msg_ui_thread_gl_sel, pListData);
-
- if (dateline_data != NULL)
- dateline_data->subitem_cnt++;
-
- prev_thread = cur_thread;
+ elm_genlist_item_append(pListData->genlist, &pListData->itc_conv, cur_thread, NULL, ELM_GENLIST_ITEM_NONE, __msg_ui_thread_gl_sel, pListData);
}
-
msg_release_list_struct(&peerList);
}
- MSG_UI_LEAVE(MSG_UI_LEVEL_DEBUG);
+ D_LEAVE;
}
void msg_ui_thread_list_update(PMSG_THREAD_LIST_DATA pListData)
msg_error_t err = MSG_SUCCESS;
msg_struct_t sort_rule_t = msg_create_struct(MSG_STRUCT_SORT_RULE);
msg_struct_list_s peerList;
- PMSG_APP_THREAD_DATA_S cur_sel_thread = NULL;
+ PMSG_APP_THREAD_CONV_DATA_S cur_sel_thread = NULL;
Elm_Object_Item *gen_item = NULL;
int row = 0;
pListData->item_cnt = peerList.nCount;
if (peerList.nCount <= 0 || err != MSG_SUCCESS) {
- msg_ui_thread_button_disabled_set(pListData, EINA_TRUE, CONTROLBAR_ITEM_2);
+ msg_ui_thread_button_disabled_set(pListData, EINA_TRUE);
if (!pListData->noc_ly)
- pListData->noc_ly = msg_ui_thread_create_nocontent_layout(pData->navi_frame);
+ pListData->noc_ly = msg_ui_thread_create_nocontent_layout(pData->navi_frame, pListData->search_mode);
if (swl_ly != pListData->noc_ly) {
evas_object_hide(swl_ly);
}
} else {
- msg_ui_thread_button_disabled_set(pListData, EINA_FALSE, CONTROLBAR_ITEM_2);
+ msg_ui_thread_button_disabled_set(pListData, EINA_FALSE);
if (swl_ly != pListData->genlist) {
evas_object_hide(swl_ly);
gen_item = elm_genlist_first_item_get(pListData->genlist);
while (gen_item) {
- if (elm_genlist_item_parent_get(gen_item) == NULL) {
- gen_item = elm_genlist_item_next_get(gen_item);
- continue;
- }
-
cur_sel_thread = elm_object_item_data_get(gen_item);
- msg_ui_thread_set_thread_data(pListData, cur_sel_thread, peerList.msg_struct_info[row]);
+ msg_ui_thread_set_conv_data(pListData, cur_sel_thread, peerList.msg_struct_info[row]);
if (cur_sel_thread->unread_cnt > 0)
elm_genlist_item_item_class_update(gen_item, &pListData->itc_unread);
else
- elm_genlist_item_item_class_update(gen_item, &pListData->itc_default);
+ elm_genlist_item_item_class_update(gen_item, &pListData->itc_conv);
elm_object_item_data_set(gen_item, cur_sel_thread);
gen_item = elm_genlist_item_next_get(gen_item);
row++;
MSG_UI_LEAVE(MSG_UI_LEVEL_DEBUG);
}
+void msg_ui_thread_list_item_insert(PMSG_THREAD_LIST_DATA pListData)
+{
+ MSG_UI_ENTER();
+
+ int sel_thread_id = 0, sel_msg_id = 0;
+
+ if (pListData->sel_gen_item) {
+ sel_thread_id = pListData->sel_thread_id;
+ sel_msg_id = pListData->sel_msg_id;
+ }
+
+ if (pListData->app_data_type == THREAD_LIST_APP_DATA_SEARCH) {
+ msg_ui_thread_search_list_load(pListData);
+ } else if (pListData->app_data_type == THREAD_LIST_APP_DATA_MSG) {
+ msg_ui_thread_msg_list_load(pListData, pListData->list_type);
+ msg_ui_thread_select_item_by_msg_id(pListData, sel_msg_id);
+ } else {
+ msg_ui_thread_list_load(pListData, FALSE);
+ msg_ui_thread_select_item_by_thread_id(pListData, sel_thread_id, false);
+ }
+ msg_ui_thread_set_title_unread_cnt(pListData);
+
+ if (pListData->sel_gen_item)
+ elm_genlist_item_selected_set(pListData->sel_gen_item, true);
+
+ MSG_UI_LEAVE();
+}
+
Eina_Bool msg_ui_thread_list_item_update(PMSG_THREAD_LIST_DATA pListData, msg_thread_id_t thread_id)
{
MSG_UI_ENTER();
+ PMSG_APP_THREAD_CONV_DATA_S old_data = NULL;
+ PMSG_APP_THREAD_CONV_DATA_S new_data = NULL;
+ msg_struct_t threadInfo = NULL;
+
msg_error_t err = MSG_SUCCESS;
- msg_struct_t sort_rule_t = msg_create_struct(MSG_STRUCT_SORT_RULE);
- msg_struct_list_s peerList;
- PMSG_APP_THREAD_DATA_S old_data = NULL;
- PMSG_APP_THREAD_DATA_S new_data = NULL;
- int row = 0;
Elm_Object_Item *gen_item = NULL;
- msg_set_int_value(sort_rule_t, MSG_SORT_RULE_SORT_TYPE_INT, MSG_SORT_BY_THREAD_DATE);
- msg_set_bool_value(sort_rule_t, MSG_SORT_RULE_ACSCEND_BOOL, false);
+ bool bSearchList = false;
+ char *search_str = NULL;
- err = msg_get_thread_view_list(msg_ui_thread_get_data_handle(), sort_rule_t, &peerList);
- msg_release_struct(&sort_rule_t);
- MSG_UI_RETV_IF(MSG_UI_LEVEL_DEBUG, err != MSG_SUCCESS, EINA_FALSE);
+ if (pListData->search_mode == THREAD_SEARCH_ON) {
+ Evas_Object *entry = NULL;
+
+ if (pListData->searchbar) {
+ entry = elm_object_part_content_get(pListData->searchbar, "elm.swallow.content");
+ search_str = elm_entry_markup_to_utf8(elm_entry_entry_get(entry));
+ }
+
+ if (!search_str || strlen(search_str) == 0)
+ bSearchList = false;
+ else
+ bSearchList = true;
+
+ if (search_str)
+ free(search_str);
+ }
gen_item = elm_genlist_first_item_get(pListData->genlist);
/* Update genlist item */
while (gen_item) {
- if (elm_genlist_item_parent_get(gen_item) == NULL) {
+ if (bSearchList == true && elm_genlist_item_parent_get(gen_item) == NULL) {
gen_item = elm_genlist_item_next_get(gen_item);
continue;
}
- old_data = (PMSG_APP_THREAD_DATA_S) elm_object_item_data_get(gen_item);
- if (old_data && thread_id == old_data->thread_id) {
- break;
- }
- gen_item = elm_genlist_item_next_get(gen_item);
- }
+ old_data = (PMSG_APP_THREAD_CONV_DATA_S) elm_object_item_data_get(gen_item);
+ if (old_data) {
+ if (old_data->app_data_type == THREAD_LIST_APP_DATA_MSG) {
+ return EINA_FALSE;
+ }
+
+ if (old_data->thread_id == thread_id)
+ break;
+ }
+ gen_item = elm_genlist_item_next_get(gen_item);
+ }
if (!gen_item) {
D_EMSG("gen_item is NULL");
- msg_release_list_struct(&peerList);
return EINA_FALSE;
}
return EINA_FALSE;
}
- for (row = 0; row < peerList.nCount; row++) {
- int sel_thread_id = 0;
- msg_get_int_value(peerList.msg_struct_info[row], MSG_THREAD_ID_INT, &sel_thread_id);
- if (sel_thread_id == thread_id) {
- new_data = (PMSG_APP_THREAD_DATA_S) calloc(1, sizeof(MSG_APP_THREAD_DATA_S));
- if (!new_data)
- break;
-
- msg_ui_thread_set_thread_data(pListData, new_data, peerList.msg_struct_info[row]);
- break;
- }
+ threadInfo = msg_create_struct(MSG_STRUCT_THREAD_INFO);
+ err = msg_get_thread(msg_ui_thread_get_data_handle(), thread_id, threadInfo);
+ if (err != MSG_SUCCESS) {
+ MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "msg_get_message() is failed : err = %d", err);
+ msg_release_struct(&threadInfo);
+ return EINA_FALSE;
}
- msg_release_list_struct(&peerList);
+ new_data = (PMSG_APP_THREAD_CONV_DATA_S) calloc(1, sizeof(MSG_APP_THREAD_CONV_DATA_S));
+ msg_ui_thread_set_conv_data(pListData, new_data, threadInfo);
+ msg_release_struct(&threadInfo);
if (!new_data) {
- D_EMSG("new_data is NULL");
- return EINA_FALSE;
+ msg_ui_thread_list_item_delete(pListData, thread_id);
+ return EINA_TRUE;
}
+ if (new_data->unread_cnt != old_data->unread_cnt)
+ msg_ui_thread_set_title_unread_cnt(pListData);
+
if (new_data->thread_time && (*new_data->thread_time != *old_data->thread_time)){
- msg_ui_thread_list_load(pListData, FALSE);
- msg_ui_thread_select_item_by_thread_id(pListData, thread_id);
+ if (pListData->search_mode == THREAD_SEARCH_ON)
+ msg_ui_thread_search_list_load(pListData);
+ else
+ msg_ui_thread_list_load(pListData, FALSE);
+ msg_ui_thread_select_item_by_thread_id(pListData, thread_id, true);
free(new_data->thread_time);
new_data->thread_time = NULL;
if (new_data->unread_cnt > 0)
elm_genlist_item_item_class_update(gen_item, &pListData->itc_unread);
else
- elm_genlist_item_item_class_update(gen_item, &pListData->itc_default);
+ elm_genlist_item_item_class_update(gen_item, &pListData->itc_conv);
elm_object_item_data_set(gen_item, new_data);
elm_genlist_item_update(gen_item);
- elm_genlist_item_selected_set(gen_item, false);
+
+ if (pListData->sel_thread_id != new_data->thread_id)
+ elm_genlist_item_selected_set(gen_item, false);
if (pListData->view_mode == THREAD_EDIT_VIEW) {
if (eina_list_data_find(pListData->chk_list, old_data)) {
{
MSG_UI_ENTER();
- PMSG_APP_THREAD_DATA_S item_data = NULL;
+ PMSG_APP_THREAD_CONV_DATA_S item_data = NULL;
Elm_Object_Item *gen_item = NULL;
MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "thread_id = [%d] ", thread_id);
gen_item = elm_genlist_first_item_get(pListData->genlist);
while (gen_item) {
- if (elm_genlist_item_parent_get(gen_item) == NULL) {
+ if (pListData->app_data_type == THREAD_LIST_APP_DATA_SEARCH && elm_genlist_item_parent_get(gen_item) == NULL) {
gen_item = elm_genlist_item_next_get(gen_item);
continue;
}
- item_data = (PMSG_APP_THREAD_DATA_S) elm_object_item_data_get(gen_item);
- if (item_data && thread_id == item_data->thread_id) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "thread_id == item_data->thread_id == [%d] ", thread_id);
- break;
+ item_data = (PMSG_APP_THREAD_CONV_DATA_S) elm_object_item_data_get(gen_item);
+
+ if (item_data) {
+ if (item_data->app_data_type == THREAD_LIST_APP_DATA_MSG)
+ return;
+
+ if (thread_id == item_data->thread_id) {
+ MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "thread_id == item_data->thread_id == [%d] ", thread_id);
+
+ if (item_data->unread_cnt != 0)
+ msg_ui_thread_set_title_unread_cnt(pListData);
+ break;
+ }
}
gen_item = elm_genlist_item_next_get(gen_item);
}
return;
}
- Elm_Object_Item *it_dateline = NULL;
- PMSG_APP_THREAD_DATELINE_DATA_S dateline_data = NULL;
+ if (pListData->app_data_type == THREAD_LIST_APP_DATA_SEARCH) {
+ Elm_Object_Item *it_search = NULL;
+ PMSG_APP_THREAD_SEARCH_TITLE_S search_title = NULL;
- it_dateline = elm_genlist_item_parent_get(gen_item);
- if (it_dateline) {
- dateline_data = elm_object_item_data_get(it_dateline);
-
- if (dateline_data) {
- dateline_data->subitem_cnt--;
- if (dateline_data->subitem_cnt == 0)
- elm_object_item_del((Elm_Object_Item *)it_dateline);
+ it_search = elm_genlist_item_parent_get(gen_item);
+ if (it_search) {
+ search_title = elm_object_item_data_get(it_search);
+ if (search_title) {
+ search_title->subitem_cnt--;
+ if(search_title->subitem_cnt == 0)
+ elm_object_item_del((Elm_Object_Item *)it_search);
+ }
}
}
+
elm_object_item_del((Elm_Object_Item *)gen_item);
pListData->item_cnt--;
if (pListData->item_cnt <= 0) {
- msg_ui_thread_list_load(pListData, FALSE);
+ if (pListData->search_mode == THREAD_SEARCH_ON)
+ msg_ui_thread_search_list_load(pListData);
+ else
+ msg_ui_thread_list_load(pListData, FALSE);
}
MSG_UI_LEAVE();
switch (listType) {
case THREAD_SPAM_LIST_TYPE:
- err = msg_get_message_list(pData->msgHandle, MSG_SPAMBOX_ID, 0, 0, 0, &msg_list);
+ err = msg_get_message_list(pData->msgHandle, MSG_SPAMBOX_ID, 0, 0, MSG_STORAGE_PHONE, &msg_list);
break;
case THREAD_SIM_LIST_TYPE:
err = msg_get_message_list(pData->msgHandle, MSG_ALLBOX_ID, 0, MSG_TYPE_SMS, MSG_STORAGE_SIM, &msg_list);
break;
case THREAD_CBMSG_LIST_TYPE:
- err = msg_get_message_list(pData->msgHandle, MSG_CBMSGBOX_ID, 0, 0, 0, &msg_list);
+ err = msg_get_message_list(pData->msgHandle, MSG_CBMSGBOX_ID, 0, 0, MSG_STORAGE_PHONE, &msg_list);
break;
default:
D_MSG("[WARNING] invalid view mode");
pListData->item_cnt = msg_list.nCount;
Evas_Object *swl_ly = elm_object_part_content_get(pListData->content_ly, "thread_list");
+ pListData->app_data_type = THREAD_LIST_APP_DATA_MSG;
- if (pListData->item_cnt == 0) {
- msg_ui_thread_button_disabled_set(pListData, EINA_TRUE, CONTROLBAR_ITEM_1);
+ if (msg_list.nCount <= 0 || err != MSG_SUCCESS) {
+ msg_ui_thread_button_disabled_set(pListData, EINA_TRUE);
// show non cotent
if (!pListData->noc_ly)
- pListData->noc_ly = msg_ui_thread_create_nocontent_layout(pData->navi_frame);
+ pListData->noc_ly = msg_ui_thread_create_nocontent_layout(pData->navi_frame, pListData->search_mode);
if (swl_ly != pListData->noc_ly) {
evas_object_hide(swl_ly);
}
} else {
// fill the genlist
- msg_ui_thread_button_disabled_set(pListData, EINA_FALSE, CONTROLBAR_ITEM_1);
-
- pListData->app_data_type = THREAD_LIST_APP_DATA_MSG;
- msg_ui_thread_genlist_style_set(pListData);
+ msg_ui_thread_button_disabled_set(pListData, EINA_FALSE);
+ msg_ui_thread_genlist_style_set(pListData, THREAD_LIST_APP_DATA_MSG);
if (swl_ly != pListData->genlist) {
evas_object_hide(swl_ly);
elm_object_part_content_set(pListData->content_ly, "thread_list", pListData->genlist);
}
- PMSG_APP_THREAD_DATELINE_DATA_S dateline_data = NULL;
PMSG_APP_THREAD_MSG_DATA_S cur_item = NULL;
- PMSG_APP_THREAD_MSG_DATA_S prev_item = NULL;
int row = 0;
for (row = 0; row < msg_list.nCount; row++) {
- PMSG_APP_THREAD_DATELINE_DATA_S tmp_date_line = NULL;
- Elm_Object_Item *item = NULL;
-
cur_item = (PMSG_APP_THREAD_MSG_DATA_S) calloc(1, sizeof(MSG_APP_THREAD_MSG_DATA_S));
msg_ui_thread_set_msg_data(cur_item, msg_list.msg_struct_info[row]);
- if (prev_item)
- tmp_date_line = msg_ui_thread_list_insert_dateline(pListData, cur_item->msg_time, prev_item->msg_time);
- else
- tmp_date_line = msg_ui_thread_list_insert_dateline(pListData, cur_item->msg_time, NULL);
-
- if (tmp_date_line != NULL)
- dateline_data = tmp_date_line;
-
- if (dateline_data != NULL)
- item = dateline_data->date_it;
- elm_genlist_item_append(pListData->genlist, &pListData->itc_default, cur_item, item, ELM_GENLIST_ITEM_NONE, msg_ui_thread_msg_gl_sel, (void *)pListData);
-
- if (dateline_data != NULL)
- dateline_data->subitem_cnt++;
-
- prev_item = cur_item;
+ elm_genlist_item_append(pListData->genlist, &pListData->itc_msg, cur_item, NULL, ELM_GENLIST_ITEM_NONE, msg_ui_thread_msg_gl_sel, (void *)pListData);
}
if (pListData->item_cnt == 0) {
- msg_ui_thread_button_disabled_set(pListData, EINA_TRUE, CONTROLBAR_ITEM_1);
+ msg_ui_thread_button_disabled_set(pListData, EINA_TRUE);
// show non cotent
if (!pListData->noc_ly)
- pListData->noc_ly = msg_ui_thread_create_nocontent_layout(pData->navi_frame);
+ pListData->noc_ly = msg_ui_thread_create_nocontent_layout(pData->navi_frame, pListData->search_mode);
Evas_Object *swl_ly = elm_object_part_content_get(pListData->content_ly, "thread_list");
PMSG_APP_THREAD_MSG_DATA_S item_data = NULL;
int row = 0;
Elm_Object_Item *gen_item = NULL;
- Evas_Object *entry = NULL;
msg_error_t err = MSG_SUCCESS;
msg_struct_list_s msg_list;
Evas_Object *swl_ly = elm_object_part_content_get(pListData->content_ly, "thread_list");
- if (pListData->search_mode == THREAD_SEARCH_ON) {
- msg_struct_t search_s = msg_create_struct(MSG_STRUCT_SEARCH_CONDITION);
- char *search_str = NULL;
-
- if (pListData->searchbar) {
- entry = elm_object_part_content_get(pListData->searchbar, "elm.swallow.content");
- search_str = elm_entry_markup_to_utf8(elm_entry_entry_get(entry));
- }
-
- if (!search_str || strlen(search_str) == 0) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "empty search_str");
- if (pListData->list_type == THREAD_NORMAL_LIST_TYPE)
- msg_ui_thread_list_update(pListData);
-
- if (search_str) {
- free(search_str);
- search_str = NULL;
- }
- msg_release_struct(&search_s);
+ switch (pListData->list_type) {
+ case THREAD_SPAM_LIST_TYPE:
+ err = msg_get_message_list(pData->msgHandle, MSG_SPAMBOX_ID, 0, 0, MSG_STORAGE_PHONE, &msg_list);
+ break;
+ case THREAD_SIM_LIST_TYPE:
+ err = msg_get_message_list(pData->msgHandle, MSG_ALLBOX_ID, 0, MSG_TYPE_SMS, MSG_STORAGE_SIM, &msg_list);
+ break;
+ case THREAD_CBMSG_LIST_TYPE:
+ err = msg_get_message_list(pData->msgHandle, MSG_CBMSGBOX_ID, 0, 0, MSG_STORAGE_PHONE, &msg_list);
+ break;
+ default:
+ D_MSG("[WARNING] invalid view mode");
return;
- }
-
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "Search string word = [%s] ", search_str);
-
- switch (pListData->list_type) {
- case THREAD_NORMAL_LIST_TYPE:
- msg_set_int_value(search_s, MSG_SEARCH_CONDITION_FOLDERID_INT, MSG_ALLBOX_ID);
- break;
- case THREAD_SPAM_LIST_TYPE:
- msg_set_int_value(search_s, MSG_SEARCH_CONDITION_FOLDERID_INT, MSG_SPAMBOX_ID);
- break;
- case THREAD_SIM_LIST_TYPE:
- msg_set_int_value(search_s, MSG_SEARCH_CONDITION_FOLDERID_INT, MSG_ALLBOX_ID);
- msg_set_int_value(search_s, MSG_SEARCH_CONDITION_MSGTYPE_INT, MSG_TYPE_SMS);
- break;
- case THREAD_CBMSG_LIST_TYPE:
- msg_set_int_value(search_s, MSG_SEARCH_CONDITION_FOLDERID_INT, MSG_CBMSGBOX_ID);
- break;
- default:
- D_MSG("[WARNING] invalid view mode");
- if (search_str) {
- free(search_str);
- search_str = NULL;
- }
- msg_release_struct(&search_s);
- return;
- }
- msg_set_str_value(search_s, MSG_SEARCH_CONDITION_SEARCH_VALUE_STR, search_str, strlen(search_str));
-
- err = msg_search_message(pData->msgHandle, search_s, 0, 0, &msg_list);
- free(search_str);
- search_str = NULL;
- msg_release_struct(&search_s);
-
- MSG_UI_RET_IF(MSG_UI_LEVEL_DEBUG, err != MSG_SUCCESS);
- } else {
- switch (pListData->list_type) {
- case THREAD_SPAM_LIST_TYPE:
- err = msg_get_message_list(pData->msgHandle, MSG_SPAMBOX_ID, 0, 0, 0, &msg_list);
- break;
- case THREAD_SIM_LIST_TYPE:
- err = msg_get_message_list(pData->msgHandle, MSG_ALLBOX_ID, 0, MSG_TYPE_SMS, MSG_STORAGE_SIM, &msg_list);
- break;
- case THREAD_CBMSG_LIST_TYPE:
- err = msg_get_message_list(pData->msgHandle, MSG_CBMSGBOX_ID, 0, 0, 0, &msg_list);
- break;
- default:
- D_MSG("[WARNING] invalid view mode");
- return;
- }
- MSG_UI_RET_IF(MSG_UI_LEVEL_DEBUG, err != MSG_SUCCESS);
}
+ MSG_UI_RET_IF(MSG_UI_LEVEL_DEBUG, err != MSG_SUCCESS);
pListData->item_cnt = msg_list.nCount;
if (msg_list.nCount <= 0 || err != MSG_SUCCESS) {
- if (pListData->list_type == THREAD_NORMAL_LIST_TYPE)
- msg_ui_thread_button_disabled_set(pListData, EINA_TRUE, CONTROLBAR_ITEM_2);
- else
- msg_ui_thread_button_disabled_set(pListData, EINA_TRUE, CONTROLBAR_ITEM_1);
+ msg_ui_thread_button_disabled_set(pListData, EINA_TRUE);
if (!pListData->noc_ly)
- pListData->noc_ly = msg_ui_thread_create_nocontent_layout(pData->navi_frame);
+ pListData->noc_ly = msg_ui_thread_create_nocontent_layout(pData->navi_frame, pListData->search_mode);
if (swl_ly != pListData->noc_ly) {
evas_object_hide(swl_ly);
elm_object_part_content_set(pListData->content_ly, "thread_list", pListData->noc_ly);
}
} else {
- if (pListData->list_type == THREAD_NORMAL_LIST_TYPE)
- msg_ui_thread_button_disabled_set(pListData, EINA_FALSE, CONTROLBAR_ITEM_2);
- else
- msg_ui_thread_button_disabled_set(pListData, EINA_FALSE, CONTROLBAR_ITEM_1);
+ msg_ui_thread_button_disabled_set(pListData, EINA_FALSE);
if (swl_ly != pListData->genlist) {
evas_object_hide(swl_ly);
gen_item = elm_genlist_first_item_get(pListData->genlist);
- while (gen_item) {
- if (elm_genlist_item_parent_get(gen_item) == NULL) {
- gen_item = elm_genlist_item_next_get(gen_item);
- continue;
- }
+ while (gen_item && (row < msg_list.nCount)) {
+ int msg_id = 0;
item_data = elm_object_item_data_get(gen_item);
- msg_ui_thread_set_msg_data(item_data, msg_list.msg_struct_info[row]);
+ msg_get_int_value(msg_list.msg_struct_info[row], MSG_MESSAGE_ID_INT, &msg_id);
- elm_object_item_data_set(gen_item, item_data);
+ if (item_data->msg_id == msg_id) {
+ msg_ui_thread_set_msg_data(item_data, msg_list.msg_struct_info[row]);
+ elm_object_item_data_set(gen_item, item_data);
+ }
gen_item = elm_genlist_item_next_get(gen_item);
row++;
}
PMSG_THREAD_DATA pData = msg_ui_thread_get_data();
PMSG_APP_THREAD_MSG_DATA_S old_data = NULL;
PMSG_APP_THREAD_MSG_DATA_S new_data = NULL;
- int row = 0;
Elm_Object_Item *gen_item = NULL;
- Evas_Object *entry = NULL;
msg_error_t err = MSG_SUCCESS;
- msg_struct_list_s msg_list;
+ bool bSearchList = false;
+ char *search_str = NULL;
MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "msg_id = [%d] ", msg_id);
if (pListData->search_mode == THREAD_SEARCH_ON) {
- msg_struct_t search_s = msg_create_struct(MSG_STRUCT_SEARCH_CONDITION);
- char *search_str = NULL;
+ Evas_Object *entry = NULL;
if (pListData->searchbar) {
entry = elm_object_part_content_get(pListData->searchbar, "elm.swallow.content");
search_str = elm_entry_markup_to_utf8(elm_entry_entry_get(entry));
}
- if (!search_str || strlen(search_str) == 0) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "empty search_str");
- if (pListData->list_type == THREAD_NORMAL_LIST_TYPE) {
- msg_struct_t msgInfo = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
- msg_struct_t sendOpt = msg_create_struct(MSG_STRUCT_SENDOPT);
- int thread_id = 0;
-
- err = msg_get_message(pData->msgHandle, msg_id, msgInfo, sendOpt);
- msg_get_int_value(msgInfo, MSG_MESSAGE_THREAD_ID_INT, &thread_id);
- msg_release_struct(&msgInfo);
- msg_release_struct(&sendOpt);
-
- msg_ui_thread_list_item_update(pListData, thread_id);
- }
-
- if (search_str) {
- free(search_str);
- search_str = NULL;
- }
- msg_release_struct(&search_s);
- return EINA_TRUE;
- }
-
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "Search string word = [%s] ", search_str);
-
- switch (pListData->list_type) {
- case THREAD_NORMAL_LIST_TYPE:
- msg_set_int_value(search_s, MSG_SEARCH_CONDITION_FOLDERID_INT, MSG_ALLBOX_ID);
- break;
- case THREAD_SPAM_LIST_TYPE:
- msg_set_int_value(search_s, MSG_SEARCH_CONDITION_FOLDERID_INT, MSG_SPAMBOX_ID);
- break;
- case THREAD_SIM_LIST_TYPE:
- msg_set_int_value(search_s, MSG_SEARCH_CONDITION_FOLDERID_INT, MSG_ALLBOX_ID);
- msg_set_int_value(search_s, MSG_SEARCH_CONDITION_MSGTYPE_INT, MSG_TYPE_SMS);
- break;
- case THREAD_CBMSG_LIST_TYPE:
- msg_set_int_value(search_s, MSG_SEARCH_CONDITION_FOLDERID_INT, MSG_CBMSGBOX_ID);
- break;
- default:
- D_MSG("[WARNING] invalid view mode");
- if (search_str) {
- free(search_str);
- search_str = NULL;
- }
- return EINA_FALSE;
- }
- msg_set_str_value(search_s, MSG_SEARCH_CONDITION_SEARCH_VALUE_STR, search_str, strlen(search_str));
-
- err = msg_search_message(pData->msgHandle, search_s, 0, 0, &msg_list);
- free(search_str);
- search_str = NULL;
- msg_release_struct(&search_s);
+ if (!search_str || strlen(search_str) == 0)
+ bSearchList = false;
+ else
+ bSearchList = true;
- MSG_UI_RETV_IF(MSG_UI_LEVEL_DEBUG, err != MSG_SUCCESS, EINA_FALSE);
- } else {
- switch (pListData->list_type) {
- case THREAD_SPAM_LIST_TYPE:
- err = msg_get_message_list(pData->msgHandle, MSG_SPAMBOX_ID, 0, 0, 0, &msg_list);
- break;
- case THREAD_SIM_LIST_TYPE:
- err = msg_get_message_list(pData->msgHandle, MSG_ALLBOX_ID, 0, MSG_TYPE_SMS, MSG_STORAGE_SIM, &msg_list);
- break;
- case THREAD_CBMSG_LIST_TYPE:
- err = msg_get_message_list(pData->msgHandle, MSG_CBMSGBOX_ID, 0, 0, 0, &msg_list);
- break;
- default:
- D_MSG("[WARNING] invalid view mode");
- return EINA_FALSE;
+ if (search_str) {
+ free(search_str);
+ search_str = NULL;
}
- MSG_UI_RETV_IF(MSG_UI_LEVEL_DEBUG, err != MSG_SUCCESS, EINA_FALSE);
}
gen_item = elm_genlist_first_item_get(pListData->genlist);
/* Update genlist item */
while (gen_item) {
- if (elm_genlist_item_parent_get(gen_item) == NULL) {
+ if (bSearchList == true && elm_genlist_item_parent_get(gen_item) == NULL) {
gen_item = elm_genlist_item_next_get(gen_item);
continue;
}
old_data = (PMSG_APP_THREAD_MSG_DATA_S) elm_object_item_data_get(gen_item);
- if (old_data && msg_id == old_data->msg_id) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "msg_id == item_data->msg_id == [%d] ", msg_id);
- break;
+ if (old_data) {
+ if (old_data->app_data_type == THREAD_LIST_APP_DATA_CONV) {
+ gen_item = elm_genlist_item_next_get(gen_item);
+ continue;
+ }
+
+ if (msg_id == old_data->msg_id) {
+ MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "msg_id == item_data->msg_id == [%d] ", msg_id);
+ break;
+ }
}
gen_item = elm_genlist_item_next_get(gen_item);
}
if (!gen_item) {
D_EMSG("gen_item is NULL");
- msg_release_list_struct(&msg_list);
return EINA_FALSE;
}
- if (!old_data) {
- D_EMSG("old_data is NULL");
- return EINA_FALSE;
- }
+ msg_struct_t msgInfo = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
+ msg_struct_t sendOpt = msg_create_struct(MSG_STRUCT_SENDOPT);
- for (row = 0; row <msg_list.nCount; row++) {
- int row_msg_id = 0;
- msg_get_int_value(msg_list.msg_struct_info[row], MSG_MESSAGE_ID_INT, &row_msg_id);
- if (row_msg_id == msg_id) {
- new_data = (PMSG_APP_THREAD_MSG_DATA_S)calloc(1, sizeof(MSG_APP_THREAD_MSG_DATA_S));
- if (!new_data)
- break;
+ err = msg_get_message(pData->msgHandle, msg_id, msgInfo, sendOpt);
- msg_ui_thread_set_msg_data(new_data, msg_list.msg_struct_info[row]);
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "find row = %d ", row);
- break;
- }
+ if (err != MSG_SUCCESS) {
+ msg_release_struct(&msgInfo);
+ msg_release_struct(&sendOpt);
+ D_EMSG("error : msg_id : %d, error : %d", msg_id, err);
+ return EINA_FALSE;
}
- msg_release_list_struct(&msg_list);
+ new_data = (PMSG_APP_THREAD_MSG_DATA_S)calloc(1, sizeof(MSG_APP_THREAD_MSG_DATA_S));
if (!new_data) {
+ msg_release_struct(&msgInfo);
+ msg_release_struct(&sendOpt);
D_EMSG("new_data is NULL");
return EINA_FALSE;
}
- new_data->chk = old_data->chk;
- new_data->is_check = old_data->is_check;
+ msg_ui_thread_set_msg_data(new_data, msgInfo);
+
+ msg_release_struct(&msgInfo);
+ msg_release_struct(&sendOpt);
+
+ if (new_data->is_read != old_data->is_read)
+ msg_ui_thread_set_title_unread_cnt(pListData);
- elm_object_item_data_set(gen_item, new_data);
- elm_genlist_item_update(gen_item);
- elm_genlist_item_selected_set(gen_item, false);
+ if (new_data->msg_time && (*new_data->msg_time != *old_data->msg_time)) {
+ if (pListData->search_mode == THREAD_SEARCH_ON)
+ msg_ui_thread_search_list_load(pListData);
+ else
+ msg_ui_thread_msg_list_load(pListData, pListData->list_type);
+ msg_ui_thread_select_item_by_msg_id(pListData, msg_id);
+
+ free(new_data->msg_time);
+ new_data->msg_time = NULL;
+
+ free(new_data);
+ } else {
+ new_data->chk = old_data->chk;
+ new_data->is_check = old_data->is_check;
- if (pListData->view_mode == THREAD_EDIT_VIEW) {
- if (eina_list_data_find(pListData->chk_list, old_data)) {
- pListData->chk_list = eina_list_remove(pListData->chk_list, old_data);
- pListData->chk_list = eina_list_append(pListData->chk_list, new_data);
+ elm_object_item_data_set(gen_item, new_data);
+ elm_genlist_item_update(gen_item);
+ elm_genlist_item_selected_set(gen_item, false);
+
+ if (pListData->view_mode == THREAD_EDIT_VIEW) {
+ if (eina_list_data_find(pListData->chk_list, old_data)) {
+ pListData->chk_list = eina_list_remove(pListData->chk_list, old_data);
+ pListData->chk_list = eina_list_append(pListData->chk_list, new_data);
+ }
}
- }
- if (old_data->msg_time) {
- free(old_data->msg_time);
- old_data->msg_time = NULL;
+ if (old_data->msg_time) {
+ free(old_data->msg_time);
+ old_data->msg_time = NULL;
+ }
+ free(old_data);
}
- free(old_data);
MSG_UI_LEAVE();
return EINA_TRUE;
PMSG_APP_THREAD_MSG_DATA_S item_data = NULL;
Elm_Object_Item *gen_item = NULL;
Elm_Object_Item *del_item = NULL;
- Elm_Object_Item *it_dateline = NULL;
- PMSG_APP_THREAD_DATELINE_DATA_S dateline_data = NULL;
MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "msg_id = [%d] ", msg_id);
gen_item = elm_genlist_first_item_get(pListData->genlist);
- while (gen_item) {
- if (elm_genlist_item_parent_get(gen_item) == NULL) {
- gen_item = elm_genlist_item_next_get(gen_item);
- continue;
- }
+ if (pListData->app_data_type == THREAD_LIST_APP_DATA_SEARCH) {
+ while (gen_item) {
+ if (elm_genlist_item_parent_get(gen_item) == NULL) {
+ gen_item = elm_genlist_item_next_get(gen_item);
+ continue;
+ }
- //120803 - can exist multiple message with the same address in search result list
- item_data = (PMSG_APP_THREAD_MSG_DATA_S) elm_object_item_data_get(gen_item);
- if (item_data && msg_id == item_data->msg_id) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "msg_id == item_data->msg_id == [%d] ", msg_id);
+ //120803 - can exist multiple message with the same address in search result list
+ item_data = (PMSG_APP_THREAD_MSG_DATA_S) elm_object_item_data_get(gen_item);
+ if (item_data) {
+ if (item_data->app_data_type == THREAD_LIST_APP_DATA_CONV) {
+ gen_item = elm_genlist_item_next_get(gen_item);
+ continue;
+ }
- del_item = gen_item;
+ if (msg_id == item_data->msg_id) {
+ MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "msg_id == item_data->msg_id == [%d] ", msg_id);
+ del_item = gen_item;
- it_dateline = elm_genlist_item_parent_get(gen_item);
- if (it_dateline) {
- dateline_data = elm_object_item_data_get(it_dateline);
+ if (item_data->is_read == false)
+ msg_ui_thread_set_title_unread_cnt(pListData);
+ }
+ }
+ gen_item = elm_genlist_item_next_get(gen_item);
- if (dateline_data) {
- dateline_data->subitem_cnt--;
- if (dateline_data->subitem_cnt == 0)
- elm_object_item_del((Elm_Object_Item *)it_dateline);
+ if (del_item) {
+ Elm_Object_Item *it_search = NULL;
+ PMSG_APP_THREAD_SEARCH_TITLE_S search_title = NULL;
+
+ it_search = elm_genlist_item_parent_get(del_item);
+ if (it_search) {
+ search_title = elm_object_item_data_get(it_search);
+ if (search_title) {
+ search_title->subitem_cnt--;
+ if(search_title->subitem_cnt == 0)
+ elm_object_item_del((Elm_Object_Item *)it_search);
+ else
+ elm_genlist_item_update(search_title->title_it);
+ }
}
+
+ elm_object_item_del(del_item);
+ pListData->item_cnt--;
+ del_item = NULL;
}
}
- gen_item = elm_genlist_item_next_get(gen_item);
+ } else {
+ while (gen_item) {
+ //120803 - can exist multiple message with the same address in search result list
+ item_data = (PMSG_APP_THREAD_MSG_DATA_S) elm_object_item_data_get(gen_item);
+ if (item_data) {
+ if (item_data->app_data_type == THREAD_LIST_APP_DATA_CONV) {
+ gen_item = elm_genlist_item_next_get(gen_item);
+ continue;
+ }
+
+ if (msg_id == item_data->msg_id) {
+ MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "msg_id == item_data->msg_id == [%d] ", msg_id);
+ del_item = gen_item;
+ break;
+ }
+ }
+ gen_item = elm_genlist_item_next_get(gen_item);
+ }
if (del_item) {
elm_object_item_del(del_item);
}
if (pListData->item_cnt <= 0) {
- if (pListData->search_mode == THREAD_SEARCH_ON) {
- elm_genlist_clear(pListData->genlist);
- elm_genlist_item_append(pListData->genlist, msg_ui_thread_get_itc_type(THREAD_ITC_EMPTY), NULL, NULL, ELM_GENLIST_ITEM_NONE, msg_ui_thread_gl_empty_sel, NULL);
- } else {
+ if (pListData->search_mode == THREAD_SEARCH_ON)
+ msg_ui_thread_search_list_load(pListData);
+ else
msg_ui_thread_msg_list_load(pListData, pListData->list_type);
- }
}
MSG_UI_LEAVE();
}
-Eina_Bool msg_ui_thread_search_msg_list_load(void *data)
+Eina_Bool msg_ui_thread_search_list_load(void *data)
{
- MSG_UI_ENTER();
+ D_ENTER;
MSG_UI_RETV_IF(MSG_UI_LEVEL_DEBUG, !data, EINA_FALSE);
PMSG_THREAD_LIST_DATA pListData = (PMSG_THREAD_LIST_DATA)data;
Evas_Object *entry = NULL;
char *search_str = NULL;
+ msg_struct_list_s search_conv_list;
msg_struct_list_s search_msg_list;
msg_struct_t search_s = msg_create_struct(MSG_STRUCT_SEARCH_CONDITION);
msg_error_t err = MSG_SUCCESS;
int idx = 0;
+ MSG_UI_RETVM_IF(MSG_UI_LEVEL_ERR, pListData == NULL, EINA_FALSE, "pListData is NULL");
+
if (pListData->searchbar) {
entry = elm_object_part_content_get(pListData->searchbar, "elm.swallow.content");
search_str = elm_entry_markup_to_utf8(elm_entry_entry_get(entry));
MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "Search string word = [%s] ", search_str);
+ Evas_Object *swl_ly = elm_object_part_content_get(pListData->content_ly, "thread_list");
+
+ /** hide control bar */
+ elm_genlist_clear(pListData->genlist);
+ pListData->item_cnt = 0;
+ pListData->app_data_type = THREAD_LIST_APP_DATA_SEARCH;
+
+ if (pListData->list_type == THREAD_NORMAL_LIST_TYPE) {
+ err = msg_search_message_for_thread_view(msg_ui_thread_get_data_handle(), search_str, &search_conv_list);
+ MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "Search result [ count = %d ] ", search_conv_list.nCount);
+
+ if (search_conv_list.nCount > 0 && err == MSG_SUCCESS) {
+ PMSG_APP_THREAD_CONV_DATA_S item_data = NULL;
+ PMSG_APP_THREAD_SEARCH_TITLE_S search_title = NULL;
+
+ msg_ui_thread_genlist_style_set(pListData, THREAD_LIST_APP_DATA_CONV);
+ search_title = __msg_ui_thread_insert_search_title(pListData, THREAD_SEARCH_CONV, search_conv_list.nCount);
+
+ while (idx < search_conv_list.nCount) {
+ item_data = (PMSG_APP_THREAD_CONV_DATA_S)calloc(1, sizeof(MSG_APP_THREAD_CONV_DATA_S));
+ msg_ui_thread_set_conv_data(pListData, item_data, search_conv_list.msg_struct_info[idx]);
+
+ if (item_data->unread_cnt > 0)
+ elm_genlist_item_append(pListData->genlist, &pListData->itc_unread, item_data, search_title->title_it, ELM_GENLIST_ITEM_NONE, __msg_ui_thread_gl_sel, pListData);
+ else
+ elm_genlist_item_append(pListData->genlist, &pListData->itc_conv, item_data, search_title->title_it, ELM_GENLIST_ITEM_NONE, __msg_ui_thread_gl_sel, pListData);
+ idx++;
+ }
+ }
+
+ pListData->item_cnt = search_conv_list.nCount;
+ msg_release_list_struct(&search_conv_list);
+ }
+
switch (pListData->list_type) {
case THREAD_NORMAL_LIST_TYPE:
msg_set_int_value(search_s, MSG_SEARCH_CONDITION_FOLDERID_INT, MSG_ALLBOX_ID);
msg_set_str_value(search_s, MSG_SEARCH_CONDITION_SEARCH_VALUE_STR, search_str, strlen(search_str));
err = msg_search_message(msg_ui_thread_get_data_handle(), search_s, 0, 0, &search_msg_list);
- pListData->item_cnt = search_msg_list.nCount;
+ idx = 0;
free(search_str);
msg_release_struct(&search_s);
- if (err != MSG_SUCCESS) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "msg_search_message failed!! [%d]", err);
-
- if (pListData->list_type == THREAD_NORMAL_LIST_TYPE)
- msg_ui_thread_list_load(pListData, FALSE);
- else
- msg_ui_thread_msg_list_load(pListData, pListData->list_type);
-
- return EINA_FALSE;
- }
-
MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "Search result [ count = %d ] ", search_msg_list.nCount);
- Evas_Object *swl_ly = elm_object_part_content_get(pListData->content_ly, "thread_list");
-
- if (swl_ly != pListData->genlist) {
- evas_object_hide(swl_ly);
- elm_object_part_content_unset(pListData->content_ly, "thread_list");
- elm_object_part_content_set(pListData->content_ly, "thread_list", pListData->genlist);
- }
+ pListData->item_cnt += search_msg_list.nCount;
- /** hide control bar */
- elm_genlist_clear(pListData->genlist);
-
- if (search_msg_list.nCount > 0) {
- PMSG_APP_THREAD_DATELINE_DATA_S dateline_data = NULL;
+ if (search_msg_list.nCount > 0 && err == MSG_SUCCESS) {
PMSG_APP_THREAD_MSG_DATA_S item_data = NULL;
- PMSG_APP_THREAD_MSG_DATA_S prev_data = NULL;
+ PMSG_APP_THREAD_SEARCH_TITLE_S search_title = NULL;
+ int msg_cnt = 0;
- pListData->app_data_type = THREAD_LIST_APP_DATA_MSG;
- msg_ui_thread_genlist_style_set(pListData);
+ msg_ui_thread_genlist_style_set(pListData, THREAD_LIST_APP_DATA_MSG);
while (idx < search_msg_list.nCount) {
- PMSG_APP_THREAD_DATELINE_DATA_S tmp_date_line = NULL;
- Elm_Object_Item *item = NULL;
+ int storage_id = 0;
+ msg_get_int_value(search_msg_list.msg_struct_info[idx], MSG_MESSAGE_STORAGE_ID_INT, &storage_id);
if (pListData->list_type == THREAD_SIM_LIST_TYPE) {
- int storage_id = 0;
- msg_get_int_value(search_msg_list.msg_struct_info[idx], MSG_MESSAGE_STORAGE_ID_INT, &storage_id);
-
if (storage_id != MSG_STORAGE_SIM) {
idx++;
- pListData->item_cnt--;
+ continue;
+ }
+ } else {
+ if (storage_id == MSG_STORAGE_SIM) {
+ idx++;
continue;
}
}
+ if (search_title == NULL)
+ search_title = __msg_ui_thread_insert_search_title(pListData, THREAD_SEARCH_MSG, msg_cnt);
+
item_data = (PMSG_APP_THREAD_MSG_DATA_S)calloc(1, sizeof(MSG_APP_THREAD_MSG_DATA_S));
msg_ui_thread_set_msg_data(item_data, search_msg_list.msg_struct_info[idx]);
- if (prev_data)
- tmp_date_line = msg_ui_thread_list_insert_dateline(pListData, item_data->msg_time, prev_data->msg_time);
- else
- tmp_date_line = msg_ui_thread_list_insert_dateline(pListData, item_data->msg_time, NULL);
-
- if (tmp_date_line != NULL)
- dateline_data = tmp_date_line;
-
- if (dateline_data != NULL)
- item = dateline_data->date_it;
- elm_genlist_item_append(pListData->genlist, msg_ui_thread_get_itc_type(THREAD_ITC_SEARCH), item_data, item, ELM_GENLIST_ITEM_NONE, msg_ui_thread_msg_gl_sel, pListData);
+ elm_genlist_item_append(pListData->genlist, &pListData->itc_msg, item_data, search_title->title_it, ELM_GENLIST_ITEM_NONE, msg_ui_thread_msg_gl_sel, pListData);
+ msg_cnt++;
+ search_title->subitem_cnt = msg_cnt;
+ elm_genlist_item_update(search_title->title_it);
- if (dateline_data != NULL)
- dateline_data->subitem_cnt++;
-
- prev_data = item_data;
idx++;
}
+ pListData->item_cnt += msg_cnt;
+ }
- if (pListData->item_cnt == 0)
- elm_genlist_item_append(pListData->genlist, msg_ui_thread_get_itc_type(THREAD_ITC_EMPTY), NULL, NULL, ELM_GENLIST_ITEM_NONE, msg_ui_thread_gl_empty_sel, NULL);
+ if (pListData->item_cnt == 0) {
+ // show non cotent
+ if (!pListData->noc_ly_search) {
+ PMSG_THREAD_DATA pData = msg_ui_thread_get_data();
+ pListData->noc_ly_search = msg_ui_thread_create_nocontent_layout(pData->navi_frame, pListData->search_mode);
+ }
+
+ if (swl_ly != pListData->noc_ly_search) {
+ evas_object_hide(swl_ly);
+ elm_object_part_content_unset(pListData->content_ly, "thread_list");
+ elm_object_part_content_set(pListData->content_ly, "thread_list", pListData->noc_ly_search);
+ }
} else {
- elm_genlist_item_append(pListData->genlist, msg_ui_thread_get_itc_type(THREAD_ITC_EMPTY), NULL, NULL, ELM_GENLIST_ITEM_NONE, msg_ui_thread_gl_empty_sel, NULL);
+ if (swl_ly != pListData->genlist) {
+ evas_object_hide(swl_ly);
+ elm_object_part_content_unset(pListData->content_ly, "thread_list");
+ elm_object_part_content_set(pListData->content_ly, "thread_list", pListData->genlist);
+ }
}
msg_release_list_struct(&search_msg_list);
+ D_LEAVE;
return EINA_TRUE;
}
+PMSG_APP_THREAD_SEARCH_TITLE_S __msg_ui_thread_insert_search_title(void *data, ThreadSearchType nType, int nCount)
+{
+ D_ENTER;
+ MSG_UI_RETV_IF(MSG_UI_LEVEL_DEBUG, !data, NULL);
+
+ PMSG_APP_THREAD_SEARCH_TITLE_S searchtitle_data = NULL;
+ PMSG_THREAD_LIST_DATA pListData = (PMSG_THREAD_LIST_DATA)data;
+
+ searchtitle_data = (PMSG_APP_THREAD_SEARCH_TITLE_S) calloc(1, sizeof(MSG_APP_THREAD_SEARCH_TITLE_S));
+ searchtitle_data->nType = nType;
+ searchtitle_data->subitem_cnt= nCount;
+
+ searchtitle_data->title_it = elm_genlist_item_append(pListData->genlist, msg_ui_thread_get_itc_type(THREAD_ITC_SEARCH_TITLE), searchtitle_data, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
+ elm_genlist_item_select_mode_set(searchtitle_data->title_it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+
+ D_LEAVE;
+ return searchtitle_data;
+}
+
Eina_Bool __msg_ui_thread_list_load_remain_item(void *data)
{
MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
err = msg_get_thread_view_list(msg_ui_thread_get_data_handle(), sort_rule_t, &peerList);
msg_release_struct(&sort_rule_t);
- PMSG_APP_THREAD_DATELINE_DATA_S dateline_data = NULL;
- PMSG_APP_THREAD_DATA_S cur_thread = NULL;
- PMSG_APP_THREAD_DATA_S prev_thread = NULL;
- Elm_Object_Item *gen_item = NULL;
- Elm_Object_Item *it_dateline = NULL;
+ PMSG_APP_THREAD_CONV_DATA_S cur_thread = NULL;
int row = 0, start = pListData->loaded_cnt;
- gen_item = elm_genlist_last_item_get(pListData->genlist);
- if (gen_item)
- prev_thread = elm_object_item_data_get(gen_item);
-
for (row = start; row < peerList.nCount; row++) {
- PMSG_APP_THREAD_DATELINE_DATA_S tmp_date_line = NULL;
- Elm_Object_Item *item = NULL;
-
- cur_thread = (PMSG_APP_THREAD_DATA_S) calloc(1, sizeof(MSG_APP_THREAD_DATA_S));
- msg_ui_thread_set_thread_data(pListData, cur_thread, peerList.msg_struct_info[row]);
-
- if (prev_thread) {
- tmp_date_line = msg_ui_thread_list_insert_dateline(pListData, cur_thread->thread_time, prev_thread->thread_time);
- if (tmp_date_line == NULL) {
- it_dateline = elm_genlist_item_parent_get(gen_item);
- if (it_dateline)
- tmp_date_line = elm_object_item_data_get(it_dateline);
- }
- } else {
- tmp_date_line = msg_ui_thread_list_insert_dateline(pListData, cur_thread->thread_time, NULL);
- }
-
- if (tmp_date_line != NULL)
- dateline_data = tmp_date_line;
-
- if (dateline_data != NULL)
- item = dateline_data->date_it;
+ cur_thread = (PMSG_APP_THREAD_CONV_DATA_S) calloc(1, sizeof(MSG_APP_THREAD_CONV_DATA_S));
+ msg_ui_thread_set_conv_data(pListData, cur_thread, peerList.msg_struct_info[row]);
if (cur_thread->unread_cnt > 0)
- elm_genlist_item_append(pListData->genlist, &pListData->itc_unread, cur_thread, item, ELM_GENLIST_ITEM_NONE, __msg_ui_thread_gl_sel, pListData);
+ elm_genlist_item_append(pListData->genlist, &pListData->itc_unread, cur_thread, NULL, ELM_GENLIST_ITEM_NONE, __msg_ui_thread_gl_sel, pListData);
else
- elm_genlist_item_append(pListData->genlist, &pListData->itc_default, cur_thread, item, ELM_GENLIST_ITEM_NONE, __msg_ui_thread_gl_sel, pListData);
-
- if (dateline_data != NULL)
- dateline_data->subitem_cnt++;
+ elm_genlist_item_append(pListData->genlist, &pListData->itc_conv, cur_thread, NULL, ELM_GENLIST_ITEM_NONE, __msg_ui_thread_gl_sel, pListData);
- prev_thread = cur_thread;
pListData->loaded_cnt++;
if (pListData->loaded_cnt == peerList.nCount) {
void msg_ui_thread_common_style_set(PMSG_THREAD_DATA pData)
{
- MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
+ D_ENTER;
MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !pData);
pData->itc_empty.item_style = "1text";
pData->itc_blank.func.state_get = NULL;
pData->itc_blank.func.del = NULL;
- pData->itc_date.item_style = "grouptitle";
- pData->itc_date.func.text_get = msg_ui_thread_date_gl_text_get;
- pData->itc_date.func.content_get = NULL;
- pData->itc_date.func.state_get = NULL;
- pData->itc_date.func.del = msg_ui_thread_date_gl_del;
+ pData->itc_search_title.item_style = "grouptitle";
+ pData->itc_search_title.func.text_get = msg_ui_thread_search_title_gl_text_get;
+ pData->itc_search_title.func.content_get = NULL;
+ pData->itc_search_title.func.state_get = NULL;
+ pData->itc_search_title.func.del = msg_ui_search_title_gl_del;
- pData->itc_search.item_style = "3text.1icon.tb";
- pData->itc_search.func.text_get = msg_ui_thread_search_msg_gl_text_get;
- pData->itc_search.func.content_get = msg_ui_thread_msg_gl_content_get;
- pData->itc_search.func.state_get = NULL;
- pData->itc_search.func.del = msg_ui_thread_msg_gl_del;
-
- MSG_UI_LEAVE(MSG_UI_LEVEL_DEBUG);
+ D_LEAVE;
}
-void msg_ui_thread_genlist_style_set(PMSG_THREAD_LIST_DATA pListData)
+void msg_ui_thread_genlist_style_set(PMSG_THREAD_LIST_DATA pListData, ThreadAppDataType nType)
{
- MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
+ D_ENTER;
MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !pListData);
- if (pListData->app_data_type == THREAD_LIST_APP_DATA_THREAD) {
- pListData->itc_default.item_style = "4text.1icon.2";
- pListData->itc_default.decorate_item_style = "mode/slide4";
- pListData->itc_default.func.text_get = __msg_ui_thread_gl_text_get;
- pListData->itc_default.func.content_get = __msg_ui_thread_gl_content_get;
- pListData->itc_default.func.state_get = NULL;
- pListData->itc_default.func.del = __msg_ui_thread_gl_del;
- pListData->itc_default.decorate_all_item_style = "edit_default";
-
- pListData->itc_unread.item_style = "4text.1icon.1";
- pListData->itc_unread.decorate_item_style = "mode/slide4";
- pListData->itc_unread.func.text_get = __msg_ui_thread_gl_text_get;
- pListData->itc_unread.func.content_get = __msg_ui_thread_gl_content_get;
- pListData->itc_unread.func.state_get = NULL;
- pListData->itc_unread.func.del = __msg_ui_thread_gl_del;
- pListData->itc_unread.decorate_all_item_style = "edit_default";
+ if (pListData->search_mode == THREAD_SEARCH_ON) {
+ if (nType == THREAD_LIST_APP_DATA_CONV) {
+ pListData->itc_conv.item_style = "3text.1icon.3.tb";
+ pListData->itc_conv.func.text_get = __msg_ui_thread_gl_text_get;
+ pListData->itc_conv.func.content_get = __msg_ui_thread_gl_content_get;
+ pListData->itc_conv.func.state_get = NULL;
+ pListData->itc_conv.func.del = __msg_ui_thread_gl_del;
+
+ pListData->itc_unread.item_style = "4text.1icon.1.tb";
+ pListData->itc_unread.func.text_get = __msg_ui_thread_gl_text_get;
+ pListData->itc_unread.func.content_get = __msg_ui_thread_gl_content_get;
+ pListData->itc_unread.func.state_get = NULL;
+ pListData->itc_unread.func.del = __msg_ui_thread_gl_del;
+ } else {
+ pListData->itc_msg.item_style = "3text.1icon.tb";
+ pListData->itc_msg.func.text_get = msg_ui_thread_msg_gl_text_get;
+ pListData->itc_msg.func.content_get = msg_ui_thread_msg_gl_content_get;
+ pListData->itc_msg.func.state_get = NULL;
+ pListData->itc_msg.func.del = msg_ui_thread_msg_gl_del;
+ }
} else {
- pListData->itc_default.item_style = "3text.1icon";
- pListData->itc_default.func.text_get = msg_ui_thread_msg_gl_text_get;
- pListData->itc_default.func.content_get = msg_ui_thread_msg_gl_content_get;
- pListData->itc_default.func.state_get = NULL;
- pListData->itc_default.func.del = msg_ui_thread_msg_gl_del;
- pListData->itc_default.decorate_all_item_style = "edit_default";
-
- if (pListData->list_type == THREAD_CBMSG_LIST_TYPE)
- pListData->itc_default.decorate_item_style = "mode/slide";
- else
- pListData->itc_default.decorate_item_style = "mode/slide2";
+ if (nType == THREAD_LIST_APP_DATA_CONV) {
+ pListData->itc_conv.item_style = "3text.1icon.3";
+ pListData->itc_conv.decorate_item_style = "mode/slide3";
+ pListData->itc_conv.func.text_get = __msg_ui_thread_gl_text_get;
+ pListData->itc_conv.func.content_get = __msg_ui_thread_gl_content_get;
+ pListData->itc_conv.func.state_get = NULL;
+ pListData->itc_conv.func.del = __msg_ui_thread_gl_del;
+ pListData->itc_conv.decorate_all_item_style = "edit_default";
+
+ pListData->itc_unread.item_style = "4text.1icon.1";
+ pListData->itc_unread.decorate_item_style = "mode/slide3";
+ pListData->itc_unread.func.text_get = __msg_ui_thread_gl_text_get;
+ pListData->itc_unread.func.content_get = __msg_ui_thread_gl_content_get;
+ pListData->itc_unread.func.state_get = NULL;
+ pListData->itc_unread.func.del = __msg_ui_thread_gl_del;
+ pListData->itc_unread.decorate_all_item_style = "edit_default";
+ } else {
+ pListData->itc_msg.item_style = "3text.1icon";
+ pListData->itc_msg.func.text_get = msg_ui_thread_msg_gl_text_get;
+ pListData->itc_msg.func.content_get = msg_ui_thread_msg_gl_content_get;
+ pListData->itc_msg.func.state_get = NULL;
+ pListData->itc_msg.func.del = msg_ui_thread_msg_gl_del;
+ pListData->itc_msg.decorate_all_item_style = "edit_default";
+
+ if (pListData->list_type == THREAD_CBMSG_LIST_TYPE)
+ pListData->itc_msg.decorate_item_style = "mode/slide";
+ else
+ pListData->itc_msg.decorate_item_style = "mode/slide2";
+ }
}
- MSG_UI_LEAVE(MSG_UI_LEVEL_DEBUG);
+ D_LEAVE;
}
if (type == THREAD_ITC_EMPTY)
return &g_data->itc_empty;
- else if (type == THREAD_ITC_SEARCH)
- return &g_data->itc_search;
+ else if (type == THREAD_ITC_SEARCH_TITLE)
+ return &g_data->itc_search_title;
else if (type == THREAD_ITC_BLANK)
return &g_data->itc_blank;
else if (type == THREAD_ITC_POPUP)
return &g_data->itc_popup;
- else if (type == THREAD_ITC_DATE)
- return &g_data->itc_date;
else
return NULL;
}
-
/* Launching Time Check */
static void __main_layout_flush_post_cb(void *data, Evas *e, void *event_info)
{
void *msg_ui_thread_init_thread_data(struct appdata *ad)
{
- PMSG_THREAD_DATA pData = NULL;
+ D_ENTER;
+ PMSG_THREAD_DATA pData = NULL;
pData = (PMSG_THREAD_DATA)calloc(1, sizeof(MSG_THREAD_DATA));
if (!pData) {
msg_ui_thread_get_time_format(pData);
pData->time_12h_ptn = msg_common_get_date_best_pattern(pData->locale, MSG_UI_TIME_PATTERN_12H);
pData->time_24h_ptn = msg_common_get_date_best_pattern(pData->locale, MSG_UI_TIME_PATTERN_24H);
- pData->date_ptn_default = msg_common_get_date_best_pattern(pData->locale, MSG_UI_DATE_PATTERN_DEFAULT);
- pData->date_ptn_year = msg_common_get_date_best_pattern(pData->locale, MSG_UI_DATE_PATTERN_YEAR);
/* Register callback to apply time change. */
if (vconf_notify_key_changed(VCONFKEY_SYSTEM_TIME_CHANGED, msg_ui_thread_timezone_change_cb, (void *)pData) < 0) {
D_EMSG("Fail to register vconf CB with [%s]", VCONFKEY_SYSTEM_TIME_CHANGED);
}
+ pData->handlerIsPressed = false;
+ pData->keypadIsShown = false;
+
+ D_LEAVE;
return (void *)pData;
}
for (i = MSG_THREAD_LIST_MAX_COUNT-1; i >= 0; i--) {
if (pData->list_data[i] != NULL) {
+ elm_object_item_del(elm_naviframe_top_item_get(pData->navi_frame));
+ elm_genlist_clear(pData->list_data[i]->genlist);
msg_ui_thread_destroy_thread_list_data(pData->list_data[i]);
}
}
msg_ui_thread_destroy_split_data(pData->split_data);
}
- if (pData->date_ptn_default) {
- free(pData->date_ptn_default);
- pData->date_ptn_default = NULL;
- }
-
- if (pData->date_ptn_year) {
- free(pData->date_ptn_year);
- pData->date_ptn_year = NULL;
- }
-
if (pData->time_12h_ptn) {
free(pData->time_12h_ptn);
pData->time_12h_ptn = NULL;
}
}
-PMSG_THREAD_LIST_DATA msg_ui_thread_create_thread_list_data(ThreadMsgListType list_type, ThreadMsgListAppDataType app_data_type)
+PMSG_THREAD_LIST_DATA msg_ui_thread_create_thread_list_data(ThreadMsgListType list_type, ThreadAppDataType app_data_type)
{
int i = 0;
PMSG_THREAD_DATA pData = msg_ui_thread_get_data();
pListData->list_type = list_type;
pListData->app_data_type = app_data_type;
pListData->search_mode = THREAD_SEARCH_OFF;
- pListData->job_popup_end = NULL;
pListData->action_type = THREAD_ACTION_NONE;
- pListData->include_protected_msg = false;
for (i = 0; i < MSG_THREAD_LIST_MAX_COUNT; i++) {
if (pData->list_data[i] == NULL) {
if (!pListData)
return;
- if (pListData->multi_action_thread) {
- if (ecore_thread_cancel(pListData->multi_action_thread) == EINA_FALSE) {
- D_MSG("ecore_thread_cancel is done.");
- } else {
- D_MSG("ecore_thread_cancel is failed.");
- }
- pListData->multi_action_thread = NULL;
- }
+ if (pListData->pPopup) {
+ if (pListData->pPopup->popup_type == THREAD_POPUP_ADDRESS) {
+ PMSG_APP_THREAD_POPUP_ADDRESS pPopup = (PMSG_APP_THREAD_POPUP_ADDRESS)pListData->pPopup;
+ if(pPopup->job_popup_end) {
+ if (ecore_job_del(pPopup->job_popup_end))
+ D_MSG("ecore_job_del is done.");
+ pPopup->job_popup_end = NULL;
+ }
+ } else if (pListData->pPopup->popup_type == THREAD_POPUP_PROGRESS) {
+ PMSG_APP_THREAD_POPUP_PROGRESS pPopup = (PMSG_APP_THREAD_POPUP_PROGRESS)pListData->pPopup;
+
+ if (pPopup->multi_action_thread) {
+ if (ecore_thread_cancel(pPopup->multi_action_thread) == EINA_FALSE) {
+ D_MSG("ecore_thread_cancel is done.");
+ } else {
+ D_MSG("ecore_thread_cancel is failed.");
+ }
+ pPopup->multi_action_thread = NULL;
+ }
+ }
- if(pListData->job_popup_end) {
- if (ecore_job_del(pListData->job_popup_end))
- D_MSG("ecore_job_del is done.");
- pListData->job_popup_end = NULL;
+ evas_object_del(pListData->pPopup->popup_object);
+ free(pListData->pPopup);
+ pListData->pPopup = NULL;
}
for (i = 0; i < CONTROLBAR_ITEM_MAX; i++) {
}
}
- evas_object_del(pListData->back_btn);
- pListData->back_btn = NULL;
+ if (pListData->search_timer) {
+ ecore_timer_del(pListData->search_timer);
+ pListData->search_timer = NULL;
+ }
+
+ if (pListData->back_btn) {
+ evas_object_del(pListData->back_btn);
+ pListData->back_btn = NULL;
+ }
for (i = MSG_THREAD_LIST_MAX_COUNT-1; i >= 0; i--) {
if (pData->list_data[i] != NULL && pData->list_data[i] == pListData) {
if (!pSplitData)
return;
- evas_object_hide(pSplitData->content_ly);
- evas_object_del(pSplitData->content_ly);
- pSplitData->content_ly = NULL;
+ if (pSplitData->content_ly) {
+ evas_object_hide(pSplitData->content_ly);
+ evas_object_del(pSplitData->content_ly);
+ pSplitData->content_ly = NULL;
+ }
free(pSplitData);
pData->split_data = NULL;
Evas_Object *msg_ui_thread_create_layout_main(PMSG_THREAD_DATA pData)
{
- MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
+ D_ENTER;
MSG_UI_RETVM_IF(MSG_UI_LEVEL_ERR, pData == NULL || pData->win_main == NULL, NULL, "pData is NULL");
Evas_Object *bg;
elm_panes_fixed_set(pData->panes, EINA_FALSE);
evas_object_size_hint_weight_set(pData->panes, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(pData->panes, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_panes_content_left_size_set(pData->panes, 1.0);
evas_object_show(pData->panes);
evas_object_smart_callback_add(pData->panes, "press", msg_ui_thread_panes_handler_press_cb, pData);
elm_object_part_content_set(pData->layout_main, "elm.swallow.content", pData->navi_frame);
evas_object_show(pData->navi_frame);
- MSG_UI_LEAVE(MSG_UI_LEVEL_DEBUG);
-
+ D_LEAVE;
return layout;
}
void msg_ui_thread_load_thread_view(void *data, service_h service)
{
+ D_ENTER;
if (!data)
return;
PMSG_THREAD_DATA pData = (PMSG_THREAD_DATA)data;
PMSG_THREAD_LIST_DATA pListData = NULL;
- pListData = msg_ui_thread_create_thread_list_data(THREAD_NORMAL_LIST_TYPE, THREAD_LIST_APP_DATA_THREAD);
+ pListData = msg_ui_thread_create_thread_list_data(THREAD_NORMAL_LIST_TYPE, THREAD_LIST_APP_DATA_CONV);
msg_ui_thread_fullview_launch(pData, pListData);
msg_ui_thread_list_load(pListData, TRUE);
- if (pData->isRotate == true) {
- PMSG_THREAD_SPLIT_DATA pSplitData = NULL;
- pSplitData = msg_ui_thread_create_split_data();
- msg_ui_thread_splitview_launch(pData, pSplitData);
- }
-
/* Search mode from live-box */
char *key_type = NULL;
service_get_extra_data(service, MSG_BUNDLE_KEY_TYPE, &key_type);
if (g_strcmp0(key_type, MSG_BUNDLE_VALUE_SEARCH_MODE) == 0) {
- if (pListData->searchbar)
- elm_object_focus_set(pListData->searchbar, EINA_TRUE);
+ if (pListData->item_cnt > 0) {
+ Evas_Object *entry = NULL;
+
+ if (msg_ui_thread_rotation_get() == true)
+ elm_naviframe_item_title_visible_set(pListData->nf_it, EINA_FALSE);
+
+ if (!pListData->searchbar)
+ pListData->searchbar = msg_ui_thread_create_searchbar_layout(pListData->content_ly, pListData);
+
+ edje_object_signal_emit(_EDJ(pListData->content_ly), "show_searchbar", "search");
+ elm_object_part_content_set(pListData->content_ly, "search", pListData->searchbar);
+
+ entry = elm_object_part_content_get(pListData->searchbar, "elm.swallow.content");
+ elm_object_focus_set(entry, EINA_TRUE);
+ pListData->search_mode = THREAD_SEARCH_ON;
+
+ msg_ui_thread_set_title_status(pListData);
+ msg_ui_thread_set_navi_toolbar_item(pListData, true);
+ }
}
+ D_LEAVE;
}
void msg_ui_thread_load_message_box(int list_type)
PMSG_THREAD_LIST_DATA pListData = NULL;
pListData = msg_ui_thread_create_thread_list_data(list_type, THREAD_LIST_APP_DATA_MSG);
+ if (pData->split_data)
+ msg_ui_thread_destroy_split_data(pData->split_data);
msg_ui_thread_fullview_launch(pData, pListData);
msg_ui_thread_msg_list_load(pListData, list_type);
if (pData->isRotate == true) {
- PMSG_THREAD_SPLIT_DATA pSplitData = NULL;
- msg_ui_thread_destroy_split_data(pData->split_data);
- pSplitData = msg_ui_thread_create_split_data();
- msg_ui_thread_splitview_launch(pData, pSplitData);
- } else {
- edje_object_signal_emit(_EDJ(pListData->content_ly), "hide_searchbar", "sel_all");
- elm_object_part_content_unset(pListData->content_ly, "sel_all");
- evas_object_hide(pListData->searchbar);
+ if (pListData->item_cnt <= 0) {
+ elm_panes_content_left_size_set(pData->panes, 0.0);
+ elm_object_signal_emit(pData->panes, "elm,panes,unpair", "");
+ }
}
D_LEAVE;
void msg_ui_thread_fullview_launch(PMSG_THREAD_DATA pData, PMSG_THREAD_LIST_DATA pListData)
{
- char label[DEF_BUF_LEN_S+1] = {0,};
-
- MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
+ D_ENTER;
MSG_UI_RETM_IF(MSG_UI_LEVEL_ERR, !pData || !pListData, "pData or pListData is NULL");
pListData->content_ly = msg_ui_thread_create_content_layout(pData->navi_frame);
- pListData->noc_ly = msg_ui_thread_create_nocontent_layout(pData->navi_frame);
+ pListData->noc_ly = msg_ui_thread_create_nocontent_layout(pData->navi_frame, pListData->search_mode);
- pListData->searchbar = msg_ui_thread_create_searchbar_layout(pListData->content_ly, pListData);
- if (pData->isRotate == true)
- elm_object_part_content_set(pListData->content_ly, "sel_all", pListData->searchbar);
+ if (pData->isRotate == true) {
+ elm_panes_content_left_size_set(pData->panes, 0.4);
+ elm_object_signal_emit(pData->panes, "elm,panes,pair", "");
+ } else {
+ if (!pListData->back_btn) {
+ pListData->back_btn = elm_button_add(pData->navi_frame);
+ elm_object_style_set(pListData->back_btn, "naviframe/back_btn/default");
+ evas_object_smart_callback_add(pListData->back_btn, "clicked", msg_ui_thread_back_btn_clicked_cb, (void *)pListData);
+ }
+ elm_panes_content_left_size_set(pData->panes, 1.0);
+ elm_object_signal_emit(pData->panes, "elm,panes,unpair", "");
+ }
pListData->genlist = msg_ui_thread_create_genlist(pListData->content_ly, pListData);
elm_object_part_content_set(pListData->content_ly, "thread_list", pListData->genlist);
- //evas_object_data_set(pListData->genlist, "pData", pListData);
if (msg_ui_thread_get_prev_list(pListData) == NULL)
elm_win_conformant_set(pData->win_main, 1);
- pListData->back_btn = elm_button_add(pData->navi_frame);
- elm_object_style_set(pListData->back_btn, "naviframe/back_btn/default");
- evas_object_smart_callback_add(pListData->back_btn, "clicked", msg_ui_thread_back_btn_clicked_cb, (void *)pListData);
+ pListData->nf_it = elm_naviframe_item_push(pData->navi_frame, NULL, pListData->back_btn, NULL, pListData->content_ly, NULL);
- msg_ui_thread_get_title_text(pListData, label, DEF_BUF_LEN_S);
- pListData->nf_it = elm_naviframe_item_push(pData->navi_frame, label, pListData->back_btn, NULL, pListData->content_ly, NULL);
- msg_ui_thread_set_navi_toolbar_item(pListData);
+ msg_ui_thread_set_title_status(pListData);
+ if (pData->isRotate == true)
+ elm_object_item_signal_emit(pListData->nf_it, "elm,state,toolbar,close", "");
+ else
+ msg_ui_thread_set_navi_toolbar_item(pListData, false);
+
+ if (pData->isRotate == true) {
+ PMSG_THREAD_SPLIT_DATA pSplitData = NULL;
+ pSplitData = msg_ui_thread_create_split_data();
+ msg_ui_thread_splitview_launch(pData, pSplitData);
+ }
- MSG_UI_LEAVE(MSG_UI_LEVEL_DEBUG);
+ D_LEAVE;
}
void msg_ui_thread_splitview_launch(PMSG_THREAD_DATA pData, PMSG_THREAD_SPLIT_DATA pSplitData)
MSG_UI_RETM_IF(MSG_UI_LEVEL_ERR, !pData || !pSplitData, "pData or pSplitData is NULL");
PMSG_THREAD_LIST_DATA pListData = msg_ui_thread_get_current_list();
- char label[DEF_BUF_LEN_S+1] = {0,};
if (!pSplitData->content_ly)
pSplitData->content_ly= elm_layout_add(pData->panes);
elm_object_part_content_set(pSplitData->content_ly, "elm.swallow.content", pSplitData->navi_frame);
if (!pSplitData->noc_ly)
- pSplitData->noc_ly= msg_ui_thread_create_nocontent_layout(pSplitData->navi_frame);
+ pSplitData->noc_ly= msg_ui_thread_create_nocontent_layout(pSplitData->navi_frame, THREAD_SEARCH_OFF);
elm_object_part_content_set(pSplitData->content_ly, "thread_list", pSplitData->noc_ly);
evas_object_show(pSplitData->noc_ly);
- /*Push content to navi frame*/
- if (!pSplitData->back_btn)
- pSplitData->back_btn = elm_button_add(pSplitData->navi_frame);
- elm_object_style_set(pSplitData->back_btn, "naviframe/back_btn/default");
- evas_object_smart_callback_add(pSplitData->back_btn, "clicked", msg_ui_thread_back_btn_clicked_cb, (void *)pListData);
- evas_object_show(pSplitData->back_btn);
-
if (!pSplitData->nf_it)
- pSplitData->nf_it = elm_naviframe_item_push(pSplitData->navi_frame, NULL, NULL, NULL, pSplitData->noc_ly, "empty");
+ pSplitData->nf_it = elm_naviframe_item_push(pSplitData->navi_frame, NULL, NULL, NULL, pSplitData->noc_ly, NULL);
- /* create navi title layout */
- if (!pSplitData->title_layout)
- pSplitData->title_layout = elm_layout_add(pSplitData->navi_frame);
- elm_layout_file_set(pSplitData->title_layout, MSG_COMMON_EDJ, "title");
- evas_object_size_hint_weight_set(pSplitData->title_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(pSplitData->title_layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(pSplitData->title_layout);
+ msg_ui_thread_set_title_status(pListData);
- msg_ui_thread_get_title_text(pListData, label, DEF_BUF_LEN_S);
- elm_object_part_text_set(pSplitData->title_layout, "title_text", label);
- elm_object_item_part_content_set(pSplitData->nf_it, "title", pSplitData->title_layout);
+ if (!pSplitData->back_btn) {
+ pSplitData->back_btn = elm_button_add(pSplitData->navi_frame);
+ elm_object_style_set(pSplitData->back_btn, "naviframe/title_icon");
- /*Create composer button*/
- if (pListData->list_type == THREAD_NORMAL_LIST_TYPE) {
- if (!pSplitData->composer_btn)
- pSplitData->composer_btn = elm_button_add(pSplitData->navi_frame);
- elm_object_style_set(pSplitData->composer_btn, "naviframe/title_icon");
+ Evas_Object *icon_back = elm_icon_add(pSplitData->back_btn);
+ elm_image_file_set(icon_back, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_TITLE_ICON_BACK);
+ elm_image_resizable_set(icon_back, 1, 1);
+ evas_object_image_smooth_scale_set(icon_back, 0);
+ elm_object_content_set(pSplitData->back_btn, icon_back);
- Evas_Object *icon = elm_icon_add(pSplitData->composer_btn);
- elm_image_file_set(icon, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_TITLE_ICON_COMPOSE);
+ evas_object_smart_callback_add(pSplitData->back_btn, "clicked", msg_ui_thread_back_btn_clicked_cb, (void *)pListData);
+ evas_object_show(pSplitData->back_btn);
+ }
+
+ if (!pSplitData->more_btn) {
+ pSplitData->more_btn = elm_button_add(pSplitData->navi_frame);
+ elm_object_style_set(pSplitData->more_btn, "naviframe/title_icon");
+
+ Evas_Object *icon = elm_icon_add(pSplitData->more_btn);
+ elm_image_file_set(icon, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_TITLE_ICON_MORE);
elm_image_resizable_set(icon, 1, 1);
evas_object_image_smooth_scale_set(icon, 0);
- elm_object_content_set(pSplitData->composer_btn, icon);
+ elm_object_content_set(pSplitData->more_btn, icon);
- evas_object_smart_callback_add(pSplitData->composer_btn, "clicked", msg_ui_thread_ctlbar_compose_cb, (void *)pListData);
- evas_object_show(pSplitData->composer_btn);
+ evas_object_smart_callback_add(pSplitData->more_btn, "clicked", msg_ui_thread_ctlbar_message_box_cb, (void *)pListData);
+ evas_object_show(pSplitData->more_btn);
- elm_object_part_content_set(pSplitData->title_layout, "compose_btn", pSplitData->composer_btn);
+ if (pListData->list_type != THREAD_NORMAL_LIST_TYPE && pListData->list_type != THREAD_SPAM_LIST_TYPE && pListData->item_cnt <= 0)
+ elm_object_disabled_set(pSplitData->more_btn, EINA_TRUE);
}
- elm_object_part_content_set(pSplitData->title_layout, "prev_btn", pSplitData->back_btn);
+
+ elm_object_item_part_content_set(pSplitData->nf_it, "title_right_btn", pSplitData->back_btn);
+ elm_object_item_part_content_set(pSplitData->nf_it, "title_left_btn", pSplitData->more_btn);
elm_object_part_content_set(pData->panes, "right", pSplitData->content_ly);
evas_object_show(pSplitData->content_ly);
Evas_Object *msg_ui_thread_create_searchbar_layout(Evas_Object *parent, PMSG_THREAD_LIST_DATA pListData)
{
- MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
+ D_ENTER;
if (!pListData)
return NULL;
elm_entry_scrollable_set(entry, EINA_TRUE);
elm_entry_single_line_set(entry, EINA_TRUE);
elm_entry_cnp_mode_set(entry, ELM_CNP_MODE_PLAINTEXT);
+ elm_entry_autocapital_type_set(entry, ELM_AUTOCAPITAL_TYPE_NONE);
+ elm_entry_input_panel_return_key_type_set(entry, ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH);
elm_object_part_content_set(layout, "elm.swallow.content", entry);
elm_object_part_text_set(layout, "elm.guidetext", dgettext("sys_string", "IDS_COM_BODY_SEARCH"));
evas_object_smart_callback_add(entry, "focused", msg_ui_thread_searchbar_entry_focus_cb, (void *)pListData);
evas_object_smart_callback_add(entry, "unfocused", msg_ui_thread_searchbar_entry_unfocus_cb, (void *)pListData);
+ evas_object_smart_callback_add(entry, "changed", msg_ui_thread_searchbar_entry_change_cb, pListData);
+ evas_object_smart_callback_add(entry, "preedit,changed", msg_ui_thread_searchbar_entry_change_cb, pListData);
evas_object_smart_callback_add(cancel_button, "clicked", msg_ui_thread_searchbar_cancel_click_cb, (void *)pListData);
elm_object_signal_callback_add(layout, "elm,eraser,clicked", "elm", msg_ui_thread_searchbar_eraser_clicked_cb, (void *)pListData);
- evas_object_show(layout);
-
- MSG_UI_LEAVE(MSG_UI_LEVEL_DEBUG);
-
+ D_LEAVE;
return layout;
}
evas_object_smart_callback_add(genlist, "drag,start,right", msg_ui_thread_gl_mode_right, (void *)pListData);
evas_object_smart_callback_add(genlist, "drag,start,left", msg_ui_thread_gl_mode_left, (void *)pListData);
+ evas_object_smart_callback_add(genlist, "highlighted", msg_ui_thread_gl_highlighted, (void *)pListData);
+ evas_object_smart_callback_add(genlist, "unhighlighted", msg_ui_thread_gl_unhighlighted, (void *)pListData);
/** "3text.tb" style is only supported COMPRESS MODE */
/** "3text.1icon" and "1text" are suported COMPRESS MODE also */
elm_genlist_mode_set(genlist, ELM_LIST_SCROLL);
- msg_ui_thread_genlist_style_set(pListData);
D_LEAVE;
-
return genlist;
}
Evas_Object *msg_ui_thread_create_content_layout(Evas_Object *parent)
{
- MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
+ D_ENTER;
/* Content layout */
Evas_Object *layout;
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
- MSG_UI_LEAVE(MSG_UI_LEVEL_DEBUG);
-
+ D_LEAVE;
return layout;
}
-Evas_Object *msg_ui_thread_create_nocontent_layout(Evas_Object *parent)
+Evas_Object *msg_ui_thread_create_nocontent_layout(Evas_Object *parent, ThreadSearchMode search_mode)
{
- MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
+ D_ENTER;
Evas_Object *noc_layout = NULL;
noc_layout = elm_layout_add(parent);
- elm_layout_theme_set(noc_layout, "layout", "nocontents", "text");
- elm_object_part_text_set(noc_layout, "elm.text", dgettext(MESSAGE_PKGNAME, "IDS_MSGF_POP_NOMESSAGES"));
-
- MSG_UI_LEAVE(MSG_UI_LEVEL_DEBUG);
+ if (search_mode == THREAD_SEARCH_ON) {
+ elm_layout_theme_set(noc_layout, "layout", "nocontents", "search");
+ elm_object_part_text_set(noc_layout, "elm.text", dgettext("sys_string", "IDS_COM_BODY_NO_SEARCH_RESULTS"));
+ } else {
+ elm_layout_theme_set(noc_layout, "layout", "nocontents", "text");
+ elm_object_part_text_set(noc_layout, "elm.text", dgettext(MESSAGE_PKGNAME, "IDS_MSGF_POP_NOMESSAGES"));
+ }
+ D_LEAVE;
return noc_layout;
}
void msg_ui_thread_reg_msg_cb_func(PMSG_THREAD_DATA pData)
{
- MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
+ D_ENTER;
MSG_UI_RETM_IF(MSG_UI_LEVEL_ERR, pData == NULL, "PMSG_THREAD_DATA is NULL");
msg_reg_storage_change_callback(pData->msgHandle, &msg_ui_thread_storage_change_cb, pData);
- MSG_UI_LEAVE(MSG_UI_LEVEL_DEBUG);
+ D_LEAVE;
}
void msg_ui_thread_reset_thread_view(void *data, service_h service)
if (pData->detail_layout) {
if (pData->isRotate == true)
- elm_naviframe_item_pop(pData->split_data->navi_frame);
+ elm_object_item_del(elm_naviframe_top_item_get(pData->split_data->navi_frame));
else
- elm_naviframe_item_pop(pData->navi_frame);
+ elm_object_item_del(elm_naviframe_top_item_get(pData->navi_frame));
pData->detail_layout = NULL;
}
ug_destroy(pData->list_data[i]->loaded_ug);
pData->list_data[i]->loaded_ug = NULL;
}
- elm_naviframe_item_pop(pData->navi_frame);
+ elm_object_item_del(elm_naviframe_top_item_get(pData->navi_frame));
elm_genlist_clear(pData->list_data[i]->genlist);
msg_ui_thread_destroy_thread_list_data(pData->list_data[i]);
}
D_LEAVE;
}
-void msg_ui_thread_set_navi_toolbar_item(PMSG_THREAD_LIST_DATA pListData)
+void msg_ui_thread_set_navi_toolbar_item(PMSG_THREAD_LIST_DATA pListData, bool bReset)
{
- MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
+ D_ENTER;
if (!pListData)
return;
Evas_Object *btn2 = NULL;
int i = 0;
- for (i = 0; i < CONTROLBAR_ITEM_MAX; i++) {
- if (pListData->toolbar_btn[i])
- evas_object_del(pListData->toolbar_btn[i]);
+ if (bReset) {
+ for (i = 0; i < CONTROLBAR_ITEM_MAX; i++) {
+ if (pListData->toolbar_btn[i]) {
+ evas_object_del(pListData->toolbar_btn[i]);
+ pListData->toolbar_btn[i] = NULL;
+ }
+ }
+ elm_object_item_part_content_unset(pListData->nf_it, "toolbar_button1");
+ elm_object_item_part_content_unset(pListData->nf_it, "toolbar_button2");
+ elm_object_item_part_content_unset(pListData->nf_it, "toolbar_more_btn");
}
- elm_object_item_part_content_unset(pListData->nf_it, "toolbar_button1");
- elm_object_item_part_content_unset(pListData->nf_it, "toolbar_button2");
- elm_object_item_part_content_unset(pListData->nf_it, "toolbar_more_btn");
if (pListData->search_mode == THREAD_SEARCH_ON)
return;
- if (!pListData->search_btn) {
- pListData->search_btn = elm_button_add(pData->navi_frame);
- elm_object_style_set(pListData->search_btn, "naviframe/title_icon");
-
- Evas_Object *icon = elm_icon_add(pListData->search_btn);
- elm_image_file_set(icon, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_TITLE_ICON_SEARCH);
- elm_image_resizable_set(icon, 1, 1);
- evas_object_image_smooth_scale_set(icon, 0);
- elm_object_content_set(pListData->search_btn, icon);
- evas_object_smart_callback_add(pListData->search_btn, "clicked", msg_ui_thread_search_btn_clicked_cb, (void *)pListData);
+ if (!pListData->back_btn) {
+ pListData->back_btn = elm_button_add(pData->navi_frame);
+ evas_object_smart_callback_add(pListData->back_btn, "clicked", msg_ui_thread_back_btn_clicked_cb, (void *)pListData);
+ elm_object_style_set(pListData->back_btn, "naviframe/back_btn/default");
}
+ elm_object_item_part_content_set(pListData->nf_it, "prev_btn", pListData->back_btn);
if (pListData->view_mode == THREAD_EDIT_VIEW) {
+ if (!pListData->sel_all_btn) {
+ pListData->sel_all_btn = elm_button_add(pData->navi_frame);
+ elm_object_style_set(pListData->sel_all_btn, "naviframe/title_icon");
+
+ Evas_Object *icon = elm_icon_add(pListData->sel_all_btn);
+ elm_image_file_set(icon, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_TITLE_ICON_SEL_ALL);
+ elm_image_resizable_set(icon, 1, 1);
+ evas_object_image_smooth_scale_set(icon, 0);
+ elm_object_content_set(pListData->sel_all_btn, icon);
+ evas_object_smart_callback_add(pListData->sel_all_btn, "clicked", msg_ui_thread_sel_all_clicked_cb, (void *)pListData);
+ }
+ elm_object_item_part_content_set(pListData->nf_it, "title_right_btn", pListData->sel_all_btn);
+
btn = elm_button_add(pData->navi_frame);
elm_object_style_set(btn, "naviframe/toolbar/default");
- elm_object_text_set(btn, dgettext("sys_string", "IDS_COM_SK_DELETE"));
- evas_object_smart_callback_add(btn, "clicked", msg_ui_thread_ctlbar_multi_action_cb, pListData);
- elm_object_item_part_content_set(pListData->nf_it, "toolbar_button1", btn);
- pListData->toolbar_btn[CONTROLBAR_ITEM_1] = btn;
-
- switch (pListData->list_type) {
- case THREAD_SIM_LIST_TYPE:
- case THREAD_SPAM_LIST_TYPE:
- btn2 = elm_button_add(pData->navi_frame);
- elm_object_style_set(btn, "naviframe/toolbar/left");
- elm_object_style_set(btn2, "naviframe/toolbar/right");
- evas_object_smart_callback_add(btn2, "clicked", msg_ui_thread_ctlbar_multi_action_cb, pListData);
- elm_object_item_part_content_set(pListData->nf_it, "toolbar_button2", btn2);
-
- pListData->toolbar_btn[CONTROLBAR_ITEM_2] = btn2;
+ switch (pListData->action_type) {
+ case THREAD_ACTION_DELETE:
+ elm_object_text_set(btn, dgettext("sys_string", "IDS_COM_SK_DELETE"));
+ break;
- if (pListData->list_type == THREAD_SIM_LIST_TYPE)
- elm_object_text_set(btn2, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_COPY_TO_PHONE"));
- else if (pListData->list_type == THREAD_SPAM_LIST_TYPE)
- elm_object_text_set(btn2, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_SK_RESTORE"));
+ case THREAD_ACTION_RESTORE:
+ elm_object_text_set(btn, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_SK_RESTORE"));
break;
- case THREAD_CBMSG_LIST_TYPE:
+ case THREAD_ACTION_COPY_TO_PHONE:
+ elm_object_text_set(btn, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_COPY_TO_PHONE"));
+ break;
default:
break;
}
+ evas_object_smart_callback_add(btn, "clicked", msg_ui_thread_ctlbar_multi_action_cb, pListData);
+ elm_object_item_part_content_set(pListData->nf_it, "toolbar_button1", btn);
+ pListData->toolbar_btn[CONTROLBAR_ITEM_1] = btn;
- if (pListData->check_cnt <= 0) {
+ if (pListData->check_cnt <= 0)
elm_object_disabled_set(btn, EINA_TRUE);
- if (btn2 != NULL)
- elm_object_disabled_set(btn2, EINA_TRUE);
- }
-
- evas_object_hide(pListData->search_btn);
- elm_object_item_part_content_unset(pListData->nf_it, "title_right_btn");
} else {
btn = elm_button_add(pData->navi_frame);
elm_object_style_set(btn, "naviframe/toolbar/default");
break;
case THREAD_SIM_LIST_TYPE:
- elm_object_text_set(btn, dgettext("sys_string", "IDS_COM_SK_EDIT"));
+ case THREAD_SPAM_LIST_TYPE:
+ elm_object_text_set(btn, dgettext("sys_string", "IDS_COM_SK_DELETE"));
evas_object_smart_callback_add(btn, "clicked", msg_ui_thread_ctlbar_checkbox_cb, pListData);
if (pListData->item_cnt <= 0)
elm_object_disabled_set(btn, EINA_TRUE);
+
+ btn2 = elm_button_add(pData->navi_frame);
+ elm_object_style_set(btn2, "naviframe/more/default");
+ evas_object_smart_callback_add(btn2, "clicked", msg_ui_thread_ctlbar_message_box_cb, pListData);
+ elm_object_item_part_content_set(pListData->nf_it, "toolbar_more_btn", btn2);
+ pListData->toolbar_btn[CONTROLBAR_ITEM_2] = btn2;
+
+ if (pListData->item_cnt <= 0 && pListData->list_type != THREAD_SPAM_LIST_TYPE)
+ elm_object_disabled_set(btn2, EINA_TRUE);
break;
case THREAD_NORMAL_LIST_TYPE:
elm_object_text_set(btn, dgettext("sys_string", "IDS_COM_SK3_COMPOSE"));
evas_object_smart_callback_add(btn, "clicked", msg_ui_thread_ctlbar_compose_cb, pListData);
- Evas_Object *btn3 = elm_button_add(pData->navi_frame);
- elm_object_style_set(btn3, "naviframe/more/default");
- evas_object_smart_callback_add(btn3, "clicked", msg_ui_thread_ctlbar_message_box_cb, pListData);
- elm_object_item_part_content_set(pListData->nf_it, "toolbar_more_btn", btn3);
- pListData->toolbar_btn[CONTROLBAR_ITEM_3] = btn3;
-
- break;
-
- case THREAD_SPAM_LIST_TYPE:
- elm_object_text_set(btn, dgettext("sys_string", "IDS_COM_SK_EDIT"));
- evas_object_smart_callback_add(btn, "clicked", msg_ui_thread_ctlbar_checkbox_cb, pListData);
-
btn2 = elm_button_add(pData->navi_frame);
- elm_object_style_set(btn, "naviframe/toolbar/left");
- elm_object_style_set(btn2, "naviframe/toolbar/right");
- elm_object_text_set(btn2, dgettext("sys_string", "IDS_COM_BODY_SETTINGS"));
- evas_object_smart_callback_add(btn2, "clicked", msg_ui_thread_ctlbar_spam_setting_cb, pListData);
- elm_object_item_part_content_set(pListData->nf_it, "toolbar_button2", btn2);
+ elm_object_style_set(btn2, "naviframe/more/default");
+ evas_object_smart_callback_add(btn2, "clicked", msg_ui_thread_ctlbar_message_box_cb, pListData);
+ elm_object_item_part_content_set(pListData->nf_it, "toolbar_more_btn", btn2);
pListData->toolbar_btn[CONTROLBAR_ITEM_2] = btn2;
-
- if (pListData->item_cnt <=0)
- elm_object_disabled_set(btn, EINA_TRUE);
break;
default:
D_MSG("[ERROR] invalid viewmode");
return;
}
+ }
- Evas_Object *search_icon = elm_object_content_get(pListData->search_btn);
- if (pListData->item_cnt > 0)
- elm_image_file_set(search_icon, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_TITLE_ICON_SEARCH);
- else
- elm_image_file_set(search_icon, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_TITLE_ICON_SEARCH_DIM);
+ D_LEAVE;
+}
+
+void msg_ui_thread_set_title_unread_cnt(PMSG_THREAD_LIST_DATA pListData)
+{
+ D_ENTER;
+
+ MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !pListData);
+
+ Elm_Object_Item *nf_it = NULL;
+ if (msg_ui_thread_rotation_get() == true) {
+ PMSG_THREAD_DATA pData = msg_ui_thread_get_data();
+
+ if (pData->split_data)
+ nf_it = pData->split_data->nf_it;
+
+ elm_object_item_part_text_set(pListData->nf_it, "title_badge", NULL);
+ } else {
+ nf_it = pListData->nf_it;
+ }
- if (pListData->search_mode == THREAD_SEARCH_OFF && msg_ui_thread_rotation_get() == false) {
- elm_object_item_part_content_set(pListData->nf_it, "title_right_btn", pListData->search_btn);
+ if (!nf_it)
+ return;
+
+ if (pListData->list_type == THREAD_NORMAL_LIST_TYPE && pListData->view_mode == THREAD_NORMAL_VIEW && pListData->search_mode == THREAD_SEARCH_OFF) {
+ msg_error_t err = MSG_SUCCESS;
+ msg_struct_t count_info = msg_create_struct(MSG_STRUCT_COUNT_INFO);
+ int unread_cnt = 0;
+
+ err = msg_count_message(msg_ui_thread_get_data_handle(), MSG_INBOX_ID, count_info);
+ if (err != MSG_SUCCESS) {
+ msg_release_struct(&count_info);
+ return;
+ }
+
+ msg_get_int_value(count_info, MSG_COUNT_INFO_UNREAD_INT, &unread_cnt);
+ msg_release_struct(&count_info);
+
+ MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "unread count is %d", unread_cnt);
+ pListData->unread_cnt = unread_cnt;
+ if (unread_cnt > 0) {
+ char buf[DEF_BUF_LEN] = { 0, };
+
+ if (unread_cnt > 999)
+ snprintf(buf, sizeof(buf), "999");
+ else
+ snprintf(buf, sizeof(buf), "%d", unread_cnt);
+
+ elm_object_item_part_text_set(nf_it, "title_badge", buf);
} else {
- evas_object_hide(pListData->search_btn);
- elm_object_item_part_content_unset(pListData->nf_it, "title_right_btn");
+ elm_object_item_part_text_set(nf_it, "title_badge", NULL);
+ }
+ } else {
+ elm_object_item_part_text_set(nf_it, "title_badge", NULL);
+ }
+
+ D_LEAVE;
+}
+
+void msg_ui_thread_set_title_status(PMSG_THREAD_LIST_DATA pListData)
+{
+ D_ENTER;
+
+ MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !pListData || !pListData->nf_it);
+
+ PMSG_THREAD_DATA pData = msg_ui_thread_get_data();
+ char label[DEF_BUF_LEN_S] = {0};
+
+ /* set title text */
+ msg_ui_thread_get_title_text(pListData, label, DEF_BUF_LEN_S);
+ if (pData->isRotate == true) {
+ if (pData->split_data)
+ elm_object_item_text_set(pData->split_data->nf_it, label);
+ else
+ elm_object_item_text_set(pListData->nf_it, label);
+
+ if (pListData->view_mode == THREAD_NORMAL_VIEW)
+ elm_object_item_text_set(pListData->nf_it, "");
+ } else {
+ elm_object_item_text_set(pListData->nf_it, label);
+ }
+
+ /* set title button */
+ if (!pListData->search_btn) {
+ pListData->search_btn = elm_button_add(pData->navi_frame);
+ elm_object_style_set(pListData->search_btn, "naviframe/title_icon");
+
+ Evas_Object *icon = elm_icon_add(pListData->search_btn);
+ elm_image_file_set(icon, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_TITLE_ICON_SEARCH);
+ elm_image_resizable_set(icon, 1, 1);
+ evas_object_image_smooth_scale_set(icon, 0);
+ elm_object_content_set(pListData->search_btn, icon);
+ evas_object_smart_callback_add(pListData->search_btn, "clicked", msg_ui_thread_search_btn_clicked_cb, (void *)pListData);
+ }
+
+ if (pListData->item_cnt > 0)
+ elm_object_disabled_set(pListData->search_btn, EINA_FALSE);
+ else
+ elm_object_disabled_set(pListData->search_btn, EINA_TRUE);
+
+ if (pData->isRotate == true && pListData->list_type == THREAD_NORMAL_LIST_TYPE) {
+ if (!pListData->composer_btn) {
+ pListData->composer_btn = elm_button_add(pData->navi_frame);
+ elm_object_style_set(pListData->composer_btn, "naviframe/title_icon");
+
+ Evas_Object *icon = elm_icon_add(pListData->composer_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(pListData->composer_btn, icon);
+ evas_object_smart_callback_add(pListData->composer_btn, "clicked", msg_ui_thread_ctlbar_compose_cb, (void *)pListData);
+ evas_object_show(pListData->composer_btn);
+ }
+ } else {
+ if (pListData->composer_btn) {
+ evas_object_del(pListData->composer_btn);
+ elm_object_item_part_content_unset(pListData->nf_it, "title_left_btn");
+ pListData->composer_btn = NULL;
+ }
+ }
+
+ if (pListData->view_mode == THREAD_EDIT_VIEW || pListData->search_mode == THREAD_SEARCH_ON) {
+ evas_object_hide(pListData->search_btn);
+ elm_object_item_part_content_unset(pListData->nf_it, "title_right_btn");
+
+ if (pListData->composer_btn) {
+ evas_object_hide(pListData->composer_btn);
+ elm_object_item_part_content_unset(pListData->nf_it, "title_left_btn");
}
+ } else {
+ elm_object_item_part_content_set(pListData->nf_it, "title_right_btn", pListData->search_btn);
+ if (pListData->composer_btn)
+ elm_object_item_part_content_set(pListData->nf_it, "title_left_btn", pListData->composer_btn);
}
- MSG_UI_LEAVE(MSG_UI_LEVEL_DEBUG);
+ /* set unread count */
+ msg_ui_thread_set_title_unread_cnt(pListData);
+
+ D_LEAVE;
}
void msg_ui_thread_show_toolbar(PMSG_THREAD_LIST_DATA pListData)
pListData->back_btn = elm_button_add(pData->navi_frame);
evas_object_smart_callback_add(pListData->back_btn, "clicked", msg_ui_thread_back_btn_clicked_cb, (void *)pListData);
elm_object_style_set(pListData->back_btn, "naviframe/back_btn/default");
- elm_object_item_part_content_set(pListData->nf_it, "prev_btn", pListData->back_btn);
}
elm_object_item_part_content_set(pListData->nf_it, "prev_btn", pListData->back_btn);
- msg_ui_thread_set_navi_toolbar_item(pListData);
+ msg_ui_thread_set_navi_toolbar_item(pListData, true);
elm_object_item_signal_emit(pListData->nf_it, "elm,state,toolbar,open", "");
D_LEAVE;
elm_object_item_part_content_unset(pListData->nf_it, "toolbar_more_btn");
elm_object_item_signal_emit(pListData->nf_it, "elm,state,toolbar,close", "");
+
D_LEAVE;
}
void msg_ui_thread_rotation_set(void *data, int rot)
{
+ D_ENTER;
+
PMSG_THREAD_DATA pData = (PMSG_THREAD_DATA)data;
if (!pData)
evas_event_feed_mouse_up(evas_object_evas_get(pData->panes), 1, EVAS_BUTTON_NONE, 0, NULL);
if (rot == THREAD_ROTATE_ANGLE_LANDSCAPE || rot == THREAD_ROTATE_ANGLE_LANDSCAPE_UPSIDEDOWN) {
- pData->isRotate = true;
- msg_ui_thread_split_view_show(pData);
- } else {
+ if (pData->isRotate == false) {
+ pData->isRotate = true;
+ msg_ui_thread_split_view_show(pData);
+ }
+ } else if (pData->isRotate == true) {
pData->isRotate = false;
msg_ui_thread_split_view_hide(pData);
}
+ D_LEAVE;
}
bool msg_ui_thread_rotation_get(void)
elm_genlist_realized_items_update(pListData->genlist);
elm_object_part_text_set(pListData->noc_ly, "elm.text", dgettext(MESSAGE_PKGNAME, "IDS_MSGF_POP_NOMESSAGES"));
- elm_object_part_text_set(pListData->searchbar, "elm.guidetext", dgettext("sys_string", "IDS_COM_BODY_SEARCH"));
+ if (pListData->searchbar)
+ elm_object_part_text_set(pListData->searchbar, "elm.guidetext", dgettext("sys_string", "IDS_COM_BODY_SEARCH"));
- if (pListData->popup) {
- evas_object_del(pListData->popup);
- pListData->popup = NULL;
+ if (pListData->pPopup && pListData->pPopup->popup_type == THREAD_POPUP_NONE) {
+ evas_object_del(pListData->pPopup->popup_object);
+ free(pListData->pPopup);
+ pListData->pPopup = NULL;
}
msg_ui_thread_get_title_text(pListData, label, DEF_BUF_LEN_S);
elm_object_item_text_set(pListData->nf_it, label);
- msg_ui_thread_set_navi_toolbar_item(pListData);
+ msg_ui_thread_set_navi_toolbar_item(pListData, false);
}
}
pListData = msg_ui_thread_get_current_list();
msg_ui_thread_get_title_text(pListData, label, DEF_BUF_LEN_S);
- elm_object_part_text_set(pData->split_data->title_layout, "title_text", label);
+ elm_object_item_text_set(pData->split_data->nf_it, label);
elm_object_part_text_set(pData->split_data->noc_ly, "elm.text", dgettext(MESSAGE_PKGNAME, "IDS_MSGF_POP_NOMESSAGES"));
}
}
PMSG_THREAD_LIST_DATA pListData = msg_ui_thread_get_current_list();
if (pListData && pListData->view_mode == THREAD_NORMAL_VIEW) {
- elm_panes_content_left_size_set(pData->panes, 0.4);
- elm_object_signal_emit(pData->panes, "elm,panes,pair", "");
-
-
- if (pListData->item_cnt > 0) {
- edje_object_signal_emit(_EDJ(pListData->content_ly), "show_searchbar", "sel_all");
- evas_object_show(pListData->searchbar);
- elm_object_part_content_set(pListData->content_ly, "sel_all", pListData->searchbar);
+ if (pData->keypadIsShown == false) {
+ if (pListData->search_mode == THREAD_SEARCH_ON) {
+ elm_panes_content_left_size_set(pData->panes, 0.4);
+ elm_object_signal_emit(pData->panes, "elm,panes,pair", "");
+ } else {
+ if (pListData->item_cnt > 0) {
+ elm_panes_content_left_size_set(pData->panes, 0.4);
+ elm_object_signal_emit(pData->panes, "elm,panes,pair", "");
+ } else {
+ elm_panes_content_left_size_set(pData->panes, 0.0);
+ elm_object_signal_emit(pData->panes, "elm,panes,unpair", "");
+ }
+ }
+ } else {
+ elm_panes_content_left_size_set(pData->panes, 0.0);
+ elm_object_signal_emit(pData->panes, "elm,panes,unpair", "");
}
- elm_naviframe_item_title_visible_set(pListData->nf_it, EINA_FALSE);
+ if (pListData->search_mode == THREAD_SEARCH_ON)
+ elm_naviframe_item_title_visible_set(pListData->nf_it, EINA_FALSE);
+
+ msg_ui_thread_set_title_status(pListData);
msg_ui_thread_hide_toolbar(pListData, true);
- if (pListData->search_btn) {
- evas_object_hide(pListData->search_btn);
- elm_object_item_part_content_unset(pListData->nf_it, "title_right_btn");
- }
elm_object_part_content_set(pData->panes, "left", pData->layout_main);
evas_object_show(pData->layout_main);
if (pData->detail_layout) {
elm_object_item_del(elm_naviframe_top_item_get(pData->navi_frame));
pData->detail_layout = NULL;
- if (pListData->sel_gen_item > 0)
- msg_ui_thread_launch_msg_detail_view(pListData, elm_object_item_data_get(pListData->sel_gen_item));
+ if (pListData->sel_gen_item > 0) {
+ PMSG_APP_THREAD_MSG_DATA_S item_data = elm_object_item_data_get(pListData->sel_gen_item);
+ if (item_data != NULL)
+ msg_ui_thread_launch_msg_detail_view(pListData, item_data->msg_id, item_data->addr_cnt, item_data->addr_info);
+ }
}
}
}
msg_ui_thread_destroy_split_data(pData->split_data);
}
- if (pListData->search_mode == THREAD_SEARCH_OFF) {
- edje_object_signal_emit(_EDJ(pListData->content_ly), "hide_searchbar", "sel_all");
- elm_object_part_content_unset(pListData->content_ly, "sel_all");
- evas_object_hide(pListData->searchbar);
- msg_ui_thread_show_toolbar(pListData);
- } else {
- Evas_Object *entry = NULL;
- entry = elm_object_part_content_get(pListData->searchbar, "elm.swallow.content");
- if (entry && elm_object_focus_get(entry) == EINA_FALSE)
- msg_ui_thread_show_toolbar(pListData);
- }
-
elm_naviframe_item_title_visible_set(pListData->nf_it, EINA_TRUE);
+ msg_ui_thread_set_title_status(pListData);
+ msg_ui_thread_show_toolbar(pListData);
Evas_Object * layout = msg_ui_get_composer_ug_viewer_layout();
if (layout) {
evas_object_hide(pData->layout_main);
} else if (pData->detail_layout) {
pData->detail_layout = NULL;
- if (pListData->sel_gen_item > 0)
- msg_ui_thread_launch_msg_detail_view(pListData, elm_object_item_data_get(pListData->sel_gen_item));
+ if (pListData->sel_gen_item > 0) {
+ PMSG_APP_THREAD_MSG_DATA_S item_data = elm_object_item_data_get(pListData->sel_gen_item);
+ if (item_data != NULL)
+ msg_ui_thread_launch_msg_detail_view(pListData, item_data->msg_id, item_data->addr_cnt, item_data->addr_info);
+ }
}
-
elm_object_signal_emit(pData->panes, "elm,panes,unpair", "");
}
D_LEAVE;
return ret;
}
-void msg_ui_thread_launch_video_call(const char *call_num)
-{
- MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
- MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !call_num);
-
- service_h svc_handle = NULL;
- char tel_num[DEF_BUF_LEN] = {0,};
- char contact_id[DEF_BUF_LEN_D] = {0,};
-
- if (service_create(&svc_handle) < 0 || svc_handle == NULL) {
- D_EMSG("service_create() is failed !!");
- } else {
- service_set_operation(svc_handle, "http://tizen.org/appcontrol/operation/vt");
-
- if (call_num) {
- snprintf(tel_num, sizeof(tel_num), "tel:%s", call_num);
- service_set_uri(svc_handle, tel_num);
- }
- snprintf(contact_id, sizeof(contact_id), "%d", -1);
- service_add_extra_data(svc_handle, "ctindex", contact_id);
-
- service_send_launch_request(svc_handle, NULL, NULL);
- service_destroy(svc_handle);
- }
-
- MSG_UI_LEAVE(MSG_UI_LEVEL_DEBUG);
-}
-
-void msg_ui_thread_launch_spam_setting(PMSG_THREAD_LIST_DATA pListData)
+void msg_ui_thread_launch_setting(PMSG_THREAD_LIST_DATA pListData)
{
MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
MSG_UI_RET_IF(MSG_UI_LEVEL_ASSERT, pListData == NULL);
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_TYPE, MSG_BUNDLE_VALUE_SPAM_SETTING);
+ if (pListData->list_type == THREAD_SPAM_LIST_TYPE)
+ service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_TYPE, MSG_BUNDLE_VALUE_SPAM_SETTING);
+
pListData->loaded_ug = ug_create(NULL, MSG_SETTING_UG_NAME, UG_MODE_FULLVIEW, svc_handle, &pListData->cbs);
service_destroy(svc_handle);
}
if (!ug || !priv)
return;
- Evas_Object *base, *win;
+ Evas_Object *base;
base = ug_get_layout(ug);
if (!base){
return;
}
- win = ug_get_window();
-
switch (mode) {
case UG_MODE_FULLVIEW:
evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
msg_ui_thread_get_title_text(pListData, label, DEF_BUF_LEN_S);
if (pData->split_data)
- elm_object_part_text_set(pData->split_data->title_layout, "title_text", label);
+ elm_object_item_text_set(pData->split_data->nf_it, label);
}
}
- if (pListData->search_mode == THREAD_SEARCH_ON)
+ if (pListData->search_mode == THREAD_SEARCH_ON && pListData->searchbar)
elm_object_focus_set(pListData->searchbar, EINA_TRUE);
if (pListData->sel_msg_id) {
}
}
-void msg_ui_thread_launch_msg_detail_view(PMSG_THREAD_LIST_DATA pListData, PMSG_APP_THREAD_MSG_DATA_S item_data)
+void msg_ui_thread_launch_msg_detail_view(PMSG_THREAD_LIST_DATA pListData, int msgID, int addrCnt, PMSG_APP_THREAD_ADDR_INFO_S *addr_info)
{
D_ENTER;
- if (!pListData || !item_data) {
- D_EMSG("[ERROR] pListData or item_data is NULL");
- return;
- }
-
PMSG_THREAD_DATA pData = msg_ui_thread_get_data();
Evas_Object *detail_layout = NULL;
Evas_Object *navi_frame = NULL;
- if (pData->isRotate == true)
+ if (pData->isRotate == true && pData->split_data)
navi_frame = pData->split_data->navi_frame;
else
navi_frame = pData->navi_frame;
if (pData->detail_layout) {
- msg_ui_thread_update_msg_detail_view(item_data);
+ msg_ui_thread_update_msg_detail_view(msgID, addrCnt, addr_info);
return;
}
elm_object_content_set(scroller, entry);
evas_object_show(entry);
- __msg_ui_thread_create_msg_detail_content(entry, pData, item_data->msg_id);
+ __msg_ui_thread_create_msg_detail_content(entry, pData, msgID);
elm_object_part_content_set(detail_layout, "elm.swallow.content", scroller);
//push navi item
char temp[DEF_BUF_LEN+1] = {0,};
int i = 0;
- for (i = 0; i < item_data->addr_cnt; i++) {
- if (item_data->addr_info[i]->contact_id > 0 && item_data->addr_info[i]->display_name[0] != '\0') {
- snprintf(str_name, sizeof(str_name), "%s", item_data->addr_info[i]->display_name);
+ for (i = 0; i < addrCnt; i++) {
+ if (addr_info[i]->contact_id > 0 && addr_info[i]->display_name[0] != '\0') {
+ snprintf(str_name, sizeof(str_name), "%s", addr_info[i]->display_name);
} else {
- if (item_data->addr_info[i]->address[0] != '\0')
- snprintf(str_name, sizeof(str_name), "%s", item_data->addr_info[i]->address);
+ if (addr_info[i]->address[0] != '\0')
+ snprintf(str_name, sizeof(str_name), "%s", addr_info[i]->address);
else
snprintf(str_name, sizeof(str_name), dgettext("sys_string", "IDS_COM_BODY_UNKNOWN"));
}
snprintf(title, sizeof(title), "%s", str_name);
}
- if (pData->isRotate == true) {
+ if (pData->isRotate == true && pData->split_data) {
Evas_Object *back_btn = NULL;
Evas_Object *title_layout = NULL;
back_btn = elm_button_add(navi_frame);
- elm_object_style_set(back_btn, "naviframe/title/icon/previous");
- evas_object_smart_callback_add(back_btn, "clicked", msg_ui_thread_back_btn_clicked_cb, (void *)pListData);
+ elm_object_style_set(back_btn, "naviframe/back_btn/default");
+ evas_object_smart_callback_add(back_btn, "clicked", msg_ui_thread_detail_view_back_btn_clicked_cb, (void *)pListData);
evas_object_show(back_btn);
title_layout = elm_layout_add(navi_frame);
back_btn = elm_button_add(navi_frame);
elm_object_style_set(back_btn, "naviframe/back_btn/default");
- evas_object_smart_callback_add(back_btn, "clicked", msg_ui_thread_back_btn_clicked_cb, (void *)pListData);
+ evas_object_smart_callback_add(back_btn, "clicked", msg_ui_thread_detail_view_back_btn_clicked_cb, (void *)pListData);
nf_it = elm_naviframe_item_push(navi_frame, title, back_btn, NULL, detail_layout, NULL);
+
+ elm_panes_content_left_size_set(pData->panes, 1.0);
+ elm_object_signal_emit(pData->panes, "elm,panes,unpair", "");
}
pData->detail_layout = detail_layout;
pData->detail_nf_it = nf_it;
D_LEAVE;
}
-void msg_ui_thread_update_msg_detail_view(PMSG_APP_THREAD_MSG_DATA_S item_data)
+void msg_ui_thread_update_msg_detail_view(int msgID, int addrCnt, PMSG_APP_THREAD_ADDR_INFO_S *addr_info)
{
D_ENTER;
- MSG_UI_RETM_IF(MSG_UI_LEVEL_ERR, !item_data, "item_data is NULL");
-
PMSG_THREAD_DATA pData = msg_ui_thread_get_data();
Evas_Object *title_layout = NULL;
Evas_Object *scroller = NULL;
char temp[DEF_BUF_LEN+1] = {0,};
int i = 0;
- for (i = 0; i < item_data->addr_cnt; i++) {
- if (item_data->addr_info[i]->contact_id > 0 && item_data->addr_info[i]->display_name[0] != '\0') {
- snprintf(str_name, sizeof(str_name), "%s", item_data->addr_info[i]->display_name);
+ for (i = 0; i < addrCnt; i++) {
+ if (addr_info[i]->contact_id > 0 && addr_info[i]->display_name[0] != '\0') {
+ snprintf(str_name, sizeof(str_name), "%s", addr_info[i]->display_name);
} else {
- if (item_data->addr_info[i]->address[0] != '\0')
- snprintf(str_name, sizeof(str_name), "%s", item_data->addr_info[i]->address);
+ if (addr_info[i]->address[0] != '\0')
+ snprintf(str_name, sizeof(str_name), "%s", addr_info[i]->address);
else
snprintf(str_name, sizeof(str_name), dgettext("sys_string", "IDS_COM_BODY_UNKNOWN"));
}
entry = elm_object_content_get(scroller);
MSG_UI_RETM_IF(MSG_UI_LEVEL_ERR, !entry, "entry is NULL");
- __msg_ui_thread_create_msg_detail_content(entry, pData, item_data->msg_id);
+ __msg_ui_thread_create_msg_detail_content(entry, pData, msgID);
D_LEAVE;
}
void msg_ui_thread_get_time_format(PMSG_THREAD_DATA pData)
{
+ D_ENTER;
int timeformat = msg_common_get_timeformat();
if (timeformat == MSG_TIME_FORMAT_UNKNOWN)
pData->time_fmt = timeformat;
D_MSG("%s", pData->time_fmt == MSG_TIME_FORMAT_24H ? "TIME FORMAT = 24h" : "TIME FORMAT = 12h");
+ D_LEAVE;
}
void msg_ui_thread_get_locale(PMSG_THREAD_DATA pData)
{
+ D_ENTER;
const char *locale;
locale = msg_common_get_default_locale();
}
D_MSG("Locale = %s", pData->locale);
+ D_LEAVE;
}
-void msg_ui_thread_get_bubble_data(PMSG_APP_THREAD_DATA_S item_data, service_h svc_handle)
+void msg_ui_thread_get_bubble_data(PMSG_APP_THREAD_CONV_DATA_S item_data, service_h svc_handle)
{
MSG_UI_ENTER();
MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !item_data || !svc_handle);
char buf[DEF_BUF_LEN_S] = {'0',};
char buf_contact[DEF_BUF_LEN_S] = {'0',};
+ char layout_address[DEF_BUF_LEN_S + 1] = {0, };
+ Evas_Object *layout = msg_ui_get_main_layout();
+ if (layout) {
+ snprintf(layout_address, sizeof(layout_address)-1, "%x", (unsigned int)layout);
+ D_MSG("hex address [0x%s]", layout_address);
+ service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_LAYOUT_ADDRESS, layout_address);
+ }
snprintf(buf, DEF_BUF_LEN_S, "%d", item_data->thread_id);
service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_THREAD_ID, buf);
service_add_extra_data(svc_handle, MSG_BUNDLE_KEY_THREAD_NAME, item_data->thread_name);
D_ENTER;
Elm_Object_Item *it;
- elm_check_state_set(pListData->sel_all_box, EINA_FALSE);
-
it = elm_genlist_first_item_get(pListData->genlist);
while (it) {
- if (elm_genlist_item_parent_get(it) == NULL) {
- it = elm_genlist_item_next_get(it);
- continue;
- }
-
- if (pListData->app_data_type == THREAD_LIST_APP_DATA_THREAD) {
- PMSG_APP_THREAD_DATA_S item_data = NULL;
+ if (pListData->app_data_type == THREAD_LIST_APP_DATA_CONV) {
+ PMSG_APP_THREAD_CONV_DATA_S item_data = NULL;
- item_data = (PMSG_APP_THREAD_DATA_S)elm_object_item_data_get(it);
+ item_data = (PMSG_APP_THREAD_CONV_DATA_S)elm_object_item_data_get(it);
if (item_data)
item_data->is_check = EINA_FALSE;
} else {
}
pListData->chk_list = eina_list_free(pListData->chk_list);
-
- elm_object_part_content_unset(pListData->content_ly, "sel_all");
- evas_object_hide(pListData->sel_all_ly);
- if (msg_ui_thread_rotation_get() == false)
- edje_object_signal_emit(_EDJ(pListData->content_ly), "hide_searchbar", "sel_all");
- else
- edje_object_signal_emit(_EDJ(pListData->content_ly), "show_searchbar", "sel_all");
+ evas_object_del(pListData->sel_all_btn);
+ pListData->sel_all_btn = NULL;
+ pListData->sel_all_checked = false;
elm_genlist_decorate_mode_set(pListData->genlist, EINA_FALSE);
elm_genlist_select_mode_set(pListData->genlist, ELM_OBJECT_SELECT_MODE_DEFAULT);
+ pListData->action_type = THREAD_ACTION_NONE;
pListData->view_mode = THREAD_NORMAL_VIEW;
}
pListData->select_info = NULL;
}
- if (pListData->list_type == THREAD_NORMAL_LIST_TYPE)
- elm_object_item_text_set(pListData->nf_it, dgettext("sys_string", "IDS_COM_BODY_MESSAGES"));
- else if (pListData->list_type == THREAD_SPAM_LIST_TYPE)
- elm_object_item_text_set(pListData->nf_it, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_SPAM_MESSAGES"));
- else if (pListData->list_type == THREAD_SIM_LIST_TYPE)
- elm_object_item_text_set(pListData->nf_it, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_SIM_CARD_MESSAGES"));
- else if (pListData->list_type == THREAD_CBMSG_LIST_TYPE)
- elm_object_item_text_set(pListData->nf_it, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_CB_MESSAGES"));
-
- if (msg_ui_thread_rotation_get() == false) {
- edje_object_signal_emit(_EDJ(pListData->content_ly), "hide_searchbar", "sel_all");
- elm_object_part_content_unset(pListData->content_ly, "sel_all");
- evas_object_hide(pListData->searchbar);
-
- elm_naviframe_item_title_visible_set(pListData->nf_it, EINA_TRUE);
+ msg_ui_thread_set_title_status(pListData);
+ if (msg_ui_thread_rotation_get() == false)
msg_ui_thread_show_toolbar(pListData);
- } else {
+ else
msg_ui_thread_split_view_show(msg_ui_thread_get_data());
- }
D_LEAVE;
}
-void msg_ui_thread_select_item_by_thread_id(PMSG_THREAD_LIST_DATA pListData, int thread_id)
+void msg_ui_thread_select_item_by_thread_id(PMSG_THREAD_LIST_DATA pListData, int thread_id, bool bTopItem)
{
if (thread_id <= 0)
return;
gen_item = elm_genlist_first_item_get(pListData->genlist);
while (gen_item) {
- if (elm_genlist_item_parent_get(gen_item) == NULL) {
+ if (pListData->app_data_type == THREAD_LIST_APP_DATA_SEARCH && elm_genlist_item_parent_get(gen_item) == NULL) {
gen_item = elm_genlist_item_next_get(gen_item);
continue;
}
- PMSG_APP_THREAD_DATA_S item_data = (PMSG_APP_THREAD_DATA_S)elm_object_item_data_get(gen_item);
- if (thread_id == item_data->thread_id) {
- pListData->sel_gen_item = gen_item;
+ PMSG_APP_THREAD_CONV_DATA_S item_data = (PMSG_APP_THREAD_CONV_DATA_S)elm_object_item_data_get(gen_item);
+ if (thread_id == item_data->thread_id)
break;
- }
gen_item = elm_genlist_item_next_get(gen_item);
}
- elm_genlist_item_show(gen_item, ELM_GENLIST_ITEM_SCROLLTO_TOP);
+ if (bTopItem == true)
+ elm_genlist_item_show(gen_item, ELM_GENLIST_ITEM_SCROLLTO_TOP);
+
+ if (pListData->sel_thread_id == thread_id) {
+ elm_genlist_item_selected_set(gen_item, true);
+ pListData->sel_gen_item = gen_item;
+ } else {
+ elm_genlist_item_selected_set(gen_item, false);
+ }
}
void msg_ui_thread_select_item_by_msg_id(PMSG_THREAD_LIST_DATA pListData, int msg_id)
gen_item = elm_genlist_first_item_get(pListData->genlist);
while (gen_item) {
- if (elm_genlist_item_parent_get(gen_item) == NULL) {
- gen_item = elm_genlist_item_next_get(gen_item);
- continue;
- }
-
PMSG_APP_THREAD_MSG_DATA_S item_data = (PMSG_APP_THREAD_MSG_DATA_S)elm_object_item_data_get(gen_item);
- if (msg_id == item_data->msg_id) {
- pListData->sel_gen_item = gen_item;
+ if (msg_id == item_data->msg_id)
break;
- }
gen_item = elm_genlist_item_next_get(gen_item);
}
elm_genlist_item_show(gen_item, ELM_GENLIST_ITEM_SCROLLTO_TOP);
+
+ if (pListData->sel_msg_id == msg_id) {
+ elm_genlist_item_selected_set(gen_item, true);
+ pListData->sel_gen_item = gen_item;
+ } else {
+ elm_genlist_item_selected_set(gen_item, false);
+ }
}
void msg_ui_thread_show_notify(PMSG_THREAD_LIST_DATA pListData, const char *msg)
elm_popup_timeout_set(popup, 0.8);
evas_object_show(popup);
- pListData->popup = popup;
+ PMSG_APP_THREAD_POPUP pPopup = (PMSG_APP_THREAD_POPUP)calloc(1, sizeof(MSG_APP_THREAD_POPUP));
+ pPopup->popup_object = popup;
+ pPopup->popup_type = THREAD_POPUP_NONE;
+
+ pListData->pPopup = pPopup;
}
static void __msg_ui_thread_popup_response_cb(void *data, Evas_Object *obj, void *event_info)
if ((int)event_info != 5 && obj) {
evas_object_del(obj);
- pListData->popup = NULL;
+ free(pListData->pPopup);
+ pListData->pPopup = NULL;
}
MSG_UI_LEAVE(MSG_UI_LEVEL_DEBUG);
Evas_Object *btn_ok;
Evas_Object *btn_cancel;
PMSG_THREAD_DATA pData = msg_ui_thread_get_data();
+ bool bDisable_btn = true;
+ bool bShow_checkbox = false;
popup = elm_popup_add(pData->win_main);
btn_ok = elm_button_add(popup);
elm_object_style_set(btn_ok, "popup_button/default");
- elm_object_text_set(btn_ok, dgettext("sys_string", "IDS_COM_SK_OK"));
+ if (actionType == THREAD_ACTION_DELETE)
+ elm_object_text_set(btn_ok, dgettext("sys_string", "IDS_COM_SK_DELETE"));
+ else
+ elm_object_text_set(btn_ok, dgettext("sys_string", "IDS_COM_SK_OK"));
elm_object_part_content_set(popup, "button1", btn_ok);
evas_object_smart_callback_add(btn_ok, "clicked", __msg_ui_thread_action_popup_ok_clicked_cb, pListData);
elm_object_part_content_set(popup, "button2", btn_cancel);
evas_object_smart_callback_add(btn_cancel, "clicked", __msg_ui_thread_action_popup_cancel_clicked_cb, pListData);
+ PMSG_APP_THREAD_POPUP_ACTION pPopup = (PMSG_APP_THREAD_POPUP_ACTION)calloc(1, sizeof(MSG_APP_THREAD_POPUP_ACTION));
+ pPopup->popup_object = popup;
+ pPopup->popup_type = THREAD_POPUP_ACTION;
+ pPopup->include_protected_msg = false;
+ pPopup->btn_ok = btn_ok;
+
+
if (actionType == THREAD_ACTION_DELETE) {
- bool bProtect = false;
Eina_List *list;
void* item_data = NULL;
msg_error_t err = MSG_SUCCESS;
- msg_struct_t threadInfo = msg_create_struct(MSG_STRUCT_THREAD_INFO);
- msg_struct_t msgInfo = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
- msg_struct_t sendOpt = msg_create_struct(MSG_STRUCT_SENDOPT);
-
if (pListData->view_mode == THREAD_EDIT_VIEW) {
EINA_LIST_FOREACH(pListData->chk_list, list, item_data) {
if (item_data) {
if (pListData->list_type == THREAD_NORMAL_LIST_TYPE) {
- PMSG_APP_THREAD_DATA_S data = (PMSG_APP_THREAD_DATA_S)item_data;
-
- err = msg_get_thread(msg_ui_thread_get_data_handle(), data->thread_id, threadInfo);
- if (err != MSG_SUCCESS) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "msg_get_thread() is failed : err = %d", err);
- break;
+ PMSG_APP_THREAD_CONV_DATA_S data = (PMSG_APP_THREAD_CONV_DATA_S)item_data;
+
+ if (data->bProtected) {
+ bShow_checkbox = true;
+
+ if (bDisable_btn) {
+ msg_struct_list_s msg_list;
+ int row = 0;
+ int nProtect_cnt = 0;
+
+ if (pListData->list_type == THREAD_SIM_LIST_TYPE)
+ err = msg_get_message_list(pData->msgHandle, MSG_ALLBOX_ID, data->thread_id, 0, MSG_STORAGE_SIM, &msg_list);
+ else
+ err = msg_get_message_list(pData->msgHandle, MSG_ALLBOX_ID, data->thread_id, 0, MSG_STORAGE_PHONE, &msg_list);
+
+ for (row = 0; row <msg_list.nCount; row++) {
+ bool is_protect;
+ msg_get_bool_value(msg_list.msg_struct_info[row], MSG_MESSAGE_PROTECTED_BOOL, &is_protect);
+ if (is_protect == true)
+ nProtect_cnt++;
+ }
+
+ if (msg_list.nCount == nProtect_cnt) {
+ msg_release_list_struct(&msg_list);
+ bDisable_btn = true;
+ } else {
+ msg_release_list_struct(&msg_list);
+ bDisable_btn = false;
+ break;
+ }
+ } else {
+ break;
+ }
+ } else {
+ bDisable_btn = false;
}
- msg_get_bool_value(threadInfo, MSG_THREAD_PROTECTED_BOOL, &bProtect);
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "bProtect = %d", bProtect);
} else {
PMSG_APP_THREAD_MSG_DATA_S data = (PMSG_APP_THREAD_MSG_DATA_S)item_data;
- err = msg_get_message(msg_ui_thread_get_data_handle(), (msg_message_id_t)data->msg_id, msgInfo, sendOpt);
- if (err != MSG_SUCCESS) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_ERR, "msg_get_message() is failed : err = %d", err);
- break;
+ if (data->is_protected) {
+ bShow_checkbox = true;
+
+ if (!bDisable_btn)
+ break;
+ } else {
+ bDisable_btn = false;
}
- msg_get_bool_value(msgInfo, MSG_MESSAGE_PROTECTED_BOOL, &bProtect);
}
-
- if (bProtect == true)
- break;
}
}
} else {
item_data = elm_object_item_data_get(it_sweep);
if (pListData->list_type == THREAD_NORMAL_LIST_TYPE) {
- PMSG_APP_THREAD_DATA_S data = (PMSG_APP_THREAD_DATA_S)item_data;
+ PMSG_APP_THREAD_CONV_DATA_S data = (PMSG_APP_THREAD_CONV_DATA_S)item_data;
+
+ if (data->bProtected) {
+ bShow_checkbox = true;
+
+ msg_struct_list_s msg_list;
+ int row = 0;
+ int nProtect_cnt = 0;
- err = msg_get_thread(msg_ui_thread_get_data_handle(), data->thread_id, threadInfo);
- if (err == MSG_SUCCESS)
- msg_get_bool_value(threadInfo, MSG_THREAD_PROTECTED_BOOL, &bProtect);
+ if (pListData->list_type == THREAD_SIM_LIST_TYPE)
+ err = msg_get_message_list(pData->msgHandle, MSG_ALLBOX_ID, data->thread_id, 0, MSG_STORAGE_SIM, &msg_list);
+ else
+ err = msg_get_message_list(pData->msgHandle, MSG_ALLBOX_ID, data->thread_id, 0, MSG_STORAGE_PHONE, &msg_list);
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "bProtect = %d", bProtect);
+ for (row = 0; row <msg_list.nCount; row++) {
+ bool is_protect;
+ msg_get_bool_value(msg_list.msg_struct_info[row], MSG_MESSAGE_PROTECTED_BOOL, &is_protect);
+ if (is_protect == true)
+ nProtect_cnt++;
+ }
+
+ if (msg_list.nCount != nProtect_cnt)
+ bDisable_btn = false;
+
+ msg_release_list_struct(&msg_list);
+ } else {
+ bDisable_btn = false;
+ }
} else {
PMSG_APP_THREAD_MSG_DATA_S data = (PMSG_APP_THREAD_MSG_DATA_S)item_data;
- err = msg_get_message(msg_ui_thread_get_data_handle(), (msg_message_id_t)data->msg_id, msgInfo, sendOpt);
- if (err == MSG_SUCCESS)
- msg_get_bool_value(msgInfo, MSG_MESSAGE_PROTECTED_BOOL, &bProtect);
+ if (!data->is_protected)
+ bDisable_btn = false;
+ else
+ bShow_checkbox = true;
}
}
- msg_release_struct(&threadInfo);
- msg_release_struct(&msgInfo);
- msg_release_struct(&sendOpt);
- if (bProtect == true) {
+ if (bShow_checkbox == true) {
Evas_Object *check;
- Evas_Object *label_text;
Evas_Object *layout;
- label_text = elm_label_add(popup);
- elm_layout_file_set(label_text, MSG_COMMON_EDJ, "popup_with_checkbox");
- elm_object_text_set(label_text, msg);
- evas_object_size_hint_weight_set(label_text, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(label_text, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(label_text);
-
layout = elm_layout_add(popup);
elm_layout_file_set(layout, MSG_COMMON_EDJ, "popup_with_checkbox");
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
check = elm_check_add(popup);
evas_object_size_hint_align_set(check, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_smart_callback_add(check, "changed", __msg_ui_thread_action_popup_checked_cb, pListData);
+ evas_object_smart_callback_add(check, "changed", __msg_ui_thread_action_popup_checked_cb, pPopup);
evas_object_show(check);
- elm_object_part_text_set(layout, "elm.text", dgettext(MESSAGE_PKGNAME, "IDS_MSGF_POP_INCLUDE_PROTECTED_MESSAGE"));
+ elm_object_part_text_set(layout, "elm.text.check", dgettext(MESSAGE_PKGNAME, "IDS_MSGF_POP_INCLUDE_PROTECTED_MESSAGE"));
elm_object_part_content_set(layout, "elm.swallow.check", check);
- elm_object_part_content_set(layout, "elm.swallow.content", label_text);
+ elm_object_part_text_set(layout, "elm.text", msg);
evas_object_show(layout);
elm_object_content_set(popup, layout);
} else {
} else {
evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_object_text_set(popup, msg);
+ bDisable_btn = false;
}
+ if (bDisable_btn)
+ elm_object_disabled_set(btn_ok, EINA_TRUE);
+ pPopup->all_protected = bDisable_btn;
+
evas_object_data_set(popup, MSG_THREAD_POPUP_DATA, MSG_THREAD_DEL_CONFIRM);
evas_object_show(popup);
- pListData->popup = popup;
+ pListData->pPopup = (PMSG_APP_THREAD_POPUP)pPopup;
pListData->action_type = actionType;
}
bool remove_it = false;
bool remove_ug = false;
void *addr_data = NULL;
+ bool include_protected_msg = false;
msg_error_t err = MSG_SUCCESS;
Elm_Object_Item *it = NULL;
- if (pListData->popup) {
- evas_object_del(pListData->popup);
- pListData->popup = NULL;
+ if (pListData->pPopup) {
+ if (pListData->pPopup->popup_type == THREAD_POPUP_ACTION) {
+ PMSG_APP_THREAD_POPUP_ACTION pPopup = (PMSG_APP_THREAD_POPUP_ACTION)pListData->pPopup;
+ include_protected_msg = pPopup->include_protected_msg;
+ } else if (pListData->pPopup->popup_type == THREAD_POPUP_PROGRESS) {
+ PMSG_APP_THREAD_POPUP_PROGRESS pPopup = (PMSG_APP_THREAD_POPUP_PROGRESS)pListData->pPopup;
+ include_protected_msg = pPopup->include_protected_msg;
+ }
+ evas_object_del(pListData->pPopup->popup_object);
+ free(pListData->pPopup);
+ pListData->pPopup = NULL;
}
if (pListData->view_mode == THREAD_EDIT_VIEW) {
- pListData->popup = msg_ui_thread_show_notify_with_progressbar(pListData, pListData->check_cnt);
- pListData->multi_action_thread = ecore_thread_feedback_run(msg_ui_thread_multi_action_thread_fn, msg_ui_thread_multi_action_thread_feedback_fn, NULL, NULL, (void *)pListData, EINA_TRUE);
+ MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "pPopup->include_protected_msg = %d", include_protected_msg);
+ msg_ui_thread_show_notify_with_progressbar(pListData, pListData->check_cnt, include_protected_msg);
} else {
it = (Elm_Object_Item *)elm_genlist_decorated_item_get(pListData->genlist);
if (!it)
elm_genlist_item_decorate_mode_set(it, "slide", EINA_FALSE);
elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DEFAULT);
- if (pListData->app_data_type == THREAD_LIST_APP_DATA_THREAD) {
- PMSG_APP_THREAD_DATA_S item_data = elm_object_item_data_get(it);
+ if (pListData->app_data_type == THREAD_LIST_APP_DATA_CONV) {
+ PMSG_APP_THREAD_CONV_DATA_S item_data = elm_object_item_data_get(it);
if (!item_data)
goto __UNABLE_TO_DELETE;
if (pListData->action_type == THREAD_ACTION_DELETE) {
- err = msg_delete_thread_message_list(msg_ui_thread_get_data_handle(), item_data->thread_id, pListData->include_protected_msg);
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "pListData->include_protected_msg = %d", pListData->include_protected_msg);
- remove_it = true;
-
- if (pListData->sel_thread_id == item_data->thread_id)
- remove_ug = true;
- pListData->include_protected_msg = false;
+ err = msg_delete_thread_message_list(msg_ui_thread_get_data_handle(), item_data->thread_id, include_protected_msg);
+ MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "pPopup->include_protected_msg = %d", include_protected_msg);
+ if (err == MSG_SUCCESS) {
+ if (item_data->bProtected == false || include_protected_msg == true) {
+ remove_it = true;
+ if (pListData->sel_thread_id == item_data->thread_id)
+ remove_ug = true;
+ } else {
+ msg_ui_thread_list_item_update(pListData, item_data->thread_id);
+ }
+ }
} else if (pListData->action_type == THREAD_ACTION_BLOCK) {
msg_struct_list_s addrList;
if (!item_data)
goto __UNABLE_TO_DELETE;
- msg_struct_t msgInfo = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
- msg_struct_t sendOpt = msg_create_struct(MSG_STRUCT_SENDOPT);
-
- err = msg_get_message(msg_ui_thread_get_data_handle(), (msg_message_id_t)item_data->msg_id, msgInfo, sendOpt);
- if (err != MSG_SUCCESS) {
- msg_release_struct(&msgInfo);
- msg_release_struct(&sendOpt);
- return;
- }
-
if (pListData->action_type == THREAD_ACTION_DELETE) {
- bool bProtect = false;
-
- msg_get_bool_value(msgInfo, MSG_MESSAGE_PROTECTED_BOOL, &bProtect);
- if (pListData->include_protected_msg == false && bProtect == true) {
- msg_release_struct(&msgInfo);
- msg_release_struct(&sendOpt);
+ if (include_protected_msg == false && item_data->is_protected == true)
goto __UNABLE_TO_DELETE;
- }
- err = msg_delete_message(msg_ui_thread_get_data_handle(), item_data->msg_id);
- remove_it = true;
- if (pListData->sel_msg_id == item_data->msg_id)
- remove_ug = true;
+ err = msg_delete_message(msg_ui_thread_get_data_handle(), item_data->msg_id);
+ if (err == MSG_SUCCESS) {
+ remove_it = true;
+ if (pListData->sel_msg_id == item_data->msg_id)
+ remove_ug = true;
+ }
} else if (pListData->action_type == THREAD_ACTION_BLOCK) {
- char strNumber[DEF_THREAD_ADDR_LEN + 1] = {0,};
- msg_struct_list_s *addr_list = NULL;
-
- msg_get_list_handle(msgInfo, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&addr_list);
- msg_get_str_value(addr_list->msg_struct_info[0], MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, strNumber, DEF_THREAD_ADDR_LEN);
- strncpy(address, strNumber, DEF_THREAD_ADDR_LEN);
+ if (item_data->addr_info[0]->address[0] != '\0')
+ strncpy(address, item_data->addr_info[0]->address, DEF_THREAD_ADDR_LEN);
- if (msg_common_add_block_number(msg_ui_thread_get_data_handle(), address) != MSG_SUCCESS) {
- msg_release_struct(&msgInfo);
- msg_release_struct(&sendOpt);
+ if (msg_common_add_block_number(msg_ui_thread_get_data_handle(), address) != MSG_SUCCESS)
goto __UNABLE_TO_DELETE;
- }
addr_data = &address;
} else if (pListData->action_type == THREAD_ACTION_RESTORE) {
err = msg_move_msg_to_folder(msg_ui_thread_get_data_handle(), item_data->msg_id, MSG_INBOX_ID);
- remove_it = true;
- if (pListData->sel_msg_id == item_data->msg_id)
- remove_ug = true;
+ if (err == MSG_SUCCESS) {
+ remove_it = true;
+ if (pListData->sel_msg_id == item_data->msg_id)
+ remove_ug = true;
+ }
}
-
- msg_release_struct(&msgInfo);
- msg_release_struct(&sendOpt);
}
if (err != MSG_SUCCESS)
pListData->sel_gen_item = NULL;
pListData->sel_msg_id = 0;
} else {
- msg_ui_destroy_composer_ug();
+ msg_ui_destroy_composer_ug(NULL, true);
}
if (!pData->split_data) {
msg_ui_thread_create_split_data();
msg_ui_thread_splitview_launch(pData, pData->split_data);
}
- if (pData->split_data) {
- char label[DEF_BUF_LEN_S+1] = {0,};
-
- msg_ui_thread_get_title_text(pListData, label, DEF_BUF_LEN_S);
- elm_object_part_text_set(pData->split_data->title_layout, "title_text", label);
- }
}
- Elm_Object_Item *it_dateline = NULL;
- PMSG_APP_THREAD_DATELINE_DATA_S dateline_data = NULL;
-
- it_dateline = elm_genlist_item_parent_get((Elm_Object_Item *)it);
- if (it_dateline) {
- dateline_data = elm_object_item_data_get(it_dateline);
+ if (pListData->list_type != THREAD_NORMAL_LIST_TYPE) {
+ PMSG_THREAD_LIST_DATA pDefaultList = msg_ui_thread_get_default_list();
+ PMSG_APP_THREAD_MSG_DATA_S item_data = elm_object_item_data_get(it);
- if (dateline_data) {
- MSG_UI_DEBUG(MSG_UI_LEVEL_DEBUG, "subitem_cnt : %d", dateline_data->subitem_cnt);
- dateline_data->subitem_cnt--;
- if (dateline_data->subitem_cnt == 0)
- elm_object_item_del((Elm_Object_Item *)it_dateline);
- }
+ if (msg_ui_thread_list_item_update(pDefaultList, item_data->thread_id) == EINA_FALSE)
+ msg_ui_thread_list_item_insert(pDefaultList);
}
+
elm_object_item_del((Elm_Object_Item *)it);
pListData->item_cnt--;
+ msg_ui_thread_set_title_status(pListData);
+
if (pListData->item_cnt == 0) {
- if (pListData->app_data_type == THREAD_LIST_APP_DATA_THREAD)
+ if (pData->isRotate == true) {
+ if (pListData->search_mode == THREAD_SEARCH_OFF) {
+ elm_panes_content_left_size_set(pData->panes, 0.0);
+ elm_object_signal_emit(pData->panes, "elm,panes,unpair", "");
+ }
+ } else {
+ elm_object_disabled_set(pListData->search_btn, EINA_TRUE);
+ }
+
+ if (pListData->app_data_type == THREAD_LIST_APP_DATA_CONV)
msg_ui_thread_list_load(pListData, FALSE);
else
msg_ui_thread_msg_list_load(pListData, pListData->list_type);
}
}
- pListData->include_protected_msg = false;
pListData->action_type = THREAD_ACTION_NONE;
}
__UNABLE_TO_DELETE:
- pListData->include_protected_msg = false;
pListData->action_type = THREAD_ACTION_NONE;
msg_ui_thread_show_notify(pListData, dgettext("sys_string", "IDS_COM_POP_UNABLE_TO_DELETE"));
return;
}
if (pListData->view_mode == THREAD_EDIT_VIEW) {
- if (pListData->multi_action_thread) {
- if (ecore_thread_cancel(pListData->multi_action_thread) == EINA_FALSE) {
- D_MSG("ecore_thread_cancel is done.");
- pListData->multi_action_thread = NULL;
- } else {
- D_MSG("ecore_thread_cancel is failed.");
- return;
+ if (pListData->pPopup) {
+ if (pListData->pPopup->popup_type == THREAD_POPUP_PROGRESS) {
+ PMSG_APP_THREAD_POPUP_PROGRESS pPopup = (PMSG_APP_THREAD_POPUP_PROGRESS)pListData->pPopup;
+
+ if (pPopup->multi_action_thread) {
+ if (ecore_thread_cancel(pPopup->multi_action_thread) == EINA_FALSE) {
+ D_MSG("ecore_thread_cancel is done.");
+ pPopup->multi_action_thread = NULL;
+ } else {
+ D_MSG("ecore_thread_cancel is failed.");
+ return;
+ }
+ show_info = true;
+ }
}
- show_info = true;
- }
- if (pListData->popup) {
- evas_object_del(pListData->popup);
- pListData->popup = NULL;
+ evas_object_del(pListData->pPopup->popup_object);
+ free(pListData->pPopup);
+ pListData->pPopup = NULL;
}
if (show_info == true)
msg_ui_thread_show_action_finish_info(pListData, pListData->action_type, NULL);
msg_ui_thread_show_normal_mode(pListData);
- if (pListData->list_type == THREAD_NORMAL_LIST_TYPE)
+ if (pListData->list_type == THREAD_NORMAL_LIST_TYPE) {
msg_ui_thread_list_load(pListData, FALSE);
- else
+ } else {
+ PMSG_THREAD_LIST_DATA pDefaultList = msg_ui_thread_get_default_list();
+
msg_ui_thread_msg_list_load(pListData, pListData->list_type);
+
+ if (pDefaultList)
+ msg_ui_thread_list_load(pDefaultList, FALSE); //might be changed
+ }
} else {
- if (pListData->popup) {
- evas_object_del(pListData->popup);
- pListData->popup = NULL;
+ if (pListData->pPopup) {
+ evas_object_del(pListData->pPopup->popup_object);
+ free(pListData->pPopup);
+ pListData->pPopup = NULL;
}
}
pListData->action_type = THREAD_ACTION_NONE;
- pListData->include_protected_msg = false;
}
static void __msg_ui_thread_action_popup_checked_cb(void *data, Evas_Object *obj, void *event_info)
{
MSG_UI_ENTER();
- PMSG_THREAD_LIST_DATA pListData = (PMSG_THREAD_LIST_DATA)data;
- bool is_check = pListData->include_protected_msg;
+ PMSG_APP_THREAD_POPUP_ACTION pPopup = (PMSG_APP_THREAD_POPUP_ACTION)data;
+ bool is_check = pPopup->include_protected_msg;
if (is_check)
- pListData->include_protected_msg = false;
+ pPopup->include_protected_msg = false;
else
- pListData->include_protected_msg = true;
+ pPopup->include_protected_msg = true;
+
+ if (pPopup->btn_ok) {
+ if (pPopup->all_protected == true && pPopup->include_protected_msg == false)
+ elm_object_disabled_set(pPopup->btn_ok, EINA_TRUE);
+ else
+ elm_object_disabled_set(pPopup->btn_ok, EINA_FALSE);
+ }
MSG_UI_LEAVE();
}
-Evas_Object* msg_ui_thread_show_notify_with_progressbar(PMSG_THREAD_LIST_DATA pListData, int count)
+void msg_ui_thread_show_notify_with_progressbar(PMSG_THREAD_LIST_DATA pListData, int count, bool include_protected_msg)
{
MSG_UI_ENTER(MSG_UI_LEVEL_DEBUG);
- MSG_UI_RETV_IF(MSG_UI_LEVEL_DEBUG, !pListData, NULL);
+ MSG_UI_RET_IF(MSG_UI_LEVEL_DEBUG, !pListData);
char buf[DEF_BUF_LEN_S] = {0,};
PMSG_THREAD_DATA pData = msg_ui_thread_get_data();
evas_object_show(popup);
- pListData->progressbar = progressbar;
+ PMSG_APP_THREAD_POPUP_PROGRESS pPopup = (PMSG_APP_THREAD_POPUP_PROGRESS)calloc(1, sizeof(MSG_APP_THREAD_POPUP_PROGRESS));
+ pPopup->popup_object = popup;
+ pPopup->popup_type = THREAD_POPUP_PROGRESS;
+
+ pPopup->progressbar = progressbar;
+ pPopup->include_protected_msg = include_protected_msg;
+ pPopup->multi_action_thread = ecore_thread_feedback_run(msg_ui_thread_multi_action_thread_fn, msg_ui_thread_multi_action_thread_feedback_fn, NULL, NULL, (void *)pListData, EINA_TRUE);
- return popup;
+ pListData->pPopup = (PMSG_APP_THREAD_POPUP)pPopup;
}
void msg_ui_thread_show_select_info(PMSG_THREAD_LIST_DATA pListData)
elm_notify_align_set(pListData->select_info, ELM_NOTIFY_ALIGN_FILL, 1.0);
pListData->selectioninfo_layout = elm_layout_add(pListData->content_ly);
- elm_layout_theme_set(pListData->selectioninfo_layout, "standard", "selectioninfo", "center_text");
+ elm_layout_theme_set(pListData->selectioninfo_layout, "standard", "selectioninfo", "default");
elm_object_content_set(pListData->select_info, pListData->selectioninfo_layout);
}
if (pListData->check_cnt == 0) {
evas_object_hide(pListData->select_info);
elm_object_disabled_set(pListData->toolbar_btn[CONTROLBAR_ITEM_1], EINA_TRUE);
- elm_object_disabled_set(pListData->toolbar_btn[CONTROLBAR_ITEM_2], EINA_TRUE);
} else {
char text[DEF_BUF_LEN_S] = {'0',};
evas_object_show(pListData->select_info);
elm_object_disabled_set(pListData->toolbar_btn[CONTROLBAR_ITEM_1], EINA_FALSE);
- if (pListData->toolbar_btn[CONTROLBAR_ITEM_2] != NULL)
- elm_object_disabled_set(pListData->toolbar_btn[CONTROLBAR_ITEM_2], EINA_FALSE);
}
}
popup_title = (char *) calloc(1, strlen(title) + 1);
if (strlen(title) > 0)
- strncpy(popup_title, title, sizeof(char)* strlen(title));
+ strncpy(popup_title, title, sizeof(char) * strlen(title));
evas_object_data_set(genlist, "title", popup_title);
memset(&pData->itc_popup, 0x00, sizeof(Elm_Genlist_Item_Class));
msg_common_check_block_number(msg_ui_thread_get_data_handle(), addr_info->address, &isBlock);
- if (strncmp(title, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_OPT_BLOCK"), strlen(title)) == 0 && isBlock == true) {
+ if (strcmp(title, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_OPT_BLOCK")) == 0 && isBlock == true) {
free(addr_info);
continue;
- } else if (strncmp(title, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_OPT_UNBLOCK"), strlen(title)) == 0 && isBlock == false) {
+ } else if (strcmp(title, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_OPT_UNBLOCK")) == 0 && isBlock == false) {
free(addr_info);
continue;
}
elm_object_content_set(popup, box);
evas_object_show(popup);
- pListData->popup = popup;
+ PMSG_APP_THREAD_POPUP_ADDRESS pPopup = (PMSG_APP_THREAD_POPUP_ADDRESS)calloc(1, sizeof(MSG_APP_THREAD_POPUP_ADDRESS));
+ pPopup->popup_object = popup;
+ pPopup->popup_type = THREAD_POPUP_ADDRESS;
+
+ pListData->pPopup = (PMSG_APP_THREAD_POPUP)pPopup;
}
static char *__msg_ui_thread_addr_select_popup_gl_text_get(void *data, Evas_Object *obj, const char *part)
MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !data);
PMSG_THREAD_LIST_DATA pListData = (PMSG_THREAD_LIST_DATA)data;
+ PMSG_APP_THREAD_POPUP_ADDRESS pPopup = (PMSG_APP_THREAD_POPUP_ADDRESS)pListData->pPopup;
char *title = (char *)evas_object_data_get(obj, "title");
if (title != NULL)
free(title);
- if (pListData->popup) {
- evas_object_del(pListData->popup);
- pListData->popup = NULL;
+ if (pPopup) {
+ if (pPopup->popup_object)
+ evas_object_del(pPopup->popup_object);
+
+ free(pPopup);
+ pListData->pPopup = NULL;
}
}
if (strncmp(title, dgettext("sys_string", "IDS_COM_BODY_CALL"), strlen(title)) == 0) {
msg_ui_thread_launch_voice_call(addr_info->address);
- } else if (strncmp(title, dgettext("sys_string", "IDS_COM_BODY_VIDEO_CALL"), strlen(title)) == 0) {
- msg_ui_thread_launch_video_call(addr_info->address);
} else if (strncmp(title, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_OPT_BLOCK"), strlen(title)) == 0) {
if (msg_common_add_block_number(msg_ui_thread_get_data_handle(), addr_info->address) == MSG_SUCCESS)
msg_ui_thread_show_action_finish_info(pListData, THREAD_ACTION_BLOCK, addr_info->address);
free(title);
- if (pListData->job_popup_end)
- ecore_job_del(pListData->job_popup_end);
+ PMSG_APP_THREAD_POPUP_ADDRESS pPopup = (PMSG_APP_THREAD_POPUP_ADDRESS)pListData->pPopup;
+
+ if (pPopup->job_popup_end)
+ ecore_job_del(pPopup->job_popup_end);
- pListData->job_popup_end = ecore_job_add(__msg_ui_thread_addr_select_popup_destroy, pListData);
+ pPopup->job_popup_end = ecore_job_add(__msg_ui_thread_addr_select_popup_destroy, pListData);
}
static void __msg_ui_thread_addr_select_popup_destroy(void *data)
{
D_ENTER;
PMSG_THREAD_LIST_DATA pListData = (PMSG_THREAD_LIST_DATA)data;
+ PMSG_APP_THREAD_POPUP_ADDRESS pAddressPopup = (PMSG_APP_THREAD_POPUP_ADDRESS)pListData->pPopup;
- if (pListData && pListData->popup) {
- evas_object_del(pListData->popup);
- pListData->popup = NULL;
+ if (pAddressPopup) {
+ if (pAddressPopup->popup_object)
+ evas_object_del(pAddressPopup->popup_object);
+
+ free(pAddressPopup);
+ pListData->pPopup = NULL;
}
}
if (pListData == NULL || pListData->search_mode == THREAD_SEARCH_OFF)
return;
- pListData->search_mode = THREAD_SEARCH_OFF;
- elm_genlist_mode_set(pListData->genlist, ELM_LIST_SCROLL);
-
if (pListData->search_timer) {
ecore_timer_del(pListData->search_timer);
pListData->search_timer = NULL;
Evas_Object *entry = NULL;
- elm_object_signal_emit(pListData->searchbar, "elm,state,guidetext,show", "elm");
entry = elm_object_part_content_get(pListData->searchbar, "elm.swallow.content");
elm_object_text_set(entry, "");
+ elm_object_signal_emit(pListData->searchbar, "elm,state,guidetext,show", "elm");
elm_object_signal_emit(pListData->searchbar, "cancel,out", "");
+ elm_object_focus_set(entry, EINA_FALSE);
- if (msg_ui_thread_rotation_get() == false) {
- evas_object_show(pListData->search_btn);
- elm_object_item_part_content_set(pListData->nf_it, "title_right_btn", pListData->search_btn);
-
- edje_object_signal_emit(_EDJ(pListData->content_ly), "hide_searchbar", "sel_all");
- elm_object_part_content_unset(pListData->content_ly, "sel_all");
- evas_object_hide(pListData->searchbar);
+ pListData->search_mode = THREAD_SEARCH_OFF;
+ elm_genlist_mode_set(pListData->genlist, ELM_LIST_SCROLL);
+ msg_ui_thread_set_title_status(pListData);
- msg_ui_thread_show_toolbar(pListData);
+ if (pListData->noc_ly_search) {
+ evas_object_del(pListData->noc_ly_search);
+ pListData->noc_ly_search = NULL;
}
if (pListData->list_type== THREAD_NORMAL_LIST_TYPE)
msg_ui_thread_list_load(pListData, FALSE);
else
msg_ui_thread_msg_list_load(pListData, pListData->list_type);
+
+ if (msg_ui_thread_rotation_get() == true)
+ elm_naviframe_item_title_visible_set(pListData->nf_it, EINA_TRUE);
+
+ edje_object_signal_emit(_EDJ(pListData->content_ly), "hide_searchbar", "search");
+ elm_object_part_content_unset(pListData->content_ly, "search");
+ evas_object_del(pListData->searchbar);
+ pListData->searchbar = NULL;
+
+ evas_object_show(pListData->search_btn);
+ elm_object_item_part_content_set(pListData->nf_it, "title_right_btn", pListData->search_btn);
+
+ if (msg_ui_thread_rotation_get() == false) {
+ msg_ui_thread_show_toolbar(pListData);
+ } else {
+ if (pListData->item_cnt <= 0) {
+ PMSG_THREAD_DATA pData = msg_ui_thread_get_data();
+
+ elm_panes_content_left_size_set(pData->panes, 0.0);
+ elm_object_signal_emit(pData->panes, "elm,panes,unpair", "");
+ }
+ }
}
-void msg_ui_thread_button_disabled_set(PMSG_THREAD_LIST_DATA pListData, Eina_Bool disabled, int controlbar_btn)
+void msg_ui_thread_button_disabled_set(PMSG_THREAD_LIST_DATA pListData, Eina_Bool disabled)
{
+ D_ENTER;
MSG_UI_RET_IF(MSG_UI_LEVEL_ERR, !pListData);
+ PMSG_THREAD_DATA pData = msg_ui_thread_get_data();
+
+ if (pListData->view_mode == THREAD_EDIT_VIEW)
+ return;
if (disabled == EINA_TRUE) {
- if (pListData->view_mode == THREAD_NORMAL_VIEW) {
- if (pListData->toolbar_btn[controlbar_btn])
- elm_object_disabled_set(pListData->toolbar_btn[controlbar_btn], EINA_TRUE);
-
- if (msg_ui_thread_rotation_get() == true) {
- edje_object_signal_emit(_EDJ(pListData->content_ly), "hide_searchbar", "sel_all");
- elm_object_part_content_unset(pListData->content_ly, "sel_all");
- evas_object_hide(pListData->searchbar);
- } else {
- if (pListData->search_btn) {
- Evas_Object *search_icon = elm_object_content_get(pListData->search_btn);
- elm_image_file_set(search_icon, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_TITLE_ICON_SEARCH_DIM);
- }
- }
+ if (pListData->list_type != THREAD_NORMAL_LIST_TYPE) {
+ elm_object_disabled_set(pListData->toolbar_btn[CONTROLBAR_ITEM_1], EINA_TRUE);
+
+ if (pListData->list_type != THREAD_SPAM_LIST_TYPE && pListData->toolbar_btn[CONTROLBAR_ITEM_2] != NULL)
+ elm_object_disabled_set(pListData->toolbar_btn[CONTROLBAR_ITEM_2], EINA_TRUE);
+ }
+
+ if (pListData->search_btn)
+ elm_object_disabled_set(pListData->search_btn, EINA_TRUE);
+
+ if (pData->isRotate == true && pData->split_data) {
+ if (pListData->list_type != THREAD_NORMAL_LIST_TYPE && pListData->list_type != THREAD_SPAM_LIST_TYPE)
+ elm_object_disabled_set(pData->split_data->more_btn, EINA_TRUE);
}
} else {
- if (pListData->view_mode == THREAD_NORMAL_VIEW) {
- if (pListData->toolbar_btn[controlbar_btn])
- elm_object_disabled_set(pListData->toolbar_btn[controlbar_btn], EINA_FALSE);
-
- if (msg_ui_thread_rotation_get() == true) {
- edje_object_signal_emit(_EDJ(pListData->content_ly), "show_searchbar", "sel_all");
- evas_object_show(pListData->searchbar);
- elm_object_part_content_set(pListData->content_ly, "sel_all", pListData->searchbar);
- } else {
- if (pListData->search_btn) {
- Evas_Object *search_icon = elm_object_content_get(pListData->search_btn);
- elm_image_file_set(search_icon, MSG_IMAGES_EDJ, MSG_UI_THREAD_LIST_TITLE_ICON_SEARCH);
- }
- }
+ if (pListData->list_type != THREAD_NORMAL_LIST_TYPE) {
+ elm_object_disabled_set(pListData->toolbar_btn[CONTROLBAR_ITEM_1], EINA_FALSE);
+
+ if (pListData->list_type != THREAD_CBMSG_LIST_TYPE)
+ elm_object_disabled_set(pListData->toolbar_btn[CONTROLBAR_ITEM_2] , EINA_FALSE);
}
+
+
+ if (pListData->search_btn)
+ elm_object_disabled_set(pListData->search_btn, EINA_FALSE);
+
+ if (pData->isRotate == true && pData->split_data)
+ elm_object_disabled_set(pData->split_data->more_btn, EINA_FALSE);
+
}
}
MSG_UI_RETM_IF(MSG_UI_LEVEL_ERR, !label || !pListData, "label or pListData is NULL");
if (pListData) {
- switch (pListData->list_type) {
- case THREAD_NORMAL_LIST_TYPE:
- strncpy(label, dgettext("sys_string", "IDS_COM_BODY_MESSAGES"), sizeof(char)*label_len);
- break;
- case THREAD_SPAM_LIST_TYPE:
- strncpy(label, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_SPAM_MESSAGES"), sizeof(char)*label_len);
- break;
- case THREAD_SIM_LIST_TYPE:
- strncpy(label, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_SIM_CARD_MESSAGES"), sizeof(char)*label_len);
- break;
- case THREAD_CBMSG_LIST_TYPE:
- strncpy(label, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_CB_MESSAGES"), sizeof(char)*label_len);
- break;
- default:
- D_MSG("[ERROR] invalid viewmode");
- return;
+ if (pListData->view_mode == THREAD_EDIT_VIEW) {
+ switch (pListData->action_type) {
+ case THREAD_ACTION_DELETE:
+ strncpy(label, dgettext("sys_string", "IDS_COM_SK_DELETE"), sizeof(char)*label_len);
+ break;
+
+ case THREAD_ACTION_RESTORE:
+ strncpy(label, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_SK_RESTORE"), sizeof(char)*label_len);
+ break;
+
+ case THREAD_ACTION_COPY_TO_PHONE:
+ strncpy(label, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_COPY_TO_PHONE"), sizeof(char)*label_len);
+ break;
+
+ default:
+ break;
+ }
+ } else {
+ switch (pListData->list_type) {
+ case THREAD_NORMAL_LIST_TYPE:
+ strncpy(label, dgettext("sys_string", "IDS_COM_BODY_MESSAGES"), sizeof(char)*label_len);
+ break;
+ case THREAD_SPAM_LIST_TYPE:
+ strncpy(label, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_SPAM_MESSAGES"), sizeof(char)*label_len);
+ break;
+ case THREAD_SIM_LIST_TYPE:
+ strncpy(label, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_SIM_CARD_MESSAGES"), sizeof(char)*label_len);
+ break;
+ case THREAD_CBMSG_LIST_TYPE:
+ strncpy(label, dgettext(MESSAGE_PKGNAME, "IDS_MSGF_BODY_CB_MESSAGES"), sizeof(char)*label_len);
+ break;
+ default:
+ D_MSG("[ERROR] invalid viewmode");
+ return;
+ }
}
} else {
strncpy(label, dgettext("sys_string", "IDS_COM_BODY_MESSAGES"), sizeof(char)*label_len);
void msg_ui_thread_make_time_string(time_t *msg_t, char *buf, int buf_len)
{
PMSG_THREAD_DATA pData = msg_ui_thread_get_data();
-
char *time_str = NULL;
if (pData->time_fmt == MSG_TIME_FORMAT_24H) {
time_str = msg_common_get_formatted_date(pData->locale, pData->time_24h_ptn, msg_t);
- snprintf(buf, buf_len, " %s ", time_str);
+ snprintf(buf, buf_len, "%s", time_str);
} else { /* MSG_TIME_FORMAT_12H */
time_str = msg_common_get_formatted_date(pData->locale, pData->time_12h_ptn, msg_t);
- snprintf(buf, buf_len, " %s ", time_str);
+ snprintf(buf, buf_len, "%s", time_str);
}
if (time_str)
-#define MSG_UI_SEL_ALL_H 90
+#define MSG_UI_SEARCH_H 90
#define BEAT_GENLIST_PART_BASE(param_item_height) \
part \
}
}
part{
- name : "sel_all";
+ name : "search";
type : SWALLOW;
scale : 1;
description{
state: "default" 0.0;
fixed : 1 1;
- min : 0 MSG_UI_SEL_ALL_H;
+ min : 0 0;
align : 0.0 0.0;
- visible : 1;
+ visible : 0;
rel1 {to: "base"; relative:0.0 0.0;}
rel2 {to: "base"; relative:1.0 0.0;}
}
description
{
- state : "hide" 0.0;
+ state : "show" 0.0;
inherit : "default" 0.0;
- min : 0 0;
- visible : 0;
+ min : 0 MSG_UI_SEARCH_H;
+ visible : 1;
}
}
part{
fixed : 1 1;
min : 0 1;
align : 0.0 0.0;
- rel1 {to: "sel_all"; relative:0.0 1.0;}
+ rel1 {to: "search"; relative:0.0 1.0;}
rel2 {to: "genlist_body"; relative:1.0 0.0;}
}
}
program {
name: "searchbar_show";
signal: "show_searchbar";
- source: "sel_all";
- action: STATE_SET "default" 0.0;
- target: "sel_all";
+ source: "search";
+ action: STATE_SET "show" 0.0;
+ target: "search";
transition: LINEAR 0.1;
}
program {
name: "searchbar_hide";
signal: "hide_searchbar";
- source: "sel_all";
- action: STATE_SET "hide" 0.0;
- target: "sel_all";
+ source: "search";
+ action: STATE_SET "default" 0.0;
+ target: "search";
transition: LINEAR 0.1;
}
}
toolbar_item = elm_toolbar_item_append(toolbar, NULL, NULL, NULL, NULL);
elm_object_item_disabled_set(toolbar_item, EINA_TRUE);
- elm_toolbar_item_append(toolbar, MSG_CONTROLBAR_ICON_PLAY, NULL, __drm_list_play_button_cb, drm_list_data);
-
/*create back button*/
back_button = elm_button_add(drm_list_data->navi_frame);
elm_object_style_set(back_button, "naviframe/back_btn/default");
Evas_Object *icon = elm_icon_add(viewer_play_data->navi_frame);
- if (viewer_play_data->insert_count + viewer_play_data->attach_count != 0) {
+ if (viewer_play_data->insert_count + viewer_play_data->attach_count != 0)
elm_object_disabled_set(button, EINA_FALSE);
- elm_image_file_set(icon, MSG_IMAGES_EDJ, MSG_VIEWER_IMAGE_ATTACH_LIST_ICON);
- } else {
+ else
elm_object_disabled_set(button, EINA_TRUE);
- elm_image_file_set(icon, MSG_IMAGES_EDJ, MSG_VIEWER_IMAGE_ATTACH_LIST_DIM_ICON);
- }
+ elm_image_file_set(icon, MSG_IMAGES_EDJ, MSG_VIEWER_IMAGE_ATTACH_LIST_ICON);
elm_object_content_set(button, icon);
evas_object_smart_callback_add(button, "clicked", msg_ui_viewer_save_button_cb, viewer_play_data);