4 * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Ja-young Gu <jygu@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
23 * @ingroup TelephonyAPI
24 * @addtogroup PHONEBOOK_TAPI PHONEBOOK
27 * @file ITapiPhonebook.h
29 @brief This file serves as a "C" header file defines functions for Tapi SIM phonebook Services.\n
30 It contains a sample set of function prototypes that would be required by applications.
34 #ifndef _ITAPI_PHONEBOOK_H_
35 #define _ITAPI_PHONEBOOK_H_
37 #include <tapi_common.h>
40 #include <TelDefines.h>
48 * @brief This function is used to get current inserted SIM phonebook init status, available phonebook list and first valid index in case of FDN, ADN, 3G phonebook.
49 * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs.
51 * @par Sync (or) Async:
52 * This is an synchronous API.
54 * @par Important Notes:
55 * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook).
56 * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine.
57 * pb_list and first_index value are available at init_completed status is '1' only.
63 * - handle from tel_init().
65 * @param [out] init_completed
66 * - phonebook init status. '0' is not init, '1' is init complete to use.
68 * @param [out] pb_list
69 * - available SIM phonebook list. This value is valid in phonebook init complete case.
71 * @par Async Response Message:
80 * @return Return Type (int) \n
81 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
82 * - Negative integer : it provides an error code (Refer #TapiResult_t)
84 * @par Prospective Clients:
90 * #include <ITapiSim.h>
92 * TelSimPbList_t pb_list = {0,};
93 * int pPbInitCompleted = 0; // init or not
94 * TapiHandle *handle; // handle given by tel_init()
96 * // GET SIM PHONEBOOK INIT INFORMATION
97 * err_code = tel_get_sim_pb_init_info(handle, &pPbInitCompleted, &pb_list);
103 /*================================================================================================*/
104 int tel_get_sim_pb_init_info(TapiHandle *handle, int *init_completed, TelSimPbList_t *pb_list);
108 * @brief This API is used to get number of used records and total records in specific SIM phonebook type.
109 * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs.
111 * This function makes Dbus method call to Telephony Sever and returns immediate value.
112 * However it just means that the API request has been transfered to the CP successfully.
113 * The actual operation result is being delivered in the corresponding event asynchronously.
115 * @par Sync (or) Async:
116 * This is an Asynchronous API.
118 * @par Important Notes:
119 * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook).
120 * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine.
127 * - handle from tel_init().
130 * -Different storage types to be selected in SIM. #TelSimPbType_t
132 * @param [in] callback
133 * - To register callback function for result.
135 * @param [in] user_data
136 * - user_data for user specification.
138 * @par Async Response Message:
139 * The event data is #TelSimPbStorageInfo_t.
140 * Asynchronous return status is indicated by #TelSimPbAccessResult_t.
143 * - A dbus connection is established with #tel_init
144 * - The application name is registered with #tel_register_app_name
145 * - The application is registered events to listen asynchronous response with #tel_register_event
146 * - A event loop is running to listen events
151 * @return Return Type (int) \n
152 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
153 * - Negative integer : it provides an error code (Refer #TapiResult_t)
155 * @par Prospective Clients:
161 * #include <ITapiSim.h>
163 * int request_id = 0;
164 * TapiHandle *handle; // handle given by tel_init()
165 * tapi_response_cb callback; // Initialized callback function pointer in which response is returned
166 * TelSimPbType_t storage_type = 0x00;
167 * storage_type = TAPI_SIM_PB_3GSIM; // usim phonebook
168 * err_code = tel_get_sim_pb_count(handle, storage_type, callback, &request_id);
174 /*================================================================================================*/
175 int tel_get_sim_pb_count(TapiHandle *handle, TelSimPbType_t pb_type, tapi_response_cb callback, void *user_data);
179 * @brief This API is used to get max text length and max number length supported by SIM phone book elementary file.
180 * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs.
182 * This function makes Dbus method call to Telephony Sever and returns immediate value.
183 * However it just means that the API request has been transfered to the CP successfully.
184 * The actual operation result is being delivered in the corresponding event asynchronously.
186 * @par Sync (or) Async:
187 * This is an Asynchronous API.
189 * @par Important Notes:
190 * - The max number length includes the storage space provided by the corresponding EXT file for a given Dialling Number file.
191 * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook).
192 * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine.
198 * - handle from tel_init().
201 * -Different storage types to be selected in SIM. #TelSimPbType_t
203 * @param [in] callback
204 * - To register callback function for result.
206 * @param [in] user_data
207 * - user_data for user specification.
209 * @par Async Response Message:
210 * The event data is #TelSimPbEntryInfo_t.
211 * Asynchronous return status is indicated by #TelSimPbAccessResult_t.
214 * - A dbus connection is established with #tel_init
215 * - The application name is registered with #tel_register_app_name
216 * - The application is registered events to listen asynchronous response with #tel_register_event
217 * - A event loop is running to listen events
222 * @return Return Type (int) \n
223 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
224 * - Negative integer : it provides an error code (Refer #TapiResult_t)
226 * @par Prospective Clients:
232 * #include <ITapiSim.h>
234 * int request_id = 0;
235 * TapiHandle *handle; // handle given by tel_init()
236 * tapi_response_cb callback; // Initialized callback function pointer in which response is returned
237 * TelSimPbType_t storage_type = 0x00;
238 * storage_type = TAPI_SIM_PB_ADN; // ADN phonebook
239 * err_code = tel_get_sim_pb_meta_info(handle, storage_type, callback, &request_id);
245 /*================================================================================================*/
246 int tel_get_sim_pb_meta_info(TapiHandle *handle, TelSimPbType_t pb_type, tapi_response_cb callback, void *user_data);
250 * @brief This API is used to get SIM 3G phonebook supported EFs like ANR, SNE, GRP, EMAIL etc and corresponding EFs max text length, number length and size.
251 * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs.
253 * This function makes Dbus method call to Telephony Sever and returns immediate value.
254 * However it just means that the API request has been transfered to the CP successfully.
255 * The actual operation result is being delivered in the corresponding event asynchronously.
257 * @par Sync (or) Async:
258 * This is an Asynchronous API.
260 * @par Important Notes:
261 * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook).
262 * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine.
268 * - handle from tel_init().
270 * @param [in] callback
271 * - To register callback function for result.
273 * @param [in] user_data
274 * - user_data for user specification.
276 * @par Async Response Message:
277 * The event data is #TelSimPbCapabilityInfo_t.
278 * Asynchronous return status is indicated by #TelSimPbAccessResult_t.
281 * - A dbus connection is established with #tel_init
282 * - The application name is registered with #tel_register_app_name
283 * - The application is registered events to listen asynchronous response with #tel_register_event
284 * - A event loop is running to listen events
289 * @return Return Type (int) \n
290 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
291 * - Negative integer : it provides an error code (Refer #TapiResult_t)
293 * @par Prospective Clients:
299 * #include <ITapiSim.h>
301 * int request_id = 0;
302 * TapiHandle *handle; // handle given by tel_init()
303 * tapi_response_cb callback; // Initialized callback function pointer in which response is returned
304 * err_code = tel_get_sim_pb_usim_meta_info(handle, callback, &request_id);
310 /*================================================================================================*/
311 int tel_get_sim_pb_usim_meta_info(TapiHandle *handle, tapi_response_cb callback, void *user_data);
315 * @brief This API is used to read SIM phone book entry information from given storage type and index.
316 * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs.
318 * This function makes Dbus method call to Telephony Sever and returns immediate value.
319 * However it just means that the API request has been transfered to the CP successfully.
320 * The actual operation result is being delivered in the corresponding event asynchronously.
322 * @par Sync (or) Async:
323 * This is an Asynchronous API.
325 * @par Important Notes:
326 * - The index ranges from 1 through to a maximum of 254 for a Linear fixed file and 255 for a cyclic file.
327 * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook).
328 * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine.
334 * - handle from tel_init().
337 * -Different storage types to be selected in SIM. #TelSimPbType_t
340 * -Index for accessing the SIM data.
342 * @param [in] callback
343 * - To register callback function for result.
345 * @param [in] user_data
346 * - user_data for user specification.
348 * @par Async Response Message:
349 * The event data is #TelSimPbRecord_t.
350 * Asynchronous return status is indicated by #TelSimPbAccessResult_t.
353 * - A dbus connection is established with #tel_init
354 * - The application name is registered with #tel_register_app_name
355 * - The application is registered events to listen asynchronous response with #tel_register_event
356 * - A event loop is running to listen events
361 * @return Return Type (int) \n
362 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
363 * - Negative integer : it provides an error code (Refer #TapiResult_t)
365 * @par Prospective Clients:
371 * #include <ITapiSim.h>
373 * int request_id = 0;
374 * TapiHandle *handle; // handle given by tel_init()
375 * tapi_response_cb callback; // Initialized callback function pointer in which response is returned
376 * unsigned short index = 1;
377 * TelSimPbType_t storage_type = 0x00;
378 * storage_type = TAPI_SIM_PB_3GSIM; // usim phonebook
379 * err_code = tel_read_sim_pb_record(handle, storage_type, index, callback, &request_id);
385 /*================================================================================================*/
386 int tel_read_sim_pb_record(TapiHandle *handle, TelSimPbType_t pb_type, unsigned short index, tapi_response_cb callback, void *user_data);
390 * @brief This API is used to add or edit SIM phone book record entry information.
391 * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs.
393 * This function makes Dbus method call to Telephony Sever and returns immediate value.
394 * However it just means that the API request has been transfered to the CP successfully.
395 * The actual operation result is being delivered in the corresponding event asynchronously.
397 * @par Sync (or) Async:
398 * This is an Asynchronous API.
400 * @par Important Notes:
401 * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook).
402 * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine.
409 * - handle from tel_init().
411 * @param[in] req_data
412 * -phonebook data which will be updated or added. #TelSimPbRecordData_t
414 * @param [in] callback
415 * - To register callback function for result.
417 * @param [in] user_data
418 * - user_data for user specification.
420 * @par Async Response Message:
421 * The event data is NULL.
422 * Asynchronous return status is indicated by #TelSimPbAccessResult_t.
425 * - A dbus connection is established with #tel_init
426 * - The application name is registered with #tel_register_app_name
427 * - The application is registered events to listen asynchronous response with #tel_register_event
428 * - A event loop is running to listen events
433 * @return Return Type (int) \n
434 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
435 * - Negative integer : it provides an error code (Refer #TapiResult_t)
437 * @par Prospective Clients:
443 * #include <ITapiSim.h>
445 * int request_id = 0;
446 * TapiHandle *handle; // handle given by tel_init()
447 * tapi_response_cb callback; // Initialized callback function pointer in which response is returned
448 * unsigned short index = 1;
449 * TelSimPbRecord_t data;
450 * data.StorageFileType = TAPI_SIM_PB_3GSIM; // usim phonebook
451 * data.Index = 1; // index which will be updated
452 * data.NextIndex = 0;
453 * //data.ContactInfo will be added
454 * err_code = tel_update_sim_pb_record(handle, &data, callback, &request_id);
460 /*================================================================================================*/
461 int tel_update_sim_pb_record(TapiHandle *handle, const TelSimPbRecord_t *req_data, tapi_response_cb callback, void *user_data);
465 * @brief This API is used to delete a SIM phonebook record.
466 * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs.
468 * This function makes Dbus method call to Telephony Sever and returns immediate value.
469 * However it just means that the API request has been transfered to the CP successfully.
470 * The actual operation result is being delivered in the corresponding event asynchronously.
472 * @par Sync (or) Async:
473 * This is an Asynchronous API.
475 * @par Important Notes:
476 * - The index ranges from 1 through to a maximum of 254 for a Linear fixed file and 255 for a cyclic file.
477 * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook).
478 * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine.
485 * - handle from tel_init().
488 * -Different storage types to be selected in SIM. #TelSimPbType_t
491 * -Index of the record to be deleted.
493 * @param [in] callback
494 * - To register callback function for result.
496 * @param [in] user_data
497 * - user_data for user specification.
499 * @par Async Response Message:
500 * The event data is NULL.
501 * Asynchronous return status is indicated by #TelSimPbAccessResult_t.
504 * - A dbus connection is established with #tel_init
505 * - The application name is registered with #tel_register_app_name
506 * - The application is registered events to listen asynchronous response with #tel_register_event
507 * - A event loop is running to listen events
512 * @return Return Type (int) \n
513 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
514 * - Negative integer : it provides an error code (Refer #TapiResult_t)
516 * @par Prospective Clients:
522 * #include <ITapiSim.h>
524 * int request_id = 0;
525 * TapiHandle *handle; // handle given by tel_init()
526 * tapi_response_cb callback; // Initialized callback function pointer in which response is returned
527 * unsigned short index = 1;
528 * TelSimPbType_t storage_type = 0x00;
529 * storage_type = TAPI_SIM_PB_3GSIM; // usim phonebook
530 * err_code = tel_delete_sim_pb_record(handle, storage_type, index, callback, &request_id);
536 /*================================================================================================*/
537 int tel_delete_sim_pb_record(TapiHandle *handle, TelSimPbType_t pb_type, unsigned short index, tapi_response_cb callback, void *user_data);
543 #endif /* _ITAPI_PHONEBOOK_H_ */