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 108
40 #define COMPOSER_SP_H 10
41 #define COMPOSER_EDIT_FIELD_H 80
42 #define COMPOSER_BUTTON_FIELD_H 80
44 #define _ENABLE_ENDKEY_ 0
45 #define MAX_RECENT_ITEM 100
46 #define TEMP_BUFFER_SIZE 1024
48 #define MAX_WEBVIEW_HEIGHT 88
49 #define IME_WEBVIEW_LANDSCAPE_HEIGHT 20
51 #define IME_WEBVIEW_PORTRAIT_HEIGHT 43
52 #define IME_WEBVIEW_PORTRAIT_HEIGHT_WITH_OPTION_HEADER 33
55 typedef struct ug_data EmailComposerUGD;
60 Evas_Object *win_main;
66 /* New notify - TODO: unify the popup usage */
67 Evas_Object *composer_noti;
68 Evas_Object *timeout_noti;
69 Evas_Object *change_addr_noti;
70 Evas_Object *composer_popup;
72 Evas_Object *popup_win;
73 Evas_Object *main_layout;
74 Evas_Object *navi_bar;
75 Elm_Object_Item *navi_item;
76 Evas_Object *main_scroller;
77 Evas_Object *c_layout;
84 Evas_Object *subject_ly;
85 Evas_Object *webkit_ly;
87 Eina_Bool attachment_list_compressed;
88 Eina_List *attachment_item_obj_list;
89 Evas_Object *attachment_item_box;
90 Evas_Object *attachment_contracted_item;
92 bool bSendBtnDisabled;
98 bool is_main_scroller_scrolling;
99 bool is_webview_scrolling;
101 #ifdef _TEMPORARY_FIX_FOR_ROTATION_
102 bool temporary_fix_for_rotation;
105 Evas_Object *priv_selected_entry;
106 Evas_Object *selected_entry;
107 Elm_Object_Item *selected_item;
109 int option_header_opened;
111 Evas_Object *dummy_btn;
112 Evas_Object *add_me_btn;
113 Evas_Object *save_as_draft_btn;
116 Evas_Object *priority_btn;
117 Evas_Object *priority_rdg;
118 Evas_Object *priority_rd[3];
120 Evas_Object *tracking_btn;
121 Eina_Bool tracking_option[2];
125 Elm_Object_Item *controlbar_item[6];
128 Evas_Object *bcc_btn;
130 Evas_Object *send_btn;
131 Evas_Object *cancel_btn;
135 Ecore_Idler *idler_save_draft;
136 Ecore_Idler *idler_set_focus;
137 Ecore_Idler *idler_show_progress;
139 Ecore_Timer *send_timer;
140 Ecore_Timer *bringin_timer;
141 Ecore_Timer *mbe_unfocus_timer;
142 Ecore_Timer *focus_timer;
143 Ecore_Timer *launch_timer;
145 /* Predictive Search */
146 Ecore_Timer *ps_timer;
147 Ecore_Timer *sc_timer;
149 Evas_Object *ps_list;
150 Elm_Genlist_Item_Class ps_itc_1;
151 Elm_Genlist_Item_Class ps_itc_2;
152 Eina_List *contacts_list_info;
154 char ps_keyword[MAX_RECIPIENT_ADDRESS_LEN];
158 bool is_mbe_selected;
159 bool is_recipient_duplicated;
161 /* Multibutton Entry */
162 Evas_Object *to_mbe_entry;
163 Evas_Object *cc_mbe_entry;
164 Evas_Object *bcc_mbe_entry;
165 Evas_Object *from_mbe_entry;
166 Evas_Object *subject_editfield;
167 Evas_Object *subject_entry;
171 Evas_Object *bcc_mbe;
172 Evas_Object *from_mbe;
173 Eina_List *to_mbe_initial_list;
174 Eina_List *cc_mbe_initial_list;
175 Eina_List *bcc_mbe_initial_list;
176 Eina_List *attach_initial_list;
179 COMPOSER_FOCUS_STATUS_TYPE focus_status;
181 Evas_Object *body_ewkview;
183 Eina_Bool has_body_html;
184 char *saved_html_path;
185 char *saved_html_content;
186 char *latest_html_content;
189 int to_recipients_cnt;
190 int cc_recipients_cnt;
191 int bcc_recipients_cnt;
193 Evas_Object *dn_noti_popup;
194 Evas_Object *dn_prog_popup;
195 Evas_Object *fw_dn_label;
196 Evas_Object *fw_dn_progress;
201 EmailComposerAccount *account_info;
202 EmailComposerMailbox *mailbox_info;
204 EmailComposerMail *new_mail_info;
205 EmailComposerMail *existing_mail_info;
211 email_address_info_list_t *addrs_info_list;
213 GList *fw_attachment_list;
217 int fw_dn_handle[MAX_ATTACHMENT_ITEM];
223 Ecore_IMF_Context *imf_context;
225 Evas_Object *account_gen_list;
231 Eina_List *popup_list;
233 COMPOSER_ERROR_TYPE_E eComposerErrorType;
236 Eina_List *listOfImageUrls;
238 Eina_Bool b_load_finished;
241 typedef struct _EMAIL_CONTACT_LIST_INFO_S {
247 char display_name[MAX_RECIPIENT_ADDRESS_LEN];
248 EmailComposerUGD *ugd;
249 } EMAIL_CONTACT_LIST_INFO_S;
251 typedef struct _EMAIL_ATTACHMENT_INFO_S {
261 } EMAIL_ATTACHMENT_INFO_S;
264 COMPOSER_RECIPIENT_TYPE_NONE = 0,
265 COMPOSER_RECIPIENT_TYPE_TO,
266 COMPOSER_RECIPIENT_TYPE_CC,
267 COMPOSER_RECIPIENT_TYPE_BCC,
268 COMPOSER_RECIPIENT_TYPE_FROM,
269 COMPOSER_RECIPIENT_TYPE_MAX,
270 } COMPOSER_RECIPIENT_TYPE_E;
273 EMAIL_COMPOSER_ADD_ME_BTN,
274 EMAIL_COMPOSER_ADD_CC_BCC_BTN,
275 EMAIL_COMPOSER_SAVE_AS_DRAFT_BTN,
276 EMAIL_COMPOSER_PRIORITY_BTN,
277 EMAIL_COMPOSER_TRACKING_BTN,
278 EMAIL_COMPOSER_DUMMY_BTN,
279 EMAIL_COMPOSER_BTN_MAX
282 /****************************************************/
283 /* Function Declaration */
284 /****************************************************/
286 void create_composer_frame(EmailComposerUGD *ugd);
287 void _composer_create_view(Evas_Object *parent, EmailComposerUGD *ugd);
288 #endif /* __DEF_email_composer_H__ */