| 
    Tizen Native API
    10.0
    
   
   | 
  
  
  
 
The contacts record API provides the set of the definitions and interfaces that enable application developers to get/set data from/to contacts record handle.
Required Header
#include <contacts.h> 
 
Functions | |
| int | contacts_record_create (const char *view_uri, contacts_record_h *record) | 
| Creates a record.   | |
| int | contacts_record_destroy (contacts_record_h record, bool delete_child) | 
| Destroys a record and releases its all resources.   | |
| int | contacts_record_clone (contacts_record_h record, contacts_record_h *cloned_record) | 
| Makes a clone of a record.   | |
| int | contacts_record_get_str (contacts_record_h record, unsigned int property_id, char **value) | 
| Gets a string from the record handle.   | |
| int | contacts_record_get_str_p (contacts_record_h record, unsigned int property_id, char **value) | 
| Gets a string pointer from the record handle.   | |
| int | contacts_record_set_str (contacts_record_h record, unsigned int property_id, const char *value) | 
| Sets a string to a record.   | |
| int | contacts_record_get_int (contacts_record_h record, unsigned int property_id, int *value) | 
| Gets a record's integer value.   | |
| int | contacts_record_set_int (contacts_record_h record, unsigned int property_id, int value) | 
| Sets an integer value to a record.   | |
| int | contacts_record_get_lli (contacts_record_h record, unsigned int property_id, long long int *value) | 
| Gets a record's long integer value.   | |
| int | contacts_record_set_lli (contacts_record_h record, unsigned int property_id, long long int value) | 
| Sets a long long integer value to a record.   | |
| int | contacts_record_get_bool (contacts_record_h record, unsigned int property_id, bool *value) | 
| Gets a record's boolean value.   | |
| int | contacts_record_set_bool (contacts_record_h record, unsigned int property_id, bool value) | 
| Sets a boolean value to a record.   | |
| int | contacts_record_get_double (contacts_record_h record, unsigned int property_id, double *value) | 
| Gets a record's double value.   | |
| int | contacts_record_set_double (contacts_record_h record, unsigned int property_id, double value) | 
| Sets a double value to a record.   | |
| int | contacts_record_add_child_record (contacts_record_h record, unsigned int property_id, contacts_record_h child_record) | 
| Adds a child record to the parent record.   | |
| int | contacts_record_remove_child_record (contacts_record_h record, unsigned int property_id, contacts_record_h child_record) | 
| Removes a child record from the parent record.   | |
| int | contacts_record_get_child_record_count (contacts_record_h record, unsigned int property_id, int *count) | 
| Gets the number of child records of a parent record.   | |
| int | contacts_record_get_child_record_at_p (contacts_record_h record, unsigned int property_id, int index, contacts_record_h *child_record) | 
| Gets a child record handle pointer from the parent record.   | |
| int | contacts_record_clone_child_record_list (contacts_record_h record, unsigned int property_id, contacts_list_h *cloned_list) | 
| Clones a child record list of the given parent record.   | |
| int | contacts_record_get_uri_p (contacts_record_h record, const char **view_uri) | 
| Gets URI string from a record.   | |
Typedefs | |
| typedef struct  __contacts_record_h *  | contacts_record_h | 
| Handle for contacts record.   | |
| typedef struct  __contacts_filter_h *  | contacts_filter_h | 
| Handle for contacts filter.   | |
| typedef struct __contacts_list_h * | contacts_list_h | 
| Handle for contacts list.   | |
| typedef struct __contacts_query_h * | contacts_query_h | 
| Handle for contacts query.   | |
| typedef struct __contacts_h * | contacts_h | 
| The contacts handle.   | |
Typedef Documentation
| typedef struct __contacts_filter_h * contacts_filter_h | 
Handle for contacts filter.
- Since :
 - 2.3
 
| typedef struct __contacts_h * contacts_h | 
The contacts handle.
- Since :
 - 2.3
 
| typedef struct __contacts_list_h * contacts_list_h | 
Handle for contacts list.
- Since :
 - 2.3
 
| typedef struct __contacts_query_h * contacts_query_h | 
Handle for contacts query.
- Since :
 - 2.3
 
| typedef struct __contacts_record_h * contacts_record_h | 
Handle for contacts record.
- Since :
 - 2.3
 
Enumeration Type Documentation
Enumeration for Contact address type.
- Since :
 - 2.3
 
- Enumerator:
 
| enum contacts_data_type_e | 
Enumeration for contacts data type.
- Since :
 - 3.0
 
Enumeration for Contact display name source type.
- Since :
 - 2.3
 
- Enumerator:
 
Enumeration for Contact email type.
- Since :
 - 2.3
 
Enumeration for Contact messenger type.
- Since :
 - 2.3
 
- Enumerator:
 
Enumeration for contacts number type.
The number can be made with a set of values by specifying one or more values. Example : CTS_NUM_TYPE_HOME|CTS_NUM_TYPE_VOICE Exceptionally, CTS_NUM_TYPE_CUSTOM is exclusive.
- Since :
 - 2.3
 
- Enumerator:
 
Enumeration for Call history type.
- Since :
 - 2.3
 
- Enumerator:
 
Enumeration for Contact relationship type.
- Since :
 - 2.3
 
- Enumerator:
 
Enumeration for Contact search range.
- Since :
 - 2.3
 
- Enumerator:
 
| enum contacts_sip_type_e | 
| enum contacts_url_type_e | 
Enumeration for usage type.
- Since :
 - 2.3
 
- Enumerator:
 
Function Documentation
| int contacts_record_add_child_record | ( | contacts_record_h | record, | 
| unsigned int | property_id, | ||
| contacts_record_h | child_record | ||
| ) | 
Adds a child record to the parent record.
- Since :
 - 2.3
 
- Parameters:
 - 
  
[in] record The parent record handle [in] property_id The property ID [in] child_record The child record handle to be added to parent record handle  
- Returns:
 0on success, otherwise a negative error value
- Return values:
 - 
  
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_record_clone | ( | contacts_record_h | record, | 
| contacts_record_h * | cloned_record | ||
| ) | 
Makes a clone of a record.
- Since :
 - 2.3
 
- Remarks:
 - You must release cloned_record using contacts_record_destroy().
 
- Parameters:
 - 
  
[in] record The record handle [out] cloned_record The cloned record handle  
- Returns:
 0on success, otherwise a negative error value
- Return values:
 - 
  
CONTACTS_ERROR_NONE Successful CONTACTS_ERROR_OUT_OF_MEMORY Out of memory CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter CONTACTS_ERROR_NOT_SUPPORTED Not supported CONTACTS_ERROR_SYSTEM Internal system module error  
- See also:
 - contacts_record_destroy()
 
| int contacts_record_clone_child_record_list | ( | contacts_record_h | record, | 
| unsigned int | property_id, | ||
| contacts_list_h * | cloned_list | ||
| ) | 
Clones a child record list of the given parent record.
- Since :
 - 2.3
 
- Remarks:
 - You must release cloned_list using contacts_list_destroy().
 
- Parameters:
 - 
  
[in] record The record handle [in] property_id The property ID [out] cloned_list The cloned list handle  
- Returns:
 0on success, otherwise a negative error value
- Return values:
 - 
  
CONTACTS_ERROR_NONE Successful CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter CONTACTS_ERROR_NOT_SUPPORTED Not supported CONTACTS_ERROR_SYSTEM Internal system module error  
- See also:
 - contacts_list_destroy()
 
| int contacts_record_create | ( | const char * | view_uri, | 
| contacts_record_h * | record | ||
| ) | 
Creates a record.
- Since :
 - 2.3
 
- Remarks:
 - You must release record using contacts_record_destroy().
 
- Parameters:
 - 
  
[in] view_uri The view URI [out] record The record handle  
- Returns:
 0on success, otherwise a negative error value
- Return values:
 - 
  
CONTACTS_ERROR_NONE Successful CONTACTS_ERROR_OUT_OF_MEMORY Out of memory CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter CONTACTS_ERROR_NOT_SUPPORTED Not supported CONTACTS_ERROR_SYSTEM Internal system module error  
- Precondition:
 - contacts_connect() should be called to initialize.
 
- See also:
 - contacts_record_destroy()
 
| int contacts_record_destroy | ( | contacts_record_h | record, | 
| bool | delete_child | ||
| ) | 
Destroys a record and releases its all resources.
- Since :
 - 2.3
 
- Parameters:
 - 
  
[in] record The record handle [in] delete_child Set trueto destroy child records automatically, otherwise setfalseto not destroy child records automatically 
- Returns:
 0on success, otherwise a negative error value
- Return values:
 - 
  
CONTACTS_ERROR_NONE Successful CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter CONTACTS_ERROR_NOT_SUPPORTED Not supported CONTACTS_ERROR_SYSTEM Internal system module error  
- See also:
 - contacts_record_create()
 
| int contacts_record_get_bool | ( | contacts_record_h | record, | 
| unsigned int | property_id, | ||
| bool * | value | ||
| ) | 
Gets a record's boolean value.
- Since :
 - 2.3
 
- Parameters:
 - 
  
[in] record The record handle [in] property_id The property ID [out] value The value to be returned  
- Returns:
 0on success, otherwise a negative error value
- Return values:
 - 
  
CONTACTS_ERROR_NONE Successful CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter CONTACTS_ERROR_NOT_SUPPORTED Not supported CONTACTS_ERROR_SYSTEM Internal system module error  
- See also:
 - contacts_record_set_bool()
 
| int contacts_record_get_child_record_at_p | ( | contacts_record_h | record, | 
| unsigned int | property_id, | ||
| int | index, | ||
| contacts_record_h * | child_record | ||
| ) | 
Gets a child record handle pointer from the parent record.
- Since :
 - 2.3
 
- Remarks:
 - You MUST NOT release child_record. It is released when the parent record is destroyed.
 
- Parameters:
 - 
  
[in] record The record handle [in] property_id The property ID [in] index The index of child record [out] child_record The child record handle pointer  
- Returns:
 0on success, otherwise a negative error value
- Return values:
 - 
  
CONTACTS_ERROR_NONE Successful CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter CONTACTS_ERROR_NO_DATA CONTACTS_ERROR_NOT_SUPPORTED Not supported CONTACTS_ERROR_SYSTEM Internal system module error  
| int contacts_record_get_child_record_count | ( | contacts_record_h | record, | 
| unsigned int | property_id, | ||
| int * | count | ||
| ) | 
Gets the number of child records of a parent record.
- Since :
 - 2.3
 
- Parameters:
 - 
  
[in] record The parent record handle [in] property_id The property ID [out] count The child record count  
- Returns:
 0on success, otherwise a negative error value
- Return values:
 - 
  
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_record_get_double | ( | contacts_record_h | record, | 
| unsigned int | property_id, | ||
| double * | value | ||
| ) | 
Gets a record's double value.
- Since :
 - 2.3
 
- Parameters:
 - 
  
[in] record The record handle [in] property_id The property ID [out] value The value to be returned  
- Returns:
 0on success, otherwise a negative error value
- Return values:
 - 
  
CONTACTS_ERROR_NONE Successful CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter CONTACTS_ERROR_NOT_SUPPORTED Not supported CONTACTS_ERROR_SYSTEM Internal system module error  
- See also:
 - contacts_record_set_double()
 
| int contacts_record_get_int | ( | contacts_record_h | record, | 
| unsigned int | property_id, | ||
| int * | value | ||
| ) | 
Gets a record's integer value.
- Since :
 - 2.3
 
- Parameters:
 - 
  
[in] record The record handle [in] property_id The property ID [out] value The value to be returned  
- Returns:
 0on success, otherwise a negative error value
- Return values:
 - 
  
CONTACTS_ERROR_NONE Successful CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter CONTACTS_ERROR_NOT_SUPPORTED Not supported CONTACTS_ERROR_SYSTEM Internal system module error  
- See also:
 - contacts_record_set_int()
 
| int contacts_record_get_lli | ( | contacts_record_h | record, | 
| unsigned int | property_id, | ||
| long long int * | value | ||
| ) | 
Gets a record's long integer value.
- Since :
 - 2.3
 
- Parameters:
 - 
  
[in] record The record handle [in] property_id The property ID [out] value The value to be returned  
- Returns:
 0on success, otherwise a negative error value
- Return values:
 - 
  
CONTACTS_ERROR_NONE Successful CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter CONTACTS_ERROR_NOT_SUPPORTED Not supported CONTACTS_ERROR_SYSTEM Internal system module error  
- See also:
 - contacts_record_set_lli()
 
| int contacts_record_get_str | ( | contacts_record_h | record, | 
| unsigned int | property_id, | ||
| char ** | value | ||
| ) | 
Gets a string from the record handle.
- Since :
 - 2.3
 
- Remarks:
 - You must release value using free().
 
- Parameters:
 - 
  
[in] record The record handle [in] property_id The property ID [out] value The value to be returned  
- Returns:
 0on success, otherwise a negative error value
- Return values:
 - 
  
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_record_get_str_p | ( | contacts_record_h | record, | 
| unsigned int | property_id, | ||
| char ** | value | ||
| ) | 
Gets a string pointer from the record handle.
- Since :
 - 2.3
 
- Remarks:
 - You MUST NOT release value.
 
- Parameters:
 - 
  
[in] record The record handle [in] property_id The property ID [out] value The value to be returned  
- Returns:
 0on success, otherwise a negative error value
- Return values:
 - 
  
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_record_get_uri_p | ( | contacts_record_h | record, | 
| const char ** | view_uri | ||
| ) | 
Gets URI string from a record.
- Since :
 - 2.3
 
- Parameters:
 - 
  
[in] record The record handle [out] view_uri The URI of record  
- Returns:
 0on success, otherwise a negative error value
- Return values:
 - 
  
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_record_remove_child_record | ( | contacts_record_h | record, | 
| unsigned int | property_id, | ||
| contacts_record_h | child_record | ||
| ) | 
Removes a child record from the parent record.
- Since :
 - 2.3
 
- Parameters:
 - 
  
[in] record The parent record handle [in] property_id The property ID [in] child_record The child record handle to be removed from parent record handle  
- Returns:
 0on success, otherwise a negative error value
- Return values:
 - 
  
CONTACTS_ERROR_NONE Successful CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter CONTACTS_ERROR_NOT_SUPPORTED Not supported CONTACTS_ERROR_SYSTEM Internal system module error  
- See also:
 - contacts_record_add_child_record()
 
| int contacts_record_set_bool | ( | contacts_record_h | record, | 
| unsigned int | property_id, | ||
| bool | value | ||
| ) | 
Sets a boolean value to a record.
- Since :
 - 2.3
 
- Parameters:
 - 
  
[in] record The record handle [in] property_id The property ID [in] value The value to set  
- Returns:
 0on success, otherwise a negative error value
- Return values:
 - 
  
CONTACTS_ERROR_NONE Successful CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter CONTACTS_ERROR_NOT_SUPPORTED Not supported CONTACTS_ERROR_SYSTEM Internal system module error  
- See also:
 - contacts_record_get_bool()
 
| int contacts_record_set_double | ( | contacts_record_h | record, | 
| unsigned int | property_id, | ||
| double | value | ||
| ) | 
Sets a double value to a record.
- Since :
 - 2.3
 
- Parameters:
 - 
  
[in] record The record handle [in] property_id The property ID [in] value The value to set  
- Returns:
 0on success, otherwise a negative error value
- Return values:
 - 
  
CONTACTS_ERROR_NONE Successful CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter CONTACTS_ERROR_NOT_SUPPORTED Not supported CONTACTS_ERROR_SYSTEM Internal system module error  
- See also:
 - contacts_record_get_double()
 
| int contacts_record_set_int | ( | contacts_record_h | record, | 
| unsigned int | property_id, | ||
| int | value | ||
| ) | 
Sets an integer value to a record.
- Since :
 - 2.3
 
- Parameters:
 - 
  
[in] record The record handle [in] property_id The property ID [in] value The value to set  
- Returns:
 0on success, otherwise a negative error value
- Return values:
 - 
  
CONTACTS_ERROR_NONE Successful CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter CONTACTS_ERROR_NOT_SUPPORTED Not supported CONTACTS_ERROR_SYSTEM Internal system module error  
- See also:
 - contacts_record_get_int()
 
| int contacts_record_set_lli | ( | contacts_record_h | record, | 
| unsigned int | property_id, | ||
| long long int | value | ||
| ) | 
Sets a long long integer value to a record.
- Since :
 - 2.3
 
- Parameters:
 - 
  
[in] record The record handle [in] property_id The property ID [in] value The value to set  
- Returns:
 0on success, otherwise a negative error value
- Return values:
 - 
  
CONTACTS_ERROR_NONE Successful CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter CONTACTS_ERROR_NOT_SUPPORTED Not supported CONTACTS_ERROR_SYSTEM Internal system module error  
- See also:
 - contacts_record_get_lli()
 
| int contacts_record_set_str | ( | contacts_record_h | record, | 
| unsigned int | property_id, | ||
| const char * | value | ||
| ) | 
Sets a string to a record.
- Since :
 - 2.3
 
- Parameters:
 - 
  
[in] record The record handle [in] property_id The property ID [in] value The value to set  
- Returns:
 0on success, otherwise a negative error value
- Return values:
 - 
  
CONTACTS_ERROR_NONE Successful CONTACTS_ERROR_INVALID_PARAMETER Invalid parameter CONTACTS_ERROR_NOT_SUPPORTED Not supported CONTACTS_ERROR_SYSTEM Internal system module error