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_MSG_UI_THREAD_MAIN_H__
18 #define __DEF_MSG_UI_THREAD_MAIN_H__
22 #include <MsgStorageTypes.h>
23 #include <MapiTransport.h>
24 #include <MapiControl.h>
25 #include <MapiStorage.h>
26 #include <MapiMessage.h>
30 #include <appcore-efl.h>
32 #include <Ecore_IMF.h>
33 #include <Elementary.h>
34 #include <ui-gadget-module.h>
37 #include <contacts-svc.h>
40 #include "msg-ui-util.h"
41 #include "msg-ui-common-utility.h"
43 #define MSG_THREAD_THEME EDJDIR"/thread_genlist.edj"
44 #define MSG_THREAD_CONTROLBAR_ITEM_NUM (4)
47 THREAD_NORMAL_VIEW = 0,
49 THREAD_UNLOAD_VIEW, /* when it calls other gadgets or views. */
53 THREAD_SEARCH_OFF = 0,
58 MSG_THREAD_ID_T threadId;
59 char threadAddr[DEF_THREAD_ADDR_LEN+1];
60 char threadName[DEF_THREAD_NAME_LEN+1];
61 char threadData[DEF_BUF_LEN_S+1];
63 MSG_DIRECTION_TYPE_T direction;
64 MSG_CONTACT_ID_T contactId;
71 } MSG_APP_THREAD_DATA_S, *PMSG_APP_THREAD_DATA_S;
73 typedef struct _MSG_THREAD_DATA {
76 Evas_Object *win_main;
77 Evas_Object *navi_frame;
79 Elm_Object_Item *nf_it;
81 Evas_Object *content_ly;
83 Evas_Object *sel_all_ly;
84 Evas_Object *back_btn;
86 Evas_Object *sel_all_box;
87 Eina_Bool sel_all_checked;
89 Ecore_IMF_Context *imf_ctx;
91 Elm_Object_Item *toolbar_item[MSG_THREAD_CONTROLBAR_ITEM_NUM];
96 Evas_Object *searchbar;
98 Evas_Object *tickernoti;
102 Evas_Object *progressbar;
103 Evas_Object *progresslabel;
105 Evas_Object *select_info;
106 Evas_Object *selectioninfo_layout;
108 Elm_Genlist_Item_Class *itc;
110 Elm_Genlist_Item_Class itc_thread;
111 Elm_Genlist_Item_Class itc_empty;
113 MSG_HANDLE_T msgHandle;
114 ThreadViewMode viewmode;
115 ThreadSearchMode search_mode;
118 Elm_Object_Item *sel_gen_item;
121 Ecore_Thread *del_thread;
128 msg_time_format time_fmt;
129 char locale[DEF_BUF_LEN];
137 bool isIncomingMsg; /* Check there is new incoming message when it back from edit mode to normal. */
138 } MSG_THREAD_DATA, *PMSG_THREAD_DATA;
141 #define MSG_THREAD_UNREAD_BADGE \
142 IMGDIR"/M01_btn_Unread_message.png"
143 #define MSG_THREAD_OTA_BADGE \
144 IMGDIR"/M01_icon_OTA.png"
145 #define MSG_THREAD_PUSH_BADGE \
146 IMGDIR"/M01_icon_Push.png"
147 #define MSG_THREAD_BROADCAST_BADGE \
148 IMGDIR"/M01_icon_broadcasting.png"
150 #define MSG_THREAD_POPUP_DATA "popup_data"
151 #define MSG_THREAD_DEL_CONFIRM "del_confirm"
153 void *msg_ui_thread_init_thread_data(struct appdata *ad);
154 void msg_ui_thread_deinit_thread_data(void *data);
156 void msg_ui_thread_load_thread_view(void *data, bundle *b);
157 void msg_ui_thread_reset_thread_view(void *data, bundle *b);
159 void msg_ui_thread_fullview_launch(PMSG_THREAD_DATA pData);
160 Evas_Object *msg_ui_thread_create_content_layout(PMSG_THREAD_DATA pData);
161 Evas_Object *msg_ui_thread_create_nocontent_layout(PMSG_THREAD_DATA pData);
162 Evas_Object *msg_ui_thread_create_layout_main(Evas_Object *parent);
163 Evas_Object *msg_ui_thread_create_genlist(PMSG_THREAD_DATA pData);
164 Evas_Object *msg_ui_thread_create_searchbar_layout(PMSG_THREAD_DATA pDatat);
166 void msg_ui_thread_reg_msg_cb_func(PMSG_THREAD_DATA pData);
168 PMSG_THREAD_DATA msg_ui_thread_get_data(void);
169 void msg_ui_thread_add_navi_controlbar_item(PMSG_THREAD_DATA pData);
173 void msg_ui_thread_set_msg_data(PMSG_APP_THREAD_DATA_S thread_data, msg_thread_view_t msgThreadInfo);
174 void msg_ui_thread_gl_sel(void *data, Evas_Object *obj, void *event_info);
175 void msg_ui_thread_gl_empty_sel(void *data, Evas_Object *obj, void *event_info);
176 void msg_ui_thread_list_load(PMSG_THREAD_DATA ThreadData);
177 void msg_ui_thread_list_update(PMSG_THREAD_DATA ThreadData);
178 void msg_ui_thread_list_item_update(PMSG_THREAD_DATA ThreadData, MSG_THREAD_ID_T threadId);
179 void msg_ui_thread_genlist_style_set(PMSG_THREAD_DATA ThreadData);
180 void msg_ui_thread_genlist_frame_style_set(PMSG_THREAD_DATA ThreadData);
181 void msg_ui_thread_gl_mode_right(void *data, Evas_Object *obj, void *event_info);
182 void msg_ui_thread_gl_mode_left(void *data, Evas_Object *obj, void *event_info);
184 /* THREAD CALLBACK */
185 void msg_ui_thread_storage_change_cb(MSG_HANDLE_T handle, MSG_STORAGE_CHANGE_TYPE_T storageChangeType, MSG_MSGID_LIST_S *pMsgIdList, void *user_param);
186 void msg_ui_thread_ctlbar_del_cb(void *data, Evas_Object *obj, void *event_info);
187 void msg_ui_thread_ctlbar_edit_cb(void *data, Evas_Object *obj, void *event_info);
188 void msg_ui_thread_ctlbar_compose_cb(void *data, Evas_Object *obj, void *event_info);
189 void msg_ui_thread_ctlbar_cancel_cb(void *data, Evas_Object *obj, void *event_info);
191 void msg_ui_thread_sel_all_clicked_cb(void *data, Evas_Object *obj, void *event_info);
192 void msg_ui_thread_list_checked_cb(void *data, Evas_Object *obj, void *event_info);
193 void msg_ui_thread_back_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info);
194 void msg_ui_thread_searchbar_entry_focus_cb(void *data, Evas_Object *obj, void *event_info);
195 void msg_ui_thread_searchbar_entry_unfocus_cb(void *data, Evas_Object *obj, void *event_info);
196 void msg_ui_thread_searchbar_entry_change_cb(void *data, Evas_Object *obj, void *event_info);
197 void msg_ui_thread_searchbar_entry_click_cb(void *data, Evas_Object *obj, void *event_info);
198 void msg_ui_thread_searchbar_cancel_click_cb(void *data, Evas_Object *obj, void *event_info);
199 void msg_ui_thread_searchbar_eraser_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
200 void msg_ui_thread_timezone_change_cb(void *data);
203 void msg_ui_thread_get_time_format(PMSG_THREAD_DATA pData);
204 void msg_ui_thread_get_locale(PMSG_THREAD_DATA pData);
206 bundle *msg_ui_thread_get_bubble_data(PMSG_APP_THREAD_DATA_S item_data);
208 void msg_ui_thread_cancel_edit_mode(PMSG_THREAD_DATA pData);
209 void msg_ui_thread_show_normal_mode(PMSG_THREAD_DATA pData);
210 void msg_ui_thread_show_split_view(PMSG_THREAD_DATA pData);
211 void msg_ui_thread_select_item_by_thread_id(PMSG_THREAD_DATA pData, int thread_id);
212 void msg_ui_thread_show_notify(PMSG_THREAD_DATA threadData, const char *msg);
213 void msg_ui_thread_show_del_popup(PMSG_THREAD_DATA threadData, const char *msg);
214 Evas_Object* msg_ui_thread_show_notify_with_progressbar(PMSG_THREAD_DATA threadData, int count);
215 void msg_ui_thread_show_select_info(PMSG_THREAD_DATA pData);
217 void msg_ui_thread_set_app_state(int app_state);
218 int msg_ui_thread_get_app_state(PMSG_THREAD_DATA pData);
220 #endif /* __DEF_MSG_UI_THREAD_MAIN_H__ */