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_MAIN_H_
19 #define __VCUI_MAIN_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-doc-launch.h"
55 #include "voice-call-engine-msg.h"
57 #include "vcui-app-data.h"
58 #include "vcui-document.h"
59 #include "vcui-view-choice.h"
60 #include "vcui-engine-interface.h"
61 #include "vcui-view-common.h"
62 #include "vcui-view-elements.h"
63 #include "vcui-view-popup.h"
67 #include "ui-gadget.h" /*for UG_INIT_EFL() & ug usage*/
71 #define DIALER_PKG "org.tizen.phone"
72 #define CONTACTS_PKG "org.tizen.contacts"
75 # define PACKAGE "voice-call-ui"
78 #if !defined(LOCALEDIR)
79 # define LOCALEDIR "/opt/apps/org.tizen.call/res/locale"
83 # define EDJDIR "/opt/apps/org.tizen.call/res/edje"
87 # define IMGDIR "/opt/apps/org.tizen.call/res/images"
90 #if !defined(MEDIADIR)
91 # define MEDIADIR "/opt/apps/org.tizen.call/res/media"
95 # define ICONDIR "/opt/apps/org.tizen.call/res/icons/default/small"
98 #define EDJ_NAME EDJDIR"/voice-call-ui.edj"
99 #define CALL_THEME EDJDIR"/call_theme.edj"
101 #define GRP_MTVIEW "mt-view"
102 #define GRP_MOVIEW "mo-view"
103 #define GRP_INCALL "incall"
104 #define GRP_MTLOCK "mtlock"
105 #define GRP_KEYPAD "keypad"
106 #define GRP_MULTICALL_SPLIT "multicall-split"
107 #define GRP_MULTICALL_SPLIT2 "multicall-split2"
108 #define GRP_MULTICALL_CONF "multicall-conf"
109 #define GRP_MULTICALL "multicall-list"
110 #define GRP_UG_EFFECT "ug_effect"
111 #define GRP_END_SINGLECALL "end-singlecall"
112 #define GRP_END_CONFCALL "end-confcall"
114 #define GRP_LOCK_ACCEPT "lock_accept"
115 #define GRP_LOCK_REJECT "lock_reject"
117 #define QP_NOIMG_ICON IMGDIR"/vc_qp_caller_ID.png"
118 #define QP_CONF_ICON IMGDIR"/vc_qp_caller_ID_group.png"
119 #define NOIMG_ICON IMGDIR"/vc_normal_caller_ID.png"
120 #define CONF_ICON IMGDIR"/vc_normal_caller_ID_group.png"
121 #define PRIVATE_ICON IMGDIR"/vc_conference_private.png"
122 #define HOLD_ICON IMGDIR"/vc_icon_hold.png"
123 #define UNHOLD_ICON IMGDIR"/vc_icon_unhold.png"
124 #define KEYPAD_ICON IMGDIR"/vc_keypad_icon.png"
125 #define CONTACT_ICON IMGDIR"/vc_contact_icon.png"
126 #define ADDCALL_ICON IMGDIR"/vc_add_icon.png"
127 #define JOIN_ICON IMGDIR"/vc_join_icon.png"
128 #define SPEAKER_ICON IMGDIR"/vc_speaker_icon.png"
129 #define MUTE_ICON IMGDIR"/vc_mute_icon.png"
130 #define PLAY_ICON IMGDIR"/vc_icon_play.png"
131 #define PAUSE_ICON IMGDIR"/vc_icon_pause.png"
132 #define MORE_ICON IMGDIR"/vc_btn_more.png"
133 #define CONF_CALL_END_ICON IMGDIR"/vc_icon_conf_call_end.png"
134 #define CALLING_NAME_BG_IMAGE IMGDIR"/vc_calling_name_BG_image.png"
136 #define HOLD_DISABLED_ICON IMGDIR"/vc_icon_hold_dim.png"
137 #define UNHOLD_DISABLED_ICON IMGDIR"/vc_icon_unhold_dim.png"
138 #define KEYPAD_DISABLED_ICON IMGDIR"/vc_keypad_icon_dim.png"
139 #define CONTACT_DISABLED_ICON IMGDIR"/vc_contact_icon_dim.png"
140 #define ADDCALL_DISABLED_ICON IMGDIR"/vc_add_icon_dim.png"
141 #define JOIN_DISABLED_ICON IMGDIR"/vc_join_icon_dim.png"
142 #define SPEAKER_DISABLED_ICON IMGDIR"/vc_speaker_icon_dim.png"
143 #define MUTE_DISABLED_ICON IMGDIR"/vc_mute_icon_dim.png"
144 #define CONF_LIST_HOLD_ICON IMGDIR"/vc_icon_conf_list_hold.png"
145 #define CONF_LIST_UNHOLD_ICON IMGDIR"/vc_icon_conf_list_unhold.png"
147 #define VOLUME_ICON IMGDIR"/vc_volume_icon.png"
148 #define VOLUME_MUTE_ICON IMGDIR"/vc_volume_mute_icon.png"
150 #define NVAI_CONTROL_OTHER_ICON IMGDIR"/vc_reject_with_msg_header_icon_others.png"
152 #define MINI_CONTROLLER_WIDTH (480)
153 #define MINI_CONTROLLER_HEIGHT (42)
155 #define DEF_BUF_LEN (128)
156 #define DEF_BUF_LEN_LONG (256)
158 #define VAL_VOL_UP (1)
159 #define VAL_VOL_DOWN (0)
161 #define RINGTONE_MIN (0)
162 #define RINGTONE_MAX (15)
163 #define VOICE_VOL_MIN (1)
164 #define VOICE_VOL_MAX (7) /* It must change to 6 later.. */
165 #define BT_VOL_MIN (1)
166 #define BT_VOL_MAX (15)
168 #define RINGTONE_LONGPRESS_MUTE_TIMEOUT 0.7
169 #define VOLUME_KEY_LONG_PRESS_TIMEOUT 0.1
171 #define POPUP_TIMEOUT_SHORT (2.0)
172 #define POPUP_TIMEOUT_NORMAL (3.0)
173 #define POPUP_TIMEOUT_LONG (5.0)
174 #define POPUP_TIMEOUT_VERY_LONG (10.0)
176 #define TIMER_TIMEOUT_0_1_SEC (0.1)
177 #define TIMER_TIMEOUT_0_3_SEC (0.3)
178 #define TIMER_TIMEOUT_0_5_SEC (0.5)
179 #define TIMER_TIMEOUT_1_SEC (1.0)
180 #define TIMER_TIMEOUT_2_SEC (2.0)
181 #define TIMER_TIMEOUT_4_SEC (4.0)
183 #define BLUR_VALUE 30
184 #define IMG_TYPE_FULL 1
185 #define IMG_TYPE_WALLPAPER 2
186 #define IMG_TYPE_BLUR 3
188 #define BG_DEFAULT_PATH "/opt/media/Images and videos/Wallpapers/Home_default.png"
198 #ifdef CALL_DEBUG_ON_DLOG
199 #define CALL_UI_DEBUG(frmt, args...) do { LOG(LOG_DEBUG, TAG_CALL, "[vcui] [%s:%d] "frmt"\n", __func__, __LINE__, ##args); } while (0)
200 #define CALL_UI_KPI(frmt, args...) do { LOG(LOG_DEBUG, TAG_CALL_LAUNCH, "[VC_KPI] [%s:%d] "frmt"\n", __func__, __LINE__, ##args); } while (0)
202 #define CALL_UI_DEBUG(args...)
206 #define retv_if(expr, val) do { \
208 CALL_UI_DEBUG("(%s) -> %s() return", #expr, __FUNCTION__); \
215 #define retvm_if(expr, val, fmt, arg...) do { \
217 CALL_UI_DEBUG(fmt, ##arg); \
218 CALL_UI_DEBUG("(%s) -> %s() return", #expr, __FUNCTION__); \
224 #ifndef VCUI_RETURN_IF_FAIL
225 #define VCUI_RETURN_IF_FAIL(check_condition) \
226 if (!(check_condition)) return;
229 #ifndef VCUI_RETURN_FALSE_IF_FAIL
230 #define VCUI_RETURN_FALSE_IF_FAIL(check_condition) \
231 if (!(check_condition)) return EINA_FALSE;
234 #ifndef VCUI_RETURN_VALUE_IF_FAIL
235 #define VCUI_RETURN_VALUE_IF_FAIL(check_condition, value) \
236 if (!(check_condition)) return value;
239 #ifndef VCUI_RETURN_NULL_IF_FAIL
240 #define VCUI_RETURN_NULL_IF_FAIL(check_condition) \
241 if (!(check_condition)) return NULL;
244 #ifndef VCUI_RETURN_ZERO_IF_FAIL
245 #define VCUI_RETURN_ZERO_IF_FAIL(check_condition) \
246 if (!(check_condition)) return 0;
249 #ifndef VCUI_RETURN_INVALID_IF_FAIL
250 #define VCUI_RETURN_INVALID_IF_FAIL(check_condition) \
251 if (!(check_condition)) return -1;
254 #ifndef VCUI_RETURN_VALUE_IF_NOT_IN_RANGE
255 #define VCUI_RETURN_VALUE_IF_NOT_IN_RANGE(value, min_value, max_value, ret_val) \
256 if ((value < min_value) || (value > max_value)) return ret_val;
260 #define _EDJ(obj) elm_layout_edje_get(obj)
263 #define _EVAS_OBJ_DEL(obj) if (obj) \
265 evas_object_del(obj); \
274 typedef enum _voice_call_bg_type_t {
277 } voice_call_bg_type_t;
280 CALL_END_TYPE_NONE = -1,
281 CALL_END_TYPE_SINGLE_CALL,
282 CALL_END_TYPE_CONF_CALL,
283 } voice_call_end_type_t;
285 /************************************************************************************/
286 void _create_main_ui_set_flag();
287 void _create_main_ui_real();
288 void _vcui_show_main_ui_set_flag();
289 void __vcui_hide_main_ui_set_flag();
291 void _vcui_determine_background_show_hide();
293 void _vcui_cache_flush();
294 vcui_app_call_data_t *_vcui_get_app_data();
295 int _vcui_is_idle_lock();
297 gboolean _vcui_is_gcf_mode(void);
298 gboolean _vcui_is_headset_conected(void);
299 gboolean _vcui_is_headset_switch_on(void);
300 gboolean _vcui_is_answering_mode_on(void);
301 gboolean _vcui_is_powerkey_mode_on(void);
302 gboolean _vcui_is_phonelock_status(void);
304 void _vcui_add_calllog(int type, call_data_t *data, int boutgoing_end);
306 void _vcui_response_volume(int vol_alert_type, int vol_level);
307 void _vcui_set_volume(int key_status);
309 void _vcui_raise_main_win();
310 int _vcui_check_valid_eo(Evas_Object *eo, char *v_name);
312 unsigned long _vcui_get_diff_now(time_t start_time);
314 char *_vcui_get_endcause_string(int end_cause, char *data);
316 Evas_Object *_vcui_load_edj(Evas_Object *parent, const char *file, const char *group);
318 #endif /* __VCUI_MAIN_H_ */