Tizen Native API  5.0

The contacts record API provides the set of definitions and interfaces that enable application developers to get/set records list data.

Required Header

#include <contacts.h>

Functions

int contacts_list_create (contacts_list_h *contacts_list)
 Creates a contacts list.
int contacts_list_destroy (contacts_list_h contacts_list, bool delete_child)
 Destroys a contacts list and releases its all resources.
int contacts_list_get_count (contacts_list_h contacts_list, int *count)
 Retrieves the number of contact entities from a contacts list.
int contacts_list_add (contacts_list_h contacts_list, contacts_record_h record)
 Adds a record to a contacts list.
int contacts_list_remove (contacts_list_h contacts_list, contacts_record_h record)
 Removes a record from the contacts list.
int contacts_list_get_current_record_p (contacts_list_h contacts_list, contacts_record_h *record)
 Retrieves a record from the contacts list.
int contacts_list_prev (contacts_list_h contacts_list)
 Moves a contacts list to the previous position.
int contacts_list_next (contacts_list_h contacts_list)
 Moves a contacts list to the next position.
int contacts_list_first (contacts_list_h contacts_list)
 Moves a contacts list to the first position.
int contacts_list_last (contacts_list_h contacts_list)
 Moves a contacts list to the last position.

Function Documentation

int contacts_list_add ( contacts_list_h  contacts_list,
contacts_record_h  record 
)

Adds a record to a contacts list.

Since :
2.3
Remarks:
Same kind of record can be added.
Parameters:
[in]contacts_listThe contacts list handle
[in]recordThe record handle
Returns:
0 on success, otherwise a negative error value
Return values:
CONTACTS_ERROR_NONESuccessful
CONTACTS_ERROR_INVALID_PARAMETERInvalid parameter
CONTACTS_ERROR_NOT_SUPPORTEDNot supported
CONTACTS_ERROR_SYSTEMInternal system module error
See also:
contacts_list_remove()
int contacts_list_create ( contacts_list_h *  contacts_list)

Creates a contacts list.

Since :
2.3
Remarks:
You must release contacts_list using contacts_list_destroy().
Parameters:
[out]contacts_listThe contacts list handle
Returns:
0 on success, otherwise a negative error value
Return values:
CONTACTS_ERROR_NONESuccessful
CONTACTS_ERROR_OUT_OF_MEMORYOut of memory
CONTACTS_ERROR_INVALID_PARAMETERInvalid parameter
CONTACTS_ERROR_NOT_SUPPORTEDNot supported
CONTACTS_ERROR_SYSTEMInternal system module error
See also:
contacts_list_destroy()
int contacts_list_destroy ( contacts_list_h  contacts_list,
bool  delete_child 
)

Destroys a contacts list and releases its all resources.

Since :
2.3
Parameters:
[in]contacts_listThe contacts list handle
[in]delete_childSet true to destroy child records automatically, otherwise set false to not destroy child records automatically
Returns:
0 on success, otherwise a negative error value
Return values:
CONTACTS_ERROR_NONESuccessful
CONTACTS_ERROR_INVALID_PARAMETERInvalid parameter
CONTACTS_ERROR_NOT_SUPPORTEDNot supported
CONTACTS_ERROR_SYSTEMInternal system module error
See also:
contacts_list_create()
int contacts_list_first ( contacts_list_h  contacts_list)

Moves a contacts list to the first position.

Since :
2.3
Parameters:
[in]contacts_listThe contacts list handle
Returns:
0 on success, otherwise a negative error value
Return values:
CONTACTS_ERROR_NONESuccessful
CONTACTS_ERROR_INVALID_PARAMETERInvalid parameter
CONTACTS_ERROR_NO_DATARequested data does not exist
CONTACTS_ERROR_NOT_SUPPORTEDNot supported
CONTACTS_ERROR_SYSTEMInternal system module error
See also:
contacts_list_last()
int contacts_list_get_count ( contacts_list_h  contacts_list,
int *  count 
)

Retrieves the number of contact entities from a contacts list.

Since :
2.3
Parameters:
[in]contacts_listThe contacts list handle
[out]countThe count of contact entity
Returns:
0 on success, otherwise a negative error value
Return values:
CONTACTS_ERROR_NONESuccessful
CONTACTS_ERROR_INVALID_PARAMETERInvalid parameter
CONTACTS_ERROR_NOT_SUPPORTEDNot supported
CONTACTS_ERROR_SYSTEMInternal system module error
See also:
contacts_list_add()
int contacts_list_get_current_record_p ( contacts_list_h  contacts_list,
contacts_record_h *  record 
)

Retrieves a record from the contacts list.

The default current record is the first record.

Since :
2.3
Remarks:
You MUST NOT destroy the record. It is destroyed automatically when the contacts_list is destroyed.
Parameters:
[in]contacts_listThe contacts list handle
[out]recordThe record handle
Returns:
0 on success, otherwise a negative error value
Return values:
CONTACTS_ERROR_NONESuccessful
CONTACTS_ERROR_INVALID_PARAMETERInvalid parameter
CONTACTS_ERROR_NO_DATARequested data does not exist
CONTACTS_ERROR_NOT_SUPPORTEDNot supported
CONTACTS_ERROR_SYSTEMInternal system module error
int contacts_list_last ( contacts_list_h  contacts_list)

Moves a contacts list to the last position.

Since :
2.3
Parameters:
[in]contacts_listThe contacts list handle
Returns:
0 on success, otherwise a negative error value
Return values:
CONTACTS_ERROR_NONESuccessful
CONTACTS_ERROR_INVALID_PARAMETERInvalid parameter
CONTACTS_ERROR_NO_DATARequested data does not exist
CONTACTS_ERROR_NOT_SUPPORTEDNot supported
CONTACTS_ERROR_SYSTEMInternal system module error
See also:
contacts_list_first()
int contacts_list_next ( contacts_list_h  contacts_list)

Moves a contacts list to the next position.

Since :
2.3
Parameters:
[in]contacts_listThe contacts list handle
Returns:
0 on success, otherwise a negative error value
Return values:
CONTACTS_ERROR_NONESuccessful
CONTACTS_ERROR_INVALID_PARAMETERInvalid parameter
CONTACTS_ERROR_NO_DATARequested data does not exist
CONTACTS_ERROR_NOT_SUPPORTEDNot supported
CONTACTS_ERROR_SYSTEMInternal system module error
See also:
contacts_list_prev()
int contacts_list_prev ( contacts_list_h  contacts_list)

Moves a contacts list to the previous position.

Since :
2.3
Parameters:
[in]contacts_listThe contacts list handle
Returns:
0 on success, otherwise a negative error value
Return values:
CONTACTS_ERROR_NONESuccessful
CONTACTS_ERROR_INVALID_PARAMETERInvalid parameter
CONTACTS_ERROR_NO_DATARequested data does not exist
CONTACTS_ERROR_NOT_SUPPORTEDNot supported
CONTACTS_ERROR_SYSTEMInternal system module error
See also:
contacts_list_next()
int contacts_list_remove ( contacts_list_h  contacts_list,
contacts_record_h  record 
)

Removes a record from the contacts list.

If the record is current record, then current record is changed the next record.
If the record is the last record, then current record will be NULL.

Since :
2.3
Parameters:
[in]contacts_listThe contacts list handle
[in]recordThe record handle
Returns:
0 on success, otherwise a negative error value
Return values:
CONTACTS_ERROR_NONESuccessful
CONTACTS_ERROR_INVALID_PARAMETERInvalid parameter
CONTACTS_ERROR_NO_DATARequested data does not exist
CONTACTS_ERROR_NOT_SUPPORTEDNot supported
CONTACTS_ERROR_SYSTEMInternal system module error
See also:
contacts_list_add()