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 __MSG_UI_COMPOSER_BUBBLE_H__
18 #define __MSG_UI_COMPOSER_BUBBLE_H__
24 #include <MsgStorageTypes.h>
25 #include <MsgTransportTypes.h>
26 #include <MapiControl.h>
27 #include <MapiStorage.h>
28 #include <MapiTransport.h>
29 #include <MapiMessage.h>
33 #include <appcore-efl.h>
35 #include <Elementary.h>
36 #include <ui-gadget-module.h>
39 #include "msg-ui-util.h"
40 #include "msg-ui-common-utility.h"
42 #include <contacts-svc.h>
43 #include <contacts-ug.h>
45 #define MSG_BUBBLE_SIM_MSG_ICON IMGDIR"/07_message_sim.png"
46 #define MSG_BUBBLE_ATTACH_ICON IMGDIR"/Seven_IM_clip_nor.png"
48 #define MSG_VCONF_KEY_SELECTED_THEME "db/setting/selected_theme"
50 /* STYLE for genlist and entry */
51 #define MSG_BUBBLE_STYLE_SENT "sentmessage"
52 #define MSG_BUBBLE_STYLE_RECV "readmessage"
54 #define MSG_BUBBLE_CONTENT_H (653)
55 #define MSG_BUBBLE_IMG_MAX_W (75) //FIXME :: It should be fixed at Entry.edc
57 #define MSG_BUBBLE_CONTROLBAR_ITEM_NUM (4)
60 BUBBLE_NORMAL_VIEW = 0,
80 WORD_TYPE_NONE = 0x00,
82 WORD_TYPE_URL_WITH_PROTC,
88 MSG_BOX_PACK_START = 0,
95 MSG_MESSAGE_ID_T msgId;
97 MSG_STORAGE_ID_T storageId;
99 char displayDate[DEF_BUF_LEN_S];
100 MSG_NETWORK_STATUS_T networkStatus;
104 char msgText[DEF_MAX_MSG_TEXT_LEN+1];
111 } MSG_APP_CONV_DATA_S, *PMSG_APP_CONV_DATA_S;
114 PMSG_APP_CONV_DATA_S add_item;
115 Evas_Object *rel_obj;
116 MsgBoxPackType pack_type;
119 typedef struct _MSG_BUBBLE_DATA {
120 Evas_Object *layout_main;
122 Evas_Object *toolbar;
125 Elm_Object_Item *toolbar_item[MSG_BUBBLE_CONTROLBAR_ITEM_NUM];
127 BubbleViewMode viewmode;
128 BubbleUGState ug_state;
130 Evas_Object *parent_layout;
131 Evas_Object *bubble_layout;
132 Evas_Object *sel_all_ly;
133 Evas_Object *sel_all_box;
137 Evas_Object *progressbar;
138 Evas_Object *progresslabel;
140 Evas_Object *select_info;
141 Evas_Object *selectioninfo_layout;
143 Eina_List *bubble_list;
144 Eina_List *realized_list;
146 Eina_List *added_list;
148 Eina_Bool sel_all_checked;
153 msg_time_format time_fmt;
154 char locale[DEF_BUF_LEN];
157 Ecore_Animator *load_animator;
158 Ecore_Animator *add_animator;
159 Ecore_Idler *scroll_idler;
160 Ecore_Idler *add_idler;
161 Ecore_Idler *resend_idler;
162 Ecore_Idler *retrieve_idler;
163 Ecore_Idler *conformant_idler;
164 Ecore_Thread *del_thread;
166 MSG_HANDLE_T msgHandle;
167 MSG_THREAD_ID_T threadId;
168 MSG_CONTACT_ID_T contactId;
169 char threadAddr[DEF_THREAD_ADDR_LEN+1];
170 char threadName[DEF_THREAD_NAME_LEN+1];
175 int msg_type; /* type of the latest message in the selected converstaion list*/
180 } MSG_BUBBLE_DATA, *PMSG_BUBBLE_DATA;
184 PMSG_BUBBLE_DATA msg_ui_bubble_init_bubble_data(MSG_HANDLE_T msgHandle, void *callback_data);
185 void msg_ui_bubble_deinit_bubble_data(void *data);
187 void msg_ui_bubble_parse_bubble_data(PMSG_BUBBLE_DATA bubble_data, bundle *b);
188 void msg_ui_bubble_start_bubble_list(PMSG_BUBBLE_DATA bubble_data);
189 void msg_ui_bubble_init_bubble_list(PMSG_BUBBLE_DATA bubble_data);
191 Evas_Object *msg_ui_bubble_create_controlbar(Evas_Object *parent, void *user_data);
192 Evas_Object *msg_ui_bubble_create_view(Evas_Object *parent, void *user_data);
193 void msg_ui_bubble_start_view(PMSG_BUBBLE_DATA bubble_data);
194 void msg_ui_bubble_add_normal_control_item(void *user_data);
196 void msg_ui_bubble_reg_bubble_cb_func(PMSG_BUBBLE_DATA pData);
197 PMSG_BUBBLE_DATA msg_ui_bubble_get_bubble_data(void);
199 void msg_ui_bubble_fill_bubble_contents(PMSG_BUBBLE_DATA bubble_data, PMSG_APP_CONV_DATA_S item_data);
200 Eina_Bool msg_ui_bubble_item_load_cb(void *data);
201 void msg_ui_bubble_list_load(PMSG_BUBBLE_DATA bubble_data);
202 void msg_ui_bubble_list_data_update(PMSG_BUBBLE_DATA bubble_data);
203 void msg_ui_bubble_item_data_update(PMSG_BUBBLE_DATA bubble_data, msg_message_t msg);
204 Eina_Bool msg_ui_bubble_item_add_cb(void *data);
205 void msg_ui_bubble_list_append(PMSG_BUBBLE_DATA bubble_data, msg_message_t msg);
206 void msg_ui_bubble_list_item_move(PMSG_BUBBLE_DATA bubble_data, msg_message_t msg);
208 void msg_ui_bubble_change_normal_navi_control(PMSG_BUBBLE_DATA pData);
209 void msg_ui_bubble_msg_storage_change_cb(MSG_HANDLE_T handle, MSG_STORAGE_CHANGE_TYPE_T type, MSG_MSGID_LIST_S *pMsgIdList, void *user_param);
210 void msg_ui_bubble_ctlbar_edit_cb(void *data, Evas_Object *obj, void *event_info);
211 void msg_ui_bubble_ctlbar_call_cb(void *data, Evas_Object *obj, void *event_info);
212 void msg_ui_bubble_ctlbar_add_to_contact_cb(void *data, Evas_Object *obj, void *event_info);
213 void msg_ui_bubble_ctlbar_view_ct_detail_cb(void *data, Evas_Object *obj, void *event_info);
214 void msg_ui_bubble_ctlbar_delete_cb(void *data, Evas_Object *obj, void *event_info);
215 void msg_ui_bubble_ctlbar_forward_cb(void *data, Evas_Object *obj, void *event_info);
216 void msg_ui_bubble_ctlbar_move_cb(void *data, Evas_Object *obj, void *event_info);
217 void msg_ui_bubble_ctlbar_cancel_cb(void *data, Evas_Object *obj, void *event_info);
218 void msg_ui_bubble_sel_all_clicked_cb(void *data, Evas_Object *obj, void *event_info);
219 void msg_ui_bubble_item_mouse_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
220 void msg_ui_bubble_item_mouse_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
221 void msg_ui_bubble_layout_mouse_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
222 void msg_ui_bubble_layout_mouse_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
223 void msg_ui_bubble_list_checked_cb(void *data, Evas_Object *obj, void *event_info);
224 void msg_ui_bubble_timezone_change_cb(void *data);
225 void msg_ui_bubble_scroll_edge_top_cb(void *data, Evas_Object *obj, void *event_info);
226 void msg_ui_bubble_scroll_drag_start_cb(void *data, Evas_Object *obj, void *event_info);
227 void msg_ui_bubble_launch_voice_call(const char *call_num);
228 char *msg_ui_bubble_get_trimmed_number(const char *org_num);
229 void msg_ui_bubble_launch_add_to_contact_ug(PMSG_BUBBLE_DATA pData);
230 void msg_ui_bubble_launch_contact_list_ug(PMSG_BUBBLE_DATA pData, int type, const char *str);
231 void msg_ui_bubble_launch_contact_detail_ug(PMSG_BUBBLE_DATA pData, int ct_id);
232 void msg_ui_bubble_show_notify(PMSG_BUBBLE_DATA bubbleData, char *msg);
233 void msg_ui_bubble_show_notify_with_timeout(PMSG_BUBBLE_DATA pData, char *msg, double timeout);
234 Evas_Object* msg_ui_bubble_show_notify_with_progressbar(PMSG_BUBBLE_DATA pData, int count);
236 void msg_ui_bubble_show_select_info(PMSG_BUBBLE_DATA pData);
237 void msg_ui_bubble_contact_info_update(PMSG_BUBBLE_DATA pData);
238 void msg_ui_bubble_get_time_format(PMSG_BUBBLE_DATA pData);
239 void msg_ui_bubble_get_locale(PMSG_BUBBLE_DATA pData);