apply FSL(Flora Software License)
[apps/home/call.git] / call-engine / include / voice-call-engine-msg.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
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
7  *
8  * http://www.tizenopensource.org/license
9  *
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.
15  */
16
17
18 #ifndef _VOICE_CALL_ENGINE_MSG_H_
19 #define _VOICE_CALL_ENGINE_MSG_H_
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 #include "vc-core-engine-types.h"
26
27 typedef enum _vc_engine_msgid_t  { 
28         /* Tapi Call Related Event Types */ 
29         VC_ENGINE_MSG_INCOM_TO_UI, /**< Incoming call */ 
30         VC_ENGINE_MSG_OUTGOING_TO_UI, /**< Outgoing call. This event will be sent, when outgoing deferred and made after some time */ 
31         VC_ENGINE_MSG_OUTGOING_ORIG_TO_UI, /**< Outgoing call originated */ 
32         VC_ENGINE_MSG_OUTGOING_ORIG_TO_UI_TEST,  /**< Outgoing local test */ 
33         VC_ENGINE_MSG_OUTGOING_ALERT_TO_UI, /**< Outgoing alert call */ 
34         VC_ENGINE_MSG_CONNECTED_TO_UI, /**< Call connected */ 
35         VC_ENGINE_MSG_NORMAL_END_TO_UI, /**< Normal end */ 
36         VC_ENGINE_MSG_INCOM_END_TO_UI, /**< Incoming call end */ 
37         VC_ENGINE_MSG_REJECTED_END_TO_UI, /**< Rejected call end */ 
38         VC_ENGINE_MSG_OUTGOING_END_TO_UI, /**< Outgoing call end */ 
39         VC_ENGINE_MSG_OUTGOING_END_SIGNAL_PLAY_TO_UI, /**< Outgoing call end signal play */ 
40         VC_ENGINE_MSG_OUTGOING_ABORTED_TO_UI, /**< Outgoing call ended before making the call to the NW */ 
41         VC_ENGINE_MSG_DTMF_ACK_TO_UI, /**< DTMF Acknowledgement */ 
42         
43         /*Tapi Call Dependent SS related events */ 
44         VC_ENGINE_MSG_SS_HELD_TO_UI, /**< SS Held */ 
45         VC_ENGINE_MSG_SS_RETREIVED_TO_UI, /**< SS Retriebved */ 
46         VC_ENGINE_MSG_SS_SWAP_TO_UI, /**< SS call swap */ 
47         VC_ENGINE_MSG_SS_SETUP_CONF_TO_UI, /**< SS setup conference */ 
48         VC_ENGINE_MSG_SS_SPLIT_CONF_TO_UI, /**< SS Split conference */ 
49         VC_ENGINE_MSG_SS_TRANSFERRED_TO_UI, /**< SS call transferred */ 
50         VC_ENGINE_MSG_SS_CONNECT_LINE_IND_TO_UI,        /**< SS connectect line indication */
51         
52         /*Tapi Call SS Indication Related Events */ 
53         VC_ENGINE_MSG_IND_FORWARD_TO_UI, /**< Call forward */ 
54         VC_ENGINE_MSG_IND_ACTIVATE_TO_UI, /**< Activate call */ 
55         VC_ENGINE_MSG_IND_HOLD_TO_UI, /**< Hold call */ 
56         VC_ENGINE_MSG_IND_TRANSFER_TO_UI, /**< Call transfer */ 
57         VC_ENGINE_MSG_IND_SETUPCONFERENCE_TO_UI, /**< Setup conference */ 
58         VC_ENGINE_MSG_IND_BARRING_TO_UI, /**< Call barring */ 
59         VC_ENGINE_MSG_IND_WAITING_TO_UI, /**< Call waiting */ 
60         VC_ENGINE_MSG_IND_CUGINFO_TO_UI, /**< Closed User Group information */ 
61         VC_ENGINE_MSG_IND_SSNOTIFY_TO_UI, /**< SS nofify */ 
62         VC_ENGINE_MSG_IND_CALLINGNAMEINFO_TO_UI, /**< Caller name information */ 
63         VC_ENGINE_MSG_IND_REDIRECT_CNF_TO_UI, /**< Redirect confirmation */ 
64         VC_ENGINE_MSG_IND_ACTIVATECCBS_CNF_TO_UI, /**< Activate CCBS confirmation */ 
65         VC_ENGINE_MSG_IND_ACTIVATECCBS_USERINFO_TO_UI, /**< Activate CCBS user information */ 
66         VC_ENGINE_MSG_IND_AOC_TO_UI, /**< AOC indication */ 
67
68         /*Tapi Response Error Related Events */ 
69         VC_ENGINE_MSG_ERROR_OCCURED_TO_UI, /**< Error */ 
70         
71         /* Voicecall Engine triggered Event Type */ 
72         VC_ENGINE_MSG_ACTION_INCOM_FORCE_TO_UI, /**< If any outgoing data needs to be destroyed or cleaned up in the client during an incoming call, this event will be sent */ 
73         VC_ENGINE_MSG_ACTION_SAT_REQUEST_TO_UI, /**< SAT Request. This event will be sent to client , when SAT Engine requests any service from voicecall. Voicecall Engine holds the SAT engine related information, clients can get the information from the engine when it is required */ 
74         VC_ENGINE_MSG_ACTION_SAT_RESPONSE_TO_UI, /**< SAT Response */ 
75         VC_ENGINE_MSG_ACTION_CALL_END_HELD_RETREIVED_TO_UI, /**< If a held call is being retreived on end of an active call, this event will be emitted */ 
76         VC_ENGINE_MSG_ACTION_NO_ACTIVE_TASK_TO_UI, /**< This event will be published when engine becomes idle after executing/aborting a request from other apps - eg) if SAT request is not processed*/ 
77         VC_ENGINE_MSG_GET_VOLUME_RESP_TO_UI, /**< Response data from tapi for get tapi sound volume (with ringtone vol)*/ 
78         VC_ENGINE_MSG_SET_VOLUME_FROM_BT_TO_UI, /**< volume change form bt headset */ 
79         VC_ENGINE_MSG_HEADSET_STATUS_TO_UI, /**< Headset status to UI */ 
80         VC_ENGINE_MSG_EARJACK_STATUS_TO_UI, /**< Headset status to UI */ 
81         VC_ENGINE_MSG_ACCEPT_CHOICE_BOX_TO_UI, /**< Accept choice box to UI */ 
82         VC_ENGINE_MSG_MESSAGE_BOX_TO_UI, /**< Create Message box */ 
83         VC_ENGINE_MSG_REDIAL_TO_UI, /* To send the redial message to the UI */ 
84         VC_ENGINE_MSG_STOPPED_RECORDING_TO_UI, /* Save file event sent to the UI */ 
85         VC_ENGINE_MSG_CREATE_NEWVOICEFILE_TO_UI, /* User input for voice_recording */ 
86         VC_ENGINE_MSG_MAX_TO_UI 
87 } vc_engine_msgid_t;
88
89 typedef enum _vc_engine_msgbox_string_id_t {
90         IDS_CALL_POP_CALL_IS_DIVERTED,
91         IDS_CALL_POP_CALLFAILED,
92         IDS_CALL_POP_CALLING_EMERG_ONLY,
93         IDS_CALL_POP_CALLNOTCALLOWED,
94         IDS_CALL_POP_CAUSE_WRONG_NUMBER,
95         IDS_CALL_POP_CHANGEOFFLINEMODETOCALL,
96         IDS_CALL_POP_DTMFSENDING_FAIL,
97         IDS_CALL_POP_FDNCALLONLY,
98         IDS_CALL_POP_HOLD_FAILED,
99         IDS_CALL_POP_HOLD_NOT_SUPPORTED,
100         IDS_CALL_POP_INCOMPLETE,
101         IDS_CALL_POP_JOIN_FAILED,
102         IDS_CALL_POP_JOIN_NOT_SUPPORTED,
103         IDS_CALL_POP_OPERATION_REFUSED,
104         IDS_CALL_POP_PHONE_NOT_INITIALISED,
105         IDS_CALL_POP_REJECTED,
106         IDS_CALL_POP_SENDING,
107         IDS_CALL_POP_SOS_CALL_ONLY_IN_NO_SIM_MODE,
108         IDS_CALL_POP_SPLIT_FAILED,
109         IDS_CALL_POP_SPLIT_NOT_SUPPORTED,
110         IDS_CALL_POP_SWAP_FAILED,
111         IDS_CALL_POP_SWAP_NOT_SUPPORTED,
112         IDS_CALL_POP_TRANSFER_FAILED,
113         IDS_CALL_POP_TRANSFER_NOT_SUPPORTED,
114         IDS_CALL_POP_UNABLE_TO_RETRIEVE,
115         IDS_CALL_POP_UNAVAILABLE,
116         IDS_CALL_POP_UNHOLD_NOT_SUPPORTED,
117         IDS_CALL_POP_VOICE_CALL_IS_NOT_ALLOWED_DURING_VIDEO_CALL,
118         IDS_CALL_POP_WAITING_ACTIVE,
119         IDS_CALL_BODY_CALLENDED, 
120 #ifdef  PDIAL_SEND_DTMF
121         IDS_CALL_POP_INVALID_DTMF,
122         IDS_CALL_POP_DTMF_SENT, 
123 #endif
124         IDS_CALL_MAX 
125 } vc_engine_msgbox_string_id_t;
126
127
128 typedef enum _vc_engine_end_cause_type_t {
129         VC_ENGINE_ENDCAUSE_CALL_ENDED, /**< Call ended */ 
130         VC_ENGINE_ENDCAUSE_CALL_DISCONNECTED, /**< Call disconnected */ 
131         VC_ENGINE_ENDCAUSE_CALL_SERVICE_NOT_ALLOWED, /**< Service not allowed */ 
132         VC_ENGINE_ENDCAUSE_CALL_BARRED, /**< Call barred */ 
133         VC_ENGINE_ENDCAUSE_NO_SERVICE, /**< No Service */ 
134         VC_ENGINE_ENDCAUSE_NW_BUSY, /**< Network busy */ 
135         VC_ENGINE_ENDCAUSE_NW_FAILED, /**< Network failed */ 
136         VC_ENGINE_ENDCAUSE_NO_ANSWER, /**< No anwer from other party */ 
137         VC_ENGINE_ENDCAUSE_NO_CREDIT, /**< No credit available */ 
138         VC_ENGINE_ENDCAUSE_REJECTED, /**< Call rejected */ 
139         VC_ENGINE_ENDCAUSE_USER_BUSY, /**< user busy */ 
140         VC_ENGINE_ENDCAUSE_WRONG_GROUP, /**< Wrong group */ 
141         VC_ENGINE_ENDCAUSE_CALL_NOT_ALLOWED, /**< Call not allowed */ 
142         VC_ENGINE_ENDCAUSE_TAPI_ERROR, /**< Tapi error */ 
143         VC_ENGINE_ENDCAUSE_CALL_FAILED, /**< Call Failed */ 
144         VC_ENGINE_ENDCAUSE_NO_USER_RESPONDING, /**< User not responding */ 
145         VC_ENGINE_ENDCAUSE_USER_ALERTING_NO_ANSWER, /**< User Alerting No Answer */ 
146         VC_ENGINE_ENDCAUSE_SERVICE_TEMP_UNAVAILABLE, /**< Circuit Channel Unavailable,Network is out of Order,Switching equipment congestion,Temporary Failure */ 
147         VC_ENGINE_ENDCAUSE_USER_UNAVAILABLE, /**< Called Party Rejects the Call */ 
148         VC_ENGINE_ENDCAUSE_INVALID_NUMBER_FORMAT, /**< Entered number is invalid or incomplete */ 
149         VC_ENGINE_ENDCAUSE_NUMBER_CHANGED, /**< Entered number has been changed */ 
150         VC_ENGINE_ENDCAUSE_UNASSIGNED_NUMBER, /**< Unassigned/Unallocated number*/ 
151         VC_ENGINE_ENDCAUSE_USER_DOESNOT_RESPOND, /**< Called Party does not respond*/ 
152         VC_ENGINE_ENDCAUSE_IMEI_REJECTED, /**< Called Party does not respond*/ 
153 } vc_engine_end_cause_type_t;
154
155 typedef struct {
156         int len;
157         int msg_id;
158 } vc_engine_msg_hdr_type;
159
160 typedef struct {
161         vc_engine_msg_hdr_type hdr;
162         int call_handle;
163         int contact_index;
164         int phone_type;
165         int brejected;
166         int brestricted;
167         int bpayphone;
168         char call_num[VC_PHONE_NUMBER_LENGTH_MAX];
169         char call_name[VC_DISPLAY_NAME_LENGTH_MAX];
170         char call_file_path[VC_IMAGE_PATH_LENGTH_MAX];
171         char call_full_file_path[VC_IMAGE_PATH_LENGTH_MAX];
172 } vc_engine_incoming_type;
173
174 typedef struct {
175         vc_engine_msg_hdr_type hdr;
176         int contact_index;
177         int phone_type;
178         char call_num[VC_PHONE_NUMBER_LENGTH_MAX];
179         char call_name[VC_DISPLAY_NAME_LENGTH_MAX];
180         char call_file_path[VC_IMAGE_PATH_LENGTH_MAX];
181         char call_full_file_path[VC_IMAGE_PATH_LENGTH_MAX];
182 } vc_engine_outgoing_type;
183
184 typedef struct {
185         vc_engine_msg_hdr_type hdr;
186         int call_handle;
187         int end_cause_type;
188 } vc_engine_normal_end_type;
189
190 typedef struct {
191         vc_engine_msg_hdr_type hdr;
192         int call_handle;
193         int bt_status;
194 } vc_engine_connected_type;
195
196 typedef struct {
197         vc_engine_msg_hdr_type hdr;
198         int call_handle;
199         int bemergency;
200 } vc_engine_outgoing_orig_type;
201
202 typedef struct {
203         vc_engine_msg_hdr_type hdr;
204         int call_handle;
205         int end_cause_type;
206         int bauto_redial;
207 } vc_engine_outgoing_end_type;
208
209 typedef struct {
210         vc_engine_msg_hdr_type hdr;
211         int call_handle;
212         int end_cause_type;
213 } vc_engine_outgoing_end_signal_play_type;
214
215 typedef struct {
216         vc_engine_msg_hdr_type hdr;
217         int call_handle;
218         int end_cause_type;
219 } vc_engine_redial_type;
220
221 typedef struct {
222         vc_engine_msg_hdr_type hdr;
223         int call_handle;
224 } vc_engine_common_with_handle_type;
225
226 typedef struct {
227         vc_engine_msg_hdr_type hdr;
228 } vc_engine_common_type;
229
230 typedef struct {
231         vc_engine_msg_hdr_type hdr;
232         int fwd_type;
233 } vc_engine_ind_forward_type;
234
235 typedef struct {
236         vc_engine_msg_hdr_type hdr;
237         int ss_type;
238 } vc_engine_ind_ssnotify_type;
239
240 typedef struct {
241         vc_engine_msg_hdr_type hdr;
242         int error_code;
243 } vc_engine_error_occured_type;
244
245 typedef struct {
246         vc_engine_msg_hdr_type hdr;
247         int vol_alert_type;
248         int vol_level;
249 } vc_engine_vol_resp_type;
250
251 typedef struct {
252         vc_engine_msg_hdr_type hdr;
253         int vol_level;
254 } vc_engine_vol_set_from_bt_type;
255
256 typedef struct {
257         vc_engine_msg_hdr_type hdr;
258         int bstatus;
259 } vc_engine_headset_status_type;
260
261 typedef struct {
262         vc_engine_msg_hdr_type hdr;
263         int bstatus;
264 } vc_engine_earjack_status_type;
265
266 typedef struct {
267         vc_engine_msg_hdr_type hdr;
268         int choice;
269 } vc_engine_accept_choice_box_type;
270
271 typedef struct {
272         vc_engine_msg_hdr_type hdr;
273         int string_id;
274         char diverted_num[VC_PHONE_NUMBER_LENGTH_MAX];
275 } vc_engine_msg_box_type;
276
277 typedef struct {
278         vc_engine_msg_hdr_type hdr;
279         int type;
280         char saved_filename[VC_RECORD_FULL_FILE_PATH_LENGTH];
281 } vc_engine_stopped_recording_type;
282
283 #ifdef  PDIAL_SEND_DTMF
284 typedef struct {
285         vc_engine_msg_hdr_type hdr;
286         gboolean bstatus;
287         int string_id;
288         char display_string[VC_DISPLAY_NAME_LENGTH_MAX];
289 } vc_engine_dtmf_ack_type;
290 #endif
291
292 typedef union {
293         vc_engine_msg_hdr_type hdr;
294         vc_engine_incoming_type incoming;
295         vc_engine_outgoing_type outgoing;
296         vc_engine_outgoing_orig_type outgoing_orig;
297         vc_engine_common_with_handle_type outgoing_alert;
298         vc_engine_connected_type connected;
299         vc_engine_normal_end_type normal_end;
300         vc_engine_common_with_handle_type incom_end;
301         vc_engine_common_with_handle_type incom_droped;
302         vc_engine_common_with_handle_type rejected_end;
303         vc_engine_outgoing_end_type outgoing_end;
304         vc_engine_outgoing_end_signal_play_type outgoing_end_signal_play;
305         vc_engine_common_with_handle_type outgoing_aborted;
306         vc_engine_common_with_handle_type dtmf_ack;
307         vc_engine_common_with_handle_type auto_redial_check;
308         vc_engine_common_type ss_held;
309         vc_engine_common_type ss_retreived;
310         vc_engine_common_type ss_swap;
311         vc_engine_common_type ss_setup_conf;
312         vc_engine_common_with_handle_type ss_split_conf;
313         vc_engine_common_type ss_transferred;
314         vc_engine_common_type ss_connnect_line_ind;
315         vc_engine_ind_forward_type ss_ind_forward;
316         vc_engine_common_type ss_ind_activate;
317         vc_engine_common_type ss_ind_hold;
318         vc_engine_common_type ss_ind_transfer;
319         vc_engine_common_type ss_ind_setupconference;
320         vc_engine_common_type ss_ind_barring;
321         vc_engine_common_type ss_ind_wating;
322         vc_engine_common_type ss_ind_cuginfo;
323         vc_engine_ind_ssnotify_type ss_ind_ssnotify;
324         vc_engine_common_type ss_ind_callingnameinfo;
325         vc_engine_common_type ss_ind_redirect_cnf;
326         vc_engine_common_type ss_ind_activateccbs_cnf;
327         vc_engine_common_type ss_ind_activatedccbs_userinfo;
328         vc_engine_common_type ss_ind_aoc;
329         vc_engine_error_occured_type error_occured;
330         vc_engine_vol_resp_type vol_resp;
331         vc_engine_vol_set_from_bt_type vol_set_from_bt;
332         vc_engine_headset_status_type headset_status;
333         vc_engine_earjack_status_type earjack_status;
334         vc_engine_accept_choice_box_type accept_choice_box;
335         vc_engine_msg_box_type msg_box;
336         vc_engine_redial_type redial;
337         vc_engine_stopped_recording_type stopped_recording;
338         vc_engine_common_type voice_record;
339         
340 #ifdef  PDIAL_SEND_DTMF
341         vc_engine_dtmf_ack_type dtmf_progress;
342 #endif
343 } vc_engine_msg_type;
344
345 typedef enum {
346         VC_CALL_UI_ACCEPT_1,
347         VC_CALL_UI_ACCEPT_2 
348 } voicecal_ui_accept_choice_t;
349
350 typedef struct {
351         int len;
352         int msg_id;
353 } vcui_msg_hdr_type;
354
355 typedef struct {
356         vcui_msg_hdr_type hdr;
357 } vcui_common_type;
358
359 typedef struct {
360         vcui_msg_hdr_type hdr;
361         int call_handle;
362 } vcui_common_with_handle_type;
363
364 typedef struct {
365         vcui_msg_hdr_type hdr;
366         int ans_type;
367 } vcui_accept_with_type;
368
369 typedef struct {
370         vcui_msg_hdr_type hdr;
371         int vol_alert_type;
372 } vcui_vol_get_type;
373
374 typedef struct {
375         vcui_msg_hdr_type hdr;
376         int vol_level;
377 } vcui_tapi_vol_set_type;
378
379 typedef struct {
380         vcui_msg_hdr_type hdr;
381         int vol_level;
382 } vcui_ringtone_vol_set_type;
383
384 typedef struct {
385         vcui_msg_hdr_type hdr;
386         int manual_redial;
387 } vcui_common_with_redial_type;
388
389 typedef struct {
390         vcui_msg_hdr_type hdr;
391         char dtmf_number[2];
392 } vcui_dtmf_type;
393
394 typedef union {
395         vcui_msg_hdr_type hdr;
396         vcui_common_type accept;
397         vcui_accept_with_type accept_with_type;
398         vcui_common_type reject;
399         vcui_common_type end;
400         vcui_common_with_handle_type end_with_handle;
401         vcui_common_type end_all_calls;
402         vcui_common_type end_active_calls;
403         vcui_common_type end_held_calls;
404         vcui_common_type hold;
405         vcui_common_type unhold;
406         vcui_common_type swap;
407         vcui_common_type join;
408         vcui_common_with_handle_type split;
409         vcui_common_type transfer;
410         vcui_common_type spkon;
411         vcui_common_type spkoff;
412         vcui_common_type muteon;
413         vcui_common_type muteoff;
414         vcui_vol_get_type vol_get;
415         vcui_tapi_vol_set_type tapi_vol_set;
416         vcui_ringtone_vol_set_type ringtone_vol_set;
417         vcui_common_type headset_on;
418         vcui_common_type headset_off;
419         vcui_common_with_redial_type redial_type;
420         vcui_common_type redial_stop;
421         vcui_common_type record_stop;
422         vcui_common_type record_start;
423         vcui_dtmf_type dtmf;
424 } vcui_msg_type;
425 #ifdef __cplusplus
426 }
427 #endif
428
429 #endif
430