Tizen Native API  4.0
vCard

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

Required Header

#include <contacts.h>

Functions

int contacts_vcard_parse_to_contact_foreach (const char *vcard_file_path, contacts_vcard_parse_cb callback, void *user_data)
 Retrieves all contacts with a record handle (_contacts_contact) from a vCard file.
int contacts_vcard_parse_to_contacts (const char *vcard_stream, contacts_list_h *contacts_list)
 Retrieves all contacts with a contacts list from a vCard stream.
int contacts_vcard_make_from_contact (contacts_record_h contact, char **vcard_stream)
 Retrieves the vCard stream from a contact.
int contacts_vcard_make_from_my_profile (contacts_record_h my_profile, char **vcard_stream)
 Retrieves the vCard stream from a contact.
int contacts_vcard_make_from_person (contacts_record_h person, char **vcard_stream)
 Retrieves the vCard stream from a person.
int contacts_vcard_get_entity_count (const char *vcard_file_path, int *count)
 Retrieves the count of contact entities from a vCard file.
int contacts_vcard_get_limit_size_of_photo (unsigned int *limit_size)
 Gets the limit size of width and height of photos to append in vCard streams.
int contacts_vcard_set_limit_size_of_photo (unsigned int limit_size)
 Sets the limit size of width and height of photos to append to vCard streams.

Typedefs

typedef bool(* contacts_vcard_parse_cb )(contacts_record_h record, void *user_data)
 Called to get a record handle of _contacts_contact view.

Typedef Documentation

typedef bool(* contacts_vcard_parse_cb)(contacts_record_h record, void *user_data)

Called to get a record handle of _contacts_contact view.

Since :
2.3
Parameters:
[in]recordThe record handle
[in]user_dataThe user data passed from the foreach function
Returns:
true to continue with the next iteration of the loop, otherwise false to break out of the loop
Precondition:
contacts_vcard_parse_to_contact_foreach() will invoke this callback.
See also:
contacts_vcard_parse_to_contact_foreach()

Function Documentation

int contacts_vcard_get_entity_count ( const char *  vcard_file_path,
int *  count 
)

Retrieves the count of contact entities from a vCard file.

Since :
2.3
Parameters:
[in]vcard_file_pathThe person record 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_SYSTEMSystem error
int contacts_vcard_get_limit_size_of_photo ( unsigned int *  limit_size)

Gets the limit size of width and height of photos to append in vCard streams.

Since :
3.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/contact.read
Parameters:
[out]limit_sizeThe limit size of width and height of photos to append in vCard streams. It's in pixels
Returns:
0 on success, otherwise a negative error value
Return values:
CONTACTS_ERROR_NONESuccessful
CONTACTS_ERROR_INVALID_PARAMETERInvalid parameter
CONTACTS_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method
CONTACTS_ERROR_NOT_SUPPORTEDNot supported
CONTACTS_ERROR_SYSTEMInternal system module error
int contacts_vcard_make_from_contact ( contacts_record_h  contact,
char **  vcard_stream 
)

Retrieves the vCard stream from a contact.

Since :
2.3
Parameters:
[in]contactThe contact record handle
[out]vcard_streamThe vCard stream
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
int contacts_vcard_make_from_my_profile ( contacts_record_h  my_profile,
char **  vcard_stream 
)

Retrieves the vCard stream from a contact.

Since :
2.3
Parameters:
[in]my_profileThe my_profile record handle
[out]vcard_streamThe vCard stream
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
int contacts_vcard_make_from_person ( contacts_record_h  person,
char **  vcard_stream 
)

Retrieves the vCard stream from a person.

Since :
2.3
Privilege Level:
public
Privilege:
http://tizen.org/privilege/contact.read
Parameters:
[in]personThe person record handle
[out]vcard_streamThe vCard stream
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_DBDB error
CONTACTS_ERROR_IPCIPC error
CONTACTS_ERROR_SYSTEMInternal system module error
Precondition:
contacts_connect() should be called to initialize.
int contacts_vcard_parse_to_contact_foreach ( const char *  vcard_file_path,
contacts_vcard_parse_cb  callback,
void *  user_data 
)

Retrieves all contacts with a record handle (_contacts_contact) from a vCard file.

Since :
2.3
Parameters:
[in]vcard_file_pathThe file path of vCard stream file
[in]callbackThe callback function to invoke
[in]user_dataThe user data to be passed to the callback function
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_NO_DATARequested data does not exist
CONTACTS_ERROR_SYSTEMSystem error
Precondition:
contacts_connect() should be called to initialize.
Postcondition:
This function invokes contacts_vcard_parse_cb().
See also:
contacts_vcard_parse_cb()
int contacts_vcard_parse_to_contacts ( const char *  vcard_stream,
contacts_list_h *  contacts_list 
)

Retrieves all contacts with a contacts list from a vCard stream.

Since :
2.3
Parameters:
[in]vcard_streamThe vCard stream
[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
Precondition:
contacts_connect() should be called to initialize.
int contacts_vcard_set_limit_size_of_photo ( unsigned int  limit_size)

Sets the limit size of width and height of photos to append to vCard streams.

This function can be used for getting reduced vCard stream.
When making vCard stream by using contacts_vcard_make_from_person(), contacts_vcard_make_from_my_profile(), contacts_vcard_make_from_contact(),
if width or height of the photo to append is bigger than the limit size, it is reduced to the limit size while maintaining original aspect ratio,
so that vCard stream size can be reduced.

Since :
3.0
Privilege Level:
public
Privilege:
http://tizen.org/privilege/contact.write
Remarks:
The limit_size should be bigger than or equal to 8 and smaller than 1080.
Parameters:
[in]limit_sizeThe limit size of width and height of photos to append in vCard streams. It's in pixels
Returns:
0 on success, otherwise a negative error value
Return values:
CONTACTS_ERROR_NONESuccessful
CONTACTS_ERROR_INVALID_PARAMETERInvalid parameter
CONTACTS_ERROR_PERMISSION_DENIEDPermission denied. This application does not have the privilege to call this method
CONTACTS_ERROR_NOT_SUPPORTEDNot supported
CONTACTS_ERROR_SYSTEMInternal system module error