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}")
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)
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);
{"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},
{"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}
#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
Ecore_Timer *bringin_timer;
Ecore_Timer *mbe_unfocus_timer;
Ecore_Timer *focus_timer;
+ Ecore_Timer *launch_timer;
/* Predictive Search */
Ecore_Timer *ps_timer;
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;
*/
#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>
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);
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;
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);
}
}
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);
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");
}
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);
_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", "");
}
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)
#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);
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))
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);
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.
*/
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
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;
}
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)
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;
}
}
+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("");
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);
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;
}
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) {
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);
}
}
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)
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");
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, ",");
+ }
}
}
}
#include <string.h>
#include <Ecore_X.h>
-#include <media-util-err.h>
#include "email-composer.h"
#include "email-composer-recipient.h"
#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);
//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)
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);
{
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)
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)
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)
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);
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;
}
}
}
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;
}
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);
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.
}
}
- 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 {
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
Evas_Object *_composer_create_navigation_layout(Evas_Object *parent)
{
+ debug_log("");
Evas_Object *navi_bar;
navi_bar = elm_naviframe_add(parent);
Evas_Object *_composer_create_composer_layout(Evas_Object *parent)
{
+ debug_log("");
Evas_Object *layout;
layout = elm_layout_add(parent);
Evas_Object *_composer_create_outer_layout(Evas_Object *parent)
{
+ debug_log("");
Evas_Object *layout/*, *bg*/;
layout = elm_layout_add(parent);
Evas_Object *_composer_create_main_scroller(Evas_Object *parent)
{
+ debug_log("");
Evas_Object *scroller;
scroller = elm_scroller_add(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);
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) {
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);
}
}
}
- 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;
}
}
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);
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);
FINISH_OFF:
- _composer_free_initial_email_content(ugd);
+ if (is_modified) {
+ _composer_free_initial_email_content(ugd);
+ }
return is_modified;
}
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);
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);
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);
}
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;
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
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);
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;
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) {
}
}
+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("");
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]);
} \
}
+#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; \
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);
%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
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)
/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
%{_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
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}")
int mailbox_id;
int mail_id;
int account_id;
- unsigned int download_id;
gboolean download_mail;
gboolean multi_body;
gboolean b_att_open;
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;
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;
char *cc_contact_name;
char *bcc_contact_name;
- unsigned int date;
- unsigned int time;
time_t mktime;
char *subject;
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;
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;
Evas_Object *gl;
Elm_Genlist_Item_Class itc1;
- Elm_Genlist_Item_Class itc2;
- Elm_Genlist_Item_Class itc3;
GList *from_list;
GList *to_list;
Ecore_Idler *idler;
Ecore_Timer *timer;
+ Ecore_Timer *waiting_timer;
};
void _hide_view(EmailViewerUGD *ug_data);
#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>
{"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},
{"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}
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) {
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!");
/* 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);
}
// 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("");
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)
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;
}
#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>
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);
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);
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)
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;
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);
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);
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;
}
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);
}
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);
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;
}
/* 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));
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
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);
}
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;
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));
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;
}
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;
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;
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;
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;
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);
/* 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;
}
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]);
}
}
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);
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);
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) {
ug_data->con_popup = NULL;
}
- Elm_Object_Item *git = NULL;
Evas_Object *gl = elm_genlist_add(ug_data->navi_bar);
evas_object_show(gl);
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;
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 &&
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]));
}
}
}
return;
}
- unsigned int handle;
+ int handle;
gboolean ret = 0;
EmailViewerUGD *ug_data = (EmailViewerUGD *)data;
EmailViewerPrivate *priv = ug_data->email_data;
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)--;
}
}
+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("");
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>>");
}
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));
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;
+ }
}
}
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("");
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);
}
}
if (!info->download_yn) {
- unsigned handle = 0;
+ int handle = 0;
gboolean res = FALSE;
if (ug_data->progress_bar[index + 1] != NULL) {
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);
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");
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);
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);
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);
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;
}
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("");
_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) {
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");
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 */
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; \
} \
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;
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";
}
}
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";
}
}
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 {
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";
}
}
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;
}
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";
name: "down";
clip_to: "disclip";
type: RECT;
- ignore_flags: ON_HOLD;
+ //ignore_flags: ON_HOLD;
mouse_events: 1;
scale: 1;
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);
}
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";