Make TIZEN 2.0
[apps/home/call.git] / ui / src / include / vcui-document.h
1 /*\r
2  * Copyright 2012  Samsung Electronics Co., Ltd\r
3  *\r
4  * Licensed under the Flora License, Version 1.0 (the "License");\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  *\r
8  * http://www.tizenopensource.org/license\r
9  *\r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an "AS IS" BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  */\r
16 \r
17 \r
18 #ifndef _VCUI_DOCUMENT_H_\r
19 #define _VCUI_DOCUMENT_H_\r
20 \r
21 typedef struct _call_data_t call_data_t;\r
22 \r
23 /**\r
24  * This function initializes the data structure pointers maintained in the document file\r
25  *\r
26  * @return      nothing\r
27  * @param[in]   nothing\r
28 */\r
29 void _vcui_doc_data_init();\r
30 \r
31 /**\r
32  * This function allocates memory for the call data structure - call_data_t\r
33  *\r
34  * @return      pointer to the memory allocated for call-data structure, or NULL if memory allocation fails\r
35  * @param[in]   nothing\r
36 */\r
37 call_data_t *_vcui_doc_allocate_call_data_memory(void);\r
38 \r
39 /**\r
40  * This function retrieves the value of the call handle\r
41  *\r
42  * @return      value of the call handle\r
43  * @param[in]   pcall_data      pointer to the call-data structure\r
44 */\r
45 int _vcui_doc_get_call_handle(call_data_t *pcall_data);\r
46 \r
47 /**\r
48  * This function assigns the value of call handle for a given pointer of the call-data structure\r
49  *\r
50  * @return      nothing\r
51  * @param[in]   pcall_data      pointer to the call-data structure\r
52  * @param[in]   call_handle     new value of the call handle\r
53 */\r
54 void _vcui_doc_set_call_handle(call_data_t *pcall_data, int call_handle);\r
55 \r
56 /**\r
57  * This function retrieves the value of the call number\r
58  *\r
59  * @return      pointer to the call number string\r
60  * @param[in]   pcall_data      pointer to the call-data structure\r
61 */\r
62 char *_vcui_doc_get_call_number(call_data_t *pcall_data);\r
63 \r
64 /**\r
65  * This function assigns the value of call number for a given pointer of the call-data structure\r
66  *\r
67  * @return      nothing\r
68  * @param[in]   pcall_data      pointer to the call-data structure\r
69  * @param[in]   pnumber         pointer to the call number string\r
70 */\r
71 void _vcui_doc_set_call_number(call_data_t *pcall_data, char *pnumber);\r
72 \r
73 /**\r
74  * This function retrieves the value of the call name (available from contact DB)\r
75  *\r
76  * @return      pointer to the call name string\r
77  * @param[in]   pcall_data      pointer to the call-data structure\r
78 */\r
79 char *_vcui_doc_get_call_display_name(call_data_t *pcall_data);\r
80 \r
81 /**\r
82  * This function assigns the value of contact name for a given pointer of the call-data structure\r
83  *\r
84  * @return      nothing\r
85  * @param[in]   pcall_data      pointer to the call-data structure\r
86  * @param[in]   pname           pointer to the call number string\r
87 */\r
88 void _vcui_doc_set_call_display_name(call_data_t *pcall_data, char *pname);\r
89 \r
90 /**\r
91  * This function retrieves the caller-ID file path (caller-ID for split screen)\r
92  *\r
93  * @return      pointer to the caller-ID file path string\r
94  * @param[in]   pcall_data      pointer to the call-data structure\r
95 */\r
96 char *_vcui_doc_get_caller_id_file_path(call_data_t *pcall_data);\r
97 \r
98 /**\r
99  * This function assigns the value of caller-ID file-path for a given pointer of the call-data structure\r
100  *\r
101  * @return      nothing\r
102  * @param[in]   pcall_data      pointer to the call-data structure\r
103  * @param[in]   pfile_path      pointer to the caller-ID file-path string\r
104 */\r
105 void _vcui_doc_set_caller_id_file_path(call_data_t *pcall_data, char *pfile_path);\r
106 \r
107 /**\r
108  * This function retrieves the caller-ID full file path (caller-ID for full screen)\r
109  *\r
110  * @return      pointer to the caller-ID full file path string\r
111  * @param[in]   pcall_data      pointer to the call-data structure\r
112 */\r
113 char *_vcui_doc_get_caller_id_full_file_path(call_data_t *pcall_data);\r
114 \r
115 /**\r
116  * This function assigns the value of caller-ID full file-path for a given pointer of the call-data structure\r
117  *\r
118  * @return      nothing\r
119  * @param[in]   pcall_data              pointer to the call-data structure\r
120  * @param[in]   pfull_file_path pointer to the caller-ID full file-path string\r
121 */\r
122 void _vcui_doc_set_caller_id_full_file_path(call_data_t *pcall_data, char *pfull_file_path);\r
123 \r
124 /**\r
125  * This function retrieves the value of the call start time\r
126  *\r
127  * @return      value of the call start time\r
128  * @param[in]   pcall_data      pointer to the call-data structure\r
129 */\r
130 int _vcui_doc_get_call_start_time(call_data_t *pcall_data);\r
131 \r
132 /**\r
133  * This function assigns the value of call start time for a given pointer of the call-data structure\r
134  *\r
135  * @return      nothing\r
136  * @param[in]   pcall_data      pointer to the call-data structure\r
137 */\r
138 void _vcui_doc_set_call_start_time(call_data_t *pcall_data);\r
139 \r
140 /**\r
141  * This function retrieves the value of the contact index\r
142  *\r
143  * @return      value of the contact index\r
144  * @param[in]   pcall_data      pointer to the call-data structure\r
145 */\r
146 int _vcui_doc_get_contact_index(call_data_t *pcall_data);\r
147 \r
148 /**\r
149  * This function assigns the value of contact index for a given pointer of the call-data structure\r
150  *\r
151  * @return      nothing\r
152  * @param[in]   pcall_data              pointer to the call-data structure\r
153  * @param[in]   contact_index   value of the contact index\r
154 */\r
155 void _vcui_doc_set_contact_index(call_data_t *pcall_data, int contact_index);\r
156 \r
157 /**\r
158  * This function retrieves the value of the contact phone type\r
159  *\r
160  * @return      value of the contact phone type\r
161  * @param[in]   pcall_data      pointer to the call-data structure\r
162 */\r
163 int _vcui_doc_get_contact_phone_type(call_data_t *pcall_data);\r
164 \r
165 /**\r
166  * This function assigns the value of contact phone type for a given pointer of the call-data structure\r
167  *\r
168  * @return      nothing\r
169  * @param[in]   pcall_data      pointer to the call-data structure\r
170  * @param[in]   phone_type      value of the contact phone type\r
171 */\r
172 void _vcui_doc_set_contact_phone_type(call_data_t *pcall_data, int phone_type);\r
173 \r
174 /**\r
175  * This function retrieves the value of the remaining days for the contact birthday\r
176  *\r
177  * @return      value of the contact remaining days in birthday\r
178  * @param[in]   pcall_data      pointer to the call-data structure\r
179 */\r
180 int _vcui_doc_get_birthday_remaining_days(call_data_t *pcall_data);\r
181 \r
182 /**\r
183  * This function assigns the value of birthday remaining days for a given pointer of the call-data structure\r
184  *\r
185  * @return      nothing\r
186  * @param[in]   pcall_data              pointer to the call-data structure\r
187  * @param[in]   bday_rem_days   value of the birthday remaining days\r
188 */\r
189 void _vcui_doc_set_birthday_remaining_days(call_data_t *pcall_data, int bday_rem_days);\r
190 \r
191 /**\r
192  * This function retrieves the value of the auto reject status\r
193  *\r
194  * @return      value of the auto reject status\r
195  * @param[in]   pcall_data      pointer to the call-data structure\r
196 */\r
197 int _vcui_doc_get_auto_reject_status(call_data_t *pcall_data);\r
198 \r
199 /**\r
200  * This function assigns the value of auto reject status for a given pointer of the call-data structure\r
201  *\r
202  * @return      nothing\r
203  * @param[in]   pcall_data              pointer to the call-data structure\r
204  * @param[in]   bauto_rejected  value of the auto reject status\r
205 */\r
206 void _vcui_doc_set_auto_reject_status(call_data_t *pcall_data, gboolean bauto_rejected);\r
207 \r
208 /**\r
209  * This function retrieves if a call is MO or MT type\r
210  *\r
211  * @return      value of the call type - MO or MT\r
212  * @param[in]   pcall_data      pointer to the call-data structure\r
213 */\r
214 int _vcui_doc_get_call_type(call_data_t *pcall_data);\r
215 \r
216 /**\r
217  * This function assigns the value of call type for a given pointer of the call-data structure\r
218  *\r
219  * @return      nothing\r
220  * @param[in]   pcall_data      pointer to the call-data structure\r
221  * @param[in]   call_type       type of call, MO or MT\r
222 */\r
223 void _vcui_doc_set_call_type(call_data_t *pcall_data, int call_type);\r
224 \r
225 /**\r
226  * This function retrieves the call status of a particular call data structure (HOLD/UNHOLD)\r
227  *\r
228  * @return      value of the call status, HOLD/UNHOLD\r
229  * @param[in]   pcall_data      pointer to the call-data structure\r
230 */\r
231 int _vcui_doc_get_call_status(call_data_t *pcall_data);\r
232 \r
233 /**\r
234  * This function assigns the value of call status for a given pointer of the call-data structure\r
235  *\r
236  * @return      nothing\r
237  * @param[in]   pcall_data      pointer to the call-data structure\r
238  * @param[in]   call_status     status of call, active/held\r
239 */\r
240 void _vcui_doc_set_call_status(call_data_t *pcall_data, int call_status);\r
241 \r
242 /**\r
243  * This function retrieves the pointer to the most recent MO(outgoing) call data\r
244  *\r
245  * @return      pointer to the call data structure\r
246  * @param[in]   nothing\r
247 */\r
248 call_data_t *_vcui_doc_get_recent_mo_call_data();\r
249 \r
250 /**\r
251  * This function assigns the pointer of the most recent MO(outgoing) call data\r
252  * to the pointer stored in the vcui-document file (recent_mo)\r
253  *\r
254  * @return      nothing\r
255  * @param[in]   in              pointer to the call-data structure to be copied/assigned\r
256 */\r
257 void _vcui_doc_set_recent_mo_call_data(call_data_t *in);\r
258 \r
259 /**\r
260  * This function retrieves the pointer to the most recent MT(incoming) call data\r
261  *\r
262  * @return      pointer to the call data structure\r
263  * @param[in]   nothing\r
264 */\r
265 call_data_t *_vcui_doc_get_recent_mt_call_data();\r
266 \r
267 /**\r
268  * This function assigns the pointer of the most recent MT(incoming) call data\r
269  * to the pointer stored in the vcui-document file (recent_mt)\r
270  *\r
271  * @return      nothing\r
272  * @param[in]   in              pointer to the call-data structure to be copied/assigned\r
273 */\r
274 void _vcui_doc_set_recent_mt_call_data(call_data_t *in);\r
275 \r
276 /**\r
277  * This function retrieves the pointer to the most recent call data, either MT(incoming)/MO(outgoing)\r
278  *\r
279  * @return      pointer to the call data structure\r
280  * @param[in]   nothing\r
281 */\r
282 call_data_t *_vcui_doc_get_recent_call_data();\r
283 \r
284 /**\r
285  * This function assigns the pointer of the most recent MT(incoming)/MO(outgoing) call data\r
286  * to the pointer stored in the vcui-document file (recent_call)\r
287  *\r
288  * @return      nothing\r
289  * @param[in]   in              pointer to the call-data structure to be copied/assigned\r
290 */\r
291 void _vcui_doc_set_all_recent(call_data_t *in);\r
292 \r
293 /**\r
294  * This function adds the call data structure to the list of call data maintained in the\r
295  * vcui-document file (caller_list link list)\r
296  *\r
297  * @return      nothing\r
298  * @param[in]   in              pointer to the call-data structure to be added\r
299 */\r
300 void _vcui_doc_add_call_data(call_data_t *in);\r
301 \r
302 /**\r
303  * This function updates the call data structure contained in the list of call data maintained in the\r
304  * vcui-document file (caller_list link list) with the new call-data structure\r
305  *\r
306  * @return      nothing\r
307  * @param[in]   in              pointer to the call-data structure to be updated\r
308 */\r
309 void _vcui_doc_update_call_data(call_data_t *in);\r
310 \r
311 /**\r
312  * This function checks if the call data pointer data is valid and present in the 'caller_list' list\r
313  *\r
314  * @return      TRUE if the call-data is present and FALSE if there is no such call-data in the list\r
315  * @param[in]   in              pointer to the call-data structure\r
316 */\r
317 Eina_Bool _vcui_doc_is_valid_call_data(call_data_t *in);\r
318 \r
319 /**\r
320  * This function removes the call data structure from the list of call data maintained in the\r
321  * vcui-document file (caller_list link list) and frees the call data structure\r
322  *\r
323  * @return      nothing\r
324  * @param[in]   in              pointer to the call-data structure to be added\r
325 */\r
326 void _vcui_doc_remove_call_data(call_data_t *in);\r
327 \r
328 /**\r
329  * This function removes the call data structure from the list of call data maintained in the\r
330  * vcui-document file (caller_list link list)\r
331  *\r
332  * @return      a pointer to the call data structure which is passed\r
333  * @param[in]   in              pointer to the call-data structure to be added\r
334 */\r
335 call_data_t *_vcui_doc_remove_call_data_from_list(call_data_t *in);\r
336 \r
337 /**\r
338  * This function removes all the call data from list and frees the memory\r
339  *\r
340  * @return      nothing\r
341  * @param[in]   void\r
342 */\r
343 void _vcui_doc_remove_all_call_data();\r
344 \r
345 /**\r
346  * This function retrieves the earliest call data based on the call status\r
347  *\r
348  * @return      pointer to the call data structure\r
349  * @param[in]   call_status             value of the call status (hold/unhold)\r
350 */\r
351 call_data_t *_vcui_doc_get_call_data_by_call_status(int call_status);\r
352 \r
353 /**\r
354  * This function retrieves the most recent MO call data\r
355  *\r
356  * @return      pointer to the call data structure\r
357  * @param[in]   nothing\r
358 */\r
359 call_data_t *_vcui_doc_get_call_data_mo_type();\r
360 \r
361 /**\r
362  * This function retrieves the first call data in the list\r
363  *\r
364  * @return      pointer to the call data structure\r
365  * @param[in]   nothing\r
366 */\r
367 call_data_t *_vcui_doc_get_first_call_data_from_list();\r
368 \r
369 /**\r
370  * This function retrieves the first call data in the list which is of UNHOLD status\r
371  *\r
372  * @return      pointer to the call data structure\r
373  * @param[in]   nothing\r
374 */\r
375 call_data_t *_vcui_doc_get_first_call_data_by_unhold_status();\r
376 \r
377 /**\r
378  * This function retrieves the call data based on the given call handle\r
379  *\r
380  * @return      pointer to the call data structure\r
381  * @param[in]   handle  value of the call handle\r
382 */\r
383 call_data_t *_vcui_doc_get_call_data_by_handle(int handle);\r
384 \r
385 /**\r
386  * This function retrieves the count of call data which are in HOLD status\r
387  *\r
388  * @return      count of held call data\r
389  * @param[in]   nothing\r
390 */\r
391 int _vcui_doc_get_hold_call_data_count();\r
392 \r
393 /**\r
394  * This function retrieves the count of call data which are in UNHOLD status\r
395  *\r
396  * @return      count of active call data\r
397  * @param[in]   nothing\r
398 */\r
399 int _vcui_doc_get_unhold_call_data_count();\r
400 \r
401 /**\r
402  * This function retrieves the count of call data which are in NO status (neither hold/unhold)\r
403  *\r
404  * @return      count of 'no status' call data\r
405  * @param[in]   nothing\r
406 */\r
407 int _vcui_doc_get_no_status_call_data_count();\r
408 \r
409 /**\r
410  * This function retrieves the count of all call data in the list\r
411  *\r
412  * @return      count of all call data\r
413  * @param[in]   nothing\r
414 */\r
415 int _vcui_doc_get_all_call_data_count();\r
416 \r
417 /**\r
418  * This function retrieves the call status of a group (greater than 1 member group)\r
419  *\r
420  * @return      value of the call status (HOLD/UNHOLD)\r
421  * @param[in]   nothing\r
422 */\r
423 int _vcui_doc_get_group_call_status();\r
424 \r
425 /**\r
426  * This function retrieves the pointer to the list containing the call data with HOLD status\r
427  *\r
428  * @return      pointer to the HOLD call data list\r
429  * @param[in]   nothing\r
430 */\r
431 Eina_List *_vcui_doc_get_caller_list_with_hold_status();\r
432 \r
433 /**\r
434  * This function retrieves the pointer to the list containing the call data with UNHOLD status\r
435  *\r
436  * @return      pointer to the UNHOLD call data list\r
437  * @param[in]   nothing\r
438 */\r
439 Eina_List *_vcui_doc_get_caller_list_with_unhold_status();\r
440 \r
441 /**\r
442  * This function prints all the call data structure members\r
443  *\r
444  * @return      nothing\r
445  * @param[in]   msg_pos         type of message\r
446 */\r
447 void _vcui_doc_print_all_call_data(char *msg_pos);\r
448 \r
449 /**\r
450  * This function assigns UNHOLD call status to all the call data in the list\r
451  *\r
452  * @return      nothing\r
453  * @param[in]   nothing\r
454 */\r
455 void _vcui_doc_set_all_call_data_to_unhold_status();\r
456 \r
457 /**\r
458  * This function assigns HOLD call status to all the call data in the list\r
459  *\r
460  * @return      nothing\r
461  * @param[in]   nothing\r
462 */\r
463 void _vcui_doc_set_all_call_data_to_hold_status();\r
464 \r
465 /**\r
466  * This function swaps the HOLD and UNHOLD calls in the call list\r
467  *\r
468  * @return      nothing\r
469  * @param[in]   nothing\r
470 */\r
471 void _vcui_doc_swap_all_call_data_status();\r
472 \r
473 #endif\r
474 \r