2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.tizenopensource.org/license
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __DEF_email_composer_H_
18 #define __DEF_email_composer_H_
22 #include <ui-gadget.h>
23 #include <ui-gadget-module.h>
27 #include "email-composer-type.h"
28 #include "email-common-types.h"
29 #include "email-locale.h"
30 #include "email-engine.h"
31 #include "email-utils.h"
33 #define _EDJ(o) elm_layout_edje_get(o)
34 #define COMPOSER_STRDUP(src) (((src)) ? g_strdup((src)) : NULL)
36 #define COMPOSER_ICON_DIR IMGDIR
38 #define COMPOSER_NAVI_HEIGHT 98 //108
39 #define COMPOSER_INDI_HEIGHT 76
40 #define COMPOSER_IME_HEIGHT_V 444
41 #define COMPOSER_IME_HEIGHT_H 316
42 #define COMPOSER_IME_PREDICTION_H 84
44 #define COMPOSER_SP_H 10
45 #define COMPOSER_EDIT_FIELD_H 80
46 #define COMPOSER_BUTTON_FIELD_H 80
48 #define _ENABLE_ENDKEY_ 0
49 #define MAX_RECENT_ITEM 100
50 #define TEMP_BUFFER_SIZE 1024
52 #define MAX_WEBVIEW_HEIGHT 88
53 #define IME_WEBVIEW_LANDSCAPE_HEIGHT 20
55 #define IME_WEBVIEW_PORTRAIT_HEIGHT 43
56 #define IME_WEBVIEW_PORTRAIT_HEIGHT_WITH_OPTION_HEADER 33
59 typedef struct ug_data EmailComposerUGD;
64 Evas_Object *win_main;
70 /* New notify - TODO: unify the popup usage */
71 Evas_Object *composer_noti;
72 Evas_Object *timeout_noti;
73 Evas_Object *change_addr_noti;
74 Evas_Object *composer_popup;
76 Evas_Object *popup_win;
77 Evas_Object *main_layout;
78 Evas_Object *navi_bar;
79 Elm_Object_Item *navi_item;
80 Evas_Object *main_scroller;
81 Evas_Object *c_layout;
87 Evas_Object *subject_ly;
88 Evas_Object *webkit_ly;
90 Eina_Bool attachment_list_compressed;
91 Eina_List *attachment_item_obj_list;
92 Evas_Object *attachment_item_box;
93 Evas_Object *attachment_contracted_item;
95 bool bSendBtnDisabled;
100 Eina_Bool is_prediction;
101 bool is_main_scroller_scrolling;
102 bool is_webview_scrolling;
104 bool temporary_fix_for_rotation;
106 Evas_Object *priv_selected_entry;
107 Evas_Object *selected_entry;
108 Elm_Object_Item *selected_item;
110 Evas_Object *dummy_btn;
111 Evas_Object *add_me_btn;
114 Evas_Object *priority_rdg;
115 Evas_Object *priority_rd[3];
117 Eina_Bool tracking_option[2];
121 Evas_Object *send_btn;
122 Evas_Object *cancel_btn;
123 Evas_Object *send_btm_btn;
124 Evas_Object *cancel_btm_btn;
128 Ecore_Idler *idler_save_draft;
129 Ecore_Idler *idler_set_focus;
130 Ecore_Idler *idler_show_progress;
132 Ecore_Timer *send_timer;
133 Ecore_Timer *bringin_timer;
134 Ecore_Timer *mbe_unfocus_timer;
135 Ecore_Timer *focus_timer;
136 Ecore_Timer *launch_timer;
138 /* Predictive Search */
139 Ecore_Timer *ps_timer;
140 Ecore_Timer *sc_timer;
142 Evas_Object *ps_list;
143 Elm_Genlist_Item_Class ps_itc_1;
144 Elm_Genlist_Item_Class ps_itc_2;
145 Eina_List *contacts_list_info;
147 char ps_keyword[MAX_RECIPIENT_ADDRESS_LEN];
151 bool is_mbe_selected;
152 bool is_recipient_duplicated;
154 /* Multibutton Entry */
155 Evas_Object *to_mbe_entry;
156 Evas_Object *cc_mbe_entry;
157 Evas_Object *bcc_mbe_entry;
158 Evas_Object *from_mbe_entry;
159 Evas_Object *subject_editfield;
160 Evas_Object *subject_entry;
164 Evas_Object *bcc_mbe;
165 Evas_Object *from_mbe;
166 Eina_List *to_mbe_initial_list;
167 Eina_List *cc_mbe_initial_list;
168 Eina_List *bcc_mbe_initial_list;
169 Eina_List *attach_initial_list;
172 COMPOSER_FOCUS_STATUS_TYPE focus_status;
174 Evas_Object *body_ewkview;
176 Evas_Object *context_popup;
178 Eina_Bool has_body_html;
179 char *saved_html_path;
180 char *latest_info_content;
181 char *latest_html_content;
183 char *original_info_content;
184 char *original_html_content;
186 int to_recipients_cnt;
187 int cc_recipients_cnt;
188 int bcc_recipients_cnt;
190 Evas_Object *dn_noti_popup;
191 Evas_Object *dn_prog_popup;
192 Evas_Object *fw_dn_label;
193 Evas_Object *fw_dn_progress;
198 EmailComposerAccount *account_info;
199 EmailComposerMailbox *mailbox_info;
201 EmailComposerMail *new_mail_info;
202 EmailComposerMail *existing_mail_info;
208 email_address_info_list_t *addrs_info_list;
210 GList *fw_attachment_list;
215 int fw_dn_handle[MAX_ATTACHMENT_ITEM];
221 Ecore_IMF_Context *imf_context;
224 Evas_Object *account_gen_list;
225 bool b_launch_finished;
231 Eina_List *popup_list;
233 COMPOSER_ERROR_TYPE_E eComposerErrorType;
235 Eina_List *listOfImageUrls;
237 Eina_Bool b_load_finished;
238 Eina_Bool need_download;
241 typedef struct _EMAIL_ATTACHMENT_INFO_S {
251 } EMAIL_ATTACHMENT_INFO_S;
254 COMPOSER_RECIPIENT_TYPE_NONE = 0,
255 COMPOSER_RECIPIENT_TYPE_TO,
256 COMPOSER_RECIPIENT_TYPE_CC,
257 COMPOSER_RECIPIENT_TYPE_BCC,
258 COMPOSER_RECIPIENT_TYPE_FROM,
259 COMPOSER_RECIPIENT_TYPE_MAX,
260 } COMPOSER_RECIPIENT_TYPE_E;
262 /****************************************************/
263 /* Function Declaration */
264 /****************************************************/
266 void create_composer_frame(EmailComposerUGD *ugd);
267 void _composer_create_view(Evas_Object *parent, EmailComposerUGD *ugd);
269 #endif /* __DEF_email_composer_H__ */