Tizen Native API
4.0
|
The contacts database API provides the set of definitions and interfaces that enable application developers to handle contacts database.
#include <contacts.h>
Functions | |
int | contacts_db_insert_record (contacts_record_h record, int *id) |
Inserts a record to the contacts database. | |
int | contacts_db_get_record (const char *view_uri, int record_id, contacts_record_h *record) |
Gets a record from the contacts database. | |
int | contacts_db_update_record (contacts_record_h record) |
Updates a record in the contacts database. | |
int | contacts_db_delete_record (const char *view_uri, int record_id) |
Deletes a record from the contacts database with related child records. | |
int | contacts_db_replace_record (contacts_record_h record, int id) |
Replaces an id-identified record with the given record. | |
int | contacts_db_get_all_records (const char *view_uri, int offset, int limit, contacts_list_h *record_list) |
Retrieves all records and returns the results list. | |
int | contacts_db_get_records_with_query (contacts_query_h query, int offset, int limit, contacts_list_h *record_list) |
Uses a query to find records. | |
int | contacts_db_insert_records (contacts_list_h record_list, int **ids, int *count) |
Inserts multiple records to the contacts database. | |
int | contacts_db_update_records (contacts_list_h record_list) |
Updates multiple records in the contacts database. | |
int | contacts_db_delete_records (const char *view_uri, int record_id_array[], int count) |
Deletes multiple records in the contacts database with related child records. | |
int | contacts_db_replace_records (contacts_list_h list, int record_id_array[], int count) |
Replaces database records identified by given ids with a given record list. | |
int | contacts_db_get_current_version (int *contacts_db_version) |
Gets the current contacts database version. | |
int | contacts_db_add_changed_cb (const char *view_uri, contacts_db_changed_cb callback, void *user_data) |
Registers a callback function to be invoked when a record changes. | |
int | contacts_db_remove_changed_cb (const char *view_uri, contacts_db_changed_cb callback, void *user_data) |
Unregisters a callback function. | |
int | contacts_db_get_changes_by_version (const char *view_uri, int address_book_id, int contacts_db_version, contacts_list_h *change_record_list, int *current_contacts_db_version) |
Retrieves records changes since the given database version. | |
int | contacts_db_search_records (const char *view_uri, const char *keyword, int offset, int limit, contacts_list_h *record_list) |
Finds records based on a given keyword. | |
int | contacts_db_search_records_with_query (contacts_query_h query, const char *keyword, int offset, int limit, contacts_list_h *record_list) |
Finds records based on given query and keyword. | |
int | contacts_db_search_records_with_range (const char *view_uri, const char *keyword, int offset, int limit, int range, contacts_list_h *record_list) |
Finds records based on a keyword and range. | |
int | contacts_db_search_records_for_snippet (const char *view_uri, const char *keyword, int offset, int limit, const char *start_match, const char *end_match, int token_number, contacts_list_h *record_list) |
Finds records based on a given keyword for snippet. | |
int | contacts_db_search_records_with_query_for_snippet (contacts_query_h query, const char *keyword, int offset, int limit, const char *start_match, const char *end_match, int token_number, contacts_list_h *record_list) |
Finds records based on given query and keyword for snippet. | |
int | contacts_db_search_records_with_range_for_snippet (const char *view_uri, const char *keyword, int offset, int limit, int range, const char *start_match, const char *end_match, int token_number, contacts_list_h *record_list) |
Finds records based on a keyword and range for snippet. | |
int | contacts_db_get_count (const char *view_uri, int *count) |
Gets the number of records in a specific view. | |
int | contacts_db_get_count_with_query (contacts_query_h query, int *count) |
Gets the number of records matching a query. | |
int | contacts_db_get_last_change_version (int *last_change_version) |
Gets the last successful changed contacts database version on the current connection. | |
int | contacts_db_get_status (contacts_db_status_e *status) |
Gets the current status of server. | |
int | contacts_db_add_status_changed_cb (contacts_db_status_changed_cb callback, void *user_data) |
Registers a callback function. | |
int | contacts_db_remove_status_changed_cb (contacts_db_status_changed_cb callback, void *user_data) |
Unregisters a callback function. | |
Typedefs | |
typedef void(* | contacts_db_changed_cb )(const char *view_uri, void *user_data) |
Called when the designated view changes. | |
typedef void(* | contacts_db_status_changed_cb )(contacts_db_status_e status, void *user_data) |
Called when contacts-service server status changes. |
typedef void(* contacts_db_changed_cb)(const char *view_uri, void *user_data) |
Called when the designated view changes.
[in] | view_uri | The view URI |
[in] | user_data | The user data passed from the callback registration function |
typedef void(* contacts_db_status_changed_cb)(contacts_db_status_e status, void *user_data) |
Called when contacts-service server status changes.
[in] | status | The current status of server |
[in] | user_data | The user data passed from the callback registration function |
enum contacts_changed_e |
enum contacts_db_status_e |
int contacts_db_add_changed_cb | ( | const char * | view_uri, |
contacts_db_changed_cb | callback, | ||
void * | user_data | ||
) |
Registers a callback function to be invoked when a record changes.
[in] | view_uri | The view URI of records whose changes are monitored |
[in] | callback | The callback function to register |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_OUT_OF_MEMORY | Out of memory |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_PERMISSION_DENIED | Permission denied. This application does not have the privilege to call this method |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_SYSTEM | System error |
int contacts_db_add_status_changed_cb | ( | contacts_db_status_changed_cb | callback, |
void * | user_data | ||
) |
Registers a callback function.
[in] | callback | The callback function to register |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_SYSTEM | Internal system module error |
int contacts_db_delete_record | ( | const char * | view_uri, |
int | record_id | ||
) |
Deletes a record from the contacts database with related child records.
[in] | view_uri | The view URI of a record |
[in] | record_id | The record ID to delete |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_OUT_OF_MEMORY | Out of memory |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_FILE_NO_SPACE | FS Full |
CONTACTS_ERROR_NO_DATA | Requested data does not exist |
CONTACTS_ERROR_PERMISSION_DENIED | Permission denied. This application does not have the privilege to call this method |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_DB | Database operation failure |
CONTACTS_ERROR_IPC | IPC error |
CONTACTS_ERROR_SYSTEM | Internal system module error |
int contacts_db_delete_records | ( | const char * | view_uri, |
int | record_id_array[], | ||
int | count | ||
) |
Deletes multiple records in the contacts database with related child records.
[in] | view_uri | The view URI of records |
[in] | record_id_array | The record IDs to delete |
[in] | count | The size of record ID array |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_OUT_OF_MEMORY | Out of memory |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_FILE_NO_SPACE | FS Full |
CONTACTS_ERROR_NO_DATA | Requested data does not exist |
CONTACTS_ERROR_PERMISSION_DENIED | Permission denied. This application does not have the privilege to call this method |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_DB | Database operation failure |
CONTACTS_ERROR_IPC | IPC error |
CONTACTS_ERROR_SYSTEM | Internal system module error |
int contacts_db_get_all_records | ( | const char * | view_uri, |
int | offset, | ||
int | limit, | ||
contacts_list_h * | record_list | ||
) |
Retrieves all records and returns the results list.
[in] | view_uri | The view URI to get records |
[in] | offset | The index from which to get results |
[in] | limit | The number to limit results(value 0 is used for all records) |
[out] | record_list | The record list |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_OUT_OF_MEMORY | Out of memory |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_FILE_NO_SPACE | FS Full |
CONTACTS_ERROR_NO_DATA | Requested data does not exist |
CONTACTS_ERROR_PERMISSION_DENIED | Permission denied. This application does not have the privilege to call this method |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_DB | Database operation failure |
CONTACTS_ERROR_IPC | IPC error |
CONTACTS_ERROR_SYSTEM | Internal system module error |
int contacts_db_get_changes_by_version | ( | const char * | view_uri, |
int | address_book_id, | ||
int | contacts_db_version, | ||
contacts_list_h * | change_record_list, | ||
int * | current_contacts_db_version | ||
) |
Retrieves records changes since the given database version.
This function will find all changed records since the given contacts_db_version.
Now, support _contacts_contact_updated_info view (read only), _contacts_group_updated_info view (read only)
_contacts_my_profile_updated_info view (read only) and _contacts_grouprel_updated_info view (read only).
[in] | view_uri | The view URI to get records |
[in] | address_book_id | The address book ID to filter |
[in] | contacts_db_version | The contacts database version |
[out] | change_record_list | The record list |
[out] | current_contacts_db_version | The current contacts database version |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_OUT_OF_MEMORY | Out of memory |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_FILE_NO_SPACE | FS Full |
CONTACTS_ERROR_NO_DATA | Requested data does not exist |
CONTACTS_ERROR_PERMISSION_DENIED | Permission denied. This application does not have the privilege to call this method |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_DB | Database operation failure |
CONTACTS_ERROR_IPC | IPC error |
CONTACTS_ERROR_SYSTEM | Internal system module error |
int contacts_db_get_count | ( | const char * | view_uri, |
int * | count | ||
) |
Gets the number of records in a specific view.
[in] | view_uri | The view URI |
[out] | count | The count of records |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_OUT_OF_MEMORY | Out of memory |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_NO_DATA | Requested data does not exist |
CONTACTS_ERROR_PERMISSION_DENIED | Permission denied. This application does not have the privilege to call this method |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_DB | Database operation failure |
CONTACTS_ERROR_IPC | IPC error |
CONTACTS_ERROR_SYSTEM | Internal system module error |
int contacts_db_get_count_with_query | ( | contacts_query_h | query, |
int * | count | ||
) |
Gets the number of records matching a query.
[in] | query | The query handle |
[out] | count | The count of records |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_OUT_OF_MEMORY | Out of memory |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_NO_DATA | Requested data does not exist |
CONTACTS_ERROR_PERMISSION_DENIED | Permission denied. This application does not have the privilege to call this method |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_DB | Database operation failure |
CONTACTS_ERROR_IPC | IPC error |
CONTACTS_ERROR_SYSTEM | Internal system module error |
int contacts_db_get_current_version | ( | int * | contacts_db_version | ) |
Gets the current contacts database version.
[out] | contacts_db_version | The contacts database version |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_OUT_OF_MEMORY | Out of memory |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_PERMISSION_DENIED | Permission denied. This application does not have the privilege to call this method |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_NO_DATA | Requested data does not exist |
CONTACTS_ERROR_DB | Database operation failure |
CONTACTS_ERROR_IPC | IPC error |
CONTACTS_ERROR_SYSTEM | Internal system module error |
int contacts_db_get_last_change_version | ( | int * | last_change_version | ) |
Gets the last successful changed contacts database version on the current connection.
[out] | last_change_version | The database version |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_DB | Database operation failure |
CONTACTS_ERROR_PERMISSION_DENIED | Permission denied. This application does not have the privilege to call this method |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_SYSTEM | Internal system module error |
int contacts_db_get_record | ( | const char * | view_uri, |
int | record_id, | ||
contacts_record_h * | record | ||
) |
Gets a record from the contacts database.
This function creates a new contact handle from the contacts database by the given record_id.
record will be created, which is filled with contact information.
[in] | view_uri | The view URI of a record |
[in] | record_id | The record ID to get from database |
[out] | record | The record handle associated with the record ID |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_OUT_OF_MEMORY | Out of memory |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_FILE_NO_SPACE | FS Full |
CONTACTS_ERROR_NO_DATA | Requested data does not exist |
CONTACTS_ERROR_PERMISSION_DENIED | Permission denied. This application does not have the privilege to call this method |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_DB | Database operation failure |
CONTACTS_ERROR_IPC | IPC error |
CONTACTS_ERROR_SYSTEM | Internal system module error |
int contacts_db_get_records_with_query | ( | contacts_query_h | query, |
int | offset, | ||
int | limit, | ||
contacts_list_h * | record_list | ||
) |
Uses a query to find records.
[in] | query | The query to filter the results |
[in] | offset | The index from which to get results |
[in] | limit | The number to limit results(value 0 is used for get all records) |
[out] | record_list | The record list |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_OUT_OF_MEMORY | Out of memory |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_FILE_NO_SPACE | FS Full |
CONTACTS_ERROR_NO_DATA | Requested data does not exist |
CONTACTS_ERROR_PERMISSION_DENIED | Permission denied. This application does not have the privilege to call this method |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_DB | Database operation failure |
CONTACTS_ERROR_IPC | IPC error |
CONTACTS_ERROR_SYSTEM | Internal system module error |
int contacts_db_get_status | ( | contacts_db_status_e * | status | ) |
Gets the current status of server.
[in] | status | The current status of server |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_SYSTEM | Internal system module error |
int contacts_db_insert_record | ( | contacts_record_h | record, |
int * | id | ||
) |
Inserts a record to the contacts database.
[in] | record | The record handle |
[out] | id | The ID of inserted record |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_OUT_OF_MEMORY | Out of memory |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_FILE_NO_SPACE | FS Full |
CONTACTS_ERROR_NO_DATA | Requested data does not exist |
CONTACTS_ERROR_PERMISSION_DENIED | Permission denied. This application does not have the privilege to call this method |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_DB | Database operation failure |
CONTACTS_ERROR_IPC | IPC error |
CONTACTS_ERROR_SYSTEM | Internal system module error |
int contacts_db_insert_records | ( | contacts_list_h | record_list, |
int ** | ids, | ||
int * | count | ||
) |
Inserts multiple records to the contacts database.
[in] | record_list | The record list handle |
[out] | ids | The IDs of inserted records |
[out] | count | The number of IDs |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_OUT_OF_MEMORY | Out of memory |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_FILE_NO_SPACE | FS Full |
CONTACTS_ERROR_NO_DATA | Requested data does not exist |
CONTACTS_ERROR_PERMISSION_DENIED | Permission denied. This application does not have the privilege to call this method |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_DB | Database operation failure |
CONTACTS_ERROR_IPC | IPC error |
CONTACTS_ERROR_SYSTEM | Internal system module error |
int contacts_db_remove_changed_cb | ( | const char * | view_uri, |
contacts_db_changed_cb | callback, | ||
void * | user_data | ||
) |
Unregisters a callback function.
[in] | view_uri | The view URI of records whose changes are monitored |
[in] | callback | The callback function to register |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_PERMISSION_DENIED | Permission denied. This application does not have the privilege to call this method |
CONTACTS_ERROR_NO_DATA | Requested data does not exist |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_SYSTEM | System error |
int contacts_db_remove_status_changed_cb | ( | contacts_db_status_changed_cb | callback, |
void * | user_data | ||
) |
Unregisters a callback function.
[in] | callback | The callback function to register |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_SYSTEM | Internal system module error |
int contacts_db_replace_record | ( | contacts_record_h | record, |
int | id | ||
) |
Replaces an id-identified record with the given record.
Now, this API supports only _contacts_contact view_uri.
[in] | record | The new record handle to replace |
[in] | id | The DB record ID to be replaced |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_OUT_OF_MEMORY | Out of memory |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_FILE_NO_SPACE | FS Full |
CONTACTS_ERROR_NO_DATA | Requested data does not exist |
CONTACTS_ERROR_PERMISSION_DENIED | Permission denied. This application does not have the privilege to call this method |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_DB | Database operation failure |
CONTACTS_ERROR_IPC | IPC error |
CONTACTS_ERROR_SYSTEM | Internal system module error |
int contacts_db_replace_records | ( | contacts_list_h | list, |
int | record_id_array[], | ||
int | count | ||
) |
Replaces database records identified by given ids with a given record list.
[in] | list | The new record list handle to replace |
[in] | record_id_array | The record IDs to replace |
[in] | count | The size of record ID array |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_OUT_OF_MEMORY | Out of memory |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_FILE_NO_SPACE | FS Full |
CONTACTS_ERROR_NO_DATA | Requested data does not exist |
CONTACTS_ERROR_PERMISSION_DENIED | Permission denied. This application does not have the privilege to call this method |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_DB | Database operation failure |
CONTACTS_ERROR_IPC | IPC error |
CONTACTS_ERROR_SYSTEM | Internal system module error |
int contacts_db_search_records | ( | const char * | view_uri, |
const char * | keyword, | ||
int | offset, | ||
int | limit, | ||
contacts_list_h * | record_list | ||
) |
Finds records based on a given keyword.
[in] | view_uri | The view URI to get records |
[in] | keyword | The keyword |
[in] | offset | The index from which to get results |
[in] | limit | The number to limit results(value 0 is used for get all records) |
[out] | record_list | The record list |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_OUT_OF_MEMORY | Out of memory |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_PERMISSION_DENIED | Permission denied. This application does not have the privilege to call this method |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_DB | Database operation failure |
CONTACTS_ERROR_IPC | IPC error |
CONTACTS_ERROR_SYSTEM | Internal system module error |
int contacts_db_search_records_for_snippet | ( | const char * | view_uri, |
const char * | keyword, | ||
int | offset, | ||
int | limit, | ||
const char * | start_match, | ||
const char * | end_match, | ||
int | token_number, | ||
contacts_list_h * | record_list | ||
) |
Finds records based on a given keyword for snippet.
[in] | view_uri | The view URI to get records |
[in] | keyword | The keyword |
[in] | offset | The index from which to get results |
[in] | limit | The number to limit results(value 0 used for get all records) |
[in] | start_match | The text which is inserted into the fragment before the keyword(If NULL, default is "[") |
[in] | end_match | The text which is inserted into the fragment after the keyword(If NULL, default is "]") |
[in] | token_number | The one side extra number of tokens near keyword(If negative value, full sentence is printed. e.g. if token number is 3 with 'abc' keyword, "my name is [abc]de and my home") |
[out] | record_list | The record list |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_OUT_OF_MEMORY | Out of memory |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_PERMISSION_DENIED | Permission denied. This application does not have the privilege to call this method |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_DB | Database operation failure |
CONTACTS_ERROR_IPC | IPC error |
CONTACTS_ERROR_SYSTEM | Internal system module error |
int contacts_db_search_records_with_query | ( | contacts_query_h | query, |
const char * | keyword, | ||
int | offset, | ||
int | limit, | ||
contacts_list_h * | record_list | ||
) |
Finds records based on given query and keyword.
[in] | query | The query handle to filter |
[in] | keyword | The keyword |
[in] | offset | The index from which to get results |
[in] | limit | The number to limit results(value 0 used for get all records) |
[out] | record_list | The record list |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_OUT_OF_MEMORY | Out of memory |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_FILE_NO_SPACE | FS Full |
CONTACTS_ERROR_PERMISSION_DENIED | Permission denied. This application does not have the privilege to call this method |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_DB | Database operation failure |
CONTACTS_ERROR_IPC | IPC error |
CONTACTS_ERROR_SYSTEM | Internal system module error |
int contacts_db_search_records_with_query_for_snippet | ( | contacts_query_h | query, |
const char * | keyword, | ||
int | offset, | ||
int | limit, | ||
const char * | start_match, | ||
const char * | end_match, | ||
int | token_number, | ||
contacts_list_h * | record_list | ||
) |
Finds records based on given query and keyword for snippet.
[in] | query | The query handle to filter |
[in] | keyword | The keyword |
[in] | offset | The index from which to get results |
[in] | limit | The number to limit results(value 0 used for get all records) |
[in] | start_match | The text which is inserted into the fragment before the keyword(If NULL, default is "[") |
[in] | end_match | The text which is inserted into the fragment after the keyword(If NULL, default is "]") |
[in] | token_number | The one side extra number of tokens near keyword(If negative value, full sentence is printed. e.g. if token number is 3 with 'abc' keyword, "my name is [abc]de and my home") |
[out] | record_list | The record list |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_OUT_OF_MEMORY | Out of memory |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_FILE_NO_SPACE | FS Full |
CONTACTS_ERROR_PERMISSION_DENIED | Permission denied. This application does not have the privilege to call this method |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_DB | Database operation failure |
CONTACTS_ERROR_IPC | IPC error |
CONTACTS_ERROR_SYSTEM | Internal system module error |
int contacts_db_search_records_with_range | ( | const char * | view_uri, |
const char * | keyword, | ||
int | offset, | ||
int | limit, | ||
int | range, | ||
contacts_list_h * | record_list | ||
) |
Finds records based on a keyword and range.
[in] | view_uri | The view URI |
[in] | keyword | The keyword |
[in] | offset | The index from which to get results |
[in] | limit | The number to limit results(value 0 is used for get all records) |
[in] | range | The search range |
[out] | record_list | The record list |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_OUT_OF_MEMORY | Out of memory |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_PERMISSION_DENIED | Permission denied. This application does not have the privilege to call this method |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_DB | Database operation failure |
CONTACTS_ERROR_IPC | IPC error |
CONTACTS_ERROR_SYSTEM | Internal system module error |
int contacts_db_search_records_with_range_for_snippet | ( | const char * | view_uri, |
const char * | keyword, | ||
int | offset, | ||
int | limit, | ||
int | range, | ||
const char * | start_match, | ||
const char * | end_match, | ||
int | token_number, | ||
contacts_list_h * | record_list | ||
) |
Finds records based on a keyword and range for snippet.
[in] | view_uri | The view URI |
[in] | keyword | The keyword |
[in] | offset | The index from which to get results |
[in] | limit | The number to limit results(value 0 is used for get all records) |
[in] | range | The search range |
[in] | start_match | The text which is inserted into the fragment before the keyword(If NULL, default is "[") |
[in] | end_match | The text which is inserted into the fragment after the keyword(If NULL, default is "]") |
[in] | token_number | The one side extra number of tokens near keyword(If negative value, full sentence is printed. e.g. if token number is 3 with 'abc' keyword, "my name is [abc]de and my home") |
[out] | record_list | The record list |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_OUT_OF_MEMORY | Out of memory |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_PERMISSION_DENIED | Permission denied. This application does not have the privilege to call this method |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_DB | Database operation failure |
CONTACTS_ERROR_IPC | IPC error |
CONTACTS_ERROR_SYSTEM | Internal system module error |
int contacts_db_update_record | ( | contacts_record_h | record | ) |
Updates a record in the contacts database.
[in] | record | The record handle |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_OUT_OF_MEMORY | Out of memory |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_FILE_NO_SPACE | FS Full |
CONTACTS_ERROR_NO_DATA | Requested data does not exist |
CONTACTS_ERROR_PERMISSION_DENIED | Permission denied. This application does not have the privilege to call this method |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_DB | Database operation failure |
CONTACTS_ERROR_IPC | IPC error |
CONTACTS_ERROR_SYSTEM | Internal system module error |
int contacts_db_update_records | ( | contacts_list_h | record_list | ) |
Updates multiple records in the contacts database.
[in] | record_list | The record list handle |
0
on success, otherwise a negative error value CONTACTS_ERROR_NONE | Successful |
CONTACTS_ERROR_OUT_OF_MEMORY | Out of memory |
CONTACTS_ERROR_INVALID_PARAMETER | Invalid parameter |
CONTACTS_ERROR_FILE_NO_SPACE | FS Full |
CONTACTS_ERROR_NO_DATA | Requested data does not exist |
CONTACTS_ERROR_PERMISSION_DENIED | Permission denied. This application does not have the privilege to call this method |
CONTACTS_ERROR_NOT_SUPPORTED | Not supported |
CONTACTS_ERROR_DB | Database operation failure |
CONTACTS_ERROR_IPC | IPC error |
CONTACTS_ERROR_SYSTEM | Internal system module error |