Liblinphone  3.10.2
Typedefs | Enumerations | Functions
Carddav_vcard

Typedefs

typedef struct
_LinphoneCardDavContext 
LinphoneCardDavContext
typedef enum
_LinphoneCardDavQueryType 
LinphoneCardDavQueryType
typedef struct
_LinphoneCardDavQuery 
LinphoneCardDavQuery
typedef struct
_LinphoneCardDavResponse 
LinphoneCardDavResponse
typedef void(* LinphoneCardDavContactCreatedCb )(LinphoneCardDavContext *cdc, LinphoneFriend *lf)
typedef void(* LinphoneCardDavContactUpdatedCb )(LinphoneCardDavContext *cdc, LinphoneFriend *new_friend, LinphoneFriend *old_friend)
typedef void(* LinphoneCardDavContactRemovedCb )(LinphoneCardDavContext *cdc, LinphoneFriend *lf)
typedef void(* LinphoneCardDavSynchronizationDoneCb )(LinphoneCardDavContext *cdc, bool_t success, const char *message)
typedef struct
_LinphoneVcardContext 
LinphoneVcardContext
typedef struct _LinphoneVcard LinphoneVcard

Enumerations

enum  _LinphoneCardDavQueryType {
  LinphoneCardDavQueryTypePropfind,
  LinphoneCardDavQueryTypeAddressbookQuery,
  LinphoneCardDavQueryTypeAddressbookMultiget,
  LinphoneCardDavQueryTypePut,
  LinphoneCardDavQueryTypeDelete
}

Functions

LinphoneCardDavContextlinphone_carddav_context_new (LinphoneFriendList *lfl)
void linphone_carddav_context_destroy (LinphoneCardDavContext *cdc)
void linphone_carddav_set_user_data (LinphoneCardDavContext *cdc, void *ud)
void * linphone_carddav_get_user_data (LinphoneCardDavContext *cdc)
void linphone_carddav_synchronize (LinphoneCardDavContext *cdc)
void linphone_carddav_put_vcard (LinphoneCardDavContext *cdc, LinphoneFriend *lf)
void linphone_carddav_delete_vcard (LinphoneCardDavContext *cdc, LinphoneFriend *lf)
void linphone_carddav_set_synchronization_done_callback (LinphoneCardDavContext *cdc, LinphoneCardDavSynchronizationDoneCb cb)
void linphone_carddav_set_new_contact_callback (LinphoneCardDavContext *cdc, LinphoneCardDavContactCreatedCb cb)
void linphone_carddav_set_updated_contact_callback (LinphoneCardDavContext *cdc, LinphoneCardDavContactUpdatedCb cb)
void linphone_carddav_set_removed_contact_callback (LinphoneCardDavContext *cdc, LinphoneCardDavContactRemovedCb cb)
void linphone_carddav_get_current_ctag (LinphoneCardDavContext *cdc)
void linphone_carddav_fetch_vcards (LinphoneCardDavContext *cdc)
void linphone_carddav_pull_vcards (LinphoneCardDavContext *cdc, MSList *vcards_to_pull)
LinphoneVcardContextlinphone_vcard_context_new (void)
void linphone_vcard_context_destroy (LinphoneVcardContext *context)
void * linphone_vcard_context_get_user_data (const LinphoneVcardContext *context)
void linphone_vcard_context_set_user_data (LinphoneVcardContext *context, void *data)
LinphoneVcardlinphone_vcard_new (void)
void linphone_vcard_free (LinphoneVcard *vCard)
bctbx_list_t * linphone_vcard_context_get_vcard_list_from_file (LinphoneVcardContext *context, const char *file)
bctbx_list_t * linphone_vcard_context_get_vcard_list_from_buffer (LinphoneVcardContext *context, const char *buffer)
LinphoneVcardlinphone_vcard_context_get_vcard_from_buffer (LinphoneVcardContext *context, const char *buffer)
const char * linphone_vcard_as_vcard4_string (LinphoneVcard *vCard)
void linphone_vcard_set_full_name (LinphoneVcard *vCard, const char *name)
const char * linphone_vcard_get_full_name (const LinphoneVcard *vCard)
void linphone_vcard_add_sip_address (LinphoneVcard *vCard, const char *sip_address)
void linphone_vcard_remove_sip_address (LinphoneVcard *vCard, const char *sip_address)
void linphone_vcard_edit_main_sip_address (LinphoneVcard *vCard, const char *sip_address)
bctbx_list_t * linphone_vcard_get_sip_addresses (const LinphoneVcard *vCard)
void linphone_vcard_add_phone_number (LinphoneVcard *vCard, const char *phone)
void linphone_vcard_remove_phone_number (LinphoneVcard *vCard, const char *phone)
bctbx_list_t * linphone_vcard_get_phone_numbers (const LinphoneVcard *vCard)
void linphone_vcard_set_organization (LinphoneVcard *vCard, const char *organization)
const char * linphone_vcard_get_organization (const LinphoneVcard *vCard)
bool_t linphone_vcard_generate_unique_id (LinphoneVcard *vCard)
void linphone_vcard_set_uid (LinphoneVcard *vCard, const char *uid)
const char * linphone_vcard_get_uid (const LinphoneVcard *vCard)
void linphone_vcard_set_etag (LinphoneVcard *vCard, const char *etag)
const char * linphone_vcard_get_etag (const LinphoneVcard *vCard)
void linphone_vcard_set_url (LinphoneVcard *vCard, const char *url)
const char * linphone_vcard_get_url (const LinphoneVcard *vCard)
void linphone_vcard_compute_md5_hash (LinphoneVcard *vCard)
bool_t linphone_vcard_compare_md5_hash (LinphoneVcard *vCard)

Typedef Documentation

Callback used to notify a new contact has been created on the CardDAV server

Callback used to notify a contact has been removed on the CardDAV server

Callback used to notify a contact has been updated on the CardDAV server

typedef void(* LinphoneCardDavSynchronizationDoneCb)(LinphoneCardDavContext *cdc, bool_t success, const char *message)

Callback used to notify a contact has been removed on the CardDAV server

typedef struct _LinphoneVcard LinphoneVcard

The LinphoneVcard object.

The LinphoneVcardContext object.


Function Documentation

Deletes a LinphoneCardDavContext object

Parameters:
cdcLinphoneCardDavContext object

Creates a CardDAV context for all related operations

Parameters:
lflLinphoneFriendList object
Returns:
LinphoneCardDavContext object if vCard support is enabled and server URL is available, NULL otherwise

Deletes a LinphoneFriend on the CardDAV server

Parameters:
cdcLinphoneCardDavContext object
lfa LinphoneFriend object to delete on the server

Retrieves a list of all the vCards on server side to be able to detect changes

Parameters:
cdcLinphoneCardDavContext object

Retrieves the current cTag value for the remote server

Parameters:
cdcLinphoneCardDavContext object

Gets the user pointer set in the LinphoneCardDAVContext object

Parameters:
cdcLinphoneCardDavContext object
Returns:
The user data pointer if set, NULL otherwise
void linphone_carddav_pull_vcards ( LinphoneCardDavContext cdc,
MSList *  vcards_to_pull 
)

Download asked vCards from the server

Parameters:
cdcLinphoneCardDavContext object
vcards_to_pulla MSList of LinphoneCardDavResponse objects with at least the url field filled

Sends a LinphoneFriend to the CardDAV server for update or creation

Parameters:
cdcLinphoneCardDavContext object
lfa LinphoneFriend object to update/create on the server

Set the new contact callback.

Parameters:
cdcLinphoneCardDavContext object
cbThe new contact callback to be used.

Set the removed contact callback.

Parameters:
cdcLinphoneCardDavContext object
cbThe removed contact callback to be used.

Set the synchronization done callback.

Parameters:
cdcLinphoneCardDavContext object
cbThe synchronization done callback to be used.

Set the updated contact callback.

Parameters:
cdcLinphoneCardDavContext object
cbThe updated contact callback to be used.
void linphone_carddav_set_user_data ( LinphoneCardDavContext cdc,
void *  ud 
)

Sets a user pointer to the LinphoneCardDAVContext object

Parameters:
cdcLinphoneCardDavContext object
udThe user data pointer

Starts a synchronization with the remote server to update local friends with server changes

Parameters:
cdcLinphoneCardDavContext object
void linphone_vcard_add_phone_number ( LinphoneVcard vCard,
const char *  phone 
)

Adds a phone number in the vCard, using the TEL property

Parameters:
[in]vCardthe LinphoneVcard
[in]phonethe phone number to add
void linphone_vcard_add_sip_address ( LinphoneVcard vCard,
const char *  sip_address 
)

Adds a SIP address in the vCard, using the IMPP property

Parameters:
[in]vCardthe LinphoneVcard
[in]sip_addressthe SIP address to add

Returns the vCard4 representation of the LinphoneVcard.

Parameters:
[in]vCardthe LinphoneVcard
Returns:
a const char * that represents the vCard

Compares the previously computed md5 hash (using linphone_vcard_compute_md5_hash) with the current one

Parameters:
[in]vCardthe LinphoneVcard
Returns:
0 if the md5 hasn't changed, 1 otherwise

Computes the md5 hash for the vCard

Parameters:
[in]vCardthe LinphoneVcard

Destroys the vCard context

Parameters:
[in]contexta LinphoneVcardContext object

Gets the user data set in the LinphoneVcardContext

Parameters:
[in]contexta LinphoneVcardContext object
Returns:
the user data pointer

Uses belcard to parse the content of a buffer and returns one vCard if possible, or NULL otherwise.

Parameters:
[in]contextthe vCard context to use (speed up the process by not creating a Belcard parser each time)
[in]bufferthe buffer to parse
Returns:
a LinphoneVcard if one could be parsed, or NULL otherwise
bctbx_list_t* linphone_vcard_context_get_vcard_list_from_buffer ( LinphoneVcardContext context,
const char *  buffer 
)

Uses belcard to parse the content of a buffer and returns all the vcards it contains as LinphoneVcards, or NULL if it contains none.

Parameters:
[in]contextthe vCard context to use (speed up the process by not creating a Belcard parser each time)
[in]bufferthe buffer to parse
Returns:
A list of LinphoneVcard objects.
bctbx_list_t* linphone_vcard_context_get_vcard_list_from_file ( LinphoneVcardContext context,
const char *  file 
)

Uses belcard to parse the content of a file and returns all the vcards it contains as LinphoneVcards, or NULL if it contains none.

Parameters:
[in]contextthe vCard context to use (speed up the process by not creating a Belcard parser each time)
[in]filethe path to the file to parse
Returns:
A list of LinphoneVcard objects.

Creates a vCard context to reuse the same BelCardParser object

Returns:
a new LinphoneVcardContext object
void linphone_vcard_context_set_user_data ( LinphoneVcardContext context,
void *  data 
)

Sets the user data in the LinphoneVcardContext

Parameters:
[in]contexta LinphoneVcardContext object
[in]datathe user data pointer
void linphone_vcard_edit_main_sip_address ( LinphoneVcard vCard,
const char *  sip_address 
)

Edits the preferred SIP address in the vCard (or the first one), using the IMPP property

Parameters:
[in]vCardthe LinphoneVcard
[in]sip_addressthe new SIP address

Deletes a LinphoneVcard object properly

Parameters:
[in]vCardthe LinphoneVcard to destroy

Generates a random unique id for the vCard. If is required to be able to synchronize the vCard with a CardDAV server

Parameters:
[in]vCardthe LinphoneVcard
Returns:
TRUE if operation is successful, otherwise FALSE (for example if it already has an unique ID)
const char* linphone_vcard_get_etag ( const LinphoneVcard vCard)

Gets the eTag of the vCard

Parameters:
[in]vCardthe LinphoneVcard
Returns:
the eTag of the vCard in the CardDAV server, otherwise NULL
const char* linphone_vcard_get_full_name ( const LinphoneVcard vCard)

Returns the FN attribute of the vCard, or NULL if it isn't set yet.

Parameters:
[in]vCardthe LinphoneVcard
Returns:
the display name of the vCard, or NULL
const char* linphone_vcard_get_organization ( const LinphoneVcard vCard)

Gets the Organization of the vCard

Parameters:
[in]vCardthe LinphoneVcard
Returns:
the Organization of the vCard or NULL
bctbx_list_t* linphone_vcard_get_phone_numbers ( const LinphoneVcard vCard)

Returns the list of phone numbers (as string) in the vCard (all the TEL attributes) or NULL

Parameters:
[in]vCardthe LinphoneVcard
Returns:
A list of const char * objects.
bctbx_list_t * linphone_vcard_get_sip_addresses ( const LinphoneVcard vCard)

Returns the list of SIP addresses (as string) in the vCard (all the IMPP attributes that has an URI value starting by "sip:") or NULL

Parameters:
[in]vCardthe LinphoneVcard
Returns:
A list of const char * objects.
const char* linphone_vcard_get_uid ( const LinphoneVcard vCard)

Gets the UID of the vCard

Parameters:
[in]vCardthe LinphoneVcard
Returns:
the UID of the vCard, otherwise NULL
const char* linphone_vcard_get_url ( const LinphoneVcard vCard)

Gets the URL of the vCard

Parameters:
[in]vCardthe LinphoneVcard
Returns:
the URL of the vCard in the CardDAV server, otherwise NULL

Creates a LinphoneVcard object that has a pointer to an empty vCard

Returns:
a new LinphoneVcard object
void linphone_vcard_remove_phone_number ( LinphoneVcard vCard,
const char *  phone 
)

Removes a phone number in the vCard (if it exists), using the TEL property

Parameters:
[in]vCardthe LinphoneVcard
[in]phonethe phone number to remove
void linphone_vcard_remove_sip_address ( LinphoneVcard vCard,
const char *  sip_address 
)

Removes a SIP address in the vCard (if it exists), using the IMPP property

Parameters:
[in]vCardthe LinphoneVcard
[in]sip_addressthe SIP address to remove
void linphone_vcard_set_etag ( LinphoneVcard vCard,
const char *  etag 
)

Sets the eTAG of the vCard

Parameters:
[in]vCardthe LinphoneVcard
[in]etagthe eTAG
void linphone_vcard_set_full_name ( LinphoneVcard vCard,
const char *  name 
)

Sets the FN attribute of the vCard (which is mandatory).

Parameters:
[in]vCardthe LinphoneVcard
[in]namethe display name to set for the vCard
void linphone_vcard_set_organization ( LinphoneVcard vCard,
const char *  organization 
)

Fills the Organization field of the vCard

Parameters:
[in]vCardthe LinphoneVcard
[in]organizationthe Organization
void linphone_vcard_set_uid ( LinphoneVcard vCard,
const char *  uid 
)

Sets the unique ID of the vCard

Parameters:
[in]vCardthe LinphoneVcard
[in]uidthe unique id
void linphone_vcard_set_url ( LinphoneVcard vCard,
const char *  url 
)

Sets the URL of the vCard

Parameters:
[in]vCardthe LinphoneVcard
[in]urlthe URL