fix build break
authorSungbok Park <parksb@samsung.com>
Wed, 10 Oct 2012 11:39:39 +0000 (20:39 +0900)
committerSungbok Park <parksb@samsung.com>
Wed, 10 Oct 2012 11:39:39 +0000 (20:39 +0900)
21 files changed:
composer/CMakeLists.txt
composer/include/email-composer-callback.h
composer/include/email-composer-filetype.h
composer/include/email-composer-type.h
composer/include/email-composer.h
composer/src/email-composer-attachment.c
composer/src/email-composer-callback.c
composer/src/email-composer-contents.c
composer/src/email-composer-util.c
composer/src/email-composer.c
composer/theme/email-composer-edc-common.edc
main/email.c
packaging/org.tizen.email.spec
viewer/CMakeLists.txt
viewer/include/email-viewer-logic.h
viewer/include/email-viewer.h
viewer/src/email-viewer-utils.c
viewer/src/email-viewer-webview.c
viewer/src/email-viewer.c
viewer/theme/email-viewer-theme-macro.edc
viewer/theme/email-viewer-theme.edc

index 6f5c276..0bd0ede 100755 (executable)
@@ -24,9 +24,9 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common/include)
 
 INCLUDE(FindPkgConfig)
 pkg_check_modules(pkgs-composer REQUIRED ecore ecore-file glib-2.0 gobject-2.0 edbus
-                                       appcore-common elementary capi-appfw-application status
+                                       appcore-common elementary capi-appfw-application capi-media-metadata-extractor capi-media-image-util status
                                        sysman dlog email-service contacts-service
-                                       efreet-mime ewebkit2 ui-gadget-1 bundle mm-fileinfo mmutil-jpeg libmedia-utils ethumb ecore-x)
+                                       efreet-mime ewebkit2 ui-gadget-1 bundle ethumb ecore-x)
 
 FOREACH(flag ${pkgs-composer_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
@@ -64,5 +64,4 @@ ADD_DEPENDENCIES(${PROJECT_NAME} email-composer-view.edj)
 
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${UGDIR})
 INSTALL(FILES ${CMAKE_COMPOSER_BINARY_DIR}/email-composer-view.edj DESTINATION ${EDJDIR})
-INSTALL(FILES ${CMAKE_COMPOSER_SOURCE_DIR}/ug-email-composer-efl.xml DESTINATION /opt/share/packages)
 
index 98222ef..533a6b7 100755 (executable)
@@ -40,7 +40,7 @@ Eina_Bool _composer_send_mail_cb(void *data);
 Eina_Bool _composer_region_show_cb(void *data);
 Eina_Bool _composer_bringin_cb(void *data);
 Eina_Bool _composer_mbe_popup_del(void *data);
-Eina_Bool _composer_mbe_create_change_addr_list(void *data);
+Eina_Bool _composer_mbe_create_change_addr_list(EmailComposerUGD *ugd);
 
 char *_composer_change_addr_gl_text_get(void *data, Evas_Object *obj, const char *part);
 Evas_Object *_composer_change_addr_gl_content_get(void *data, Evas_Object *obj, const char *part);
index 32bb450..9b62e8e 100755 (executable)
@@ -41,7 +41,6 @@ struct _mtd mtd_main[] = {
        {"Video", "video/3gpp", IMGDIR "/U01_icon_video.png", "video-player", NULL, TRUE, FALSE, TRUE},
        {"Video", "video/x-ms-asf", IMGDIR "/U01_icon_video.png", "video-player", NULL, TRUE, FALSE, TRUE},
        {"Video", "video/x-ms-wmv", IMGDIR "/U01_icon_video.png", "video-player", NULL, TRUE, FALSE, TRUE},
-       {"Image", "image/svg+xml", MYFILE_IMGE_PATH "/myfile_icon_svg.png", "svg-viewer", NULL, TRUE, FALSE, FALSE},
        {"PDF", "application/pdf", IMGDIR "/U01_icon_pdf.png", "documents", NULL, TRUE, FALSE, FALSE},
        {"Doc", "application/msword", IMGDIR "/U01_icon_word.png", "documents", NULL, TRUE, FALSE, FALSE},
        {"Doc", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", IMGDIR "/U01_icon_word.png", "documents", NULL, TRUE, FALSE, FALSE},
@@ -56,7 +55,6 @@ struct _mtd mtd_main[] = {
        {"Java", "text/vnd.sun.j2me.app-descriptor", MYFILE_IMGE_PATH "/myfile_icon_java.png", NULL, NULL, FALSE, FALSE, FALSE},
        {"Java", "application/x-java-archive", MYFILE_IMGE_PATH "/myfile_icon_java.png", NULL, NULL, FALSE, FALSE, FALSE},
        {"SVG", "image/svg+xml", MYFILE_IMGE_PATH "/myfile_icon_svg.png", "svg-viewer", NULL, TRUE, FALSE, FALSE},
-       {"ETC", "etc", MYFILE_IMGE_PATH "/myfile_icon_etc.png", NULL, NULL, TRUE, FALSE, FALSE},
        {"VCARD", "text/directory", MYFILE_IMGE_PATH "/myfile_icon_etc.png", NULL, NULL, FALSE, FALSE, FALSE},
        {"VCALENDAR", "text/calendar", MYFILE_IMGE_PATH "/myfile_icon_etc.png", NULL, NULL, FALSE, FALSE, FALSE},
        {NULL, NULL, NULL, NULL}
index cb0fb64..b42ac82 100755 (executable)
@@ -58,7 +58,7 @@
 
 #define MAX_BODY_SIZE                          32763
 #define MAX_ATTACHMENT_ITEM            100
-#define MAX_ATTACHMENT_SIZE            10 * 1024 * 1024
+#define MAX_ATTACHMENT_SIZE            50 * 1024 * 1024
 #define MAX_ATTACHMENT_FILE_LEN        1024
 
 #define CONV_THUMB_WIDTH       250
index 2fb9af9..cad530b 100755 (executable)
@@ -140,6 +140,7 @@ struct ug_data {
        Ecore_Timer *bringin_timer;
        Ecore_Timer *mbe_unfocus_timer;
        Ecore_Timer *focus_timer;
+       Ecore_Timer *launch_timer;
 
        /* Predictive Search */
        Ecore_Timer *ps_timer;
@@ -213,7 +214,7 @@ struct ug_data {
        int fw_dn_cnt;
        int fw_dn_total_cnt;
        int fw_dn_idx;
-       unsigned int fw_dn_handle[MAX_ATTACHMENT_ITEM];
+       int fw_dn_handle[MAX_ATTACHMENT_ITEM];
 
        int send_result;
        int save_drafts;
index 29e6bb9..0abbb87 100755 (executable)
@@ -15,9 +15,8 @@
  */
 
 #include <sys/stat.h>
-#include <mm_file.h>
-#include <mm_error.h>
-#include <mm_util_jpeg.h>
+#include <metadata_extractor.h>
+#include <image_util.h>
 #include <Ethumb.h>
 #include <app.h>
 
@@ -128,26 +127,15 @@ int _composer_get_files_size(Eina_List *files_list)
        char *recv = NULL;
 
        int temp_size = 0;
+       int file_size = 0;
 
        EINA_LIST_FOREACH(list, l, recv) {
                debug_log("File : %s", recv);
 
-               struct stat file_info;
-               int return_stat;
-
-               if ((return_stat = stat(recv, &file_info)) == -1) {
-                       debug_log("stat Error(%d): %s", errno, strerror(errno));
-                       return COMPOSER_ERROR_INVALID_FILE;
-               }
-
-               debug_log("file size : %d", file_info.st_size);
-
-/*             if (file_info.st_size / 1024 > 1)
-                       temp_file_size = file_info.st_size / 1024;
-               else
-                       temp_file_size = 1;
-*/
-               temp_size = temp_size + file_info.st_size;
+               file_size = ecore_file_size(recv);
+               debug_log("file_size : %d", file_size);
+               temp_size = temp_size + file_size;
+               debug_log("total_size : %d", temp_size);
        }
 
        debug_log("Files total size : %d", temp_size);
@@ -167,6 +155,7 @@ int _composer_get_inline_images_size(EmailComposerUGD *ugd)
        int total_size = 0;
 
        if (EINA_TRUE == ugd->has_body_html) {
+               debug_log("listOfImageUrls count : %d", eina_list_count(ugd->listOfImageUrls));
                if (eina_list_count(ugd->listOfImageUrls) > 0) {
 
                        Eina_List *list = ugd->listOfImageUrls;
@@ -600,66 +589,65 @@ Evas_Object *_composer_attachment_make_thumbnail(EmailComposerUGD *ugd, char *fi
                                if (err != COMPOSER_ERROR_NONE)
                                        goto FINISH_OFF;
                        } else if (strncmp(type, ATTACHMENT_MEDIA_AUDIO, 5) == 0) {
-                               MMHandleType tag_attrs = 0;
-                               int tag_ret = 0;
-
-                               tag_ret = mm_file_create_tag_attrs(&tag_attrs, filePath);
-
-                               if (tag_ret == MM_ERROR_NONE) {
-                                       char *error = NULL;
-                                       char *art_name = NULL;
-                                       int art_len = 0;
-                                       int art_size = 0;
-
-                                       tag_ret = mm_file_get_attrs(tag_attrs,
-                                                                                       &error,
-                                                                                       MM_FILE_TAG_ARTWORK, &art_name, &art_len,
-                                                                                       MM_FILE_TAG_ARTWORK_SIZE, &art_size,
-                                                                                       NULL);
-
-                                       if (tag_ret != MM_ERROR_NONE) {
-                                               if (error) {
-                                                       debug_log("fail to mm_file_get_attrs() - ret(%x), error(%s)", tag_ret, error);
-                                                       free(error);
-                                               } else {
-                                                       debug_log("fail to mm_file_get_attrs() - ret(%x)", tag_ret);
-                                               }
-                                       }
+                               metadata_extractor_h metadata = NULL;
+                               int ret = METADATA_EXTRACTOR_ERROR_NONE;
+                               void *artwork = NULL;
+                               int artwork_size = 0;
+                               char *artwork_mime = NULL;
+
+                               ret = metadata_extractor_create(&metadata);
+                               debug_log("metadata_extractor_create: %d", ret);
+                               if (!metadata) {
+                                       debug_log("metadata extractor create failed");
+                                       return NULL;
+                               }
+
+                               ret = metadata_extractor_set_path(metadata, filePath);
+                               debug_log("metadata_extractor_set_path: %d", ret);
 
-                                       if (art_name) {
-                                               gchar *mm_path = NULL;
-                                               int fd = g_file_open_tmp(NULL, &mm_path, NULL);
+                               ret = metadata_extractor_get_artwork(metadata, &artwork, &artwork_size, &artwork_mime);
+                               debug_log("metadata_extractor_get_artwork: %d", ret);
+                               debug_log("artwork_mime: %s, artwork_size: %d", artwork_mime, artwork_size);
+
+                               if (artwork) {
+                                       gchar *mm_path = NULL;
+                                       int fd = g_file_open_tmp(NULL, &mm_path, NULL);
 
-                                               if (fd != -1) {
-                                                       FILE *fp = fdopen(fd, "w");
-                                                       if (fp == NULL) {
-                                                               debug_log("fail to fdopen()");
+                                       if (fd != -1) {
+                                               FILE *fp = fdopen(fd, "w");
+                                               if (fp == NULL) {
+                                                       debug_log("fail to fdopen()");
+                                                       close(fd);
+                                               } else {
+                                                       if (fwrite((unsigned char *)artwork, 1, artwork_size, fp) != artwork_size/*1*/) {
+                                                               debug_log("fail to fwrite()");
+                                                               fclose(fp);
                                                                close(fd);
                                                        } else {
-                                                               if (fwrite((unsigned char *)art_name, 1, art_size, fp) != art_size/*1*/) {
-                                                                       debug_log("fail to fwrite()");
-                                                                       fclose(fp);
-                                                                       close(fd);
-                                                               } else {
-                                                                       fflush(fp);
-                                                                       fclose(fp);
-                                                                       close(fd);
-                                                               }
+                                                               fflush(fp);
+                                                               fclose(fp);
+                                                               close(fd);
                                                        }
                                                }
+                                       }
 
-                                               snprintf(thumb_path, sizeof(thumb_path), "%s", mm_path);
+                                       snprintf(thumb_path, sizeof(thumb_path), "%s", mm_path);
 
-                                               debug_log("file : %s, albumart_path : %s", filePath, thumb_path);
-                                               if (mm_path) {
-                                                       free(mm_path);
-                                                       mm_path = NULL;
-                                               }
+                                       debug_log("file : %s, album art_path : %s", filePath, thumb_path);
+
+                                       if (mm_path) {
+                                               free(mm_path);
+                                               mm_path = NULL;
                                        }
+
+                                       g_free(artwork);
                                }
 
-                               mm_file_destroy_tag_attrs(tag_attrs);
+                               if (artwork_mime)
+                                       g_free(artwork_mime);
 
+                               ret = metadata_extractor_destroy(metadata);
+                               debug_log("metadata_extractor_destroy: %d", ret);
                        }
                }
 
@@ -732,135 +720,75 @@ int _composer_attachment_make_ethumb(const char *source, char *target)
 
        if (mime_type) {
                if (strncmp(mime_type, "image", 5) == 0) {
-                       Ethumb *e = ethumb_new();
-                       const char *target_path;
-                       const char *key;
-
-                       if (ethumb_file_set(e, source, NULL) != EINA_TRUE) {
-                               debug_log("Fail to ethumb_file_set()");
-                               return COMPOSER_ERROR_ETHUMB_FAIL;
-                       }
-
-                       ethumb_thumb_size_set(e, CONV_THUMB_WIDTH, CONV_THUMB_HEIGHT);
-                       ethumb_thumb_dir_path_set(e, DATADIR);
-                       ethumb_thumb_path_get(e, &target_path, &key);
-
-                       if (ethumb_generate(e, _composer_ethumb_generate_cb, NULL, NULL) != EINA_TRUE) {
-                               debug_log("Fail to ethumb_generate()");
-                               return COMPOSER_ERROR_ETHUMB_FAIL;
-                       }
-
-                       strncpy(target, target_path, MAX_ATTACHMENT_FILE_LEN);
-                       ethumb_free(e);
-
+                       strncpy(target, source, MAX_ATTACHMENT_FILE_LEN);
                } else if (strncmp(mime_type, "video", 5) == 0) {
-                       int ret = 0;
-                       int video_track_num = 0;
+                       metadata_extractor_h metadata = NULL;
+                       int ret = METADATA_EXTRACTOR_ERROR_NONE;
+                       char *video_width = NULL;
+                       char *video_height = NULL;
+                       char *video_track_cnt = NULL;
+                       void *video_thumbnail = NULL;
+                       int video_thumbnail_len = 0;
                        int video_w = 0;
                        int video_h = 0;
-                       int thumb_len = 0;
-                       void *stream = NULL;
-                       MMHandleType content_attrs = 0;
-
-                       ret = mm_file_create_content_attrs(&content_attrs, source);
-
-                       if (ret == MM_ERROR_NONE && content_attrs) {
-                               mm_file_get_attrs(content_attrs, NULL,
-                                                               MM_FILE_CONTENT_VIDEO_TRACK_COUNT,
-                                                               &video_track_num, NULL);
-
-                               if (video_track_num) {
-                                       mm_file_get_attrs(content_attrs, NULL,
-                                                                       MM_FILE_CONTENT_VIDEO_WIDTH, &video_w,
-                                                                       MM_FILE_CONTENT_VIDEO_HEIGHT, &video_h,
-                                                                       MM_FILE_CONTENT_VIDEO_THUMBNAIL, &stream,
-                                                                       &thumb_len, NULL);
-
-                                       if (stream) {
-                                               int mm_ret = 0;
-                                               char filename[MAX_ATTACHMENT_FILE_LEN] = { 0, };
-                                               char *file_name = NULL;
-                                               char *file_ext = NULL;
-
-                                               email_parse_get_filename_n_ext_from_path(source, &file_name, &file_ext);
-                                               snprintf(filename, sizeof(filename), "%s%s%s%s", DATADIR"/", file_name, file_ext, ".jpg");
-                                               g_free(file_name);
-                                               g_free(file_ext);
-
-                                               mm_ret = mm_util_jpeg_encode_to_file(filename, stream,
-                                                                                                                       video_w, video_h,
-                                                                                                                       MM_UTIL_JPEG_FMT_RGB888, 70);
-
-                                               if (ecore_file_exists(filename)) {
-                                                       strncpy(target, filename, MAX_ATTACHMENT_FILE_LEN);
-//                                                     snprintf(thumb_path, sizeof(thumb_path), "%s", filename);
-                                                       debug_log("file : %s, thumb_path : %s", source, target);
-                                               }
-                                       }
-                               }
 
-                               mm_file_destroy_content_attrs(content_attrs);
-                       } else {
-                               debug_log("fail to mm_file_create_content_attrs - error(%x)", ret);
+                       ret = metadata_extractor_create(&metadata);
+                       debug_log("metadata_extractor_create: %d", ret);
+                       if (!metadata) {
+                               debug_log("metadata extractor create failed");
+                               return COMPOSER_ERROR_ETHUMB_FAIL;
                        }
-               }/* else if (strncmp(mime_type, "audio", 5) == 0) {
-                       int tag_ret = 0;
-                       MMHandleType tag_attrs = 0;
-
-                       tag_ret = mm_file_create_tag_attrs(&tag_attrs, source);
-
-                       if (tag_ret == MM_ERROR_NONE && tag_attrs) {
-                               char *error = NULL;
-                               char *art_name = NULL;
-                               int art_len = 0;
-                               int art_size = 0;
-
-                               tag_ret = mm_file_get_attrs(tag_attrs, &error,
-                                                                                       MM_FILE_TAG_ARTWORK, &art_name, &art_len,
-                                                                                       MM_FILE_TAG_ARTWORK_SIZE, &art_size, NULL);
-
-                               if (tag_ret != MM_ERROR_NONE) {
-                                       if (error) {
-                                               debug_log("fail to mm_file_get_attrs() - ret(%x), error(%s)", tag_ret, error);
-                                               free(error);
-                                       } else {
-                                               debug_log("fail to mm_file_get_attrs() - ret(%x)", tag_ret);
-                                       }
-                               }
-
-                               if (art_name) {
-                                       gchar *mm_path = NULL;
-                                       int fd = g_file_open_tmp(NULL, &mm_path, NULL);
-
-                                       if (fd != -1) {
-                                               FILE *fp = fdopen(fd, "w");
-                                               if (fp == NULL) {
-                                                       debug_log("fail to fdopen()");
-                                                       close(fd);
-                                               } else {
-                                                       int n = fwrite((unsigned char *)art_name, sizeof(char), art_size, fp);
-                                                       if (n != art_size) {
-                                                               debug_log("fail to fwrite()");
-                                                               fclose(fp);
-                                                               close(fd);
-                                                       } else {
-                                                               fflush(fp);
-                                                               fclose(fp);
-                                                               close(fd);
-                                                       }
-                                               }
-                                       }
 
-                                       strncpy(target, mm_path, MAX_ATTACHMENT_FILE_LEN);
-//                                     snprintf(thumb_path, sizeof(thumb_path), "%s", mm_path);
-                                       debug_log("file : %s, albumart_path : %s", source, target);
-                                       if (mm_path)
-                                               g_free(mm_path);
+                       ret = metadata_extractor_set_path(metadata, source);
+                       debug_log("metadata_extractor_set_path: %d", ret);
+
+                       ret = metadata_extractor_get_metadata(metadata, METADATA_VIDEO_WIDTH, &video_width);
+                       debug_log("metadata_extractor_get_metadata: %d [video_width:%s]", ret, video_width);
+                       ret = metadata_extractor_get_metadata(metadata, METADATA_VIDEO_HEIGHT, &video_height);
+                       debug_log("metadata_extractor_get_metadata: %d [video_height:%s]", ret, video_height);
+                       ret = metadata_extractor_get_metadata(metadata, METADATA_HAS_VIDEO, &video_track_cnt);
+                       debug_log("metadata_extractor_get_metadata: %d [video_track_cnt:%s]", ret, video_track_cnt);
+
+                       ret = metadata_extractor_get_frame(metadata, &video_thumbnail, &video_thumbnail_len);
+                       debug_log("metadata_extractor_get_frame: %d (video_thumbnail_len:%d)", ret, video_thumbnail_len);
+
+                       if (video_thumbnail) {
+                               int mm_ret = 0;
+                               char filename[MAX_ATTACHMENT_FILE_LEN] = { 0, };
+                               char *file_name = NULL;
+                               char *file_ext = NULL;
+
+                               email_parse_get_filename_n_ext_from_path(source, &file_name, &file_ext);
+                               snprintf(filename, sizeof(filename), "%s%s%s%s", DATADIR"/", file_name, file_ext, ".jpg");
+                               g_free(file_name);
+                               g_free(file_ext);
+
+                               if (video_width)
+                                       video_w = atoi(video_width);
+                               if (video_height)
+                                       video_h = atoi(video_height);
+                               mm_ret = image_util_encode_jpeg(video_thumbnail,
+                                                                                                       video_w, video_h,
+                                                                                                       IMAGE_UTIL_COLORSPACE_RGB888, 70, filename);
+
+                               if (ecore_file_exists(filename)) {
+                                       strncpy(target, filename, MAX_ATTACHMENT_FILE_LEN);
+//                                     snprintf(thumb_path, sizeof(thumb_path), "%s", filename);
+                                       debug_log("file : %s, thumb_path : %s", source, target);
                                }
+                               g_free(video_thumbnail);
                        }
 
-                       mm_file_destroy_tag_attrs(tag_attrs);
-               }*/
+                       if (video_width)
+                               g_free(video_width);
+                       if (video_height)
+                               g_free(video_height);
+                       if (video_track_cnt)
+                               g_free(video_track_cnt);
+
+                       ret = metadata_extractor_destroy(metadata);
+                       debug_log("metadata_extractor_destroy: %d", ret);
+               }
        }
 
        g_free(mime_type);
@@ -871,7 +799,7 @@ int _composer_attachment_make_ethumb(const char *source, char *target)
 void _composer_ethumb_generate_cb(void *data, Ethumb *e, Eina_Bool success)
 {
        if (success == EINA_TRUE) {
-               debug_log("Success to create thumbnail");
+               debug_log("Succeed in thumbnail generation");
        } else {
                debug_log("Fail to create thumbnail");
        }
index f33602a..6fa5781 100755 (executable)
@@ -47,6 +47,7 @@ static Elm_Genlist_Item_Class tracking_itc;
 
 static void _composer_mbe_popup_change_addr_selected_cb(void *data, Evas_Object *obj, void *event_info);
 static void _composer_from_change_response_cb(void *data, Evas_Object *obj, void *event_info);
+static void _composer_from_close_response_cb(EmailComposerUGD *ugd);
 static void _composer_from_radio_cb(void *data, Evas_Object *obj, void *event_info);
 static void _composer_from_gl_sel(void *data, Evas_Object *obj, void *event_info);
 
@@ -117,7 +118,6 @@ void _composer_more_button_cb(void *data, Evas_Object *obj, void *event_info)
                        _composer_resize_body_webview(ugd, 316 + 122);
                } else {
                        _composer_resize_body_webview(ugd, ugd->ime_height + 122);
-
                }
                elm_object_item_signal_emit(ugd->navi_item, "elm,state,optionheader,open", "");
        }
@@ -417,7 +417,7 @@ void _composer_mbe_selected_cb(void *data, Evas_Object *obj, void *event_info)
                elm_list_item_append(pu_list, dgettext("sys_string", "IDS_COM_SK_EDIT"), NULL, NULL, _composer_mbe_popup_edit_cb, ugd);
 
                if (obj != ugd->to_mbe)
-                       elm_list_item_append(pu_list, N_("Move to To"), NULL, NULL, _composer_mbe_popup_move_to_to_cb, ugd);
+                       elm_list_item_append(pu_list, _("IDS_EMAIL_BODY_MOVE_TO_TO"), NULL, NULL, _composer_mbe_popup_move_to_to_cb, ugd);
                if (obj != ugd->cc_mbe)
                        elm_list_item_append(pu_list, _("IDS_EMAIL_OPT_MOVE_TO_CC"), NULL, NULL, _composer_mbe_popup_move_to_cc_cb, ugd);
                if (obj != ugd->bcc_mbe)
@@ -434,7 +434,7 @@ void _composer_mbe_selected_cb(void *data, Evas_Object *obj, void *event_info)
 
 #ifdef _POPUP_WITH_LIST
                elm_list_mode_set(pu_list, ELM_LIST_EXPAND);
-               evas_object_size_hint_max_set(pu_list, -1, 113 * item_count * elm_scale_get());
+               evas_object_size_hint_max_set(pu_list, -1, 114 * item_count * elm_scale_get());
 #endif
                elm_object_content_set(ugd->composer_popup, pu_list);
 
@@ -470,7 +470,7 @@ void _composer_mbe_focused_cb(void *data, Evas_Object *obj, void *event_info)
 
                ugd->selected_entry = elm_multibuttonentry_entry_get(obj);
 //             ugd->bringin_timer = ecore_timer_add(0.5f, _composer_bringin_cb, ugd);
-               debug_log("MBE edtable:%d", elm_multibuttonentry_editable_get(obj));
+               debug_log("MBE editable:%d", elm_multibuttonentry_editable_get(obj));
        } else {
                if (ugd->selected_entry == ugd->body_ewkview) {
                        if (EINA_TRUE == elm_object_focus_get(ugd->to_mbe))
@@ -993,16 +993,16 @@ char *_composer_change_addr_gl_text_get(void *data, Evas_Object *obj, const char
        int index = (int)data;
        const char *email_str = NULL;
 
-       debug_log("label index = %d", index);
+       debug_log("label index = %d, email_type = %d", index, email_list[index].email_type);
 
        if (!g_strcmp0(part, "elm.text")) {
                if (email_list[index].email_type == 0)
                        email_str = g_strconcat(_("IDS_EMAIL_OPT_OTHER"), ": ", email_list[index].email_addr, NULL);
-               else if (email_list[index].email_type == 1)
-                       email_str = g_strconcat(dgettext("sys_string", "IDS_COM_BODY_HOME"), ": ", email_list[index].email_addr, NULL);
                else if (email_list[index].email_type == 2)
+                       email_str = g_strconcat(dgettext("sys_string", "IDS_COM_BODY_HOME"), ": ", email_list[index].email_addr, NULL);
+               else if (email_list[index].email_type == 4)
                        email_str = g_strconcat(dgettext("sys_string", "IDS_COM_BODY_WORK"), ": ", email_list[index].email_addr, NULL);
-               else if (email_list[index].email_type == 3)
+               else
                        email_str = g_strconcat(_("IDS_EMAIL_OPT_OTHER"), ": ", email_list[index].email_addr, NULL);
 
                debug_log("email_type(%d), email_str(%s)", email_list[index].email_type, email_str);
@@ -1100,13 +1100,6 @@ Eina_Bool _composer_send_mail_cb(void *data)
                elm_progressbar_pulse(progressbar, EINA_TRUE);
                elm_object_content_set(ugd->composer_noti, progressbar);
 
-               if (elm_multibuttonentry_first_item_get(ugd->to_mbe))
-                       elm_multibuttonentry_clear(ugd->to_mbe);
-               if (elm_multibuttonentry_first_item_get(ugd->cc_mbe))
-                       elm_multibuttonentry_clear(ugd->cc_mbe);
-               if (elm_multibuttonentry_first_item_get(ugd->bcc_mbe))
-                       elm_multibuttonentry_clear(ugd->bcc_mbe);
-
                /*
                        After sending, not to focus mbe.
                */
@@ -1265,16 +1258,15 @@ Eina_Bool _composer_mbe_popup_del(void *data)
        return EINA_FALSE;
 }
 
-Eina_Bool _composer_mbe_create_change_addr_list(void *data)
+Eina_Bool _composer_mbe_create_change_addr_list(EmailComposerUGD *ugd)
 {
        debug_log("");
-       EmailComposerUGD *ugd = (EmailComposerUGD *)data;
 
        if (ugd->change_addr_noti) {
                evas_object_del(ugd->change_addr_noti);
                ugd->change_addr_noti = NULL;
        }
-       ugd->change_addr_noti = _composer_create_noti(ugd, false, _("IDS_EMAIL_OPT_CHANGE_EMAIL_ADDRESS_ABB"), NULL, 1,
+       ugd->change_addr_noti = _composer_create_noti(ugd, false, _("IDS_EMAIL_HEADER_SELECT_EMAIL_ADDRESS"), NULL, 1,
                dgettext("sys_string", "IDS_COM_SK_CANCEL"), NULL, 0.0, _composer_mbe_change_addr_response_cb);
 
 #ifdef _POPUP_WITH_LIST
@@ -1332,6 +1324,13 @@ Eina_Bool _composer_send_popup_finish_cb(void *data)
        debug_log("");
        EmailComposerUGD *ugd = (EmailComposerUGD *)data;
 
+       if (elm_multibuttonentry_first_item_get(ugd->to_mbe))
+               elm_multibuttonentry_clear(ugd->to_mbe);
+       if (elm_multibuttonentry_first_item_get(ugd->cc_mbe))
+               elm_multibuttonentry_clear(ugd->cc_mbe);
+       if (elm_multibuttonentry_first_item_get(ugd->bcc_mbe))
+               elm_multibuttonentry_clear(ugd->bcc_mbe);
+
        _composer_popup_end(ugd, ugd->send_result);
        return EINA_TRUE;
 }
@@ -1673,6 +1672,8 @@ static void _composer_from_gl_sel(void *data, Evas_Object *obj, void *event_info
        int index = (int)data;
 
        elm_radio_value_set(g_ugd->account_info->account_rdg, index);
+
+       _composer_from_close_response_cb(g_ugd);
 }
 
 static void _composer_from_change_response_cb(void *data, Evas_Object *obj, void *event_info)
@@ -1797,8 +1798,8 @@ static void _composer_from_change_response_cb(void *data, Evas_Object *obj, void
                EmailRecpInfo *new_from_ri = (EmailRecpInfo *) calloc(1, sizeof(EmailRecpInfo));
 
                new_from_ri->selected_email_idx = 0;
-               new_from_ri->display_name = ugd->account_info->account->user_display_name;
-               snprintf(new_from_ri->email_list[0].email_addr, MAX_RECIPIENT_ADDRESS_LEN, "%s", ugd->account_info->account->user_email_address);
+               new_from_ri->display_name = ugd->account_info->account_list[set_val].user_display_name;
+               snprintf(new_from_ri->email_list[0].email_addr, MAX_RECIPIENT_ADDRESS_LEN, "%s", ugd->account_info->account_list[set_val].user_email_address);
                new_from_ri->email_cnt = 1;
                new_from_ri->is_contact_info = false;
                new_from_ri->is_always_bcc = false;
@@ -1839,6 +1840,161 @@ static void _composer_from_change_response_cb(void *data, Evas_Object *obj, void
        }
 }
 
+static void _composer_from_close_response_cb(EmailComposerUGD *ugd)
+{
+       debug_log("composer_noti : %p", ugd->composer_noti);
+
+       int set_val = elm_radio_value_get(ugd->account_info->account_rdg);
+
+       debug_log("set_val = %d", set_val);
+
+       ugd->account_info->account_id = ugd->account_info->account_list[set_val].account_id;
+
+       if (ugd->account_info->account_name) {
+               g_free(ugd->account_info->account_name);
+               ugd->account_info->account_name = NULL;
+       }
+
+       ugd->account_info->account_name = g_strdup(ugd->account_info->account_list[set_val].user_email_address);
+
+       debug_log("account_id = %d", ugd->account_info->account_id);
+
+       debug_log("priority = %d", (*ugd->account_info->account).options.priority);
+
+       Elm_Object_Item *from_item = NULL;
+       from_item = elm_multibuttonentry_first_item_get(ugd->from_mbe);
+
+       EmailRecpInfo *from_ri = NULL;
+
+       if (from_item) {
+               from_ri = elm_object_item_data_get(from_item);
+
+               debug_log("from_ri = %s", from_ri->email_list[0].email_addr);
+       }
+
+       debug_log("add_my_address_to_bcc = %d", ugd->account_info->account->options.add_my_address_to_bcc);
+
+#ifdef _ALWAYS_CC_MYSELF
+       debug_log("remove bcc myself if it is");
+       Elm_Object_Item *bcc_item = NULL;
+       bcc_item = elm_multibuttonentry_first_item_get(ugd->bcc_mbe);
+
+       while (bcc_item) {
+               EmailRecpInfo *bcc_ri = NULL;
+               int index = 0;
+
+               bcc_ri = (EmailRecpInfo *) elm_object_item_data_get(bcc_item);
+
+               index = bcc_ri->selected_email_idx;
+
+               debug_log("bcc_ri email_addr = %s", bcc_ri->email_list[index].email_addr);
+
+               if ((g_strcmp0(bcc_ri->email_list[index].email_addr, from_ri->email_list[0].email_addr) == 0) && (bcc_ri->is_always_bcc == true)) {
+                       elm_object_item_del(bcc_item);
+                       break;
+               }
+
+               bcc_item = elm_multibuttonentry_item_next_get(bcc_item);
+       }
+
+       debug_log("remove cc myself if it is");
+       Elm_Object_Item *cc_item = NULL;
+       cc_item = elm_multibuttonentry_first_item_get(ugd->cc_mbe);
+
+       while (cc_item) {
+               EmailRecpInfo *cc_ri = NULL;
+               int index = 0;
+
+               cc_ri = (EmailRecpInfo *) elm_object_item_data_get(cc_item);
+
+               index = cc_ri->selected_email_idx;
+
+               debug_log("cc_ri email_addr = %s", cc_ri->email_list[index].email_addr);
+
+               if ((g_strcmp0(cc_ri->email_list[index].email_addr, from_ri->email_list[0].email_addr) == 0) && (cc_ri->is_always_bcc == true)) {
+                       elm_object_item_del(cc_item);
+                       break;
+               }
+
+               cc_item = elm_multibuttonentry_item_next_get(cc_item);
+       }
+
+       if (ugd->account_info->account->options.add_my_address_to_bcc == EMAIL_ADD_MY_ADDRESS_OPTION_ALWAYS_ADD_TO_BCC) {
+               debug_log("always bcc on");
+               EmailRecpInfo *new_bcc_ri = (EmailRecpInfo *) calloc(1, sizeof(EmailRecpInfo));
+
+               new_bcc_ri->selected_email_idx = 0;
+               new_bcc_ri->display_name = ugd->account_info->account->user_display_name;
+               snprintf(new_bcc_ri->email_list[0].email_addr, MAX_RECIPIENT_ADDRESS_LEN, "%s", ugd->account_info->account->user_email_address);
+               new_bcc_ri->email_cnt = 1;
+               new_bcc_ri->is_contact_info = false;
+               new_bcc_ri->is_always_bcc = true;
+               new_bcc_ri->is_from_addr = false;
+
+               bcc_item = elm_multibuttonentry_first_item_get(ugd->bcc_mbe);
+               elm_multibuttonentry_item_insert_before(ugd->bcc_mbe, bcc_item, g_strdup(new_bcc_ri->display_name), NULL, new_bcc_ri);
+       } else if (ugd->account_info->account->options.add_my_address_to_bcc == EMAIL_ADD_MY_ADDRESS_OPTION_ALWAYS_ADD_TO_CC) {
+               debug_log("always cc on");
+               EmailRecpInfo *new_cc_ri = (EmailRecpInfo *) calloc(1, sizeof(EmailRecpInfo));
+
+               new_cc_ri->selected_email_idx = 0;
+               new_cc_ri->display_name = ugd->account_info->account->user_display_name;
+               snprintf(new_cc_ri->email_list[0].email_addr, MAX_RECIPIENT_ADDRESS_LEN, "%s", ugd->account_info->account->user_email_address);
+               new_cc_ri->email_cnt = 1;
+               new_cc_ri->is_contact_info = false;
+               new_cc_ri->is_always_bcc = true;
+               new_cc_ri->is_from_addr = false;
+
+               cc_item = elm_multibuttonentry_first_item_get(ugd->cc_mbe);
+               elm_multibuttonentry_item_insert_before(ugd->cc_mbe, cc_item, g_strdup(new_cc_ri->display_name), NULL, new_cc_ri);
+       } else {
+               debug_log("always bcc/cc off");
+       }
+#endif
+
+       EmailRecpInfo *new_from_ri = (EmailRecpInfo *) calloc(1, sizeof(EmailRecpInfo));
+
+       new_from_ri->selected_email_idx = 0;
+       new_from_ri->display_name = ugd->account_info->account_list[set_val].user_display_name;
+       snprintf(new_from_ri->email_list[0].email_addr, MAX_RECIPIENT_ADDRESS_LEN, "%s", ugd->account_info->account_list[set_val].user_email_address);
+       new_from_ri->email_cnt = 1;
+       new_from_ri->is_contact_info = false;
+       new_from_ri->is_always_bcc = false;
+       new_from_ri->is_from_addr = true;
+
+       elm_object_item_del(from_item);
+
+       elm_multibuttonentry_item_append(ugd->from_mbe, g_strdup(new_from_ri->display_name), NULL, new_from_ri);
+
+       if (ugd->selected_entry == ugd->to_mbe_entry) {
+               elm_object_focus_set(ugd->to_mbe, EINA_TRUE);
+       } else if (ugd->selected_entry == ugd->cc_mbe_entry) {
+               elm_object_focus_set(ugd->cc_mbe, EINA_TRUE);
+       } else if (ugd->selected_entry == ugd->bcc_mbe_entry) {
+               elm_object_focus_set(ugd->bcc_mbe, EINA_TRUE);
+       }
+
+       if (ugd->account_gen_list) {
+               elm_genlist_clear(ugd->account_gen_list);
+
+               evas_object_del(ugd->account_gen_list);
+               ugd->account_gen_list = NULL;
+       }
+
+       if (ugd->popup_list) {
+               debug_log("popup count = %d", eina_list_count(ugd->popup_list));
+               debug_log("composer_noti: %p", ugd->composer_noti);
+
+               ugd->popup_list = eina_list_remove(ugd->popup_list, ugd->composer_noti);
+       }
+
+       if (ugd->composer_noti) {
+               debug_log("@@@ ELM_POPUP_RESPONSE_CLOSE @@@");
+               _composer_popup_delete(ugd->composer_noti);
+               ugd->composer_noti = NULL;
+       }
+}
+
 static void _composer_from_radio_cb(void *data, Evas_Object *obj, void *event_info)
 {
        debug_log("");
@@ -1935,9 +2091,17 @@ void _composer_cbar_add_me_clicked(void *data, Evas_Object *obj, void *event_inf
 
                        debug_log("to_ri email_addr = %s", to_ri->email_list[index].email_addr);
 
-                       if (g_strcmp0(to_ri->email_list[index].email_addr, from_ri->email_list[0].email_addr) == 0) {
-                               elm_object_item_del(to_item);
-                               break;
+                       debug_log("account name = %s", ugd->account_info->account_name);
+                       if (from_ri) {
+                               if (g_strcmp0(to_ri->email_list[index].email_addr, from_ri->email_list[0].email_addr) == 0) {
+                                       elm_object_item_del(to_item);
+                                       break;
+                               }
+                       } else {
+                               if (g_strcmp0(to_ri->email_list[index].email_addr, ugd->account_info->account_name) == 0) {
+                                       elm_object_item_del(to_item);
+                                       break;
+                               }
                        }
 
                        to_item = elm_multibuttonentry_item_next_get(to_item);
@@ -2031,10 +2195,11 @@ static void _composer_cbar_save_as_draft_cb(Evas_Object *o, const char *result,
 
                char str[128] = { 0, };
                snprintf(str, sizeof(str), "%s", _("IDS_EMAIL_OPT_COMPOSE_EMAIL"));
-               /*_show_select_info(ug_data, str);*/
                int ret = status_message_post(str);
                if (ret)
                        debug_log("status_message_post failed: %d", ret);
+
+               _composer_mbe_set_focus(ugd);
                return;
        }
 
@@ -2058,7 +2223,7 @@ static void _composer_cbar_save_as_draft_cb(Evas_Object *o, const char *result,
 
                ugd->idler_save_draft = ecore_idler_add(_composer_show_fail_to_save, ugd);
        } else {
-               debug_log("Success save in Drafts");
+               debug_log("Succeed in saving in Drafts");
 
                debug_log("composer_type:%d", ugd->composer_type);
                if (ugd->composer_type == RUN_COMPOSER_EDIT) {
@@ -2072,10 +2237,11 @@ static void _composer_cbar_save_as_draft_cb(Evas_Object *o, const char *result,
 
                char str[128] = { 0, };
                snprintf(str, sizeof(str), "%s", _("IDS_EMAIL_POP_SAVED_IN_DRAFTS"));
-               /*_show_select_info(ug_data, str);*/
                int ret = status_message_post(str);
                if (ret)
                        debug_log("status_message_post failed: %d", ret);
+
+               ug_destroy_me(ugd->ug_main);
        }
 }
 
@@ -2187,6 +2353,11 @@ static void _composer_priority_gl_sel(void *data, Evas_Object *obj, void *event_
                debug_log("\n g_ugd->priority_option = %d", g_ugd->priority_option);
        }
        debug_log("\n _composer_priority_gl_sel : priority_option = %d", g_ugd->priority_option);
+
+       if (g_ugd->composer_noti) {
+               evas_object_del(g_ugd->composer_noti);
+               g_ugd->composer_noti = NULL;
+       }
 }
 
 void _composer_cbar_priority_clicked(void *data, Evas_Object *obj, void *event_info)
@@ -2494,8 +2665,10 @@ static void _composer_get_html_content_for_draft_cb(Evas_Object *o, const char *
                ugd->latest_html_content = NULL;
        }
 
-       ugd->latest_html_content = g_strdup(result);
-       debug_log("ugd->latest_html_content => %s", ugd->latest_html_content);
+       if (result != NULL) {
+               ugd->latest_html_content = g_strdup(result);
+               debug_log("ugd->latest_html_content => %s", ugd->latest_html_content);
+       }
 
        if (EINA_FALSE == ewk_view_plain_text_get(ugd->body_ewkview, _composer_plain_text_get_cb, (void *)ugd)) {
                debug_log("ewk_view_plain_text_get Failed");
@@ -2604,15 +2777,17 @@ void _composer_get_image_list_cb(Evas_Object *o, const char *result, void *data)
                eina_list_free(ugd->listOfImageUrls);
                ugd->listOfImageUrls = NULL;
        }
-       debug_log("listOFImageUrls => %s", result);
 
-       list = g_strdup(result);
+       if (result != NULL) {
+               debug_log("listOFImageUrls => %s", result);
+               list = g_strdup(result);
 
-       char *token = strtok(list, ",");
-       while (token != NULL) {
-               if (token) {
-                       ugd->listOfImageUrls = eina_list_append(ugd->listOfImageUrls, token);
-                       token = strtok(NULL, ",");
+               char *token = strtok(list, ",");
+               while (token != NULL) {
+                       if (token) {
+                               ugd->listOfImageUrls = eina_list_append(ugd->listOfImageUrls, token);
+                               token = strtok(NULL, ",");
+                       }
                }
        }
 }
index 9552033..b8d347e 100755 (executable)
@@ -16,7 +16,6 @@
 
 #include <string.h>
 #include <Ecore_X.h>
-#include <media-util-err.h>
 
 #include "email-composer.h"
 #include "email-composer-recipient.h"
@@ -27,8 +26,6 @@
 #include "email-composer-predictive-search.h"
 #include "email-composer-js.h"
 
-extern EmailComposerUGD *g_ugd;
-
 void _composer_webview_reach_top_cb(void *data, Evas_Object *obj, void *event_info);
 void _composer_webview_reach_bottom_cb(void *data, Evas_Object *obj, void *event_info);
 void _composer_webview_mouse_down_cb(void *data, Evas * evas, Evas_Object *obj, void *event_info);
@@ -222,7 +219,6 @@ Evas_Object *_composer_create_body_webview(Evas_Object *parent, char *title, Ema
        //evas_object_event_callback_add(ugd->body_webview, EVAS_CALLBACK_MOUSE_UP, _composer_webview_mouse_up_cb, ugd);
 
        Ewk_Setting *ewkSetting = NULL;
-
        ewkSetting = ewk_view_setting_get(ugd->body_ewkview);
 
        if (NULL == ewkSetting)
@@ -231,8 +227,6 @@ Evas_Object *_composer_create_body_webview(Evas_Object *parent, char *title, Ema
        ewk_setting_uses_encoding_detector_set(ewkSetting, EINA_TRUE);
 
        //ewk_view_show_ime_on_autofocus_set(ugd->body_ewkview, EINA_TRUE); // jcpark reviewing
-
-//     _composer_register_editfield_entry_callback(ugd->body_webkit, ugd);
        evas_object_smart_callback_add(ugd->body_ewkview, "load,finished", _composer_webkit_loadFinished_cb, ugd);
        evas_object_smart_callback_add(ugd->body_ewkview, "policy,navigation,decide", _composer_webview_policy_navigation_decide_cb, ugd);
        evas_object_smart_callback_add(ugd->body_ewkview, "scroll,up", _composer_webkit_scroll_up_cb, ugd);
@@ -310,8 +304,6 @@ void _composer_webkit_loadFinished_cb(void *data, Evas_Object *obj, void *event_
 {
        debug_log("");
 
-       Ewk_Setting *ewkSetting = NULL;
-
        EmailComposerUGD *ugd = (EmailComposerUGD *)data;
 
        if (ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_ENABLE_EDITABLE, _composer_script_executed_cb, 0) == EINA_FALSE)
@@ -320,6 +312,7 @@ void _composer_webkit_loadFinished_cb(void *data, Evas_Object *obj, void *event_
        if (ewk_view_script_execute(ugd->body_ewkview, COMPOSER_JS_GET_HTML_CONTENT, _composer_get_html_content_cb, (void *)ugd) == EINA_FALSE)
                debug_log("COMPOSER_JS_GET_HTML_CONTENT failed.");
 
+       Ewk_Setting *ewkSetting = NULL;
        ewkSetting = ewk_view_setting_get(ugd->body_ewkview);
 
        if (ewkSetting == NULL)
@@ -475,9 +468,10 @@ static void _composer_get_html_content_cb(Evas_Object *o, const char *result, vo
 
        EmailComposerUGD *ugd = (EmailComposerUGD *)data;
 
-       ugd->saved_html_content = g_strdup(result);
-
-       debug_log("ugd->saved_html_content => %s", ugd->saved_html_content);
+       if (result != NULL) {
+               ugd->saved_html_content = g_strdup(result);
+               debug_log("ugd->saved_html_content => %s", ugd->saved_html_content);
+       }
 }
 
 static void _composer_webkit_scroll_up_cb(void *data, Evas_Object *obj, void *event_info)
@@ -526,6 +520,10 @@ static void _composer_webview_policy_navigation_decide_cb(void *data, Evas_Objec
 
        EmailComposerUGD *ugd = (EmailComposerUGD *)data;
 
+       const char *uri = NULL;
+       uri = ewk_view_uri_get(ugd->body_ewkview);
+       debug_log("ewk_view_uri_get(%s)", uri);
+
        if (ugd->b_load_finished == EINA_TRUE) {
                Ewk_Policy_Decision *policy_decision = (Ewk_Policy_Decision *)event_info;
                ewk_policy_decision_ignore(policy_decision);
index 204c793..750d6bf 100755 (executable)
@@ -405,13 +405,13 @@ int _composer_add_mailbox_folder(EmailComposerUGD *ugd, email_mailbox_type_e mai
 
        nResult = email_add_mail(ugd->new_mail_info->mail_data, ugd->new_mail_info->attachment_list, ugd->new_mail_info->mail_data->attachment_count, NULL, 0);
        if (nResult != EMAIL_ERROR_NONE) {
-               debug_log("email_add_mail failed! %d", nResult);
+               debug_warning("email_add_mail failed! %d", nResult);
                return nResult;
        }
 
        if (email_check_file_exist(ugd->saved_html_path)) {
                if (-1 == remove(ugd->saved_html_path)) {
-                       debug_log("Failed to remove file");
+                       debug_warning("Failed to remove file");
                        return COMPOSER_ERROR_FAIL;
                }
        }
@@ -477,7 +477,7 @@ int _composer_make_mail(EmailComposerUGD *ugd)
        }
 
        ugd->new_mail_info->mail_data->report_status = EMAIL_MAIL_REPORT_NONE;
-/*
+
        if (ugd->tracking_option[0] == 1) {
                ugd->new_mail_info->mail_data->report_status |= EMAIL_MAIL_REQUEST_MDN;
        }
@@ -485,7 +485,7 @@ int _composer_make_mail(EmailComposerUGD *ugd)
                ugd->new_mail_info->mail_data->report_status |= EMAIL_MAIL_REQUEST_DSN;
        }
        debug_log("ugd->new_mail_info->mail_data->report_status = %d", ugd->new_mail_info->mail_data->report_status);
-*/
+
        ugd->new_mail_info->mail_data->priority = ugd->priority_option;
 
        ugd->new_mail_info->mail_data->server_mailbox_name = strdup(ugd->mailbox_info->mail_box->mailbox_name);
@@ -816,10 +816,8 @@ int _composer_send_mail(EmailComposerUGD *ugd)
                return COMPOSER_ERROR_SEND_FAIL;
        }
 
-       email_option_t option = (*ugd->account_info->account).options;
-
        debug_log("priority = %d", (*ugd->account_info->account).options.priority);
-       debug_log("keep a copy = %d", (*ugd->account_info->account).options.keep_local_copy);
+       debug_log("request read report = %d", (*ugd->account_info->account).options.req_read_receipt);
 
        if (ugd->composer_type == RUN_COMPOSER_EDIT) {
                /* Currently when a saved email is opened in drafts and edited before sending it then edited mail is not added to Outbox and edited email is not sent.
@@ -867,10 +865,10 @@ int _composer_send_mail(EmailComposerUGD *ugd)
                }
        }
 
-       unsigned handle = 0;
+       int handle = 0;
        int err = 0;
 
-       if ((err = email_send_mail(ugd->new_mail_info->mail_data->mail_id, &option, &handle)) != EMAIL_ERROR_NONE) {
+       if ((err = email_send_mail(ugd->new_mail_info->mail_data->mail_id, &handle)) != EMAIL_ERROR_NONE) {
                debug_log("   fail sending [%d]", err);
                return COMPOSER_ERROR_SEND_FAIL;
        } else {
@@ -968,7 +966,7 @@ void _composer_save_popup_response_cb(void *data, Evas_Object *obj, void *event_
 
                        ugd->idler_save_draft = ecore_idler_add(_composer_show_fail_to_save, ugd);
                } else {
-                       debug_log("Success save in Drafts");
+                       debug_log("Succeed in saving in Drafts");
 
                        if (ugd->composer_type == RUN_COMPOSER_EDIT) {
                                //After a new draft mail is added, the old draft mail is deleted and synced to server
@@ -1173,6 +1171,7 @@ Evas_Object *_composer_load_edj(Evas_Object *parent, const char *file, const cha
 
 Evas_Object *_composer_create_navigation_layout(Evas_Object *parent)
 {
+       debug_log("");
        Evas_Object *navi_bar;
 
        navi_bar = elm_naviframe_add(parent);
@@ -1185,6 +1184,7 @@ Evas_Object *_composer_create_navigation_layout(Evas_Object *parent)
 
 Evas_Object *_composer_create_composer_layout(Evas_Object *parent)
 {
+       debug_log("");
        Evas_Object *layout;
 
        layout = elm_layout_add(parent);
@@ -1199,6 +1199,7 @@ Evas_Object *_composer_create_composer_layout(Evas_Object *parent)
 
 Evas_Object *_composer_create_outer_layout(Evas_Object *parent)
 {
+       debug_log("");
        Evas_Object *layout/*, *bg*/;
 
        layout = elm_layout_add(parent);
@@ -1214,6 +1215,7 @@ Evas_Object *_composer_create_outer_layout(Evas_Object *parent)
 
 Evas_Object *_composer_create_main_scroller(Evas_Object *parent)
 {
+       debug_log("");
        Evas_Object *scroller;
 
        scroller = elm_scroller_add(parent);
@@ -1227,6 +1229,7 @@ Evas_Object *_composer_create_main_scroller(Evas_Object *parent)
 
 Evas_Object *_composer_create_box(Evas_Object *parent)
 {
+       debug_log("");
 
        Evas_Object *box = elm_box_add(parent);
        evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -2339,7 +2342,7 @@ void _composer_add_subject(EmailComposerUGD *ugd)
 void _composer_add_body(EmailComposerUGD *ugd)
 {
        debug_log("");
-       char *temp = NULL;
+       char *full_text = NULL;
 
        if (ugd->existing_mail_info->mail_data && ugd->existing_mail_info->mail_data->body_download_status) {
                if (ugd->composer_type == RUN_COMPOSER_EDIT) {
@@ -2359,15 +2362,16 @@ void _composer_add_body(EmailComposerUGD *ugd)
 
                                char szMetaViewportInfo[TEMP_BUFFER_SIZE + 1] = { 0x00, };
                                strncpy(szMetaViewportInfo, HTML_META_INFORMATION, TEMP_BUFFER_SIZE);
-                               char *full_text = NULL;
-                               full_text = g_strconcat(szMetaViewportInfo, html_text_for_body, NULL);
-                               debug_log("html_text_for_body: %s", html_text_for_body);
 
                                if (html_text_for_body) {
+                                       debug_log("html_text_for_body: %s", html_text_for_body);
+                                       full_text = g_strconcat(szMetaViewportInfo, html_text_for_body, NULL);
                                        email_composer_save_file(ugd->saved_html_path, full_text, STR_LEN(full_text));
                                        g_free(html_text_for_body);
                                } else {
                                        html_text_for_body = (char *)email_get_buff_from_file(DATADIR"/_email_default.html", 0);
+                                       debug_log("html_text_for_body: %s", html_text_for_body);
+                                       full_text = g_strconcat(szMetaViewportInfo, html_text_for_body, NULL);
                                        email_composer_save_file(ugd->saved_html_path, full_text, STR_LEN(full_text));
                                        g_free(html_text_for_body);
                                }
@@ -2377,10 +2381,10 @@ void _composer_add_body(EmailComposerUGD *ugd)
                }
        }
 
-       debug_log("Freed body :%s", temp);
-       if (temp) {
-               free(temp);
-               temp = NULL;
+       debug_log("full_text :%s", full_text);
+       if (full_text) {
+               free(full_text);
+               full_text = NULL;
        }
 }
 
@@ -2577,7 +2581,6 @@ void _composer_make_html_body(EmailComposerUGD *ugd)
 
        debug_log("text_for_original_info: %s", text_for_original_info);
        debug_log("html_text_for_body: %s", html_text_for_body);
-
        email_composer_save_file(ugd->saved_html_path, full_text, STR_LEN(full_text));
 
        debug_log("full text:\n%s", full_text);
@@ -2854,14 +2857,12 @@ bool _composer_check_mail_is_modified(void *data)
 
        if ((ugd->attach_initial_list && !ugd->attachment_item_obj_list) || (!ugd->attach_initial_list && ugd->attachment_item_obj_list)) {
                is_attach_modified = true;
-
        } else if (ugd->attach_initial_list && ugd->attachment_item_obj_list) {
                int nInitialListCount = eina_list_count(ugd->attach_initial_list);
                int nAttachmentCount = eina_list_count(ugd->attachment_item_obj_list);
 
                if (nInitialListCount != nAttachmentCount) {
                        is_attach_modified = true;
-
                } else {
                        int i = 0;
                        int nInitialListCount = eina_list_count(ugd->attach_initial_list);
@@ -2900,7 +2901,9 @@ bool _composer_check_mail_is_modified(void *data)
 
 FINISH_OFF:
 
-       _composer_free_initial_email_content(ugd);
+       if (is_modified) {
+               _composer_free_initial_email_content(ugd);
+       }
 
        return is_modified;
 }
@@ -3428,7 +3431,7 @@ void _composer_resize_body_webview(EmailComposerUGD *ugd, int ime_height)
 
        Evas_Coord x, y, w, h;
 
-       debug_log("ime_height %d", ime_height);
+       debug_log(" === ime_height %d", ime_height);
 
        evas_object_geometry_get(ugd->win_main, &x, &y, &w, &h);
        debug_log(" === win_main x:%d, y:%d, w:%d, h:%d", x, y, w, h);
index e0889d4..f78eab3 100755 (executable)
@@ -47,6 +47,7 @@ static void _win_profile_changed_cb(void *data, Evas_Object *obj, void *event);
 static void _composer_delete_evas_objects(EmailComposerUGD *ugd);
 static void _composer_delete_all_popup(EmailComposerUGD *ugd);
 static void _composer_free_email_info(EmailComposerUGD *ugd);
+static Eina_Bool _composer_launch_email_app_cb(void *data);
 static void _composer_popup_warning(EmailComposerUGD *ugd, char *header, char *content);
 static void _composer_ug_destroy_cb(void *data, Evas_Object *obj, void *event_info);
 
@@ -217,6 +218,16 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode, service_h data, void *
                                return ugd->main_layout;
                        }
 
+                       if (ugd->account_info->account != NULL) {
+                               if (ugd->account_info->account) {
+                                       email_option_t option;
+                                       memcpy(&option, &(ugd->account_info->account->options), sizeof(email_option_t));
+                                       debug_log("read report : [%d], delivery report : [%d]", option.req_read_receipt, option.req_delivery_receipt);
+                                       ugd->tracking_option[0] = option.req_read_receipt;
+                                       ugd->tracking_option[1] = option.req_delivery_receipt;
+                               }
+                       }
+
                        ugd->account_info->account_type = ugd->account_info->account->incoming_server_type;
                        ugd->account_info->account_name = _composer_get_email_addr_from_account_id(ugd, ugd->account_info->account_id);
                }
@@ -266,6 +277,8 @@ static void on_start(ui_gadget_h ug, service_h data, void *priv)
                        case COMPOSER_ERROR_NO_ACCOUNT:
                                debug_log("Failed to get default account");
                                _composer_popup_warning(ugd, dgettext("sys_string", "IDS_COM_POP_WARNING"), _("IDS_EMAIL_POP_THERE_IS_NO_ACCOUNT_CREATE_A_NEW_ACCOUNT_FIRST"));
+                               if (!ugd->launch_timer)
+                                       ugd->launch_timer = ecore_timer_add(2.0f, _composer_launch_email_app_cb, ugd);
                                elm_object_style_set(ugd->bg, "transparent");
                                break;
 
@@ -805,11 +818,11 @@ void create_composer_frame(EmailComposerUGD *ugd)
        if (ugd->composer_type == RUN_COMPOSER_REPLY || ugd->composer_type == RUN_COMPOSER_REPLY_ALL)
                snprintf(title_str, sizeof(title_str), "%s", _("IDS_EMAIL_HEADER_REPLY_ABB"));
        else if (ugd->composer_type == RUN_COMPOSER_FORWARD)
-               snprintf(title_str, sizeof(title_str), "%s", N_("Forward"));
+               snprintf(title_str, sizeof(title_str), "%s", _("IDS_EMAIL_OPT_FORWARD"));
        else if (ugd->composer_type == RUN_COMPOSER_EDIT)
                snprintf(title_str, sizeof(title_str), "%s", dgettext("sys_string", "IDS_COM_HEADER_EDIT"));
        else
-               snprintf(title_str, sizeof(title_str), "%s", N_("New email"));
+               snprintf(title_str, sizeof(title_str), "%s", _("IDS_EMAIL_BODY_NEW_EMAIL"));
        ugd->navi_item = elm_naviframe_item_push(ugd->navi_bar, title_str, NULL, NULL, outer_layout, "2line");
 
        // Right : cancel button
@@ -865,6 +878,7 @@ void create_composer_frame(EmailComposerUGD *ugd)
        elm_object_item_part_content_set(ugd->navi_item, "optionheader", ugd->cbar);
        elm_object_item_part_content_set(ugd->navi_item, "optionheader2", ugd->cbar2);
        elm_object_item_signal_emit(ugd->navi_item, "elm,state,optionheader,close", "");
+       elm_object_item_signal_emit(ugd->navi_item, "elm,state,optionheader,close", "");
 
        _composer_register_scroller_callback(ugd);
 
@@ -914,6 +928,7 @@ static void _composer_init_data(void *data)
        ugd->bringin_timer = NULL;
        ugd->mbe_unfocus_timer = NULL;
        ugd->focus_timer = NULL;
+       ugd->launch_timer = NULL;
        ugd->ps_timer = NULL;
        ugd->sc_timer = NULL;
 
@@ -1105,6 +1120,12 @@ static void _composer_delete_evas_objects(EmailComposerUGD *ugd)
                ugd->send_timer = NULL;
        }
 
+       if (ugd->launch_timer) {
+               debug_log("delete launch_timer");
+               ecore_timer_del(ugd->launch_timer);
+               ugd->launch_timer = NULL;
+       }
+
        _composer_delete_all_popup(ugd);
 
        if (ugd->ps_list) {
@@ -1237,6 +1258,41 @@ static void _composer_free_email_info(EmailComposerUGD *ugd)
        }
 }
 
+static Eina_Bool _composer_launch_email_app_cb(void *data)
+{
+       debug_log("");
+
+       EmailComposerUGD *ugd = (EmailComposerUGD *)data;
+
+       int ret;
+       service_h service = NULL;
+       ret = service_create(&service);
+       debug_log("service_create: %d", ret);
+       if (!service) {
+               debug_log("service create failed");
+       }
+       ret = service_add_extra_data(service, EMAIL_BUNDLE_KEY_RUN_TYPE, "9");
+       debug_log("service_add_extra_data: %d", ret);
+       ret = service_set_package(service, PKGNAME);
+       debug_log("service_set_package: %d", ret);
+       ret = service_send_launch_request(service, NULL, NULL);
+       debug_log("service_send_launch_request: %d", ret);
+       ret = service_destroy(service);
+       debug_log("service_destroy: %d", ret);
+
+       if (ugd->launch_timer) {
+               debug_log("delete launch_timer");
+               ecore_timer_del(ugd->launch_timer);
+               ugd->launch_timer = NULL;
+       }
+       /*if (ugd->idler_resize_body) {
+               ecore_idler_del(ugd->idler_resize_body);
+               ugd->idler_resize_body = NULL;
+       }*/
+
+       return ECORE_CALLBACK_CANCEL;
+}
+
 static void _composer_popup_warning(EmailComposerUGD *ugd, char *header, char *content)
 {
        debug_log("");
@@ -1466,11 +1522,9 @@ static int _composer_pre_parse_bundle(EmailComposerUGD *ugd, service_h data)
                case RUN_COMPOSER_FORWARD:
                        if (argv[1])
                                ugd->account_info->account_id = atoi(argv[1]);
-                       debug_log("");
 
                        if (argv[2])
                                ugd->mailbox_info->mailbox_id = atoi(argv[2]);
-                       debug_log("");
 
                        if (argv[3])
                                ugd->nExistingMailID = atoi(argv[3]);
index 8917ff3..a97602f 100755 (executable)
                } \
        }
 
+#define PART_SWALLOW_RECT_BAR(pName, pTo, pRx1, pRy1, pRx2, pRy2)\
+       part{\
+               name: pName;\
+               type: SWALLOW;\
+               mouse_events: 0; \
+               scale: 1;\
+               description{\
+                       state: "default" 0.0;\
+                       rel1 { relative: pRx1 pRy1; to: pTo;}\
+                       rel2 { relative: pRx2 pRy2; to: pTo;}\
+               }\
+       }
+
 #define PART_TEXT(pName, pTo, pString, pFont, pClass, pSize, pAx, pAy, pCr, pCg, pCb, pCa) \
        part { \
                name: pName; \
index b7ac5dc..1312444 100755 (executable)
@@ -379,8 +379,22 @@ static int app_reset(service_h b, void *data)
                Evas_Object *popup = elm_popup_add(ad->win_main);
                evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
                elm_popup_timeout_set(popup, 2.0);
-               elm_object_part_text_set(popup, "title,text", dgettext("sys_string", "IDS_COM_POP_WARNING"));
-               elm_object_text_set(popup, _("IDS_EMAIL_POP_FAILED_TO_START_EMAIL_APPLICATION"));
+               elm_object_part_text_set(popup, "title,text", dgettext("sys_string", "IDS_COM_POP_INITIALIZING"));
+
+               Evas_Object *progress = elm_progressbar_add(popup);
+               elm_object_style_set(progress, "list_process");
+               elm_progressbar_pulse_set(progress, EINA_TRUE);
+               elm_progressbar_pulse(progress, EINA_TRUE);
+               evas_object_show(progress);
+
+               elm_object_content_set(popup, progress);
+
+               /*Evas_Object *btn1 = elm_button_add(popup);
+               elm_object_style_set(btn1, "popup_button/default");
+               elm_object_text_set(btn1, dgettext("sys_string", "IDS_COM_SK_OK"));
+               elm_object_part_content_set(popup, "button1", btn1);
+               evas_object_smart_callback_add(btn1, "clicked", popup_block_clicked_cb, NULL);*/
+
                evas_object_smart_callback_add(popup, "block,clicked", popup_block_clicked_cb, NULL);
                evas_object_smart_callback_add(popup, "timeout", popup_response_cb, NULL);
                evas_object_show(popup);
index de6b603..e0bf92a 100755 (executable)
@@ -1,6 +1,6 @@
 %define _optdir /opt
 %define _appdir %{_optdir}/apps
-%define _ugdir %{_optdir}/ug
+%define _ugdir %{_optdir}/ug
 %define _libdir %{_appdir}/org.tizen.email/lib
 
 Name:       org.tizen.email
@@ -36,10 +36,6 @@ BuildRequires:  pkgconfig(capi-appfw-application)
 BuildRequires:  pkgconfig(capi-base-common)
 BuildRequires:  pkgconfig(contacts-service)
 BuildRequires:  pkgconfig(ethumb)
-BuildRequires:  pkgconfig(mm-fileinfo)
-BuildRequires:  pkgconfig(mmutil-jpeg)
-BuildRequires:  pkgconfig(mmutil-imgp)
-BuildRequires:  pkgconfig(libmedia-service)
 BuildRequires:  pkgconfig(libmedia-utils)
 BuildRequires:  pkgconfig(calendar)
 BuildRequires:  pkgconfig(drm-client)
@@ -103,20 +99,6 @@ rm -rf %{buildroot}
 /usr/bin/vconftool set -t string file/private/org.tizen.email/hotmail_receiving_address "pop3.live.com" -g 6514
 /usr/bin/vconftool set -t int    file/private/org.tizen.email/hotmail_receiving_port    "995" -g 6514
 /usr/bin/vconftool set -t int    file/private/org.tizen.email/hotmail_receiving_ssl     "1" -g 6514
-/usr/bin/vconftool set -t string file/private/org.tizen.email/samsung_pop3_sending_address   "165.213.73.235" -g 6514
-/usr/bin/vconftool set -t int    file/private/org.tizen.email/samsung_pop3_sending_port      "465" -g 6514
-/usr/bin/vconftool set -t int    file/private/org.tizen.email/samsung_pop3_sending_ssl       "1" -g 6514
-/usr/bin/vconftool set -t int    file/private/org.tizen.email/samsung_pop3_receiving_type    "1" -g 6514
-/usr/bin/vconftool set -t string file/private/org.tizen.email/samsung_pop3_receiving_address "165.213.73.235" -g 6514
-/usr/bin/vconftool set -t int    file/private/org.tizen.email/samsung_pop3_receiving_port    "995" -g 6514
-/usr/bin/vconftool set -t int    file/private/org.tizen.email/samsung_pop3_receiving_ssl     "1" -g 6514
-/usr/bin/vconftool set -t string file/private/org.tizen.email/samsung_imap4_sending_address   "165.213.73.235" -g 6514
-/usr/bin/vconftool set -t int    file/private/org.tizen.email/samsung_imap4_sending_port      "465" -g 6514
-/usr/bin/vconftool set -t int    file/private/org.tizen.email/samsung_imap4_sending_ssl       "1" -g 6514
-/usr/bin/vconftool set -t int    file/private/org.tizen.email/samsung_imap4_receiving_type    "2" -g 6514
-/usr/bin/vconftool set -t string file/private/org.tizen.email/samsung_imap4_receiving_address "165.213.73.235" -g 6514
-/usr/bin/vconftool set -t int    file/private/org.tizen.email/samsung_imap4_receiving_port    "993" -g 6514
-/usr/bin/vconftool set -t int    file/private/org.tizen.email/samsung_imap4_receiving_ssl     "1" -g 6514
 
 chown -R 5000:5000 /opt/apps/org.tizen.email/data
 
@@ -146,5 +128,4 @@ ln -sf /usr/bin/ug-client /opt/ug/bin/email-composer-efl
 %{_appdir}/org.tizen.email/bin/email
 %{_appdir}/org.tizen.email/data/_email_default.html
 %{_optdir}/share/packages/org.tizen.email.xml
-%{_optdir}/share/packages/ug-email-composer-efl.xml
 %{_optdir}/share/icons/default/small/org.tizen.email.png
index 021818c..175f92b 100755 (executable)
@@ -21,7 +21,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common/include)
 INCLUDE(FindPkgConfig)
 pkg_check_modules(pkgs-viewer REQUIRED appcore-efl ui-gadget-1 x11 elementary ecore glib-2.0 gobject-2.0
                status capi-media-metadata-extractor capi-media-image-util
-               email-service edbus capi-appfw-application vconf ewebkit2 contacts-service sysman bundle dlog efreet-mime mm-fileinfo mmutil-jpeg libmedia-utils calendar ethumb)
+               email-service edbus capi-appfw-application vconf ewebkit2 contacts-service sysman bundle dlog efreet-mime libmedia-utils calendar ethumb)
 
 FOREACH(flag ${pkgs-viewer_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
index 0638294..c105f05 100755 (executable)
@@ -31,7 +31,6 @@ struct _EmailViewerPrivate {
        int mailbox_id;
        int mail_id;
        int account_id;
-       unsigned int download_id;
        gboolean download_mail;
        gboolean multi_body;
        gboolean b_att_open;
@@ -41,11 +40,8 @@ struct _EmailViewerPrivate {
        char *att_file_id;
        int file_size;
        int attachment_id;
-       unsigned int view_creation_id;
-       unsigned int download_progress_id;
-       unsigned int download_fail_id;
-       unsigned int email_handle;
-       unsigned int download_all_email_handle[ATTACH_MAX];
+       int email_handle;
+       int download_all_email_handle[ATTACH_MAX];
        unsigned int download_all_cnt;
        unsigned int download_all_fail_cnt;
        email_mail_data_t *mail_info;
@@ -60,8 +56,8 @@ struct _EmailViewerProp {
        int account_id;
        int mail_id;
        int status;
-       int status2;
-       int priority;
+       email_mail_status_t status2;
+       email_mail_priority_t priority;
        int att_len;
        int real_att_len;
 
@@ -76,8 +72,6 @@ struct _EmailViewerProp {
        char *cc_contact_name;
        char *bcc_contact_name;
 
-       unsigned int date;
-       unsigned int time;
        time_t mktime;
 
        char *subject;
index 84ed1b9..1f57305 100755 (executable)
@@ -222,14 +222,6 @@ struct ug_data {
        int webview_margin;
        int webview_margin_landscape;
 
-       /* for cut link */
-       Ecore_Timer *cutlink_timer;
-       Eina_Bool last_click_have_link;
-       Eina_Bool last_click_have_image;
-       char *last_click_link_url;
-       char *last_click_link_text;
-       char *last_click_img_url;
-
        /* rotation */
        int isRotate;
 
@@ -305,10 +297,10 @@ struct ug_data {
        Elm_Object_Item *more_ctr_it;
 
        Elm_Object_Item *more_ctx_block_item;
+       Elm_Object_Item *ctx_block_item;
 
        Elm_Object_Item *navi_main_it;
        Elm_Object_Item *navi_move_it1;
-       Elm_Object_Item *navi_move_it2;
 
        E_DBus_Connection *edbus_conn;
        EmailViewerWebview *webview_data;
@@ -317,8 +309,6 @@ struct ug_data {
 
        Evas_Object *gl;
        Elm_Genlist_Item_Class itc1;
-       Elm_Genlist_Item_Class itc2;
-       Elm_Genlist_Item_Class itc3;
 
        GList *from_list;
        GList *to_list;
@@ -332,6 +322,7 @@ struct ug_data {
 
        Ecore_Idler *idler;
        Ecore_Timer *timer;
+       Ecore_Timer *waiting_timer;
 };
 
 void _hide_view(EmailViewerUGD *ug_data);
index 5d18639..8cf0456 100755 (executable)
@@ -21,9 +21,8 @@
 #include <time.h>
 #include <errno.h>
 #include <Ethumb.h>
-#include <mm_file.h>
-#include <mm_util_jpeg.h>
-#include <mm_error.h>
+#include <metadata_extractor.h>
+#include <image_util.h>
 #include <Efreet_Mime.h>
 #include <status.h>
 
@@ -60,7 +59,6 @@ static struct _mtd mtd_main[] = {
        {"Video", "video/3gpp", IMGDIR "/U01_icon_video.png", "video-player", NULL, TRUE, FALSE, TRUE},
        {"Video", "video/x-ms-asf", IMGDIR "/U01_icon_video.png", "video-player", NULL, TRUE, FALSE, TRUE},
        {"Video", "video/x-ms-wmv", IMGDIR "/U01_icon_video.png", "video-player", NULL, TRUE, FALSE, TRUE},
-       {"Image", "image/svg+xml", MYFILE_IMGE_PATH "/myfile_icon_svg.png", "svg-viewer", NULL, TRUE, FALSE, FALSE},
        {"PDF", "application/pdf", IMGDIR "/U01_icon_pdf.png", "documents", NULL, TRUE, FALSE, FALSE},
        {"Doc", "application/msword", IMGDIR "/U01_icon_word.png", "documents", NULL, TRUE, FALSE, FALSE},
        {"Doc", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", IMGDIR "/U01_icon_word.png", "documents", NULL, TRUE, FALSE, FALSE},
@@ -75,7 +73,6 @@ static struct _mtd mtd_main[] = {
        {"Java", "text/vnd.sun.j2me.app-descriptor", MYFILE_IMGE_PATH "/myfile_icon_java.png", NULL, NULL, FALSE, FALSE, FALSE},
        {"Java", "application/x-java-archive", MYFILE_IMGE_PATH "/myfile_icon_java.png", NULL, NULL, FALSE, FALSE, FALSE},
        {"SVG", "image/svg+xml", MYFILE_IMGE_PATH "/myfile_icon_svg.png", "svg-viewer", NULL, TRUE, FALSE, FALSE},
-       {"ETC", "etc", MYFILE_IMGE_PATH "/myfile_icon_etc.png", NULL, NULL, TRUE, FALSE, FALSE},
        {"VCARD", "text/directory", MYFILE_IMGE_PATH "/myfile_icon_etc.png", NULL, NULL, FALSE, FALSE, FALSE},
        {"VCALENDAR", "text/calendar", MYFILE_IMGE_PATH "/myfile_icon_etc.png", NULL, NULL, FALSE, FALSE, FALSE},
        {NULL, NULL, NULL, NULL}
@@ -168,110 +165,129 @@ Evas_Object *viewer_make_thumbnail(char *path, Evas_Object *parent)
 
                        ethumb_free(e);
                } else if (strncmp(mime_type, "video", 5) == 0) {
-                       int ret = 0;
-                       int video_track_num = 0;
+                       metadata_extractor_h metadata = NULL;
+                       int ret = METADATA_EXTRACTOR_ERROR_NONE;
+                       char *video_width = NULL;
+                       char *video_height = NULL;
+                       char *video_track_cnt = NULL;
+                       void *video_thumbnail = NULL;
+                       int video_thumbnail_len = 0;
                        int video_w = 0;
                        int video_h = 0;
-                       int thumb_len = 0;
-                       void *stream = NULL;
-                       MMHandleType content_attrs = 0;
-
-                       ret = mm_file_create_content_attrs(&content_attrs, path);
-
-                       if (ret == MM_ERROR_NONE && content_attrs) {
-                               mm_file_get_attrs(content_attrs, NULL,
-                                                               MM_FILE_CONTENT_VIDEO_TRACK_COUNT,
-                                                               &video_track_num, NULL);
-
-                               if (video_track_num) {
-                                       mm_file_get_attrs(content_attrs, NULL,
-                                                                       MM_FILE_CONTENT_VIDEO_WIDTH, &video_w,
-                                                                       MM_FILE_CONTENT_VIDEO_HEIGHT, &video_h,
-                                                                       MM_FILE_CONTENT_VIDEO_THUMBNAIL, &stream,
-                                                                       &thumb_len, NULL);
-
-                                       if (stream) {
-                                               int mm_ret = 0;
-                                               char filename[1024] = { 0, };
-                                               char *file_name = NULL;
-                                               char *file_ext = NULL;
-
-                                               email_parse_get_filename_n_ext_from_path(path, &file_name, &file_ext);
-                                               snprintf(filename, sizeof(filename), "%s%s%s%s", DATADIR"/", file_name, file_ext, ".jpg");
-                                               g_free(file_name);
-                                               g_free(file_ext);
-
-                                               mm_ret = mm_util_jpeg_encode_to_file(filename, stream,
-                                                                                                                       video_w, video_h,
-                                                                                                                       MM_UTIL_JPEG_FMT_RGB888, 70);
-
-                                               if (ecore_file_exists(filename)) {
-                                                       snprintf(thumb_path, sizeof(thumb_path), "%s", filename);
-                                                       debug_log("file : %s, thumb_path : %s", path, thumb_path);
-                                               }
-                                       }
-                               }
 
-                               mm_file_destroy_content_attrs(content_attrs);
-                       } else {
-                               debug_log("fail to mm_file_create_content_attrs - error(%x)", ret);
+                       ret = metadata_extractor_create(&metadata);
+                       debug_log("metadata_extractor_create: %d", ret);
+                       if (!metadata) {
+                               debug_log("metadata extractor create failed");
+                               return NULL;
                        }
-               } else if (strncmp(mime_type, "audio", 5) == 0) {
-                       int tag_ret = 0;
-                       MMHandleType tag_attrs = 0;
 
-                       tag_ret = mm_file_create_tag_attrs(&tag_attrs, path);
+                       ret = metadata_extractor_set_path(metadata, path);
+                       debug_log("metadata_extractor_set_path: %d", ret);
+
+                       ret = metadata_extractor_get_metadata(metadata, METADATA_VIDEO_WIDTH, &video_width);
+                       debug_log("metadata_extractor_get_metadata: %d [video_width:%s]", ret, video_width);
+                       ret = metadata_extractor_get_metadata(metadata, METADATA_VIDEO_HEIGHT, &video_height);
+                       debug_log("metadata_extractor_get_metadata: %d [video_height:%s]", ret, video_height);
+                       ret = metadata_extractor_get_metadata(metadata, METADATA_HAS_VIDEO, &video_track_cnt);
+                       debug_log("metadata_extractor_get_metadata: %d [video_track_cnt:%s]", ret, video_track_cnt);
+
+                       ret = metadata_extractor_get_frame(metadata, &video_thumbnail, &video_thumbnail_len);
+                       debug_log("metadata_extractor_get_frame: %d (video_thumbnail_len:%d)", ret, video_thumbnail_len);
+
+                       if (video_thumbnail) {
+                               int mm_ret = 0;
+                               char filename[1024] = { 0, };
+                               char *file_name = NULL;
+                               char *file_ext = NULL;
+
+                               email_parse_get_filename_n_ext_from_path(path, &file_name, &file_ext);
+                               snprintf(filename, sizeof(filename), "%s%s%s%s", DATADIR"/", file_name, file_ext, ".jpg");
+                               g_free(file_name);
+                               g_free(file_ext);
+
+                               if (video_width)
+                                       video_w = atoi(video_width);
+                               if (video_height)
+                                       video_h = atoi(video_height);
+                               mm_ret = image_util_encode_jpeg(video_thumbnail,
+                                                                                                       video_w, video_h,
+                                                                                                       IMAGE_UTIL_COLORSPACE_RGB888, 70, filename);
+
+                               if (ecore_file_exists(filename)) {
+                                       snprintf(thumb_path, sizeof(thumb_path), "%s", filename);
+                                       debug_log("file : %s, thumb_path : %s", path, thumb_path);
+                               }
+                               g_free(video_thumbnail);
+                       }
 
-                       if (tag_ret == MM_ERROR_NONE && tag_attrs) {
-                               char *error = NULL;
-                               char *art_name = NULL;
-                               int art_len = 0;
-                               int art_size = 0;
+                       if (video_width)
+                               g_free(video_width);
+                       if (video_height)
+                               g_free(video_height);
+                       if (video_track_cnt)
+                               g_free(video_track_cnt);
 
-                               tag_ret = mm_file_get_attrs(tag_attrs, &error,
-                                                                                       MM_FILE_TAG_ARTWORK, &art_name, &art_len,
-                                                                                       MM_FILE_TAG_ARTWORK_SIZE, &art_size, NULL);
+                       ret = metadata_extractor_destroy(metadata);
+                       debug_log("metadata_extractor_destroy: %d", ret);
+               } else if (strncmp(mime_type, "audio", 5) == 0) {
+                       metadata_extractor_h metadata = NULL;
+                       int ret = METADATA_EXTRACTOR_ERROR_NONE;
+                       void *artwork = NULL;
+                       int artwork_size = 0;
+                       char *artwork_mime = NULL;
+
+                       ret = metadata_extractor_create(&metadata);
+                       debug_log("metadata_extractor_create: %d", ret);
+                       if (!metadata) {
+                               debug_log("metadata extractor create failed");
+                               return NULL;
+                       }
 
-                               if (tag_ret != MM_ERROR_NONE) {
-                                       if (error) {
-                                               debug_log("fail to mm_file_get_attrs() - ret(%x), error(%s)", tag_ret, error);
-                                               free(error);
-                                       } else {
-                                               debug_log("fail to mm_file_get_attrs() - ret(%x)", tag_ret);
-                                       }
-                               }
+                       ret = metadata_extractor_set_path(metadata, path);
+                       debug_log("metadata_extractor_set_path: %d", ret);
+
+                       ret = metadata_extractor_get_artwork(metadata, &artwork, &artwork_size, &artwork_mime);
+                       debug_log("metadata_extractor_get_artwork: %d", ret);
+                       debug_log("artwork_mime: %s, artwork_size: %d", artwork_mime, artwork_size);
 
-                               if (art_name) {
-                                       gchar *mm_path = NULL;
-                                       int fd = g_file_open_tmp(NULL, &mm_path, NULL);
+                       if (artwork) {
+                               gchar *mm_path = NULL;
+                               int fd = g_file_open_tmp(NULL, &mm_path, NULL);
 
-                                       if (fd != -1) {
-                                               FILE *fp = fdopen(fd, "w");
-                                               if (fp == NULL) {
-                                                       debug_log("fail to fdopen()");
+                               if (fd != -1) {
+                                       FILE *fp = fdopen(fd, "w");
+                                       if (fp == NULL) {
+                                               debug_log("fail to fdopen()");
+                                               close(fd);
+                                       } else {
+                                               int n = fwrite((unsigned char *)artwork, sizeof(char), artwork_size, fp);
+                                               if (n != artwork_size) {
+                                                       debug_log("fail to fwrite()");
+                                                       fclose(fp);
                                                        close(fd);
                                                } else {
-                                                       int n = fwrite((unsigned char *)art_name, sizeof(char), art_size, fp);
-                                                       if (n != art_size) {
-                                                               debug_log("fail to fwrite()");
-                                                               fclose(fp);
-                                                               close(fd);
-                                                       } else {
-                                                               fflush(fp);
-                                                               fclose(fp);
-                                                               close(fd);
-                                                       }
+                                                       fflush(fp);
+                                                       fclose(fp);
+                                                       close(fd);
                                                }
                                        }
-
-                                       snprintf(thumb_path, sizeof(thumb_path), "%s", mm_path);
-                                       debug_log("file : %s, albumart_path : %s", path, thumb_path);
-                                       if (mm_path)
-                                               g_free(mm_path);
                                }
+
+                               snprintf(thumb_path, sizeof(thumb_path), "%s", mm_path);
+                               debug_log("file : %s, album art_path : %s", path, thumb_path);
+
+                               if (mm_path)
+                                       g_free(mm_path);
+
+                               g_free(artwork);
                        }
 
-                       mm_file_destroy_tag_attrs(tag_attrs);
+                       if (artwork_mime)
+                               g_free(artwork_mime);
+
+                       ret = metadata_extractor_destroy(metadata);
+                       debug_log("metadata_extractor_destroy: %d", ret);
                }
 
                if (strlen(thumb_path) > 0) {
index cc9bd2d..64735d9 100755 (executable)
@@ -48,8 +48,8 @@ Evas_Object *viewer_get_webview(EmailViewerUGD *ug_data, gboolean has_html)
 
        Ewk_Setting *setting = ewk_view_setting_get(ewk_view);
 
-       ewk_setting_auto_fitting_set(setting, EINA_FALSE);
-       ewk_setting_enable_text_zoom_set(setting, EINA_TRUE);
+       ewk_setting_auto_fitting_set(setting, EINA_TRUE);
+       ewk_setting_enable_text_zoom_set(setting, EINA_FALSE);
 
        if (ewk_setting_load_remote_images_set(setting, ug_data->b_show_remote_images) == EINA_FALSE) {
                debug_log("SET remote images is FAILED!");
@@ -125,7 +125,7 @@ void viewer_set_webview_content(EmailViewerUGD *ug_data, int reload)
                /* generate temporary html file for viewing */
                tmp_file_name = viewer_set_html_content_file(wvd);
 
-               sprintf(tmp_file_path, "file://%s", tmp_file_name);
+               snprintf(tmp_file_path, sizeof(tmp_file_path), "file://%s", tmp_file_name);
                debug_log("file://%s", tmp_file_name);
        }
 
@@ -232,6 +232,25 @@ static void _webview_get_html_content_cb(Evas_Object *o, const char *result, voi
 //     debug_log("ug_data->saved_html_content => %s", ug_data->saved_html_content);
 }
 
+static Eina_Bool _loading_prog_finish_cb(void *data)
+{
+       debug_log("");
+
+       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+
+       if (ug_data->timeout_popup) {
+               evas_object_del(ug_data->timeout_popup);
+               ug_data->timeout_popup = NULL;
+       }
+
+       if (ug_data->waiting_timer) {
+               ecore_timer_del(ug_data->waiting_timer);
+               ug_data->waiting_timer = NULL;
+       }
+
+       return EINA_FALSE;
+}
+
 static void _webview_load_finished_cb(void *data, Evas_Object *obj, void *event_info)
 {
        debug_log("");
@@ -250,11 +269,51 @@ static void _webview_load_finished_cb(void *data, Evas_Object *obj, void *event_
                ecore_timer_del(ug_data->timer);
                ug_data->timer = NULL;
        }
-
        ug_data->timer = ecore_timer_add(0.0, viewer_send_message, ug_data);
 
        if (ewk_view_script_execute(ug_data->webview, VIEWER_JS_INSERT_IM(VIEWER_JS_FILE_PATH), _webview_script_executed_cb, 0) == EINA_FALSE)
                debug_log("VIEWER_JS_INSERT_IM(VIEWER_JS_FILE_PATH) failed.");
+
+       double scale, t_scale, ratio, mins, maxs;
+       int w, h;
+       scale = ewk_view_scale_get(ug_data->webview);
+       debug_log("scale is %f", scale);
+
+       t_scale = ewk_view_text_zoom_get(ug_data->webview);
+       debug_log("t_scale is %f", t_scale);
+
+       ewk_view_text_zoom_set(ug_data->webview, 2.3f/scale);
+
+       ewk_view_contents_size_get(ug_data->webview, &w, &h);
+       debug_log("contents width : %d, heigth : %d", w, h);
+
+       ewk_view_scroll_size_get(ug_data->webview, &w, &h);
+       debug_log("scroll width : %d, heigth : %d", w, h);
+
+       ewk_view_scroll_pos_get(ug_data->webview, &w, &h);
+       debug_log("scroll x : %d, y : %d", w, h);
+
+       ratio = ewk_view_device_pixel_ratio_get(ug_data->webview);
+       debug_log("ratio is %f", ratio);
+
+       ewk_view_scale_range_get(ug_data->webview, &mins, &maxs);
+       debug_log("mins : %f , maxs : %f", mins, maxs);
+
+
+       debug_log("flags_seen_field:%d, request_report:%d, report_status:%d", ug_data->email_data->mail_info->flags_seen_field, ug_data->property->request_report, ug_data->email_data->mail_info->report_status & EMAIL_MAIL_REQUEST_MDN);
+       if (!ug_data->email_data->mail_info->flags_seen_field && ug_data->property->request_report == TRUE && (ug_data->email_data->mail_info->report_status & EMAIL_MAIL_REQUEST_MDN)) {
+               int send_result = _send_read_report_mail(ug_data);
+               debug_log("send_result (%d)", send_result);
+               if (send_result != 1) {
+                       debug_log("Failed to send read report mail (%s)", send_result);
+               }
+       }
+
+       if (ug_data->waiting_timer) {
+               ecore_timer_del(ug_data->waiting_timer);
+               ug_data->waiting_timer = NULL;
+       }
+       ug_data->waiting_timer = ecore_timer_add(0.5, _loading_prog_finish_cb, ug_data);
 }
 
 static void _webview_load_error_cb(void *data, Evas_Object *obj, void *event_info)
@@ -327,40 +386,22 @@ static int _send_read_report_mail(EmailViewerUGD *ug_data)
 
        int err = 0;
 
-       email_account_t *account = NULL;
-       email_option_t option;
-       if (!email_engine_get_account_full_data(ug_data->account_id, &account)) {
-               debug_log("Failed email_engine_get_account_full_data");
-               goto error;
-       }
-
-       if (account) {
-               memcpy(&option, &(account->options), sizeof(email_option_t));
-       }
-
        int output_receipt_mail_id = 0;
        if ((err = email_add_read_receipt(ug_data->email_data->mail_id, &output_receipt_mail_id)) != EMAIL_ERROR_NONE) {
                debug_log("   fail sending [%d]", err);
-               goto error;
+               return 0;
        }
        debug_log("output_receipt_mail_id of saved email = %d", output_receipt_mail_id);
 
-       unsigned handle = 0;
+       int handle = 0;
 
-       if ((err = email_send_mail(output_receipt_mail_id, &option, &handle)) != EMAIL_ERROR_NONE) {
+       if ((err = email_send_mail(output_receipt_mail_id, &handle)) != EMAIL_ERROR_NONE) {
                debug_log("   fail sending [%d]", err);
-               goto error;
+               return 0;
        } else {
                debug_log("   finish sending");
        }
 
- error:
-       if (account) {
-               debug_log("[_send_read_report_mail] email_free_account is called");
-               email_free_account(&account, 1);
-               account = NULL;
-       }
-
        return 1;
 }
 
index 36315b2..73ff494 100755 (executable)
@@ -22,7 +22,6 @@
 #include <contacts-ug.h>
 #include <calendar-svc-provider.h>
 #include <media-util-register.h>
-#include <media-util-err.h>
 #include <app_service.h>
 #include <status.h>
 
@@ -114,6 +113,8 @@ static void _attachment_bg_set_cb(void *data, Evas * evas, Evas_Object *obj, voi
 static void _attachment_bg_unset_cb(void *data, Evas * evas, Evas_Object *obj, void *event_info);
 static void _mark_as_unread_cb(void *data, Evas_Object *obj, void *event_info);
 static void _mark_as_read_cb(void *data, Evas_Object *obj, void *event_info);
+static void _save_email_cb(void *data, Evas_Object *obj, void *event_info);
+static Eina_Bool _save_email_prog_cb(void *data);
 
 static void _ctxpopup_detail_contact_cb(void *data, Evas_Object *obj, void *event_info);
 static void _ctxpopup_send_email_cb(void *data, Evas_Object *obj, void *event_info);
@@ -133,6 +134,8 @@ static void _outter_scroller_bottom_hit_cb(void *data, Evas_Object *obj, void *e
 static void _outter_scroller_top_hit_cb(void *data, Evas_Object *obj, void *event_info);
 static void _outter_scroller_scroll_cb(void *data, Evas_Object *obj, void *event_info);
 
+static void _mbe_focused_cb(void *data, Evas_Object *obj, void *event_info);
+static void _mbe_unfocused_cb(void *data, Evas_Object *obj, void *event_info);
 static void _mbe_added_cb(void *data, Evas_Object *obj, void *event_info);
 static void _mbe_selected_cb(void *data, Evas_Object *obj, void *event_info);
 static void _destroy_down_progress_cb(void *data, Evas_Object *obj, void *event_info);
@@ -166,13 +169,8 @@ static Eina_Bool _gl_state_get(void *data, Evas_Object *obj, const char *part);
 static void _gl_del(void *data, Evas_Object *obj);
 static char *_gl_text_get(void *data, Evas_Object *obj, const char *part);
 static Evas_Object *_gl_content_get(void *data, Evas_Object *obj, const char *part);
-static void _gl_sel(void *data, Evas_Object *obj, void *event_info);
-static char *_gl_sub_upper_text_get(void *data, Evas_Object *obj, const char *part);
-static Evas_Object *_gl_sub_upper_icon_get(void *data, Evas_Object *obj, const char *part);
-static void _gl_sub_upper_sel(void *data, Evas_Object *obj, void *event_info);
 static void _move_here_cb(void *data, Evas_Object *obj, void *event_info);
 static void _move_back_cb(void *data, Evas_Object *obj, void *event_info);
-static void _move_back_cb2(void *data, Evas_Object *obj, void *event_info);
 
 
 UG_MODULE_API int UG_MODULE_INIT(struct ug_module_ops *ops)
@@ -373,7 +371,7 @@ static void *on_create(ui_gadget_h ug, enum ug_mode mode, service_h data, void *
                ug_data->webview_margin_landscape = 379;
        } else if (w == 720) {
                ug_data->webview_width = 710.0;
-               ug_data->webview_height = 1009.0;
+               ug_data->webview_height = 1021.0;
                ug_data->webview_width_landscape = 710.0;
                ug_data->webview_height_landscape = 558.0;
                ug_data->webview_margin = 1029;
@@ -699,6 +697,7 @@ static void on_event(ui_gadget_h ug, enum ug_event event, service_h data, void *
        case UG_EVENT_ROTATE_PORTRAIT:
        case UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN:
                if (ug_data->b_internal && ug_data->isRotate == true) {
+                       ewk_view_command_execute(ug_data->webview, "Unselect", NULL);
                        debug_log("In Full view - Showing navi bar");
                        elm_naviframe_item_title_visible_set(ug_data->navi_main_it, EINA_TRUE);
 
@@ -720,14 +719,6 @@ static void on_event(ui_gadget_h ug, enum ug_event event, service_h data, void *
                                        ug_data->move_cbar = NULL;
                                }
                        }
-                       if (ug_data->navi_move_it2) {
-                               debug_log("move2");
-                               Evas_Object *move_back_btn = elm_button_add(ug_data->navi_bar);
-                               elm_object_style_set(move_back_btn, "naviframe/back_btn/default");
-                               evas_object_smart_callback_add(move_back_btn, "clicked", _move_back_cb2, ug_data);
-                               elm_object_item_part_content_set(ug_data->navi_move_it2, "prev_btn", move_back_btn);
-                               elm_naviframe_item_title_visible_set(ug_data->navi_move_it2, EINA_TRUE);
-                       }
 
                        if (ug_data->b_btn) {
                                evas_object_smart_callback_del(ug_data->b_btn, "clicked", _back_cb);
@@ -740,10 +731,6 @@ static void on_event(ui_gadget_h ug, enum ug_event event, service_h data, void *
                        evas_object_smart_callback_add(ug_data->b_btn, "clicked", _back_cb, ug_data);
                        elm_object_item_part_content_set(ug_data->navi_main_it, "prev_btn", ug_data->b_btn);
 
-                       int resized_w = ug_data->webview_width * ug_data->scale_factor;
-                       int resized_h = ug_data->webview_height * ug_data->scale_factor;
-                       evas_object_size_hint_min_set(ug_data->webview, resized_w, resized_h);
-
                        ug_data->isRotate = false;
                }
 
@@ -752,6 +739,7 @@ static void on_event(ui_gadget_h ug, enum ug_event event, service_h data, void *
        case UG_EVENT_ROTATE_LANDSCAPE:
        case UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN:
                if (ug_data->b_internal && ug_data->isRotate == false) {
+                       ewk_view_command_execute(ug_data->webview, "Unselect", NULL);
                        debug_log("In Split view - Hiding navi bar");
                        elm_naviframe_item_title_visible_set(ug_data->navi_main_it, EINA_FALSE);
 
@@ -779,16 +767,6 @@ static void on_event(ui_gadget_h ug, enum ug_event event, service_h data, void *
                                }
                                elm_naviframe_item_title_visible_set(ug_data->navi_move_it1, EINA_FALSE);
                        }
-                       if (ug_data->navi_move_it2) {
-                               debug_log("move2");
-                               Evas_Object *move_back_btn = elm_object_item_part_content_get(ug_data->navi_move_it2, "prev_btn");
-                               if (move_back_btn) {
-                                       evas_object_smart_callback_del(move_back_btn, "clicked", _move_back_cb2);
-                                       evas_object_del(move_back_btn);
-                                       elm_object_item_part_content_set(ug_data->navi_move_it2, "prev_btn", NULL);
-                               }
-                               elm_naviframe_item_title_visible_set(ug_data->navi_move_it2, EINA_FALSE);
-                       }
 
                        if (ug_data->b_btn) {
                                evas_object_smart_callback_del(ug_data->b_btn, "clicked", _back_cb);
@@ -797,10 +775,6 @@ static void on_event(ui_gadget_h ug, enum ug_event event, service_h data, void *
                                elm_object_item_part_content_set(ug_data->navi_main_it, "prev_btn", NULL);
                        }
 
-                       int resized_w = ug_data->webview_width_landscape * ug_data->scale_factor;
-                       int resized_h = ug_data->webview_height_landscape * ug_data->scale_factor;
-                       evas_object_size_hint_min_set(ug_data->webview, resized_w, resized_h);
-
                        ug_data->isRotate = true;
                }
 
@@ -1254,6 +1228,10 @@ static void _reset_view(EmailViewerUGD *ug_data)
 
        /* reset subject */
        char *_subject = elm_entry_utf8_to_markup(prop->subject);
+       if (!g_strcmp0(_subject, "")) {
+               g_free(_subject);
+               _subject = g_strdup(_("IDS_EMAIL_BODY_NO_SUBJECT"));
+       }
        char *_subject_concated = g_strconcat("<font_size=44><color=#000000FF>", _subject, "</color></font_size>", NULL);
        elm_object_text_set(ug_data->lb_subject, _subject_concated);
        elm_label_wrap_width_set(ug_data->lb_subject, ug_data->main_w - (int)(110 * ug_data->scale_factor));
@@ -1303,6 +1281,12 @@ static void _reset_view(EmailViewerUGD *ug_data)
        evas_object_show(ug_data->ly_subject);
        elm_box_pack_end(ug_data->main_bx, ug_data->ly_subject);
 
+       Evas_Object *edje = elm_layout_edje_get(ug_data->ly_subject);
+
+       if (!ug_data->to_list && !ug_data->cc_list && !ug_data->bcc_list) {
+               edje_object_signal_emit(edje, "elm,state,arrow_hidden", "elm");
+       }
+
        if (prop->has_attachment)
                ug_data->got_att = 1;
        else
@@ -1331,7 +1315,6 @@ void _hide_view(EmailViewerUGD *ug_data)
 
        if (elm_naviframe_top_item_get(ug_data->navi_bar) != ug_data->navi_main_it) {
                ug_data->navi_move_it1 = NULL;
-               ug_data->navi_move_it2 = NULL;
                elm_naviframe_item_pop_to(ug_data->navi_main_it);
        }
 
@@ -1451,7 +1434,6 @@ void _hide_view(EmailViewerUGD *ug_data)
        ug_data->m_is_multi_touch = 0;
 
        ug_data->navi_move_it1 = NULL;
-       ug_data->navi_move_it2 = NULL;
 
        /* Double_Scroller */
        ug_data->b_noc = 1;
@@ -1516,6 +1498,10 @@ static Evas_Object *_create_subject(EmailViewerUGD *ug_data)
        subject_label = elm_label_add(di);
        elm_object_part_content_set(di, "elm.text", subject_label);
        char *subject = elm_entry_utf8_to_markup(prop->subject);
+       if (!g_strcmp0(subject, "")) {
+               g_free(subject);
+               subject = g_strdup(_("IDS_EMAIL_BODY_NO_SUBJECT"));
+       }
        char *subject_tagged = g_strconcat("<font_size=44><color=#000000FF>", subject, "</color></font_size>", NULL);
        elm_object_text_set(subject_label, subject_tagged);
        elm_label_wrap_width_set(subject_label, ug_data->main_w - (int)(110 * ug_data->scale_factor));
@@ -1568,10 +1554,10 @@ static Evas_Object *_create_subject(EmailViewerUGD *ug_data)
 
        if (ug_data->to_list || ug_data->cc_list || ug_data->bcc_list) {
                edje_object_signal_callback_add(edje, "elm,action,expand,toggle", "elm", _subject_detail_clicked_cb, di);
-               edje_object_signal_callback_add(edje, "elm,action,toggle", "elm", _subject_favorite_clicked_cb, di);
        } else {
                edje_object_signal_emit(edje, "elm,state,arrow_hidden", "elm");
        }
+       edje_object_signal_callback_add(edje, "elm,action,toggle", "elm", _subject_favorite_clicked_cb, di);
 
        return di;
 }
@@ -1611,6 +1597,8 @@ static Evas_Object *_create_to_addrs(EmailViewerUGD *ug_data)
 
        evas_object_smart_callback_add(to_mbe, "item,clicked", _mbe_selected_cb, ug_data);
        evas_object_smart_callback_add(to_mbe, "item,added", _mbe_added_cb, ug_data);
+       evas_object_smart_callback_add(to_mbe, "focused", _mbe_focused_cb, ug_data);
+       evas_object_smart_callback_add(to_mbe, "unfocused", _mbe_unfocused_cb, ug_data);
        elm_object_part_content_set(di, "elm.icon", to_mbe);
        ug_data->to_mbe = to_mbe;
 
@@ -1677,6 +1665,8 @@ static Evas_Object *_create_cc_addrs(EmailViewerUGD *ug_data)
        g_free(cc_str);
        evas_object_smart_callback_add(cc_mbe, "item,clicked", _mbe_selected_cb, ug_data);
        evas_object_smart_callback_add(cc_mbe, "item,added", _mbe_added_cb, ug_data);
+       evas_object_smart_callback_add(cc_mbe, "focused", _mbe_focused_cb, ug_data);
+       evas_object_smart_callback_add(cc_mbe, "unfocused", _mbe_unfocused_cb, ug_data);
        elm_object_part_content_set(di, "elm.icon", cc_mbe);
        ug_data->cc_mbe = cc_mbe;
 
@@ -1743,6 +1733,8 @@ static Evas_Object *_create_bcc_addrs(EmailViewerUGD *ug_data)
        g_free(bcc_str);
        evas_object_smart_callback_add(bcc_mbe, "item,clicked", _mbe_selected_cb, ug_data);
        evas_object_smart_callback_add(bcc_mbe, "item,added", _mbe_added_cb, ug_data);
+       evas_object_smart_callback_add(bcc_mbe, "focused", _mbe_focused_cb, ug_data);
+       evas_object_smart_callback_add(bcc_mbe, "unfocused", _mbe_unfocused_cb, ug_data);
        elm_object_part_content_set(di, "elm.icon", bcc_mbe);
        ug_data->bcc_mbe = bcc_mbe;
 
@@ -1996,6 +1988,8 @@ static Evas_Object *_create_body(EmailViewerUGD *ug_data)
        if (ug_data->webview_bx) {
                _init_webview_data(ug_data);
 
+               ewk_view_scale_set(ug_data->webview, 1.0f, 0, 0);
+
                if (prop->has_html) {
                /* html mail */
                        ug_data->webview_data->body_type_prev = BODY_TYPE_HTML;
@@ -2056,6 +2050,7 @@ static Evas_Object *_create_body(EmailViewerUGD *ug_data)
                        resized_w = ug_data->webview_width * ug_data->scale_factor;
                        resized_h = ug_data->webview_height * ug_data->scale_factor;
                }
+               debug_log("resized_w:%d, resized_h:%d", resized_w, resized_h);
 
                evas_object_size_hint_min_set(ug_data->webview, resized_w, resized_h);
 
@@ -2393,7 +2388,7 @@ static void _destroy_down_progress_ex(void *data, Evas_Object *obj, void *event_
        /* Cancel the download in email-service */
        if (index >= 0) {
                debug_log("index[%d] download_all_cnt[%d] email_handle[%d]", index, priv->download_all_cnt, priv->download_all_email_handle[index]);
-               if (priv->download_all_email_handle[index] > 0) {
+               if (priv->download_all_email_handle[index] != 0) {
                        email_engine_stop_working(ug_data->account_id, priv->download_all_email_handle[index]);
                        priv->download_all_email_handle[index] = 0;
                }
@@ -2407,7 +2402,7 @@ static void _destroy_down_progress_ex(void *data, Evas_Object *obj, void *event_
                        EmailAttachmentType *info = (EmailAttachmentType *)LIST_ITER_GET_DATA(i, attachment_list);
                        if (info && !info->inline_content) {
                                debug_log("index[%d] download_all_cnt[%d] email_handle[%d]", i, priv->download_all_cnt, priv->download_all_email_handle[i]);
-                               if (priv->download_all_email_handle[i] > 0) {
+                               if (priv->download_all_email_handle[i] != 0) {
                                        email_engine_stop_working(ug_data->account_id, priv->download_all_email_handle[i]);
                                }
                        }
@@ -2511,6 +2506,7 @@ static void _create_more_ctxpopup(EmailViewerUGD *ug_data)
                        elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_MARK_AS_READ"), NULL, _mark_as_read_cb, ug_data);
 
                elm_ctxpopup_item_append(ug_data->con_popup, dgettext("sys_string", "IDS_COM_BODY_MOVE"), NULL, _move_cb, ug_data);
+               elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_SAVE_EMAIL_ABB"), NULL, _save_email_cb, ug_data);
                elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_VIEW_CONTACT"), NULL, _ctxpopup_detail_contact_cb, g_strdup(index));
                elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_ADD_TO_CALENDAR"), NULL, _add_to_calendar_cb, ug_data);
                ug_data->more_ctx_block_item = elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_BLOCK"), NULL, _ctxpopup_add_block_rule_cb, prop->sender);
@@ -2523,6 +2519,7 @@ static void _create_more_ctxpopup(EmailViewerUGD *ug_data)
                        elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_MARK_AS_READ"), NULL, _mark_as_read_cb, ug_data);
 
                elm_ctxpopup_item_append(ug_data->con_popup, dgettext("sys_string", "IDS_COM_BODY_MOVE"), NULL, _move_cb, ug_data);
+               elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_SAVE_EMAIL_ABB"), NULL, _save_email_cb, ug_data);
                elm_ctxpopup_item_append(ug_data->con_popup, dgettext("sys_string", "IDS_COM_OPT_ADD_TO_CONTACTS"), NULL, _ctxpopup_select_contact_mode_email_cb, prop->sender);
                elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_ADD_TO_CALENDAR"), NULL, _add_to_calendar_cb, ug_data);
                ug_data->more_ctx_block_item = elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_BLOCK"), NULL, _ctxpopup_add_block_rule_cb, prop->sender);
@@ -2676,9 +2673,9 @@ static void _delete_evas_objects(EmailViewerUGD *ug_data)
                ug_data->partial_dn_btn_bx = NULL;
        }
 
-       if (ug_data->cutlink_timer) {
-               ecore_timer_del(ug_data->cutlink_timer);
-               ug_data->cutlink_timer = NULL;
+       if (ug_data->waiting_timer) {
+               ecore_timer_del(ug_data->waiting_timer);
+               ug_data->waiting_timer = NULL;
        }
 
        if (ug_data->timer) {
@@ -3050,7 +3047,6 @@ static void _move_cb(void *data, Evas_Object *obj, void *event_info)
                ug_data->con_popup = NULL;
        }
 
-       Elm_Object_Item *git = NULL;
        Evas_Object *gl = elm_genlist_add(ug_data->navi_bar);
        evas_object_show(gl);
 
@@ -3060,18 +3056,6 @@ static void _move_cb(void *data, Evas_Object *obj, void *event_info)
        ug_data->itc1.func.state_get = _gl_state_get;
        ug_data->itc1.func.del = _gl_del;
 
-       ug_data->itc2.item_style = "1text.1icon.2";
-       ug_data->itc2.func.text_get = _gl_sub_upper_text_get;
-       ug_data->itc2.func.content_get = _gl_sub_upper_icon_get;
-       ug_data->itc2.func.state_get = _gl_state_get;
-       ug_data->itc2.func.del = NULL;
-
-       ug_data->itc3.item_style = "grouptitle.dialogue.seperator";
-       ug_data->itc3.func.text_get = NULL;
-       ug_data->itc3.func.content_get = NULL;
-       ug_data->itc3.func.state_get = _gl_state_get;
-       ug_data->itc3.func.del = NULL;
-
        Elm_Object_Item *navi_it = NULL;
        navi_it = elm_naviframe_item_push(ug_data->navi_bar, dgettext("sys_string", "IDS_COM_BODY_MOVE"), NULL, NULL, gl, NULL);
        ug_data->navi_move_it1 = navi_it;
@@ -3087,9 +3071,6 @@ static void _move_cb(void *data, Evas_Object *obj, void *event_info)
        ug_data->move_mailbox_list = mailbox_list;
        ug_data->move_mailbox_count = mailbox_count;
 
-       git = elm_genlist_item_append(gl, &(ug_data->itc3), NULL, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
-       elm_genlist_item_select_mode_set(git, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
-
        for (i = 0; i < mailbox_count; i++) {
                if (g_strcmp0(ug_data->mailbox_name, mailbox_list[i].mailbox_name) != 0) {
                        if (mailbox_list[i].mailbox_type != EMAIL_MAILBOX_TYPE_OUTBOX &&
@@ -3099,7 +3080,7 @@ static void _move_cb(void *data, Evas_Object *obj, void *event_info)
                                mailbox_list[i].mailbox_type != EMAIL_MAILBOX_TYPE_ALL_EMAILS &&
                                mailbox_list[i].mailbox_type != EMAIL_MAILBOX_TYPE_SEARCH_RESULT)
                                if (g_strcmp0(mailbox_list[i].alias, "[Gmail]")) {
-                                       elm_genlist_item_append(gl, &ug_data->itc1, (void *)&(mailbox_list[i]), git, ELM_GENLIST_ITEM_NONE, _gl_sel, (void *)&(mailbox_list[i]));
+                                       elm_genlist_item_append(gl, &ug_data->itc1, (void *)&(mailbox_list[i]), NULL, ELM_GENLIST_ITEM_NONE, _move_here_cb, (void *)&(mailbox_list[i]));
                                }
                }
        }
@@ -3158,7 +3139,7 @@ static void _body_down_cb(void *data, Evas_Object *obj, void *event_info)
                return;
        }
 
-       unsigned int handle;
+       int handle;
        gboolean ret = 0;
        EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
        EmailViewerPrivate *priv = ug_data->email_data;
@@ -3355,9 +3336,9 @@ static void _subject_detail_clicked_cb(void *data, Evas_Object *obj, const char
                edje_object_signal_emit(_EDJ(item), "elm,state,expanded", "elm");
                (ug_data->subject_onoff_flag)++;
 
-               _create_to_addrs(_g_ug_data);
-               _create_cc_addrs(_g_ug_data);
-               _create_bcc_addrs(_g_ug_data);
+               _create_to_addrs(ug_data);
+               _create_cc_addrs(ug_data);
+               _create_bcc_addrs(ug_data);
        } else {
                edje_object_signal_emit(_EDJ(item), "elm,state,contracted", "elm");
                (ug_data->subject_onoff_flag)--;
@@ -3641,6 +3622,133 @@ static void _mark_as_read_cb(void *data, Evas_Object *obj, void *event_info)
        }
 }
 
+static void _create_waiting_popup(EmailViewerUGD *ug_data, const char *title_text, const char *style)
+{
+       debug_enter();
+       Evas_Object *popup;
+       Evas_Object *progress;
+
+       if (title_text == NULL) {
+               debug_log("popup text is null");
+               return;
+       }
+
+       popup = elm_popup_add(ug_data->win_main);
+       evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       elm_object_part_text_set(popup, "title,text", title_text);
+
+       progress = elm_progressbar_add(popup);
+       elm_object_style_set(progress, style);
+       elm_progressbar_pulse_set(progress, EINA_TRUE);
+       elm_progressbar_pulse(progress, EINA_TRUE);
+       evas_object_show(progress);
+
+       elm_object_content_set(popup, progress);
+
+       ug_data->timeout_popup = popup;
+
+       evas_object_show(popup);
+}
+
+static void _save_email_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       debug_log("");
+       if (!data) {
+               debug_log("data is NULL");
+               return;
+       }
+
+       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+
+       if (ug_data->con_popup) {
+               evas_object_del(ug_data->con_popup);
+               ug_data->con_popup = NULL;
+       }
+
+       _create_waiting_popup(ug_data, dgettext("sys_string", "IDS_COM_POP_SAVING_ING"), "pending_list");       //"list_process"
+
+       if (ug_data->waiting_timer) {
+               ecore_timer_del(ug_data->waiting_timer);
+               ug_data->waiting_timer = NULL;
+       }
+       ug_data->waiting_timer = ecore_timer_add(0.2, _save_email_prog_cb, ug_data);
+}
+
+static Eina_Bool _save_email_prog_cb(void *data)
+{
+       debug_log("");
+
+       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+
+       int err = 0;
+       debug_log("ug_data->mail_id(%d), priv->mail_id(%d), mail_info->mail_id(%d))", ug_data->mail_id, ug_data->email_data->mail_id, ug_data->email_data->mail_info->mail_id);
+
+       email_mail_data_t *mail_t = NULL;
+       err = email_get_mail_data(ug_data->email_data->mail_id, &mail_t);
+       debug_log("email_get_mail_data - err (%d)", err);
+
+       if (mail_t == NULL) {
+               debug_log("mail_t is NULL");
+               return EINA_FALSE;
+       }
+
+       email_attachment_data_t *attachment_t = NULL;
+       int attachment_count = 0;
+       err = email_get_attachment_data_list(ug_data->email_data->mail_id, &attachment_t, &attachment_count);
+       debug_log("email_get_attachment_data_list - err (%d)", err);
+
+       char file_name[MAX_PATH_LEN] = { 0, };
+       snprintf(file_name, sizeof(file_name), "%s_%d_%d.%s", DIR_DEFAULT_MEDIA_PHONE"/Downloads/Others/email", ug_data->account_id, ug_data->mail_id, "eml");
+       char *output_file_path = g_strdup(file_name);
+       debug_log("output_file_path(%s)", file_name, output_file_path);
+
+       err = email_write_mime_file(mail_t, attachment_t, attachment_count, &output_file_path);
+       debug_log("email_write_mime_file - err(%d)", err);
+
+       g_free(output_file_path);
+
+       if (mail_t) {
+               email_free_mail_data(&(mail_t), 1);
+               mail_t = NULL;
+       }
+
+       if (attachment_t && attachment_count > 0) {
+               email_free_attachment_data(&(attachment_t), attachment_count);
+               attachment_t = NULL;
+               attachment_count = 0;
+       }
+
+       if (ug_data->timeout_popup) {
+               evas_object_del(ug_data->timeout_popup);
+               ug_data->timeout_popup = NULL;
+       }
+
+       if (err != EMAIL_ERROR_NONE) {
+               _create_notify(ug_data, _("IDS_EMAIL_POP_ALERT"),
+                                               dgettext("sys_string", "IDS_COM_POP_UNABLE_TO_SAVE"), 0,
+                                               NULL, NULL, NULL, NULL, _popup_response_cb);
+       } else {
+#ifdef _SMALL_NOTI
+               char str[128] = { 0, };
+               snprintf(str, sizeof(str), "%s", N_("Saved in My files"));
+               int ret = status_message_post(str);
+               if (ret)
+                       debug_log("status_message_post failed: %d", ret);
+#else
+               _create_notify(ug_data, dgettext("sys_string", "IDS_COM_OPT_INFORMATION"),
+                                               N_("Saved in My files"), 0,
+                                               NULL, NULL, NULL, NULL, _popup_response_cb);
+#endif
+       }
+
+       if (ug_data->waiting_timer) {
+               ecore_timer_del(ug_data->waiting_timer);
+               ug_data->waiting_timer = NULL;
+       }
+
+       return EINA_FALSE;
+}
+
 static void _ctxpopup_detail_contact_cb(void *data, Evas_Object *obj, void *event_info)
 {
        debug_log("");
@@ -4094,7 +4202,6 @@ static void _webview_multi_down_cb(void *data, Evas * evas, Evas_Object *obj, vo
        EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
 
        ug_data->m_is_multi_touch = TRUE;
-
        if (ug_data->scroller_locked == FALSE) {
                ug_data->scroller_locked = TRUE;
                debug_log("<<lock scroller>>");
@@ -4111,9 +4218,15 @@ static void _webview_policy_navigation_decide_cb(void *data, Evas_Object *obj, v
        }
 
        EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
+       Ewk_Policy_Decision *policy_decision = (Ewk_Policy_Decision *)event_info;
+       Ewk_Policy_Navigation_Type pd_type = ewk_policy_decision_navigation_type_get(policy_decision);
+       debug_log("Ewk_Policy_Navigation_Type:%d", pd_type);
+
+       const char *uri = NULL;
+       uri = ewk_view_uri_get(ug_data->webview);
+       debug_log("ewk_view_uri_get(%s)", uri);
 
        if (ug_data->b_load_finished == EINA_TRUE) {
-               Ewk_Policy_Decision *policy_decision = (Ewk_Policy_Decision *)event_info;
                ewk_policy_decision_ignore(policy_decision);
 
                debug_log("url:%s", ewk_policy_decision_url_get(policy_decision));
@@ -4207,6 +4320,18 @@ static void _webview_policy_navigation_decide_cb(void *data, Evas_Object *obj, v
                        ret = service_destroy(service);
                        debug_log("service_destroy: %d", ret);
                }
+       } else {
+               if (ug_data->timeout_popup) {
+                       evas_object_del(ug_data->timeout_popup);
+                       ug_data->timeout_popup = NULL;
+               }
+               _create_waiting_popup(ug_data, _("IDS_EMAIL_POP_LOADING_CONTENTS_ING"), "list_process");
+
+               if (pd_type == EWK_POLICY_NAVIGATION_TYPE_LINK_CLICKED) {
+                       debug_log("Link click is ignored.");
+                       ewk_policy_decision_ignore(policy_decision);
+                       return;
+               }
        }
 }
 
@@ -4240,6 +4365,18 @@ static void _outter_scroller_scroll_cb(void *data, Evas_Object *obj, void *event
        ug_data->is_main_scroller_scrolling = EINA_TRUE;
 }
 
+static void _mbe_focused_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       debug_log("");
+       Elm_Object_Item *item = elm_multibuttonentry_selected_item_get(obj);
+       elm_multibuttonentry_item_selected_set(item, EINA_FALSE);
+}
+
+static void _mbe_unfocused_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       debug_log("");
+}
+
 static void _mbe_added_cb(void *data, Evas_Object *obj, void *event_info)
 {
        debug_log("");
@@ -4277,15 +4414,40 @@ static void _mbe_selected_cb(void *data, Evas_Object *obj, void *event_info)
 
                elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_VIEW_CONTACT"), NULL, _ctxpopup_detail_contact_cb, g_strdup(index));
                elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_SEND_EMAIL"), NULL, _ctxpopup_send_email_cb, addrs_info->address);
-               elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_BLOCK"), NULL, _ctxpopup_add_block_rule_cb, addrs_info->address);
+               ug_data->ctx_block_item = elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_BLOCK"), NULL, _ctxpopup_add_block_rule_cb, addrs_info->address);
                _delete_contacts_list(contact_list_item);
        } else {
                elm_ctxpopup_item_append(ug_data->con_popup, dgettext("sys_string", "IDS_COM_OPT_ADD_TO_CONTACTS"), NULL, _ctxpopup_select_contact_mode_email_cb, addrs_info->address);
                elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_SEND_EMAIL"), NULL, _ctxpopup_send_email_cb, addrs_info->address);
-               elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_BLOCK"), NULL, _ctxpopup_add_block_rule_cb, addrs_info->address);
+               ug_data->ctx_block_item = elm_ctxpopup_item_append(ug_data->con_popup, _("IDS_EMAIL_OPT_BLOCK"), NULL, _ctxpopup_add_block_rule_cb, addrs_info->address);
+       }
+
+       int count, i;
+       email_rule_t *rule_list = NULL;
+
+       /* get the rule list from service */
+       if (email_get_rule_list(&rule_list, &count) < 0) {
+               debug_log("email_get_rule_list failed");
+       } else {
+               if (count > 0) {
+                       for (i = 0; i < count; i++) {
+                               if (rule_list[i].type == EMAIL_FILTER_FROM/*TYPE_BLOCK_ADDRESS*/) {
+                                       debug_log("block address %s", rule_list[i].value);
+
+                                       if (g_strcmp0(rule_list[i].value, addrs_info->address) == 0) {
+                                               debug_log("[%s] already blocked", rule_list[i].value);
+                                               if (ug_data->ctx_block_item)
+                                                       elm_object_item_disabled_set(ug_data->ctx_block_item, EINA_TRUE);
+                                       }
+                               }
+                       }
+               }
+               /* free email rule_list */
+               email_free_rule(&rule_list, count);
        }
 
        evas_pointer_canvas_xy_get(ug_data->evas, &x, &y);
+               debug_log("canvas x:%d, y:%d", x, y);
        evas_object_move(ug_data->con_popup, x, y);
        evas_object_show(ug_data->con_popup);
 }
@@ -4618,7 +4780,7 @@ static void _save_attachment(EmailViewerUGD *ug_data, int index)
        }
 
        if (!info->download_yn) {
-               unsigned handle = 0;
+               int handle = 0;
                gboolean res = FALSE;
 
                if (ug_data->progress_bar[index + 1] != NULL) {
@@ -4660,7 +4822,6 @@ static void _save_attachment(EmailViewerUGD *ug_data, int index)
                if (ret == EMAIL_EXT_SAVE_ERR_NONE) {
                        char str[128] = { 0, };
                        snprintf(str, sizeof(str), "%s", dgettext("sys_string", "IDS_COM_POP_SAVED"));
-                       /*_show_select_info(ug_data, str);*/
                        ret = status_message_post(str);
                        if (ret)
                                debug_log("status_message_post failed: %d", ret);
@@ -4685,7 +4846,7 @@ static void _show_attachment(EmailViewerUGD *ug_data, int index)
                info->attach_id, info->index, info->name, info->path, (gint) info->size, info->download_yn, info->drm, info->inline_content);
 
        if (!info->download_yn) {
-               unsigned handle = 0;
+               int handle = 0;
                gboolean res = FALSE;
                debug_log("Need attachment download");
 
@@ -4714,7 +4875,6 @@ static void _show_attachment(EmailViewerUGD *ug_data, int index)
                if (res == EMAIL_EXT_SAVE_ERR_NONE) {
                        char str[128] = { 0, };
                        snprintf(str, sizeof(str), "%s", dgettext("sys_string", "IDS_COM_POP_SAVED"));
-                       /*_show_select_info(ug_data, str);*/
                        int ret = status_message_post(str);
                        if (ret)
                                debug_log("status_message_post failed: %d", ret);
@@ -4795,7 +4955,7 @@ static void _save_attachment_all(EmailViewerUGD *ug_data)
                if (info && !info->inline_content) {
                        if (!info->download_yn) {
                                if (ug_data->progress_bar_ly[i + 1] == NULL) {
-                                       unsigned handle = 0;
+                                       int handle = 0;
                                        gboolean res = FALSE;
                                        debug_log("Need attachment [%d] download", i);
 
@@ -5068,7 +5228,6 @@ static void _on_edbus_event_email_viewer_receive(void *data, DBusMessage *messag
 
                                        char str[128] = { 0, };
                                        snprintf(str, sizeof(str), "%s", dgettext("sys_string", "IDS_COM_BODY_DOWNLOADED"));
-                                       /*_show_select_info(ug_data, str);*/
                                        int ret = status_message_post(str);
                                        if (ret)
                                                debug_log("status_message_post failed: %d", ret);
@@ -5382,12 +5541,12 @@ static void _set_value_down_progress_by_index(double val, int index)
        EmailViewerProp *prop = ug_data->property;
 
        if (val < 0.0) {
-               debug_log("val(%f) is MINUS");
+               debug_log("val(%f) is MINUS", val);
                return;
        }
 
        if (index < 0 || index >= ATTACH_MAX) {
-               debug_log("index(%d) is overflowed");
+               debug_log("index(%d) is overflowed", index);
                return;
        }
 
@@ -5611,103 +5770,6 @@ static Evas_Object *_gl_content_get(void *data, Evas_Object *obj, const char *pa
        return NULL;
 }
 
-static void _gl_sel(void *data, Evas_Object *obj, void *event_info)
-{
-       debug_log("");
-
-       EmailViewerUGD *ug_data = _g_ug_data;
-       email_mailbox_t *mailbox_list = NULL;
-       mailbox_list = (email_mailbox_t *) data;
-       Elm_Object_Item *item = (Elm_Object_Item *)event_info;
-       elm_genlist_item_selected_set(item, EINA_FALSE);
-
-       Elm_Object_Item *git = NULL;
-       Evas_Object *gl = elm_genlist_add(ug_data->navi_bar);
-       evas_object_show(gl);
-
-       git = elm_genlist_item_append(gl, &(ug_data->itc3), NULL, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
-       elm_genlist_item_select_mode_set(git, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
-       elm_genlist_item_append(gl, &ug_data->itc2, NULL, git, ELM_GENLIST_ITEM_NONE, _gl_sub_upper_sel, NULL);
-
-       Evas_Object *cbar = elm_toolbar_add(ug_data->navi_bar);
-       elm_toolbar_shrink_mode_set(cbar, ELM_TOOLBAR_SHRINK_EXPAND);
-       elm_object_style_set(cbar, "naviframe");
-       evas_object_show(cbar);
-
-       elm_toolbar_item_append(cbar, NULL, _("IDS_EMAIL_SK3_MOVE_HERE"), _move_here_cb, mailbox_list);
-       elm_object_item_disabled_set(elm_toolbar_item_append(cbar, NULL, "", NULL, NULL), EINA_TRUE);
-
-       Elm_Object_Item *navi_it = NULL;
-       navi_it = elm_naviframe_item_push(ug_data->navi_bar, dgettext("sys_string", "IDS_COM_BODY_MOVE"), NULL, NULL, gl, NULL);
-       elm_object_item_part_content_set(navi_it, "controlbar", cbar);
-       ug_data->navi_move_it2 = navi_it;
-
-       Evas_Object *move_back_btn = NULL;
-       if (ug_data->isRotate) {
-               elm_naviframe_item_title_visible_set(navi_it, EINA_FALSE);
-               move_back_btn = elm_object_item_part_content_get(navi_it, "prev_btn");
-               if (move_back_btn) {
-                       evas_object_del(move_back_btn);
-                       elm_object_item_part_content_set(navi_it, "prev_btn", NULL);
-               }
-       } else {
-               move_back_btn = elm_object_item_part_content_get(navi_it, "prev_btn");
-               if (move_back_btn) {
-                       evas_object_del(move_back_btn);
-                       move_back_btn = elm_button_add(ug_data->navi_bar);
-                       elm_object_style_set(move_back_btn, "naviframe/back_btn/default");
-                       evas_object_smart_callback_add(move_back_btn, "clicked", _move_back_cb2, ug_data);
-                       elm_object_item_part_content_set(navi_it, "prev_btn", move_back_btn);
-               }
-       }
-       return;
-}
-
-static char *_gl_sub_upper_text_get(void *data, Evas_Object *obj, const char *part)
-{
-       debug_log("");
-       email_mailbox_t *mailbox_list = NULL;
-       mailbox_list = (email_mailbox_t *) data;
-
-       if (g_strcmp0(part, "elm.text") == 0) {
-               char buf[MAX_STR_LEN] = { 0, };
-               snprintf(buf, sizeof(buf), "%s", _("IDS_EMAIL_MBODY_MAILBOX_LIST"));
-               return g_strdup(buf);
-       }
-
-       return NULL;
-}
-
-static Evas_Object *_gl_sub_upper_icon_get(void *data, Evas_Object *obj, const char *part)
-{
-       debug_log("");
-
-       if (g_strcmp0(part, "elm.icon") == 0) {
-               Evas_Object *icon = elm_icon_add(obj);
-               elm_icon_file_set(icon, IMGDIR "/U01_icon_upper_folder_focus.png", NULL);
-               evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
-
-               return icon;
-       }
-
-       return NULL;
-}
-
-static void _gl_sub_upper_sel(void *data, Evas_Object *obj, void *event_info)
-{
-       debug_log("");
-
-       EmailViewerUGD *ug_data = _g_ug_data;
-
-       Elm_Object_Item *item = (Elm_Object_Item *)event_info;
-       elm_genlist_item_selected_set(item, EINA_FALSE);
-
-       ug_data->navi_move_it2 = NULL;
-       elm_naviframe_item_pop(ug_data->navi_bar);
-
-       return;
-}
-
 static void _move_here_cb(void *data, Evas_Object *obj, void *event_info)
 {
        debug_log("");
@@ -5726,7 +5788,6 @@ static void _move_here_cb(void *data, Evas_Object *obj, void *event_info)
        _move_email(ug_data, folder_id, FALSE);
 
        ug_data->navi_move_it1 = NULL;
-       ug_data->navi_move_it2 = NULL;
        elm_naviframe_item_pop_to(ug_data->navi_main_it);
 
        if (ug_data->isRotate == false && ug_data->b_internal) {
@@ -5775,7 +5836,6 @@ static void _move_back_cb(void *data, Evas_Object *obj, void *event_info)
 
        elm_naviframe_item_pop(ug_data->navi_bar);
        ug_data->navi_move_it1 = NULL;
-       ug_data->navi_move_it2 = NULL;
 
        /*if (ug_data->b_internal)
                elm_layout_theme_set(ug_data->layout_main, "layout", "controlbar", "default");
@@ -5783,19 +5843,4 @@ static void _move_back_cb(void *data, Evas_Object *obj, void *event_info)
                elm_layout_theme_set(ug_data->layout_main, "layout", "application", "controlbar");*/
 }
 
-static void _move_back_cb2(void *data, Evas_Object *obj, void *event_info)
-{
-       debug_log("");
-
-       if (data == NULL || _g_ug_data == NULL) {
-               debug_log("data is NULL");
-               return;
-       }
-
-       EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
-
-       elm_naviframe_item_pop(ug_data->navi_bar);
-       ug_data->navi_move_it2 = NULL;
-}
-
 /* EOF */
index 2fe9a25..ac85a99 100755 (executable)
                        min: 0 param_item_height; \
                        color: GENLIST_PART_BG_COLOR_INC; \
                } \
-               description     { state: "pressed" 0.0; \
+               description { state: "pressed" 0.0; \
                        inherit: "default" 0.0; \
                        color: 42 137 194 255; \
                } \
index a3e50e2..daff660 100755 (executable)
@@ -313,7 +313,7 @@ collections {
                                type: RECT;
                                scale: 1;
                                description { state: "default" 0.0;
-                                       min: 0 SCALE(48.0);
+                                       min: 0 SCALE(64.0);
                                        fixed: 1 0;
                                        visible: 0;
                                        align: 0.0 0.5;
@@ -408,12 +408,12 @@ collections {
 
                                        rel1 {
                                                relative: 1.0 0.0;
-                                               offset: -1*SCALE(152.0) SCALE(8.0);
+                                               offset: -1*SCALE(144.0) SCALE(8.0);
                                                to: "elm.subbox";
                                        }
                                        rel2 {
                                                relative: 1.0 1.0;
-                                               offset: -1*SCALE(120.0) -1*SCALE(8.0);
+                                               offset: -1*SCALE(112.0) -1*SCALE(8.0);
                                                to: "elm.subbox";
                                        }
                                }
@@ -434,12 +434,12 @@ collections {
 
                                        rel1 {
                                                relative: 1.0 0.0;
-                                               offset: -1*SCALE(112.0) SCALE(8.0);
+                                               offset: -1*SCALE(104.0) SCALE(8.0);
                                                to: "elm.subbox";
                                        }
                                        rel2 {
                                                relative: 1.0 1.0;
-                                               offset: -1*SCALE(80.0) -1*SCALE(8.0);
+                                               offset: -1*SCALE(72.0) -1*SCALE(8.0);
                                                to: "elm.subbox";
                                        }
                                }
@@ -461,7 +461,7 @@ collections {
 
                                        rel1 {
                                                relative: 1.0 0.0;
-                                               offset: -1*SCALE(72.0) SCALE(8.0);
+                                               offset: -1*SCALE(64.0) SCALE(8.0);
                                                to: "elm.subbox";
                                        }
                                        rel2 {
@@ -480,20 +480,20 @@ collections {
                                scale: 1;
                                description {
                                        state: "default" 0.0;
-                                       min: SCALE(64.0) SCALE(64.0);
-                                       max: SCALE(64.0) SCALE(64.0);
+                                       min: SCALE(60.0) SCALE(60.0);
+                                       max: SCALE(60.0) SCALE(60.0);
                                        fixed: 1 1;
                                        align: 0.0 0.5;
                                        visible: 1;
 
                                        rel1 {
                                                relative: 1.0 0.0;
-                                               offset: -1*SCALE(72.0) SCALE(8.0);
+                                               offset: -1*SCALE(64.0) SCALE(3.0);
                                                to: "elm.subbox";
                                        }
                                        rel2 {
                                                relative: 1.0 1.0;
-                                               offset: 0 -1*SCALE(8.0);
+                                               offset: 0 -1*SCALE(3.0);
                                                to: "elm.subbox";
                                        }
                                }
@@ -504,7 +504,9 @@ collections {
                                name: "touch_arrow";
                                type: RECT;
                                clip_to: "disclip";
-                               ignore_flags: ON_HOLD;
+//                             ignore_flags: ON_HOLD;
+                               mouse_events: 1;
+                               repeat_events: 1;
                                scale: 1;
                                description {
                                        state: "default" 0.0;
@@ -619,11 +621,25 @@ collections {
                        }
                        program {
                                name: "expand";
-                               signal: "mouse,up,1";
+                               signal: "mouse,clicked,1";
                                source: "touch_arrow";
                                action: SIGNAL_EMIT "elm,action,expand,toggle" "elm";
                        }
                        program {
+                               name: "arrow_up";
+                               signal: "mouse,up,1";
+                               source: "touch_arrow";
+                               script {
+                                       new st[31];
+                                       new Float:vl;
+                                       get_state(PART:"arrow", st, 30, vl)
+                                       if (vl == 0.0)
+                                               set_state(PART:"arrow", st, 1.0);
+                                       else
+                                               set_state(PART:"arrow", st, 0.0);
+                               }
+                       }
+                       program {
                                name: "arrow_down";
                                signal: "mouse,down,1";
                                source: "touch_arrow";
@@ -1075,7 +1091,7 @@ collections {
                                name: "down";
                                clip_to: "disclip";
                                type: RECT;
-                               ignore_flags: ON_HOLD;
+                               //ignore_flags: ON_HOLD;
                                mouse_events: 1;
                                scale: 1;
 
@@ -1282,7 +1298,9 @@ collections {
                                name: "touch_arrow";
                                type: RECT;
                                clip_to: "disclip";
-                               ignore_flags: ON_HOLD;
+//                             ignore_flags: ON_HOLD;
+                               mouse_events: 1;
+                               repeat_events: 1;
                                scale: 1;
                                description { state: "default" 0.0;
                                        min: SCALE(74.0) SCALE(74.0);
@@ -1463,11 +1481,25 @@ collections {
                        }
                        program {
                                name: "expand";
-                               signal: "mouse,up,1";
+                               signal: "mouse,clicked,1";
                                source: "touch_arrow";
                                action: SIGNAL_EMIT "elm,action,expand,toggle" "elm";
                        }
                        program {
+                               name: "arrow_up";
+                               signal: "mouse,up,1";
+                               source: "touch_arrow";
+                               script {
+                                       new st[31];
+                                       new Float:vl;
+                                       get_state(PART:"arrow", st, 30, vl)
+                                       if (vl == 0.0)
+                                               set_state(PART:"arrow", st, 1.0);
+                                       else
+                                               set_state(PART:"arrow", st, 0.0);
+                               }
+                       }
+                       program {
                                name: "arrow_down";
                                signal: "mouse,down,1";
                                source: "touch_arrow";