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 * int valid_index = 0; // usim or sim adn first valid index
93 * TelSimPbList_t pb_list = {0,};
94 * int pPbInitCompleted = 0; // init or not
96 * // GET SIM PHONEBOOK INIT INFORMATION
97 * err_code = tel_get_sim_pb_init_info(&pPbInitCompleted, &pb_list, &valid_index);
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 associated is TAPI_EVENT_SIM_PB_STORAGE_COUNT_CNF and 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 * TelSimPbType_t storage_type = 0x00;
165 * storage_type = TAPI_SIM_PB_3GSIM; // usim phonebook
166 * err_code = tel_get_sim_pb_count(storage_type, &request_id);
172 /*================================================================================================*/
173 int tel_get_sim_pb_count(TapiHandle *handle, TelSimPbType_t pb_type, tapi_response_cb callback, void *user_data);
177 * @brief This API is used to get max text length and max number length supported by SIM phone book elementary file.
178 * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs.
180 * This function makes Dbus method call to Telephony Sever and returns immediate value.
181 * However it just means that the API request has been transfered to the CP successfully.
182 * The actual operation result is being delivered in the corresponding event asynchronously.
184 * @par Sync (or) Async:
185 * This is an Asynchronous API.
187 * @par Important Notes:
188 * - The max number length includes the storage space provided by the corresponding EXT file for a given Dialling Number file.
189 * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook).
190 * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine.
196 * - handle from tel_init().
199 * -Different storage types to be selected in SIM. #TelSimPbType_t
201 * @param [in] callback
202 * - To register callback function for result.
204 * @param [in] user_data
205 * - user_data for user specification.
207 * @par Async Response Message:
208 * The event associated is TAPI_EVENT_SIM_PB_ENTRY_INFO_CNF and the event data is #TelSimPbEntryInfo_t.
209 * Asynchronous return status is indicated by #TelSimPbAccessResult_t.
212 * - A dbus connection is established with #tel_init
213 * - The application name is registered with #tel_register_app_name
214 * - The application is registered events to listen asynchronous response with #tel_register_event
215 * - A event loop is running to listen events
220 * @return Return Type (int) \n
221 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
222 * - Negative integer : it provides an error code (Refer #TapiResult_t)
224 * @par Prospective Clients:
230 * #include <ITapiSim.h>
232 * int request_id = 0;
233 * TelSimPbType_t storage_type = 0x00;
234 * storage_type = TAPI_SIM_PB_3GSIM; // usim phonebook
235 * err_code = tel_get_sim_pb_meta_info(storage_type, &request_id);
241 /*================================================================================================*/
242 int tel_get_sim_pb_meta_info(TapiHandle *handle, TelSimPbType_t pb_type, tapi_response_cb callback, void *user_data);
246 * @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.
247 * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs.
249 * This function makes Dbus method call to Telephony Sever and returns immediate value.
250 * However it just means that the API request has been transfered to the CP successfully.
251 * The actual operation result is being delivered in the corresponding event asynchronously.
253 * @par Sync (or) Async:
254 * This is an Asynchronous API.
256 * @par Important Notes:
257 * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook).
258 * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine.
264 * - handle from tel_init().
266 * @param [in] callback
267 * - To register callback function for result.
269 * @param [in] user_data
270 * - user_data for user specification.
272 * @par Async Response Message:
273 * - The event associated is TAPI_SIM_EVENT_PB_3G_CAPABILITY_INFO_CNF and the event data is #TelSimPbCapabilityInfo_t.
274 * Asynchronous return status is indicated by #TelSimPbAccessResult_t.
277 * - A dbus connection is established with #tel_init
278 * - The application name is registered with #tel_register_app_name
279 * - The application is registered events to listen asynchronous response with #tel_register_event
280 * - A event loop is running to listen events
285 * @return Return Type (int) \n
286 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
287 * - Negative integer : it provides an error code (Refer #TapiResult_t)
289 * @par Prospective Clients:
295 * #include <ITapiSim.h>
297 * int request_id = 0;
298 * err_code = tel_get_sim_pb_3g_meta_info(&request_id); // you can find result by receiving asynch event response
304 /*================================================================================================*/
305 int tel_get_sim_pb_usim_meta_info(TapiHandle *handle, tapi_response_cb callback, void *user_data);
309 * @brief This API is used to read SIM phone book entry information from given storage type.
310 * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs.
312 * This function makes Dbus method call to Telephony Sever and returns immediate value.
313 * However it just means that the API request has been transfered to the CP successfully.
314 * The actual operation result is being delivered in the corresponding event asynchronously.
316 * @par Sync (or) Async:
317 * This is an Asynchronous API.
319 * @par Important Notes:
320 * - The index ranges from 1 through to a maximum of 254 for a Linear fixed file and 255 for a cyclic file.
321 * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook).
322 * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine.
328 * - handle from tel_init().
331 * -Different storage types to be selected in SIM. #TelSimPbType_t
334 * -Index for accessing the SIM data.
336 * @param [in] callback
337 * - To register callback function for result.
339 * @param [in] user_data
340 * - user_data for user specification.
342 * @par Async Response Message:
343 * The event associated is TAPI_EVENT_SIM_PB_ACCESS_READ_CNF and the event data is #TelSimPbRecordData_t.
344 * Asynchronous return status is indicated by #TelSimPbAccessResult_t.
347 * - A dbus connection is established with #tel_init
348 * - The application name is registered with #tel_register_app_name
349 * - The application is registered events to listen asynchronous response with #tel_register_event
350 * - A event loop is running to listen events
355 * @return Return Type (int) \n
356 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
357 * - Negative integer : it provides an error code (Refer #TapiResult_t)
359 * @par Prospective Clients:
365 * #include <ITapiSim.h>
367 * int request_id = 0;
368 * unsigned short index = 1;
369 * TelSimPbType_t storage_type = 0x00;
370 * storage_type = TAPI_SIM_PB_3GSIM; // usim phonebook
371 * err_code = tel_read_sim_pb_record(storage_type, index, &request_id);
377 /*================================================================================================*/
378 int tel_read_sim_pb_record(TapiHandle *handle, TelSimPbType_t pb_type, unsigned short index, tapi_response_cb callback, void *user_data);
382 * @brief This API is used to add or edit SIM phone book record entry information.
383 * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs.
385 * This function makes Dbus method call to Telephony Sever and returns immediate value.
386 * However it just means that the API request has been transfered to the CP successfully.
387 * The actual operation result is being delivered in the corresponding event asynchronously.
389 * @par Sync (or) Async:
390 * This is an Asynchronous API.
392 * @par Important Notes:
393 * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook).
394 * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine.
401 * - handle from tel_init().
403 * @param[in] req_data
404 * -phonebook data which will be updated or added. #TelSimPbRecordData_t
406 * @param [in] callback
407 * - To register callback function for result.
409 * @param [in] user_data
410 * - user_data for user specification.
412 * @par Async Response Message:
413 * The event associated is TAPI_EVENT_SIM_PB_UPDATE_CNF and the event data is #TelSimPbUpdateResp_t.
414 * Asynchronous return status is indicated by #TelSimPbAccessResult_t.
417 * - A dbus connection is established with #tel_init
418 * - The application name is registered with #tel_register_app_name
419 * - The application is registered events to listen asynchronous response with #tel_register_event
420 * - A event loop is running to listen events
425 * @return Return Type (int) \n
426 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
427 * - Negative integer : it provides an error code (Refer #TapiResult_t)
429 * @par Prospective Clients:
435 * #include <ITapiSim.h>
437 * int request_id = 0;
438 * unsigned short index = 1;
439 * TelSimPbRecordData_t data;
440 * data.StorageFileType = TAPI_SIM_PB_3GSIM; // usim phonebook
441 * data.Index = 1; // index which will be updated
442 * data.NextIndex = 0;
443 * //data.ContactInfo will be added
444 * err_code = tel_update_sim_pb_record(&data, &request_id);
450 /*================================================================================================*/
451 int tel_update_sim_pb_record(TapiHandle *handle, const TelSimPbRecord_t *req_data, tapi_response_cb callback, void *user_data);
455 * @brief This API is used to delete a SIM phonebook record.
456 * Access to this API is limited to in-house application and we recommend you use phonebook-engine APIs.
458 * This function makes Dbus method call to Telephony Sever and returns immediate value.
459 * However it just means that the API request has been transfered to the CP successfully.
460 * The actual operation result is being delivered in the corresponding event asynchronously.
462 * @par Sync (or) Async:
463 * This is an Asynchronous API.
465 * @par Important Notes:
466 * - The index ranges from 1 through to a maximum of 254 for a Linear fixed file and 255 for a cyclic file.
467 * - We recommend to use phonebook-engine APIs for handling phonebook(including SIM phonebook).
468 * If user uses SIM phonebook related APIs directly, it can break device phonebook consistency because all phonebook information managed in phonebook-engine.
475 * - handle from tel_init().
478 * -Different storage types to be selected in SIM. #TelSimPbType_t
481 * -Index of the record to be deleted.
483 * @param [in] callback
484 * - To register callback function for result.
486 * @param [in] user_data
487 * - user_data for user specification.
489 * @par Async Response Message:
490 * The event associated is TAPI_EVENT_SIM_PB_DELETE_CNF and the event data is #TelSimPbUpdateResp_t.
491 * Asynchronous return status is indicated by #TelSimPbAccessResult_t.
494 * - A dbus connection is established with #tel_init
495 * - The application name is registered with #tel_register_app_name
496 * - The application is registered events to listen asynchronous response with #tel_register_event
497 * - A event loop is running to listen events
502 * @return Return Type (int) \n
503 * - Integer '0' ( same with TAPI_API_SUCCESS ) - indicating that the operation has completed successfully. \n
504 * - Negative integer : it provides an error code (Refer #TapiResult_t)
506 * @par Prospective Clients:
512 * #include <ITapiSim.h>
514 * int request_id = 0;
515 * unsigned short index = 1;
516 * TelSimPbType_t storage_type = 0x00;
517 * storage_type = TAPI_SIM_PB_3GSIM; // usim phonebook
518 * err_code = tel_delete_sim_pb_record(storage_type, index, &request_id);
524 /*================================================================================================*/
525 int tel_delete_sim_pb_record(TapiHandle *handle, TelSimPbType_t pb_type, unsigned short index, tapi_response_cb callback, void *user_data);
531 #endif /* _ITAPI_PHONEBOOK_H_ */