Tizen Native API  4.0

The contacts person API provides the set of definitions and interfaces that enable application developers to link/unlink person and contact.

Required Header

#include <contacts.h>

Functions

int contacts_person_link_person (int base_person_id, int person_id)
 Links a person to another person.
int contacts_person_unlink_contact (int person_id, int contact_id, int *unlinked_person_id)
 Unlinks a contact from a person.
int contacts_person_reset_usage (int person_id, contacts_usage_type_e type)
 Resets a person's usage count.
int contacts_person_set_favorite_order (int person_id, int previous_person_id, int next_person_id)
 Sets the order of a (favorite) contact.
int contacts_person_set_default_property (contacts_person_property_e property, int person_id, int id)
 Sets a record's default property.
int contacts_person_get_default_property (contacts_person_property_e property, int person_id, int *id)
 Gets a default property for a record.
int contacts_person_get_aggregation_suggestions (int person_id, int limit, contacts_list_h *record_list)
 Gets aggregation suggestions.

Enumeration Type Documentation

Enumeration for Contacts person properties.

Since :
2.3
Enumerator:
CONTACTS_PERSON_PROPERTY_NAME_CONTACT 

Default contacts record

CONTACTS_PERSON_PROPERTY_NUMBER 

Default number record

CONTACTS_PERSON_PROPERTY_EMAIL 

Default email record

CONTACTS_PERSON_PROPERTY_IMAGE 

Default image record


Function Documentation

int contacts_person_get_aggregation_suggestions ( int  person_id,
int  limit,
contacts_list_h *  record_list 
)

Gets aggregation suggestions.

Since :
3.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/contact.read
Remarks:
You must release record_list using contacts_list_destroy().
This may take a long time. If you need to use it in bulk, make sure the user experience is acceptable while running it.
Parameters:
[in]person_idThe person ID
[in]limitThe number to limit results(value 0 is used for get all records)
[out]record_listThe list of person records
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_FILE_NO_SPACEFS Full
CONTACTS_ERROR_NO_DATARequested data does not exist
CONTACTS_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method
CONTACTS_ERROR_NOT_SUPPORTEDNot supported
CONTACTS_ERROR_DBDatabase operation failure
CONTACTS_ERROR_IPCIPC error
CONTACTS_ERROR_SYSTEMInternal system module error
Precondition:
contacts_connect() should be called to open a connection to the contacts service.
See also:
contacts_connect()
int contacts_person_get_default_property ( contacts_person_property_e  property,
int  person_id,
int *  id 
)

Gets a default property for a record.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/contact.read
Remarks:
id can be contact_id, number_id, email_id, image_id.
Parameters:
[in]propertycontacts_person_property_e
[in]person_idThe person ID
[out]idThe record ID of the property to be set as default
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_NO_DATARequested data does not exist
CONTACTS_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method
CONTACTS_ERROR_NOT_SUPPORTEDNot supported
CONTACTS_ERROR_DBDatabase operation failure
CONTACTS_ERROR_IPCIPC error
CONTACTS_ERROR_SYSTEMInternal system module error
Precondition:
contacts_connect() should be called to open a connection to the contacts service.
See also:
contacts_connect()
int contacts_person_link_person ( int  base_person_id,
int  person_id 
)

Links a person to another person.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/contact.write
Parameters:
[in]base_person_idThe base person ID
[in]person_idThe person ID to link to
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_FILE_NO_SPACEFS Full
CONTACTS_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method
CONTACTS_ERROR_NOT_SUPPORTEDNot supported
CONTACTS_ERROR_DBDatabase operation failure
CONTACTS_ERROR_IPCIPC error
CONTACTS_ERROR_SYSTEMInternal system module error
Precondition:
contacts_connect() should be called to open a connection to the contacts service.
See also:
contacts_connect()
int contacts_person_reset_usage ( int  person_id,
contacts_usage_type_e  type 
)

Resets a person's usage count.

The person is no longer in the most frequently contacted person list.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/contact.write
Parameters:
[in]person_idThe person ID
[in]typeThe type to reset
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_FILE_NO_SPACEFS Full
CONTACTS_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method
CONTACTS_ERROR_NOT_SUPPORTEDNot supported
CONTACTS_ERROR_DBDatabase operation failure
CONTACTS_ERROR_IPCIPC error
CONTACTS_ERROR_SYSTEMInternal system module error
Precondition:
contacts_connect() should be called to open a connection to the contacts service.
See also:
contacts_connect()
int contacts_person_set_default_property ( contacts_person_property_e  property,
int  person_id,
int  id 
)

Sets a record's default property.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/contact.write
Remarks:
id can be contact_id, number_id, email_id, image_id.
Parameters:
[in]propertycontacts_person_property_e
[in]person_idThe person ID
[in]idThe record ID
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_FILE_NO_SPACEFS Full
CONTACTS_ERROR_NO_DATARequested data does not exist
CONTACTS_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method
CONTACTS_ERROR_NOT_SUPPORTEDNot supported
CONTACTS_ERROR_DBDatabase operation failure
CONTACTS_ERROR_IPCIPC error
CONTACTS_ERROR_SYSTEMInternal system module error
Precondition:
contacts_connect() should be called to open a connection to the contacts service.
See also:
contacts_connect()
int contacts_person_set_favorite_order ( int  person_id,
int  previous_person_id,
int  next_person_id 
)

Sets the order of a (favorite) contact.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/contact.write
Parameters:
[in]person_idThe person ID to move
[in]previous_person_idThe previous person ID
[in]next_person_idThe back person ID
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_FILE_NO_SPACEFS Full
CONTACTS_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method
CONTACTS_ERROR_NOT_SUPPORTEDNot supported
CONTACTS_ERROR_DBDatabase operation failure
CONTACTS_ERROR_IPCIPC error
CONTACTS_ERROR_SYSTEMInternal system module error
Precondition:
contacts_connect() should be called to open a connection to the contacts service.
See also:
contacts_connect()
int contacts_person_unlink_contact ( int  person_id,
int  contact_id,
int *  unlinked_person_id 
)

Unlinks a contact from a person.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/contact.write
Parameters:
[in]person_idThe person ID
[in]contact_idThe contact ID to unlink
[out]unlinked_person_idThe person ID generated
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_FILE_NO_SPACEFS Full
CONTACTS_ERROR_NO_DATARequested data does not exist
CONTACTS_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method
CONTACTS_ERROR_NOT_SUPPORTEDNot supported
CONTACTS_ERROR_DBDatabase operation failure
CONTACTS_ERROR_IPCIPC error
CONTACTS_ERROR_SYSTEMInternal system module error
Precondition:
contacts_connect() should be called to open a connection to the contacts service.
See also:
contacts_connect()