public interface Friend
Friend is mainly used to implement an adressbook feature, and are usedMagicSearch object. If your proxy supports it, you canFriendList which are in turn stored insideCore. They can be stored inside a database if the path to it isCore is destroyed.| Modifier and Type | Method | Description |
|---|---|---|
void |
addAddress(Address address) |
Adds an address in this friend.
|
void |
addListener(FriendListener listener) |
|
void |
addPhoneNumber(java.lang.String phoneNumber) |
Adds a phone number in this friend.
|
void |
addPhoneNumberWithLabel(FriendPhoneNumber phoneNumber) |
Adds a
FriendPhoneNumber to this friend. |
boolean |
createVcard(java.lang.String name) |
Creates a vCard object associated to this friend if there isn't one yet and if
the full name is available, either by the parameter or the one in the friend's SIP URI. |
void |
done() |
Commits modification made to the friend configuration.
|
void |
edit() |
Starts editing a friend configuration.
|
Address |
getAddress() |
Get address of this friend.
|
Address[] |
getAddresses() |
Returns a list of
Address for this friend. |
int |
getCapabilities() |
Returns the capabilities associated to this friend.
|
float |
getCapabilityVersion(FriendCapability capability) |
Returns the version of a friend's capbility.
|
ConsolidatedPresence |
getConsolidatedPresence() |
Get the consolidated presence of a friend.
|
Core |
getCore() |
Returns the
Core object managing this friend, if any. |
SubscribePolicy |
getIncSubscribePolicy() |
|
java.lang.String |
getName() |
Get the display name for this friend.
|
long |
getNativePointer() |
Gets the native pointer used by this class to make native method calls.
|
java.lang.String |
getNativeUri() |
Gets the contact's native URI.
|
java.lang.String |
getOrganization() |
Gets the contact's organization from it's vCard.
|
java.lang.String[] |
getPhoneNumbers() |
Returns a list of phone numbers for this friend.
|
FriendPhoneNumber[] |
getPhoneNumbersWithLabel() |
Returns a list of
FriendPhoneNumber for this friend. |
java.lang.String |
getPhoto() |
Gets the contact's picture URI.
|
PresenceModel |
getPresenceModel() |
Get the presence model of a friend.
|
PresenceModel |
getPresenceModelForUriOrTel(java.lang.String uriOrTel) |
Get the presence model for a specific SIP URI or phone number of a friend.
|
java.lang.String |
getRefKey() |
Get the reference key of a friend.
|
boolean |
getStarred() |
Gets if the friend is to be considered as important for the user.
|
SubscriptionState |
getSubscriptionState() |
Get subscription state of a friend.
|
java.lang.Object |
getUserData() |
Gets the object stored in this object user's data
|
Vcard |
getVcard() |
Returns the vCard object associated to this friend, if any.
|
boolean |
hasCapability(FriendCapability capability) |
Returns whether or not a friend has a capbility.
|
boolean |
hasCapabilityWithVersion(FriendCapability capability,
float version) |
Returns whether or not a friend has a capbility with a given version.
|
boolean |
hasCapabilityWithVersionOrMore(FriendCapability capability,
float version) |
Returns whether or not a friend has a capbility with a given version or more.
|
boolean |
hasPhoneNumber(java.lang.String phoneNumber) |
Returns whether a friend contains the given phone number.
|
boolean |
inList() |
Check that the given friend is in a friend list.
|
boolean |
isPresenceReceived() |
Tells whether we already received presence information for a friend.
|
boolean |
isSubscribesEnabled() |
get subscription flag value
|
Friend |
newFromVcard(Vcard vcard) |
|
void |
remove() |
Removes a friend from it's friend list and from the rc if exists.
|
void |
removeAddress(Address address) |
Removes an address in this friend.
|
void |
removeListener(FriendListener listener) |
|
void |
removePhoneNumber(java.lang.String phoneNumber) |
Removes a phone number in this friend.
|
void |
removePhoneNumberWithLabel(FriendPhoneNumber phoneNumber) |
Removes a
FriendPhoneNumber from this friend. |
void |
save(Core core) |
Saves a friend either in database if configured, otherwise in linphonerc.
|
int |
setAddress(Address address) |
Set
Address for this friend. |
int |
setIncSubscribePolicy(SubscribePolicy policy) |
Configure incoming subscription policy for this friend.
|
int |
setName(java.lang.String name) |
Set the display name for this friend.
|
void |
setNativeUri(java.lang.String nativeUri) |
Sets the contact's native URI.
|
void |
setOrganization(java.lang.String organization) |
Sets the contact's organization.
|
void |
setPhoto(java.lang.String pictureUri) |
Sets the contact's picture URI.
|
void |
setPresenceModel(PresenceModel presence) |
Set the presence model of a friend.
|
void |
setPresenceModelForUriOrTel(java.lang.String uriOrTel,
PresenceModel presence) |
Set the presence model for a specific SIP URI or phone number of a friend.
|
void |
setRefKey(java.lang.String key) |
Set the reference key of a friend.
|
void |
setStarred(boolean isStarred) |
Sets if the friend is a user's favorite or important contact.
|
int |
setSubscribesEnabled(boolean enable) |
Configure
Friend to subscribe to presence information. |
void |
setUserData(java.lang.Object data) |
Sets the object to store in this object user's data
|
void |
setVcard(Vcard vcard) |
Binds a vCard object to a friend.
|
java.lang.String |
toString() |
@Nullable Address getAddress()
Address object returned is hold by the LinphoneFriend,Address. int setAddress(@Nullable
Address address)
address - the Address to set return 0 if successful, -1int getCapabilities()
ConsolidatedPresence getConsolidatedPresence()
ConsolidatedPresence of the friend SubscribePolicy getIncSubscribePolicy()
SubscribePolicy enum int setIncSubscribePolicy(SubscribePolicy policy)
policy - SubscribePolicy policy to apply. boolean isPresenceReceived()
@Nullable java.lang.String getName()
int setName(@Nullable
java.lang.String name)
name - the display name to set @Nullable java.lang.String getNativeUri()
void setNativeUri(@Nullable
java.lang.String nativeUri)
nativeUri - the URI that matches the contact on the native system. @Nullable java.lang.String getOrganization()
getVcard() and Vcard.getOrganization(). void setOrganization(@Nullable
java.lang.String organization)
getVcard() and Vcard.setOrganization(java.lang.String). organization - the organization to store in Friend's vCard. @NonNull java.lang.String[] getPhoneNumbers()
@NonNull FriendPhoneNumber[] getPhoneNumbersWithLabel()
@Nullable java.lang.String getPhoto()
void setPhoto(@Nullable
java.lang.String pictureUri)
pictureUri - the picture URI to set. @Nullable PresenceModel getPresenceModel()
PresenceModel object, or null if the friend do not havevoid setPresenceModel(@Nullable
PresenceModel presence)
presence - The PresenceModel object to set for the friend @Nullable java.lang.String getRefKey()
void setRefKey(@Nullable
java.lang.String key)
key - The reference key to use for the friend. boolean getStarred()
void setStarred(boolean isStarred)
isStarred - true if the friend is to be considered as important, falseboolean isSubscribesEnabled()
int setSubscribesEnabled(boolean enable)
enable - if true this friend will receive subscription message SubscriptionState getSubscriptionState()
SubscriptionState enum @Nullable Vcard getVcard()
Vcard or null. void setVcard(@Nullable
Vcard vcard)
vcard - The Vcard object to bind void addAddress(@NonNull
Address address)
address - Address object void addPhoneNumber(@NonNull
java.lang.String phoneNumber)
phoneNumber - number to add void addPhoneNumberWithLabel(@NonNull
FriendPhoneNumber phoneNumber)
phoneNumber - the FriendPhoneNumber to add boolean createVcard(@Nullable
java.lang.String name)
name - The full name of the friend or null to use the one from thevoid done()
void edit()
edit()setAddress(org.linphone.core.Address)setIncSubscribePolicy(org.linphone.core.SubscribePolicy)). Once the modifications are done, then thedone() to commit the changes. float getCapabilityVersion(FriendCapability capability)
capability - FriendCapability object @Nullable PresenceModel getPresenceModelForUriOrTel(@NonNull java.lang.String uriOrTel)
uriOrTel - The SIP URI or phone number for which to get the presence modelPresenceModel object, or null if the friend do not haveboolean hasCapability(FriendCapability capability)
capability - FriendCapability object boolean hasCapabilityWithVersion(FriendCapability capability, float version)
capability - FriendCapability object version - the version to test boolean hasCapabilityWithVersionOrMore(FriendCapability capability, float version)
capability - FriendCapability object version - the version to test boolean hasPhoneNumber(@NonNull
java.lang.String phoneNumber)
phoneNumber - the phone number to search for boolean inList()
void remove()
void removeAddress(@NonNull
Address address)
address - Address object void removePhoneNumber(@NonNull
java.lang.String phoneNumber)
phoneNumber - number to remove void removePhoneNumberWithLabel(@NonNull
FriendPhoneNumber phoneNumber)
phoneNumber - the FriendPhoneNumber to remove void save(@NonNull
Core core)
core - the linphone core void setPresenceModelForUriOrTel(@NonNull
java.lang.String uriOrTel,
@Nullable
PresenceModel presence)
uriOrTel - The SIP URI or phone number for which to set the presence modelpresence - The PresenceModel object to set @Nullable Friend newFromVcard(@NonNull Vcard vcard)
vcard - a Vcard object Friend which has its vCard attribute initialized from thegetVcard(). void addListener(FriendListener listener)
void removeListener(FriendListener listener)
void setUserData(java.lang.Object data)
data - the object to storejava.lang.Object getUserData()
long getNativePointer()
java.lang.String toString()
toString in class java.lang.Object