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.
18 #ifndef _VCUI_APPLICATION_H_
19 #define _VCUI_APPLICATION_H_
21 #include <contacts-svc.h>
36 #include <Elementary.h>
38 #include <Ecore_X_Atoms.h>
41 #include <sys/types.h>
42 #include <sys/socket.h>
43 #include <arpa/inet.h>
49 #include <sys/ioctl.h>
52 #include "appcore-efl.h"
54 #include "vcui-app-data.h"
55 #include "vcui-doc-launch.h"
56 #include "voice-call-engine-msg.h"
58 #include "vcui-document.h"
59 #include "vcui-view-choice.h"
60 #include "vcui-view-common.h"
61 #include "vcui-view-elements.h"
62 #include "vcui-view-popup.h"
68 #define DIALER_PKG "org.tizen.phone"
69 #define CONTACTS_PKG "org.tizen.contacts"
72 # define PACKAGE "voice-call-ui"
75 #if !defined(LOCALEDIR)
76 # define LOCALEDIR "/opt/apps/org.tizen.call/res/locale"
80 # define EDJDIR "/opt/apps/org.tizen.call/res/edje"
84 # define IMGDIR "/opt/apps/org.tizen.call/res/images"
87 #if !defined(MEDIADIR)
88 # define MEDIADIR "/opt/apps/org.tizen.call/res/media"
92 # define ICONDIR "/opt/apps/org.tizen.call/res/icons/default/small"
95 #define EDJ_NAME EDJDIR"/voice-call-ui.edj"
96 #define CALL_THEME EDJDIR"/call_theme.edj"
98 #define GRP_MTVIEW "mt-view"
99 #define GRP_MOVIEW "mo-view"
100 #define GRP_INCALL "incall"
101 #define GRP_MTLOCK "mtlock"
102 #define GRP_KEYPAD "keypad"
103 #define GRP_MULTICALL_SPLIT "multicall-split"
104 #define GRP_MULTICALL_SPLIT2 "multicall-split2"
105 #define GRP_MULTICALL_CONF "multicall-conf"
106 #define GRP_MULTICALL "multicall-list"
107 #define GRP_REJECT_MSG "reject_with_msg"
108 #define GRP_UG_EFFECT "ug_effect"
109 #define GRP_END_SINGLECALL "end-singlecall"
110 #define GRP_END_CONFCALL "end-confcall"
111 #define GRP_QUICKPANEL "quickpanel"
112 #define GRP_QUICKPANEL_LSCAPE "quickpanel-lscape"
113 #define GRP_SEPARATOR_LAYOUT "separator-layout"
114 #define GRP_SEPARATOR_LAYOUT_3BUTTON "separator-layout-3button"
115 #define GRP_BUTTON_LAYOUT "button-layout"
116 #define GRP_CALLER_INFO "caller-info"
117 #define GRP_KEYPAD_SEP_LAYOUT "keypad-separator"
118 #define GRP_ALERTS_LAYOUT "sns-alerts-layout"
120 #define GRP_LOCK_ACCEPT "lock_accept"
121 #define GRP_LOCK_REJECT "lock_reject"
122 #define GRP_LOCK_REJECT_WITH_MSG "lock_reject_with_msg"
124 #define QP_NOIMG_ICON IMGDIR"/vc_qp_caller_ID.png"
125 #define QP_CONF_ICON IMGDIR"/vc_qp_caller_ID_group.png"
126 #define QP_CALL_ICON ICONDIR"/org.tizen.call.png"
127 #define NOIMG_ICON IMGDIR"/vc_normal_caller_ID.png"
128 #define CONF_ICON IMGDIR"/vc_normal_caller_ID_group.png"
129 #define PRIVATE_ICON IMGDIR"/vc_conference_private.png"
130 #define CALLER_ID_DEFAULT IMGDIR"/vc_caller_ID_default.png"
132 #define KEYPAD_ICON IMGDIR"/vc_keypad_icon.png"
133 #define CONTACT_ICON IMGDIR"/vc_contact_icon.png"
134 #define ADDCALL_ICON IMGDIR"/vc_add_icon.png"
135 #define JOIN_ICON IMGDIR"/vc_join_icon.png"
136 #define END_CALL_ICON IMGDIR"/vc_end_call_icon.png"
137 #define SPEAKER_ICON IMGDIR"/vc_speaker_icon.png"
138 #define MUTE_ICON IMGDIR"/vc_mute_icon.png"
139 #define CONF_CALL_END_ICON IMGDIR"/vc_icon_conf_call_end.png"
140 #define CALLING_NAME_BG_IMAGE IMGDIR"/vc_calling_name_BG_image.png"
141 #define BDAY_ICON IMGDIR"/vc_birthday_icon.png"
142 #define MO_NOCALLER_ID_ICON IMGDIR"/vc_outgoingcall_No_caller_ID.png"
143 #define CALLER_INFO_ICON IMGDIR"/vc_caller_info_icon.png"
144 #define NOIMG_SPLIT_ICON IMGDIR"/vc_caller_ID_split.png"
145 #define CONF_SPLIT_ICON IMGDIR"/vc_caller_ID_split_group.png"
147 #define SPEAKER_PRESS_ICON IMGDIR"/vc_speaker_on_icon.png"
148 #define MUTE_PRESS_ICON IMGDIR"/vc_mute_on_icon.png"
150 #define KEYPAD_DISABLED_ICON IMGDIR"/vc_keypad_icon_dim.png"
151 #define CONTACT_DISABLED_ICON IMGDIR"/vc_contact_icon_dim.png"
152 #define ADDCALL_DISABLED_ICON IMGDIR"/vc_add_icon_dim.png"
153 #define JOIN_DISABLED_ICON IMGDIR"/vc_join_icon_dim.png"
154 #define END_CALL_DISABLED_ICON IMGDIR"/vc_end_call_icon_dim.png"
155 #define SPEAKER_DISABLED_ICON IMGDIR"/vc_speaker_icon_dim.png"
156 #define MUTE_DISABLED_ICON IMGDIR"/vc_mute_icon_dim.png"
157 #define SHARE_DISABLED_ICON IMGDIR"/vc_rcs_share_icon_dim.png"
159 #define HOLD_ICON IMGDIR"/vc_icon_hold_call.png"
160 #define UNHOLD_ICON IMGDIR"/vc_icon_unhold_call.png"
161 #define SWAP_ICON IMGDIR"/vc_icon_swap_call.png"
163 #define VOLUME_ICON IMGDIR"/vc_volume_icon.png"
164 #define VOLUME_MUTE_ICON IMGDIR"/vc_volume_mute_icon.png"
166 #define VOICE_CALL_ICON IMGDIR"/vc_voice_call_icon.png"
167 #define VIDEO_CALL_ICON IMGDIR"/vc_video_call_icon.png"
168 #define MESSAGE_ICON IMGDIR"/vc_msg_icon.png"
170 #define REJ_MSG_BACK_ICON IMGDIR"/vc_reject_back_icon.png"
171 #define REJ_MSG_CREATE_ICON IMGDIR"/vc_reject_create_icon.png"
173 #define CALL_BG_IMG IMGDIR"/vc_call_bg_img.png"
174 #define CALL_NOT_SAVED_BG_IMG IMGDIR"/vc_call_not_saved_bg_img.png"
176 #define MORE_MANAGE_CONF_ICON IMGDIR"/vc_more_manage_conf.png"
177 #define MORE_ADD_CALL_ICON IMGDIR"/vc_more_add_call.png"
178 #define MORE_JOIN_ICON IMGDIR"/vc_more_join.png"
179 #define MORE_CONTACTS_ICON IMGDIR"/vc_more_contacts.png"
181 #define QP_MUTE_ICON IMGDIR"/vc_qp_mute_on.png"
183 #define NOTIFY_MISSED_CALL_ICON IMGDIR"/vc_notify_missed_call.png"
184 #define NOTIFY_SUB_MISSED_CALL_ICON IMGDIR"/vc_notify_sub_missed_call.png"
186 #define MINI_CONTROLLER_WIDTH (480)
187 #define MINI_CONTROLLER_HEIGHT (42)
189 #define MAIN_WIN_HD_W 720
190 #define MAIN_WIN_HD_H 1280
191 #define MAIN_WIN_WVGA_W 480
192 #define MAIN_WIN_WVGA_H 800
194 #define QUICKPANEL_WIDTH (720)
195 #define LSCAPE_QUICKPANEL_WIDTH (1280)
196 #define QUICKPANEL_HEIGHT (170)
198 #define MORE_MENU_CTXPOPUP_X 660
199 #define MORE_MENU_CTXPOPUP_Y 175
201 #define DEF_BUF_LEN (128)
202 #define DEF_BUF_LEN_LONG (256)
204 #define VAL_VOL_UP (1)
205 #define VAL_VOL_DOWN (0)
207 #define RINGTONE_MIN (0)
208 #define RINGTONE_MAX (15)
209 #define VOICE_VOL_MIN (1)
210 #define VOICE_VOL_MAX (7) /* It must change to 6 later.. */
211 #define BT_VOL_MIN (1)
212 #define BT_VOL_MAX (15)
214 #define RINGTONE_LONGPRESS_MUTE_TIMEOUT 0.7
215 #define VOLUME_KEY_LONG_PRESS_TIMEOUT 0.1
217 #define POPUP_TIMEOUT_SHORT (2.0)
218 #define POPUP_TIMEOUT_NORMAL (3.0)
219 #define POPUP_TIMEOUT_LONG (5.0)
220 #define POPUP_TIMEOUT_VERY_LONG (10.0)
222 #define TIMER_TIMEOUT_0_1_SEC (0.1)
223 #define TIMER_TIMEOUT_0_3_SEC (0.3)
224 #define TIMER_TIMEOUT_0_5_SEC (0.5)
225 #define TIMER_TIMEOUT_1_SEC (1.0)
226 #define TIMER_TIMEOUT_2_SEC (2.0)
227 #define TIMER_TIMEOUT_4_SEC (4.0)
229 #define BLUR_VALUE 30
230 #define IMG_TYPE_FULL 1
231 #define IMG_TYPE_WALLPAPER 2
232 #define IMG_TYPE_BLUR 3
234 #define BG_DEFAULT_PATH "/opt/media/Images and videos/Wallpapers/Home_default.png"
244 #ifdef CALL_DEBUG_ON_DLOG
245 #define CALL_UI_DEBUG(frmt, args...) do { LOG(LOG_DEBUG, TAG_CALL, "[vcui] [%s:%d] "frmt"\n", __func__, __LINE__, ##args); } while (0)
246 #define CALL_UI_KPI(frmt, args...) do { LOG(LOG_DEBUG, TAG_CALL_LAUNCH, "[VC_KPI] [%s:%d] "frmt"\n", __func__, __LINE__, ##args); } while (0)
248 #define CALL_UI_DEBUG(args...)
252 #define retv_if(expr, val) do { \
254 CALL_UI_DEBUG("(%s) -> %s() return", #expr, __FUNCTION__); \
261 #define retvm_if(expr, val, fmt, arg...) do { \
263 CALL_UI_DEBUG(fmt, ##arg); \
264 CALL_UI_DEBUG("(%s) -> %s() return", #expr, __FUNCTION__); \
270 #ifndef VCUI_RETURN_IF_FAIL
271 #define VCUI_RETURN_IF_FAIL(check_condition) \
272 if (!(check_condition)) return;
275 #ifndef VCUI_RETURN_FALSE_IF_FAIL
276 #define VCUI_RETURN_FALSE_IF_FAIL(check_condition) \
277 if (!(check_condition)) return EINA_FALSE;
280 #ifndef VCUI_RETURN_VALUE_IF_FAIL
281 #define VCUI_RETURN_VALUE_IF_FAIL(check_condition, value) \
282 if (!(check_condition)) return value;
285 #ifndef VCUI_RETURN_NULL_IF_FAIL
286 #define VCUI_RETURN_NULL_IF_FAIL(check_condition) \
287 if (!(check_condition)) return NULL;
290 #ifndef VCUI_RETURN_ZERO_IF_FAIL
291 #define VCUI_RETURN_ZERO_IF_FAIL(check_condition) \
292 if (!(check_condition)) return 0;
295 #ifndef VCUI_RETURN_INVALID_IF_FAIL
296 #define VCUI_RETURN_INVALID_IF_FAIL(check_condition) \
297 if (!(check_condition)) return -1;
300 #ifndef VCUI_RETURN_VALUE_IF_NOT_IN_RANGE
301 #define VCUI_RETURN_VALUE_IF_NOT_IN_RANGE(value, min_value, max_value, ret_val) \
302 if ((value < min_value) || (value > max_value)) return ret_val;
306 #define _EDJ(obj) elm_layout_edje_get(obj)
309 #define _EVAS_OBJ_DEL(obj) if (obj) \
311 evas_object_del(obj); \
320 typedef enum _voice_call_bg_type_t {
323 } voice_call_bg_type_t;
326 CALL_END_TYPE_NONE = -1,
327 CALL_END_TYPE_SINGLE_CALL,
328 CALL_END_TYPE_CONF_CALL,
329 } voice_call_end_type_t;
331 void _create_main_ui_set_flag();
332 void _create_main_ui_real();
333 void _vcui_show_main_ui_set_flag();
334 void __vcui_hide_main_ui_set_flag();
336 void _vcui_determine_background_show_hide();
338 void _vcui_cache_flush();
339 vcui_app_call_data_t *_vcui_get_app_data();
340 int _vcui_is_idle_lock();
342 gboolean _vcui_is_gcf_mode(void);
343 gboolean _vcui_is_headset_conected(void);
344 gboolean _vcui_is_headset_switch_on(void);
345 gboolean _vcui_is_answering_mode_on(void);
346 gboolean _vcui_is_powerkey_mode_on(void);
347 gboolean _vcui_is_phonelock_status(void);
349 void _vcui_add_calllog(int type, call_data_t *data, int boutgoing_end);
351 void _vcui_response_volume(int vol_alert_type, int vol_level);
352 void _vcui_set_volume(int key_status);
354 void _vcui_raise_main_win();
355 int _vcui_check_valid_eo(Evas_Object *eo, char *v_name);
357 unsigned long _vcui_get_diff_now(time_t start_time);
359 char *_vcui_get_endcause_string(int end_cause, char *data);
361 Evas_Object *_vcui_load_edj(Evas_Object *parent, const char *file, const char *group);
363 #endif /* _VCUI_APPLICATION_H_ */