Package org.linphone.core

# Interface Vcard

public interface Vcard
Object storing contact information using vCard 4.0 format.

## Method Summary

Modifier and Type
Method
Description
`void`
`addExtendedProperty(String name, String value)`
Adds an extended property to the vCard.
`void`
`addPhoneNumber(String phone)`
Adds a phone number in the vCard, using the TEL property.
`void`
`addPhoneNumberWithLabel(FriendPhoneNumber phoneNumber)`
Adds a `FriendPhoneNumber` in the vCard, using the TEL property.
`void`
`addSipAddress(String sipAddress)`
Adds a SIP address in the vCard, using the IMPP property.
`String`
`asVcard4String()`
Returns the vCard4 representation of the LinphoneVcard.
`String`
`asVcard4StringWithBase64Picture()`
Returns the vCard4 representation of the LinphoneVcard, but if a local file is
detected in a PHOTO field, it will be converted to base64.
`Vcard`
`clone()`
Clone a `Vcard`.
`void`
`editMainSipAddress(String sipAddress)`
Edits the preferred SIP address in the vCard (or the first one), using the IMPP
property.
`boolean`
`generateUniqueId()`
Generates a random unique id for the vCard.
`String`
`getEtag()`
Gets the eTag of the vCard.
`String[]`
`getExtendedPropertiesValuesByName(String name)`
Get the vCard extended properties values per property name.
`String`
`getFamilyName()`
Returns the family name in the N attribute of the vCard, or null if it isn't
set yet.
`String`
`getFullName()`
Returns the FN attribute of the vCard, or null if it isn't set yet.
`String`
`getGivenName()`
Returns the given name in the N attribute of the vCard, or null if it isn't set
yet.
`String`
`getJobTitle()`
Gets the Title of the vCard.
`long`
`getNativePointer()`
Gets the native pointer used by this class to make native method calls.
`String`
`getOrganization()`
Gets the Organization of the vCard.
`String[]`
`getPhoneNumbers()`
Returns the list of phone numbers in the vCard (all the TEL attributes) or
null.
`FriendPhoneNumber[]`
`getPhoneNumbersWithLabel()`
Returns the list of phone numbers in the vCard (all the TEL attributes) or
null.
`String`
`getPhoto()`
Returns the first PHOTO property or null.
`Address[]`
`getSipAddresses()`
Returns the list of SIP addresses in the vCard (all the IMPP attributes that
has an URI value starting by "sip:") or null.
`String`
`getUid()`
Gets the UID of the vCard.
`String`
`getUrl()`
Gets the URL of the vCard.
`Object`
`getUserData()`
Gets the object stored in this object user's data
`void`
`removeExtentedPropertiesByName(String name)`
Remove all the extend properties per property name.
`void`
`removeJobTitle()`
Removes the Title field of the vCard.
`void`
`removeOrganization()`
Removes the Organization field of the vCard.
`void`
`removePhoneNumber(String phone)`
Removes a phone number in the vCard (if it exists), using the TEL property.
`void`
`removePhoneNumberWithLabel(FriendPhoneNumber phoneNumber)`
Removes a `FriendPhoneNumber` in the vCard (if it exists), using the TEL
property.
`void`
`removePhoto()`
Removes any existing PHOTO property.
`void`
`removeSipAddress(String sipAddress)`
Removes a SIP address in the vCard (if it exists), using the IMPP property.
`void`
`setEtag(String etag)`
Sets the eTAG of the vCard.
`void`
`setFamilyName(String name)`
Sets the family name in the N attribute of the vCard.
`void`
`setFullName(String name)`
Sets the FN attribute of the vCard (which is mandatory).
`void`
`setGivenName(String name)`
Sets the given name in the N attribute of the vCard.
`void`
`setJobTitle(String jobTitle)`
Fills the Title field of the vCard.
`void`
`setOrganization(String organization)`
Fills the Organization field of the vCard.
`void`
`setPhoto(String picture)`
Sets a picture URI in the vCard, using the PHOTO property.
`void`
`setUid(String uid)`
Sets the unique ID of the vCard.
`void`
`setUrl(String url)`
Sets the URL of the vCard.
`void`
`setUserData(Object data)`
Sets the object to store in this object user's data
`String`
`toString()`

## Method Details

### getEtag

@Nullable String getEtag()
Gets the eTag of the vCard.

Returns:
  the eTag of the vCard in the CardDAV server, otherwise null.

### setEtag

void setEtag(@Nullable String etag)
Sets the eTAG of the vCard.

Parameters:
  `etag` - the eTAG.

### getFamilyName

@Nullable String getFamilyName()
Returns the family name in the N attribute of the vCard, or null if it isn't
set yet.

Returns:
  the family name of the vCard, or null

### setFamilyName

void setFamilyName(@Nullable String name)
Sets the family name in the N attribute of the vCard.

Parameters:
  `name` - the family name to set for the vCard

### getFullName

@Nullable String getFullName()
Returns the FN attribute of the vCard, or null if it isn't set yet.

Returns:
  the display name of the vCard, or null.

### setFullName

void setFullName(@Nullable String name)
Sets the FN attribute of the vCard (which is mandatory).

Parameters:
  `name` - the display name to set for the vCard

### getGivenName

@Nullable String getGivenName()
Returns the given name in the N attribute of the vCard, or null if it isn't set
yet.

Returns:
  the given name of the vCard, or null

### setGivenName

void setGivenName(@Nullable String name)
Sets the given name in the N attribute of the vCard.

Parameters:
  `name` - the given name to set for the vCard

### getJobTitle

@Nullable String getJobTitle()
Gets the Title of the vCard.

Returns:
  the Title of the vCard or null.

### setJobTitle

void setJobTitle(@Nullable String jobTitle)
Fills the Title field of the vCard.

Parameters:
  `jobTitle` - the job title.

### getOrganization

@Nullable String getOrganization()
Gets the Organization of the vCard.

Returns:
  the Organization of the vCard or null.

### setOrganization

void setOrganization(@Nullable String organization)
Fills the Organization field of the vCard.

Parameters:
  `organization` - the Organization.

### getPhoneNumbers

@NonNull String[] getPhoneNumbers()
Returns the list of phone numbers in the vCard (all the TEL attributes) or
null.

Returns:
  The phone numbers as string. A list of char * objects.

### getPhoneNumbersWithLabel

@NonNull FriendPhoneNumber[] getPhoneNumbersWithLabel()
Returns the list of phone numbers in the vCard (all the TEL attributes) or
null.

Returns:
  The phone numbers as `FriendPhoneNumber`. A list of `FriendPhoneNumber`
  objects.

### getPhoto

@Nullable String getPhoto()
Returns the first PHOTO property or null.

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

### setPhoto

void setPhoto(@Nullable String picture)
Sets a picture URI in the vCard, using the PHOTO property.

Parameters:
  `picture` - the picture URI to add. If null it will have the same effet as
  `removePhoto()`.

### getSipAddresses

@NonNull Address[] getSipAddresses()
Returns the list of SIP addresses in the vCard (all the IMPP attributes that
has an URI value starting by "sip:") or null.

Returns:
  The SIP addresses. A list of `Address` objects.

### getUid

@Nullable String getUid()
Gets the UID of the vCard.

Returns:
  the UID of the vCard, otherwise null.

### setUid

void setUid(@Nullable String uid)
Sets the unique ID of the vCard.

Parameters:
  `uid` - the unique id

### getUrl

@Nullable String getUrl()
Gets the URL of the vCard.

Returns:
  the URL of the vCard in the CardDAV server, otherwise null.

### setUrl

void setUrl(@Nullable String url)
Sets the URL of the vCard.

Parameters:
  `url` - the URL.

### addExtendedProperty

void addExtendedProperty(@NonNull String name, @NonNull 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

void addPhoneNumber(@NonNull String phone)
Adds a phone number in the vCard, using the TEL property.

Parameters:
  `phone` - the phone number to add

### addPhoneNumberWithLabel

void addPhoneNumberWithLabel(@NonNull FriendPhoneNumber phoneNumber)
Adds a `FriendPhoneNumber` in the vCard, using the TEL property.

Parameters:
  `phoneNumber` - the `FriendPhoneNumber` to add

### addSipAddress

void addSipAddress(@NonNull String sipAddress)
Adds a SIP address in the vCard, using the IMPP property.

Parameters:
  `sipAddress` - the SIP address to add

### asVcard4String

@Nullable String asVcard4String()
Returns the vCard4 representation of the LinphoneVcard.

Returns:
  a const char * that represents the vCard.

### asVcard4StringWithBase64Picture

@Nullable String asVcard4StringWithBase64Picture()
Returns the vCard4 representation of the LinphoneVcard, but if a local file is
detected in a PHOTO field, it will be converted to base64.

Returns:
  a const char * that represents the vCard.

### clone

@NonNull Vcard clone()
Clone a `Vcard`.

Returns:
  a new `Vcard` object

### editMainSipAddress

void editMainSipAddress(@NonNull 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

boolean 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)

### getExtendedPropertiesValuesByName

@NonNull String[] getExtendedPropertiesValuesByName(@NonNull String name)
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. A list of char * objects.

### removeExtentedPropertiesByName

void removeExtentedPropertiesByName(@NonNull String name)
Remove all the extend properties per property name.

Parameters:
  `name` - the name to remove the extended properties on.

### removeJobTitle

void removeJobTitle()
Removes the Title field of the vCard.

### removeOrganization

void removeOrganization()
Removes the Organization field of the vCard.

### removePhoneNumber

void removePhoneNumber(@NonNull String phone)
Removes a phone number in the vCard (if it exists), using the TEL property.

Parameters:
  `phone` - the phone number to remove

### removePhoneNumberWithLabel

void removePhoneNumberWithLabel(@NonNull FriendPhoneNumber phoneNumber)
Removes a `FriendPhoneNumber` in the vCard (if it exists), using the TEL
property.

Parameters:
  `phoneNumber` - the `FriendPhoneNumber` to remove

### removePhoto

void removePhoto()
Removes any existing PHOTO property.

### removeSipAddress

void removeSipAddress(@NonNull String sipAddress)
Removes a SIP address in the vCard (if it exists), using the IMPP property.

Parameters:
  `sipAddress` - the SIP address to remove

### setUserData

void setUserData(Object data)
Sets the object to store in this object user's data

Parameters:
  `data` - the object to store

### getUserData

Object getUserData()
Gets the object stored in this object user's data

Returns:
  the object store if any, null otherwise

### getNativePointer

long getNativePointer()
Gets the native pointer used by this class to make native method calls.

Returns:
  the nativer pointer, as long

### toString

String toString()

Overrides:
  `toString` in class `Object`