ADD_DEFINITIONS("-D_TEMPORARY_FIX_FOR_ROTATION_")
ADD_DEFINITIONS("-D_POPUP_WITH_LIST")
ADD_DEFINITIONS("-D_ALWAYS_CC_MYSELF")
-##ADD_DEFINITIONS("-D_LAUNCH_APP")
+ADD_DEFINITIONS("-D_NEW_CT_SVC_API")
ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} email-common ${CMAKE_LDFLAGS} ${pkgs-composer_LDFLAGS})
#include <vconf.h>
#include <email-api.h>
#include <contacts-svc.h>
+
#include "email-debug.h"
#define MYFILE_IMGE_PATH "/opt/apps/org.tizen.myfile/res/images"
typedef struct _EMAIL_CONTACT_LIST_INFO_S {
int index;
+#ifndef _NEW_CT_SVC_API
char *first_name;
char *last_name;
+#else
+ char *display;
+#endif
char *email_address;
char *image_path;
char display_name[MAX_RECIPIENT_ADDRESS_LEN];
static void _composer_attachment_delete_all_icon_clicked_cb(void *data, Evas_Object *obj, void *event_info);
static void _composer_attachment_contracted_item_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
static void _composer_attachment_unfocus(void *data, Evas_Object *obj, const char *emission, const char *source);
-#ifdef _LAUNCH_APP
static void _composer_attachment_mouse_clicked(void *data, Evas_Object *obj, const char *emission, const char *source);
-#endif
/**
* Returns total size of attachments including attachments, inline images and new files to be attached/inserted.
ugd->attachment_item_obj_list = eina_list_append(ugd->attachment_item_obj_list, attachment_base);
_composer_attachment_set_attach_data(ugd, attachment_base, attachment_data);
-#ifdef _LAUNCH_APP
+
edje_object_signal_callback_add(_EDJ(attachment_item), "clicked", "*", _composer_attachment_mouse_clicked, attachment_data);
-#endif
edje_object_signal_callback_add(_EDJ(attachment_item), "clicked", "*", _composer_attachment_unfocus, ugd);
} else {
Evas_Object *attachment_base = elm_layout_add(ugd->attachment_item_box);
// ugd->bringin_timer = ecore_timer_add(0.5f, _composer_bringin_cb, ugd);
}
-#ifdef _LAUNCH_APP
static void _composer_attachment_mouse_clicked(void *data, Evas_Object *obj, const char *emission, const char *source)
{
debug_log("");
ret = service_destroy(service);
debug_log("service_destroy: %d", ret);
}
-#endif
static void _composer_attachment_unfocus(void *data, Evas_Object *obj, const char *emission, const char *source)
{
} else {
elm_object_item_signal_emit(ugd->navi_item, "elm,state,optionheader,open", "");
}
-
+
if (ugd->isRotated == true) {
_composer_resize_body_webview(ugd, COMPOSER_IME_HEIGHT_H);
} else {
if (index > 5)
index = 5;
Evas_Object *box = elm_box_add(ugd->change_addr_noti);
- evas_object_size_hint_min_set(box, 610 * elm_scale_get(), 114 * index * elm_scale_get());
+ evas_object_size_hint_min_set(box, 610 * elm_scale_get(), 113 * index * elm_scale_get());
evas_object_show(genlist);
elm_box_pack_end(box, genlist);
elm_object_content_set(ugd->change_addr_noti, box);
int index = contacts_svc_value_get_int(row_info, CTS_LIST_EMAIL_CONTACT_ID_INT);
contacts_list_item->index = index;
+#ifndef _NEW_CT_SVC_API
contacts_list_item->first_name = g_strdup(contacts_svc_value_get_str(row_info, CTS_LIST_EMAIL_CONTACT_FIRST_STR));
contacts_list_item->last_name = g_strdup(contacts_svc_value_get_str(row_info, CTS_LIST_EMAIL_CONTACT_LAST_STR));
+#else
+ contacts_list_item->display = g_strdup(contacts_svc_value_get_str(row_info, CTS_LIST_EMAIL_CONTACT_DISPLAY_STR));
+#endif
contacts_list_item->image_path = g_strdup(contacts_svc_value_get_str(row_info, CTS_LIST_EMAIL_CONTACT_IMG_PATH_STR));
contacts_list_item->email_address = g_strdup(contacts_svc_value_get_str(row_info, CTS_LIST_EMAIL_ADDR_STR));
+#ifndef _NEW_CT_SVC_API
char *first = contacts_list_item->first_name;
char *last = contacts_list_item->last_name;
char *display = g_strdup(contacts_svc_value_get_str(row_info, CTS_LIST_EMAIL_CONTACT_DISPLAY_STR));
snprintf(contacts_list_item->display_name, sizeof(contacts_list_item->display_name), "%s", display);
g_free(display);
+#else
+ snprintf(contacts_list_item->display_name, sizeof(contacts_list_item->display_name), "%s", contacts_list_item->display);
+#endif
/*contacts_list = eina_list_append(contacts_list, contacts_list_item);*/
}
debug_log("");
if (contacts_list_item) {
+#ifndef _NEW_CT_SVC_API
g_free(contacts_list_item->first_name);
contacts_list_item->first_name = NULL;
g_free(contacts_list_item->last_name);
contacts_list_item->last_name = NULL;
+#else
+ g_free(contacts_list_item->display);
+ contacts_list_item->display = NULL;
+#endif
g_free(contacts_list_item->email_address);
contacts_list_item->email_address = NULL;
g_free(contacts_list_item->image_path);
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");
#ifdef _POPUP_WITH_LIST
Evas_Object *box = elm_box_add(ugd->composer_noti);
- evas_object_size_hint_min_set(box, 610 * elm_scale_get(), 114 * index * elm_scale_get());
+ evas_object_size_hint_min_set(box, 610 * elm_scale_get(), 113 * index * elm_scale_get());
evas_object_show(priority_genlist);
elm_box_pack_end(box, priority_genlist);
elm_object_content_set(ugd->composer_noti, box);
#ifdef _POPUP_WITH_LIST
Evas_Object *box = elm_box_add(ugd->composer_noti);
- evas_object_size_hint_min_set(box, 610 * elm_scale_get(), 114 * index * elm_scale_get());
+ evas_object_size_hint_min_set(box, 610 * elm_scale_get(), 113 * index * elm_scale_get());
evas_object_show(tracking_genlist);
elm_box_pack_end(box, tracking_genlist);
elm_object_content_set(ugd->composer_noti, box);
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);
+ }
}
static void _composer_plain_text_get_cb(Evas_Object *o, const char *plain_text, void *user_data)
static void _composer_webview_contextmenu_selected_cb(void *data, Evas_Object *webview, void *event_info);
-
static void _changed_cb(void *data, Evas_Object *obj, void *event_info) // This callback is for showing(hiding) X marked button.
{
debug_log("");
elm_entry_input_panel_show(obj);
ugd->selected_entry = ugd->subject_entry;
+ if (ugd->isRotated == true) {
+ _composer_resize_body_webview(ugd, COMPOSER_IME_HEIGHT_H);
+ } else {
+ _composer_resize_body_webview(ugd, COMPOSER_IME_HEIGHT_V);
+ }
+ elm_layout_sizing_eval(ugd->c_layout);
// ugd->bringin_timer = ecore_timer_add(0.5f, _composer_bringin_cb, ugd);
} else {
if (ugd->selected_entry == ugd->body_ewkview) {
evas_object_smart_callback_add(ugd->body_ewkview, "scroll,up", _composer_webkit_scroll_up_cb, ugd);
evas_object_smart_callback_add(ugd->body_ewkview, "scroll,down", _composer_webkit_scroll_down_cb, ugd);
evas_object_smart_callback_add(ugd->body_ewkview, "contextmenu,customize", _composer_webview_contextmenu_customize_cb, ugd);
+ evas_object_smart_callback_add(ugd->body_ewkview, "contextmenu,selected", _composer_webview_contextmenu_selected_cb, ugd);
evas_object_smart_callback_add(ugd->body_ewkview, "editorclient,ime,closed", _composer_webkit_ime_closed_cb, ugd);
evas_object_smart_callback_add(ugd->body_ewkview, "editorclient,ime,opened", _composer_webkit_ime_opened_cb, ugd);
ewk_context_menu_item_remove(contextmenu, menu_item);
}
- debug_log("Sel = %d , Content = %d", sel, has_content);
+ debug_log("Sel = %d, Content = %d", sel, has_content);
if (sel == EINA_FALSE) {
if (has_content == EINA_FALSE) {
while (CTS_SUCCESS == contacts_svc_iter_next(iter)) {
CTSvalue *contact = NULL;
CTSvalue *email = NULL;
+#ifndef _NEW_CT_SVC_API
const char *first, *last;
+#endif
const char *img_path, *email_addr;
char *display = NULL;
if (display) {
//debug_log("display = %s", display);
} else {
+#ifndef _NEW_CT_SVC_API
first = contacts_svc_value_get_str(contact, CTS_LIST_CONTACT_FIRST_STR);
last = contacts_svc_value_get_str(contact, CTS_LIST_CONTACT_LAST_STR);
else
display = g_strconcat(last, " ", first, NULL);
}
+#else
+ display = g_strdup(email_addr);
+#endif
}
if (display && contacts_list_item->email_address && (strcasestr(display, search_word) || strcasestr(contacts_list_item->email_address, search_word))) {
EMAIL_CONTACT_LIST_INFO_S *contacts_list_item = NULL;
EINA_LIST_FOREACH(l, lt, contacts_list_item) {
if (contacts_list_item) {
+#ifndef _NEW_CT_SVC_API
g_free(contacts_list_item->first_name);
contacts_list_item->first_name = NULL;
g_free(contacts_list_item->last_name);
contacts_list_item->last_name = NULL;
+#else
+ g_free(contacts_list_item->display);
+ contacts_list_item->display = NULL;
+#endif
g_free(contacts_list_item->email_address);
contacts_list_item->email_address = NULL;
g_free(contacts_list_item->image_path);
#define DEFAULT_SIGNATURE _("IDS_EMAIL_BODY_SENT_USING_TIZEN_MOBILE")
#define HTML_META_INFORMATION \
- "<html><head><meta name=\"viewport\" content=\"width=0, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=medium-dpi\" /></head>"
+ "<html><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=medium-dpi\" /></head>"
static void _composer_save_draft_response_cb(void *data, Evas_Object *obj, void *event_info);
_composer_add_softlink_to_inline_images(ugd);
char *plain_charset = NULL;
- if (ugd->existing_mail_info->mail_data && ugd->existing_mail_info->mail_data->file_path_plain)
+ if (ugd->existing_mail_info->mail_data && ugd->existing_mail_info->mail_data->file_path_plain) {
plain_charset = email_parse_get_filename_from_path(ugd->existing_mail_info->mail_data->file_path_plain);
- debug_log("plain_charset : %s", plain_charset);
+ debug_log("plain_charset : %s", plain_charset);
+ if (plain_charset) {
+ Ewk_Setting *ewkSetting = ewk_view_setting_get(ugd->body_ewkview);
- if (plain_charset) {
- Ewk_Setting *ewkSetting = ewk_view_setting_get(ugd->body_ewkview);
+ if (ewkSetting == NULL)
+ debug_log("ewkSetting is NULL.");
- if (ewkSetting == NULL)
- debug_log("ewkSetting is NULL.");
-
- ewk_setting_default_encoding_set(ewkSetting, plain_charset);
- g_free(plain_charset);
+ ewk_setting_default_encoding_set(ewkSetting, plain_charset);
+ g_free(plain_charset);
+ }
} else {
if (ugd->existing_mail_info->mail_data && ugd->existing_mail_info->mail_data->file_path_html) {
char *charset = email_parse_get_filename_from_path(ugd->existing_mail_info->mail_data->file_path_html);
if (EINA_TRUE == ugd->has_body_html) {
debug_log("");
- char file_path[100] = { 0, };
+ char file_path[MAX_STR_LEN] = { 0, };
snprintf(file_path, sizeof(file_path), "file://%s", ugd->saved_html_path);
debug_log("file_path: (%s)", file_path);
if (ugd->isRotated == false) {
// Webkit should be resized after showing/hiding IME
- debug_log("nHeight:%d, COMPOSER_NAVI_HEIGHT:%d, indicator_height:%d", nHeight, COMPOSER_NAVI_HEIGHT, ugd->indicator_height );
+ debug_log("nHeight:%d, COMPOSER_NAVI_HEIGHT:%d, indicator_height:%d", nHeight, COMPOSER_NAVI_HEIGHT, ugd->indicator_height);
evas_object_size_hint_min_set(ugd->webkit_ly, 0, nHeight - COMPOSER_NAVI_HEIGHT - ugd->indicator_height - ime_height);
} else {
debug_log("nHeight:%d, COMPOSER_NAVI_HEIGHT:%d, indicator_height:%d", nWidth, COMPOSER_NAVI_HEIGHT, ugd->indicator_height);
ugd->option_header_opened = FALSE;
}
ugd->isRotated = false;
+ win_main_angle = 180;
_composer_resize_body_webview(ugd, COMPOSER_IME_HEIGHT_V);
break;
case UG_EVENT_ROTATE_LANDSCAPE:
ugd->option_header_opened = FALSE;
}
ugd->isRotated = true;
+ win_main_angle = 90;
_composer_resize_body_webview(ugd, COMPOSER_IME_HEIGHT_H);
break;
case UG_EVENT_REGION_CHANGE:
elm_win_rotation_with_resize_set(ugd->popup_win, win_main_angle);
}
+ elm_win_rotation_with_resize_set(ugd->win_main, win_main_angle);
+
// ugd->bringin_timer = ecore_timer_add(0.1f, _composer_bringin_cb, ugd);
}
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;
}
#include <time.h>
#include <E_DBus.h>
#include <sysman.h>
-#include <aul.h>
#include <db-util.h>
#include <vconf.h>
#include <vconf-keys.h>
#include <glib.h>
#include <glib-object.h>
#include <EWebKit2.h>
+#include <contacts-svc.h>
#include "email-viewer-logic.h"
-#include <contacts-svc.h>
#include "email-utils.h"
#include "email-locale.h"