public interface Friend
Modifier and Type | Method and Description |
---|---|
void |
addAddress(Address addr)
Adds an address in this friend.
|
void |
addPhoneNumber(java.lang.String phone)
Adds a phone number in 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.
|
int |
enableSubscribes(boolean val)
Configure
Friend to subscribe to presence information. |
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()
get current subscription policy for this
Friend |
java.lang.String |
getName()
Get the display name for this friend.
|
java.lang.String[] |
getPhoneNumbers()
Returns a list of phone numbers for this friend.
|
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.
|
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 |
inList()
Check that the given friend is in a friend list.
|
boolean |
isPresenceReceived()
Tells whether we already received presence information for a friend.
|
Friend |
newFromVcard(Vcard vcard)
Contructor same as linphone_friend_new +
setAddress(org.linphone.core.Address) |
void |
remove()
Removes a friend from it's friend list and from the rc if exists.
|
void |
removeAddress(Address addr)
Removes an address in this friend.
|
void |
removePhoneNumber(java.lang.String phone)
Removes a phone number in this friend.
|
void |
save(Core lc)
Saves a friend either in database if configured, otherwise in linphonerc.
|
int |
setAddress(Address address)
Set
Address for this friend. |
int |
setIncSubscribePolicy(SubscribePolicy pol)
Configure incoming subscription policy for this friend.
|
int |
setName(java.lang.String name)
Set the display name for this friend.
|
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 |
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.
|
boolean |
subscribesEnabled()
get subscription flag value
|
Address getAddress()
Address
object returned is hold by the LinphoneFriend,
however calling several time this function may return different objects.Address
int setAddress(Address address)
Address
for this friend.address
- Address
Address[] getAddresses()
Address
for this friend.Address
objects. LinphoneAddressint getCapabilities()
ConsolidatedPresence getConsolidatedPresence()
SubscribePolicy getIncSubscribePolicy()
Friend
int setIncSubscribePolicy(SubscribePolicy pol)
pol
- LinphoneSubscribePolicy policy to apply.boolean isPresenceReceived()
java.lang.String getName()
int setName(java.lang.String name)
name
- java.lang.String[] getPhoneNumbers()
PresenceModel getPresenceModel()
PresenceModel
object, or null if the friend do not have
presence information (in which case he is considered offline)void setPresenceModel(PresenceModel presence)
presence
- The PresenceModel
object to set for the friendjava.lang.String getRefKey()
void setRefKey(java.lang.String key)
key
- The reference key to use for the friend.boolean subscribesEnabled()
int enableSubscribes(boolean val)
Friend
to subscribe to presence information.val
- if true this friend will receive subscription messageSubscriptionState getSubscriptionState()
Vcard getVcard()
void setVcard(Vcard vcard)
vcard
- The vCard object to bindvoid addAddress(Address addr)
addr
- Address
objectvoid addPhoneNumber(java.lang.String phone)
phone
- number to addboolean createVcard(java.lang.String name)
name
- The full name of the friend or null to use the one from the
friend's SIP URIvoid done()
void edit()
edit()
before doing any attempts to modify friend configuration (such as
address or subscription policy and so on). Once the modifications are done,
then the application must call done()
to commit the changes.float getCapabilityVersion(FriendCapability capability)
capability
- LinphoneFriendCapability objectPresenceModel getPresenceModelForUriOrTel(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 have
presence information for this SIP URI or phone numberboolean hasCapability(FriendCapability capability)
capability
- LinphoneFriendCapability objectboolean hasCapabilityWithVersion(FriendCapability capability, float version)
version
- the version to testboolean hasCapabilityWithVersionOrMore(FriendCapability capability, float version)
version
- the version to testboolean inList()
void remove()
void removeAddress(Address addr)
addr
- Address
objectvoid removePhoneNumber(java.lang.String phone)
phone
- number to removevoid save(Core lc)
lc
- the linphone corevoid setPresenceModelForUriOrTel(java.lang.String uriOrTel, PresenceModel presence)
presence
- The PresenceModel
object to setFriend newFromVcard(Vcard vcard)
setAddress(org.linphone.core.Address)
vcard
- a vCard objectFriend
with vCard initializedvoid setUserData(java.lang.Object data)
data
- the object to storejava.lang.Object getUserData()