Liblinphone: linphone::Vcard Class Reference

Liblinphone 5.3.0

Public Member Functions | List of all members
linphone::Vcard Class Reference

Object storing contact information using vCard 4.0 format. More...

`#include <vcard.hh>`

Inheritance diagram for linphone::Vcard:

## Public Member Functions
LINPHONECXX_PUBLIC | Vcard (void *ptr, bool takeRef=true)
LINPHONECXX_PUBLIC _LinphoneVcard * | cPtr ()
LINPHONECXX_PUBLIC std::shared_ptr< belcard::BelCard > & | getVcard ()
LINPHONECXX_PUBLIC std::string | getEtag () const
| Gets the eTag of the vCard.
LINPHONECXX_PUBLIC void | setEtag (const std::string &etag)
| Sets the eTAG of the vCard.
LINPHONECXX_PUBLIC std::string | getFamilyName () const
| Returns the family name in the N attribute of the vCard, or nullptr if it isn't set yet.
LINPHONECXX_PUBLIC void | setFamilyName (const std::string &name)
| Sets the family name in the N attribute of the vCard.
LINPHONECXX_PUBLIC std::string | getFullName () const
| Returns the FN attribute of the vCard, or nullptr if it isn't set yet.
LINPHONECXX_PUBLIC void | setFullName (const std::string &name)
| Sets the FN attribute of the vCard (which is mandatory).
LINPHONECXX_PUBLIC std::string | getGivenName () const
| Returns the given name in the N attribute of the vCard, or nullptr if it isn't set yet.
LINPHONECXX_PUBLIC void | setGivenName (const std::string &name)
| Sets the given name in the N attribute of the vCard.
LINPHONECXX_PUBLIC std::string | getJobTitle () const
| Gets the Title of the vCard.
LINPHONECXX_PUBLIC void | setJobTitle (const std::string &jobTitle)
| Fills the Title field of the vCard.
LINPHONECXX_PUBLIC std::string | getOrganization () const
| Gets the Organization of the vCard.
LINPHONECXX_PUBLIC void | setOrganization (const std::string &organization)
| Fills the Organization field of the vCard.
LINPHONECXX_PUBLIC std::list< std::string > | getPhoneNumbers () const
| Returns the list of phone numbers in the vCard (all the TEL attributes) or nullptr.
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::FriendPhoneNumber > > | getPhoneNumbersWithLabel () const
| Returns the list of phone numbers in the vCard (all the TEL attributes) or nullptr.
LINPHONECXX_PUBLIC std::string | getPhoto () const
| Returns the first PHOTO property or nullptr.
LINPHONECXX_PUBLIC void | setPhoto (const std::string &picture)
| Sets a picture URI in the vCard, using the PHOTO property.
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::Address > > | getSipAddresses ()
| Returns the list of SIP addresses in the vCard (all the IMPP attributes that has an URI value starting by "sip:") or nullptr.
LINPHONECXX_PUBLIC bool | getSkipValidation () const
| Returns the skipFieldValidation property of the vcard.
LINPHONECXX_PUBLIC void | setSkipValidation (bool skip)
| Sets the skipFieldValidation property of the vcard.
LINPHONECXX_PUBLIC std::string | getUid () const
| Gets the UID of the vCard.
LINPHONECXX_PUBLIC void | setUid (const std::string &uid)
| Sets the unique ID of the vCard.
LINPHONECXX_PUBLIC std::string | getUrl () const
| Gets the URL of the vCard.
LINPHONECXX_PUBLIC void | setUrl (const std::string &url)
| Sets the URL of the vCard.
LINPHONECXX_PUBLIC void | addExtendedProperty (const std::string &name, const std::string &value)
| Adds an extended property to the vCard.
LINPHONECXX_PUBLIC void | addPhoneNumber (const std::string &phone)
| Adds a phone number in the vCard, using the TEL property.
LINPHONECXX_PUBLIC void | addPhoneNumberWithLabel (const std::shared_ptr< linphone::FriendPhoneNumber > &phoneNumber)
| Adds a FriendPhoneNumber in the vCard, using the TEL property.
LINPHONECXX_PUBLIC void | addSipAddress (const std::string &sipAddress)
| Adds a SIP address in the vCard, using the IMPP property.
LINPHONECXX_PUBLIC std::string | asVcard4String ()
| Returns the vCard4 representation of the Vcard.
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Vcard > | clone () const
| Clone a Vcard.
LINPHONECXX_PUBLIC void | editMainSipAddress (const std::string &sipAddress)
| Edits the preferred SIP address in the vCard (or the first one), using the IMPP property.
LINPHONECXX_PUBLIC bool | generateUniqueId ()
| Generates a random unique id for the vCard.
LINPHONECXX_PUBLIC std::list< std::string > | getExtendedPropertiesValuesByName (const std::string &name) const
| Get the vCard extended properties values per property name.
LINPHONECXX_PUBLIC void | removeExtentedPropertiesByName (const std::string &name)
| Remove all the extend properties per property name.
LINPHONECXX_PUBLIC void | removeJobTitle ()
| Removes the Title field of the vCard.
LINPHONECXX_PUBLIC void | removeOrganization ()
| Removes the Organization field of the vCard.
LINPHONECXX_PUBLIC void | removePhoneNumber (const std::string &phone)
| Removes a phone number in the vCard (if it exists), using the TEL property.
LINPHONECXX_PUBLIC void | removePhoneNumberWithLabel (const std::shared_ptr< const linphone::FriendPhoneNumber > &phoneNumber)
| Removes a FriendPhoneNumber in the vCard (if it exists), using the TEL property.
LINPHONECXX_PUBLIC void | removePhoto ()
| Removes any existing PHOTO property.
LINPHONECXX_PUBLIC void | removeSipAddress (const std::string &sipAddress)
| Removes a SIP address in the vCard (if it exists), using the IMPP property.

## Detailed Description

Object storing contact information using vCard 4.0 format.

## Member Function Documentation

## ◆ addExtendedProperty()

LINPHONECXX_PUBLIC void linphone::Vcard::addExtendedProperty | ( | const std::string & | name,
|  | const std::string & | value )

Adds an extended property to the vCard.

Parameters

  name | the name of the extended property to add
  value | the value of the extended property to add

## ◆ addPhoneNumber()

LINPHONECXX_PUBLIC void linphone::Vcard::addPhoneNumber | ( | const std::string & | phone | ) |

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

Parameters

  phone | the phone number to add

## ◆ addPhoneNumberWithLabel()

LINPHONECXX_PUBLIC void linphone::Vcard::addPhoneNumberWithLabel | ( | const std::shared_ptr< linphone::FriendPhoneNumber > & | phoneNumber | ) |

Adds a FriendPhoneNumber in the vCard, using the TEL property.

Parameters

  phoneNumber | the FriendPhoneNumber to add

## ◆ addSipAddress()

LINPHONECXX_PUBLIC void linphone::Vcard::addSipAddress | ( | const std::string & | sipAddress | ) |

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

Parameters

  sipAddress | the SIP address to add

## ◆ asVcard4String()

LINPHONECXX_PUBLIC std::string linphone::Vcard::asVcard4String | ( |  | ) |

Returns the vCard4 representation of the Vcard.

Returns
  a const char * that represents the vCard.

## ◆ clone()

LINPHONECXX_PUBLIC std::shared_ptr< linphone::Vcard > linphone::Vcard::clone | ( |  | ) | const

Clone a Vcard.

Returns
  a new Vcard object

## ◆ editMainSipAddress()

LINPHONECXX_PUBLIC void linphone::Vcard::editMainSipAddress | ( | const std::string & | sipAddress | ) |

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

Parameters

  sipAddress | the new SIP address

## ◆ generateUniqueId()

LINPHONECXX_PUBLIC bool linphone::Vcard::generateUniqueId | ( |  | ) |

Generates a random unique id for the vCard.

If is required to be able to synchronize the vCard with a CardDAV server

Returns
  true if operation is successful, otherwise false (for example if it already has an unique ID)

## ◆ getEtag()

LINPHONECXX_PUBLIC std::string linphone::Vcard::getEtag | ( |  | ) | const

Gets the eTag of the vCard.

Returns
  the eTag of the vCard in the CardDAV server, otherwise nullptr.

## ◆ getExtendedPropertiesValuesByName()

LINPHONECXX_PUBLIC std::list< std::string > linphone::Vcard::getExtendedPropertiesValuesByName | ( | const std::string & | name | ) | const

Get the vCard extended properties values per property name.

Parameters

  name | the name to filter the extended properties on.

Returns
  The extended properties values as string.

## ◆ getFamilyName()

LINPHONECXX_PUBLIC std::string linphone::Vcard::getFamilyName | ( |  | ) | const

Returns the family name in the N attribute of the vCard, or nullptr if it isn't set yet.

Returns
  the family name of the vCard, or nullptr

## ◆ getFullName()

LINPHONECXX_PUBLIC std::string linphone::Vcard::getFullName | ( |  | ) | const

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

Returns
  the display name of the vCard, or nullptr.

## ◆ getGivenName()

LINPHONECXX_PUBLIC std::string linphone::Vcard::getGivenName | ( |  | ) | const

Returns the given name in the N attribute of the vCard, or nullptr if it isn't set yet.

Returns
  the given name of the vCard, or nullptr

## ◆ getJobTitle()

LINPHONECXX_PUBLIC std::string linphone::Vcard::getJobTitle | ( |  | ) | const

Gets the Title of the vCard.

Returns
  the Title of the vCard or nullptr.

## ◆ getOrganization()

LINPHONECXX_PUBLIC std::string linphone::Vcard::getOrganization | ( |  | ) | const

Gets the Organization of the vCard.

Returns
  the Organization of the vCard or nullptr.

## ◆ getPhoneNumbers()

LINPHONECXX_PUBLIC std::list< std::string > linphone::Vcard::getPhoneNumbers | ( |  | ) | const

Returns the list of phone numbers in the vCard (all the TEL attributes) or nullptr.

Returns
  The phone numbers as string.

## ◆ getPhoneNumbersWithLabel()

LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::FriendPhoneNumber > > linphone::Vcard::getPhoneNumbersWithLabel | ( |  | ) | const

Returns the list of phone numbers in the vCard (all the TEL attributes) or nullptr.

Returns
  The phone numbers as FriendPhoneNumber.

## ◆ getPhoto()

LINPHONECXX_PUBLIC std::string linphone::Vcard::getPhoto | ( |  | ) | const

Returns the first PHOTO property or nullptr.

Returns
  The picture URI as string or nullptr if none has been set.

## ◆ getSipAddresses()

LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::Address > > linphone::Vcard::getSipAddresses | ( |  | ) |

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

Returns
  The SIP addresses.

## ◆ getSkipValidation()

LINPHONECXX_PUBLIC bool linphone::Vcard::getSkipValidation | ( |  | ) | const

Returns the skipFieldValidation property of the vcard.

Returns
  the skipFieldValidation property of the vcard

## ◆ getUid()

LINPHONECXX_PUBLIC std::string linphone::Vcard::getUid | ( |  | ) | const

Gets the UID of the vCard.

Returns
  the UID of the vCard, otherwise nullptr.

## ◆ getUrl()

LINPHONECXX_PUBLIC std::string linphone::Vcard::getUrl | ( |  | ) | const

Gets the URL of the vCard.

Returns
  the URL of the vCard in the CardDAV server, otherwise nullptr.

## ◆ removeExtentedPropertiesByName()

LINPHONECXX_PUBLIC void linphone::Vcard::removeExtentedPropertiesByName | ( | const std::string & | name | ) |

Remove all the extend properties per property name.

Parameters

  name | the name to remove the extended properties on.

## ◆ removePhoneNumber()

LINPHONECXX_PUBLIC void linphone::Vcard::removePhoneNumber | ( | const std::string & | phone | ) |

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

Parameters

  phone | the phone number to remove

## ◆ removePhoneNumberWithLabel()

LINPHONECXX_PUBLIC void linphone::Vcard::removePhoneNumberWithLabel | ( | const std::shared_ptr< const linphone::FriendPhoneNumber > & | phoneNumber | ) |

Removes a FriendPhoneNumber in the vCard (if it exists), using the TEL property.

Parameters

  phoneNumber | the FriendPhoneNumber to remove

## ◆ removeSipAddress()

LINPHONECXX_PUBLIC void linphone::Vcard::removeSipAddress | ( | const std::string & | sipAddress | ) |

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

Parameters

  sipAddress | the SIP address to remove

## ◆ setEtag()

LINPHONECXX_PUBLIC void linphone::Vcard::setEtag | ( | const std::string & | etag | ) |

Sets the eTAG of the vCard.

Parameters

  etag | the eTAG.

## ◆ setFamilyName()

LINPHONECXX_PUBLIC void linphone::Vcard::setFamilyName | ( | const std::string & | name | ) |

Sets the family name in the N attribute of the vCard.

Parameters

  name | the family name to set for the vCard

## ◆ setFullName()

LINPHONECXX_PUBLIC void linphone::Vcard::setFullName | ( | const std::string & | name | ) |

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

Parameters

  name | the display name to set for the vCard

## ◆ setGivenName()

LINPHONECXX_PUBLIC void linphone::Vcard::setGivenName | ( | const std::string & | name | ) |

Sets the given name in the N attribute of the vCard.

Parameters

  name | the given name to set for the vCard

## ◆ setJobTitle()

LINPHONECXX_PUBLIC void linphone::Vcard::setJobTitle | ( | const std::string & | jobTitle | ) |

Fills the Title field of the vCard.

Parameters

  jobTitle | the job title.

## ◆ setOrganization()

LINPHONECXX_PUBLIC void linphone::Vcard::setOrganization | ( | const std::string & | organization | ) |

Fills the Organization field of the vCard.

Parameters

  organization | the Organization.

## ◆ setPhoto()

LINPHONECXX_PUBLIC void linphone::Vcard::setPhoto | ( | const std::string & | picture | ) |

Sets a picture URI in the vCard, using the PHOTO property.

Parameters

  picture | the picture URI to add. If nullptr it will have the same effet as removePhoto().

## ◆ setSkipValidation()

LINPHONECXX_PUBLIC void linphone::Vcard::setSkipValidation | ( | bool | skip | ) |

Sets the skipFieldValidation property of the vcard.

Parameters

  skip | skipFieldValidation property of the vcard

## ◆ setUid()

LINPHONECXX_PUBLIC void linphone::Vcard::setUid | ( | const std::string & | uid | ) |

Sets the unique ID of the vCard.

Parameters

  uid | the unique id

## ◆ setUrl()

LINPHONECXX_PUBLIC void linphone::Vcard::setUrl | ( | const std::string & | url | ) |

Sets the URL of the vCard.

Parameters

  url | the URL.

The documentation for this class was generated from the following file:

- vcard.hh