Liblinphone
5.5.0
|
This object representing a list of Friend. More...
#include <friend_list.hh>
Public Types | |
enum | SyncStatus { SyncStatus::Started = 0, SyncStatus::Successful = 1, SyncStatus::Failure = 2 } |
Enum describing the status of a CardDAV synchronization. More... | |
enum | Status { Status::OK = 0, Status::NonExistentFriend = 1, Status::InvalidFriend = 2, Status::ReadOnly = 3 } |
Enum describing the status of a LinphoneFriendList operation. More... | |
enum | Type { Type::Default = -1, Type::CardDAV = 0, Type::VCard4 = 1, Type::ApplicationCache = 2 } |
The types of FriendList. More... | |
Public Member Functions | |
LINPHONECXX_PUBLIC | FriendList (void *ptr, bool takeRef=true) |
LINPHONECXX_PUBLIC _LinphoneFriendList * | cPtr () |
LINPHONECXX_PUBLIC void | addListener (const std::shared_ptr< FriendListListener > &listener) |
Add an application listener to the FriendList instance. More... | |
LINPHONECXX_PUBLIC void | removeListener (const std::shared_ptr< FriendListListener > &listener) |
Remove a previously added listener from the FriendList instance. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Core > | getCore () const |
Returns the Core object attached to this LinphoneFriendList. More... | |
LINPHONECXX_PUBLIC bool | databaseStorageEnabled () const |
Gets whether this friend list and it's friends will be stored in DB or not. More... | |
LINPHONECXX_PUBLIC void | enableDatabaseStorage (bool enable) |
Sets whether this friend list and it's friends will be stored in DB or not. More... | |
LINPHONECXX_PUBLIC std::string | getDisplayName () const |
Get the display name of the friend list. More... | |
LINPHONECXX_PUBLIC void | setDisplayName (const std::string &displayName) |
Set the display name of the friend list. More... | |
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::Friend > > | getFriends () const |
Retrieves the list of Friend from this LinphoneFriendList. More... | |
LINPHONECXX_PUBLIC bool | getIsReadOnly () const |
Gets whether this friend list is read only or not. More... | |
LINPHONECXX_PUBLIC void | setIsReadOnly (bool readOnly) |
Sets whether this friend list is read only or not. More... | |
LINPHONECXX_PUBLIC bool | isSubscriptionBodyless () const |
Get wether the subscription of the friend list is bodyless or not. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Address > | getRlsAddress () const |
Get the RLS (Resource List Server) URI associated with the friend list to subscribe to these friends presence. More... | |
LINPHONECXX_PUBLIC void | setRlsAddress (const std::shared_ptr< const linphone::Address > &rlsAddr) |
Set the RLS (Resource List Server) URI associated with the friend list to subscribe to these friends presence. More... | |
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED std::string | getRlsUri () const |
Get the RLS (Resource List Server) URI associated with the friend list to subscribe to these friends presence. More... | |
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED void | setRlsUri (const std::string &rlsUri) |
Set the RLS (Resource List Server) URI associated with the friend list to subscribe to these friends presence. More... | |
LINPHONECXX_PUBLIC void | setSubscriptionBodyless (bool bodyless) |
Set wether the subscription of the friend list is bodyless or not. More... | |
LINPHONECXX_PUBLIC bool | subscriptionsEnabled () |
Gets whether subscription to NOTIFYs are enabled or not. More... | |
LINPHONECXX_PUBLIC void | enableSubscriptions (bool enabled) |
Enable subscription to NOTIFYs. More... | |
LINPHONECXX_PUBLIC Type | getType () |
Get the Type of a friend list. | |
LINPHONECXX_PUBLIC void | setType (Type type) |
Assign a friend list type to the friend list. More... | |
LINPHONECXX_PUBLIC std::string | getUri () const |
Get the URI associated with the friend list. More... | |
LINPHONECXX_PUBLIC void | setUri (const std::string &uri) |
Set the URI associated with the friend list. More... | |
LINPHONECXX_PUBLIC Status | addFriend (const std::shared_ptr< linphone::Friend > &linphoneFriend) |
Add a friend to a friend list. More... | |
LINPHONECXX_PUBLIC Status | addLocalFriend (const std::shared_ptr< linphone::Friend > &linphoneFriend) |
Add a friend to a friend list. More... | |
LINPHONECXX_PUBLIC void | exportFriendsAsVcard4File (const std::string &vcardFile) |
Creates and export Friend objects from FriendList to a file using vCard 4 format. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Friend > | findFriendByAddress (const std::shared_ptr< const linphone::Address > &address) const |
Find a friend in the friend list using a LinphoneAddress. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Friend > | findFriendByPhoneNumber (const std::string &phoneNumber) const |
Find a friend in the friend list using a phone number. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Friend > | findFriendByRefKey (const std::string &refKey) const |
Find a friend in the friend list using a ref key. More... | |
LINPHONECXX_PUBLIC std::shared_ptr< linphone::Friend > | findFriendByUri (const std::string &uri) const |
Find a friend in the friend list using an URI string. More... | |
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::Friend > > | findFriendsByAddress (const std::shared_ptr< const linphone::Address > &address) const |
Find all friends in the friend list using a LinphoneAddress. More... | |
LINPHONECXX_PUBLIC std::list< std::shared_ptr< linphone::Friend > > | findFriendsByUri (const std::string &uri) const |
Find all friends in the friend list using an URI string. More... | |
LINPHONECXX_PUBLIC int | importFriendsFromVcard4Buffer (const std::string &vcardBuffer) |
Creates and adds Friend objects to FriendList from a buffer that contains the vCard(s) to parse. More... | |
LINPHONECXX_PUBLIC int | importFriendsFromVcard4File (const std::string &vcardFile) |
Creates and adds Friend objects to FriendList from a file that contains the vCard(s) to parse. More... | |
LINPHONECXX_PUBLIC void | notifyPresence (const std::shared_ptr< linphone::PresenceModel > &presence) |
Notify our presence to all the friends in the friend list that have subscribed to our presence directly (not using a RLS). More... | |
LINPHONECXX_PUBLIC Status | removeFriend (const std::shared_ptr< linphone::Friend > &linphoneFriend) |
Remove a friend from a friend list. More... | |
LINPHONECXX_PUBLIC void | synchronizeFriendsFromServer () |
Starts a CardDAV synchronization using value set using linphone_friend_list_set_uri. | |
LINPHONECXX_PUBLIC bool | synchronizeFriendsWith (const std::list< std::shared_ptr< linphone::Friend >> &sourceFriends) |
Synchronize a local friendlist with another list of friends. More... | |
LINPHONECXX_PUBLIC void | updateDirtyFriends () |
Goes through all the Friend that are dirty and does a CardDAV PUT to update the server. | |
LINPHONECXX_PUBLIC void | updateRevision (const std::string &revision) |
Sets the revision from the last synchronization. More... | |
LINPHONECXX_PUBLIC void | updateSubscriptions () |
Update presence subscriptions for the entire list. More... | |
This object representing a list of Friend.
You can use it to store contacts locally or synchronize them through CardDAV protocol.
|
strong |
Enum describing the status of a LinphoneFriendList operation.
Enumerator | |
---|---|
OK | Operation went fine. |
NonExistentFriend | Friend wasn't found in the FriendList |
InvalidFriend | Friend is already present in a FriendList |
ReadOnly | FriendList is read only |
|
strong |
|
strong |
The types of FriendList.
Enumerator | |
---|---|
Default | Default value, used when no other type applies. |
CardDAV | Used when list is synchronized with a remote CardDAV server. |
VCard4 | Used for simple vCards list remotely provisionned by a server. |
ApplicationCache | Friend list used by app for cache purposes, friends added in this list will be ignored by MagicSearch. |
LINPHONECXX_PUBLIC Status linphone::FriendList::addFriend | ( | const std::shared_ptr< linphone::Friend > & | linphoneFriend | ) |
Add a friend to a friend list.
If or when a remote CardDAV server will be attached to the list, the friend will be sent to the server.
linphoneFriend | Friend object to add to the friend list. |
LINPHONECXX_PUBLIC void linphone::FriendList::addListener | ( | const std::shared_ptr< FriendListListener > & | listener | ) |
Add an application listener to the FriendList instance.
listener | the application listener |
LINPHONECXX_PUBLIC Status linphone::FriendList::addLocalFriend | ( | const std::shared_ptr< linphone::Friend > & | linphoneFriend | ) |
Add a friend to a friend list.
The friend will never be sent to a remote CardDAV server. Warning! Friend added this way will be removed on the next synchronization, and the callback contact_deleted will be called.
linphoneFriend | Friend object to add to the friend list. |
LINPHONECXX_PUBLIC bool linphone::FriendList::databaseStorageEnabled | ( | ) | const |
Gets whether this friend list and it's friends will be stored in DB or not.
LINPHONECXX_PUBLIC void linphone::FriendList::enableDatabaseStorage | ( | bool | enable | ) |
Sets whether this friend list and it's friends will be stored in DB or not.
enable | true to enable this friend list storage in DB, false to disable it. |
LINPHONECXX_PUBLIC void linphone::FriendList::enableSubscriptions | ( | bool | enabled | ) |
Enable subscription to NOTIFYs.
enabled | should subscription be enabled or not |
LINPHONECXX_PUBLIC void linphone::FriendList::exportFriendsAsVcard4File | ( | const std::string & | vcardFile | ) |
Creates and export Friend objects from FriendList to a file using vCard 4 format.
vcardFile | the path to a file that will contain the vCards |
LINPHONECXX_PUBLIC std::shared_ptr<linphone::Friend> linphone::FriendList::findFriendByAddress | ( | const std::shared_ptr< const linphone::Address > & | address | ) | const |
LINPHONECXX_PUBLIC std::shared_ptr<linphone::Friend> linphone::FriendList::findFriendByPhoneNumber | ( | const std::string & | phoneNumber | ) | const |
Find a friend in the friend list using a phone number.
phoneNumber | a string of the phone number for which we want to find a friend. |
LINPHONECXX_PUBLIC std::shared_ptr<linphone::Friend> linphone::FriendList::findFriendByRefKey | ( | const std::string & | refKey | ) | const |
Find a friend in the friend list using a ref key.
refKey | The ref key string of the friend we want to search for. |
LINPHONECXX_PUBLIC std::shared_ptr<linphone::Friend> linphone::FriendList::findFriendByUri | ( | const std::string & | uri | ) | const |
Find a friend in the friend list using an URI string.
uri | A string containing the URI of the friend we want to search for. |
LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::Friend> > linphone::FriendList::findFriendsByAddress | ( | const std::shared_ptr< const linphone::Address > & | address | ) | const |
LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::Friend> > linphone::FriendList::findFriendsByUri | ( | const std::string & | uri | ) | const |
Find all friends in the friend list using an URI string.
uri | A string containing the URI of the friends we want to search for. |
LINPHONECXX_PUBLIC std::shared_ptr<linphone::Core> linphone::FriendList::getCore | ( | ) | const |
LINPHONECXX_PUBLIC std::string linphone::FriendList::getDisplayName | ( | ) | const |
Get the display name of the friend list.
LINPHONECXX_PUBLIC std::list<std::shared_ptr<linphone::Friend> > linphone::FriendList::getFriends | ( | ) | const |
LINPHONECXX_PUBLIC bool linphone::FriendList::getIsReadOnly | ( | ) | const |
Gets whether this friend list is read only or not.
If it is, you won't be able to add/remove friends in/from it, nor to edit existing friends in it.
LINPHONECXX_PUBLIC std::shared_ptr<linphone::Address> linphone::FriendList::getRlsAddress | ( | ) | const |
Get the RLS (Resource List Server) URI associated with the friend list to subscribe to these friends presence.
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED std::string linphone::FriendList::getRlsUri | ( | ) | const |
Get the RLS (Resource List Server) URI associated with the friend list to subscribe to these friends presence.
LINPHONECXX_PUBLIC std::string linphone::FriendList::getUri | ( | ) | const |
Get the URI associated with the friend list.
LINPHONECXX_PUBLIC int linphone::FriendList::importFriendsFromVcard4Buffer | ( | const std::string & | vcardBuffer | ) |
Creates and adds Friend objects to FriendList from a buffer that contains the vCard(s) to parse.
vcardBuffer | the buffer that contains the vCard(s) to parse |
LINPHONECXX_PUBLIC int linphone::FriendList::importFriendsFromVcard4File | ( | const std::string & | vcardFile | ) |
Creates and adds Friend objects to FriendList from a file that contains the vCard(s) to parse.
vcardFile | the path to a file that contains the vCard(s) to parse |
LINPHONECXX_PUBLIC bool linphone::FriendList::isSubscriptionBodyless | ( | ) | const |
Get wether the subscription of the friend list is bodyless or not.
LINPHONECXX_PUBLIC void linphone::FriendList::notifyPresence | ( | const std::shared_ptr< linphone::PresenceModel > & | presence | ) |
Notify our presence to all the friends in the friend list that have subscribed to our presence directly (not using a RLS).
presence | PresenceModel object. |
LINPHONECXX_PUBLIC Status linphone::FriendList::removeFriend | ( | const std::shared_ptr< linphone::Friend > & | linphoneFriend | ) |
Remove a friend from a friend list.
linphoneFriend | Friend object to remove from the friend list. |
LINPHONECXX_PUBLIC void linphone::FriendList::removeListener | ( | const std::shared_ptr< FriendListListener > & | listener | ) |
Remove a previously added listener from the FriendList instance.
listener | the application listener |
LINPHONECXX_PUBLIC void linphone::FriendList::setDisplayName | ( | const std::string & | displayName | ) |
Set the display name of the friend list.
displayName | The new display name of the friend list. |
LINPHONECXX_PUBLIC void linphone::FriendList::setIsReadOnly | ( | bool | readOnly | ) |
Sets whether this friend list is read only or not.
If it is, you won't be able to add/remove friends in/from it, nor to edit existing friends in it.
readOnly | true to make this friend list "read only", false otherwise. |
LINPHONECXX_PUBLIC void linphone::FriendList::setRlsAddress | ( | const std::shared_ptr< const linphone::Address > & | rlsAddr | ) |
Set the RLS (Resource List Server) URI associated with the friend list to subscribe to these friends presence.
rlsAddr | The RLS URI to associate with the friend list. |
LINPHONECXX_PUBLIC LINPHONECXX_DEPRECATED void linphone::FriendList::setRlsUri | ( | const std::string & | rlsUri | ) |
Set the RLS (Resource List Server) URI associated with the friend list to subscribe to these friends presence.
rlsUri | The RLS URI to associate with the friend list. |
LINPHONECXX_PUBLIC void linphone::FriendList::setSubscriptionBodyless | ( | bool | bodyless | ) |
Set wether the subscription of the friend list is bodyless or not.
bodyless | boolean telling if the subscription of the friend list is bodyless or not. |
LINPHONECXX_PUBLIC void linphone::FriendList::setType | ( | Type | type | ) |
Assign a friend list type to the friend list.
type | Type to assign |
LINPHONECXX_PUBLIC void linphone::FriendList::setUri | ( | const std::string & | uri | ) |
Set the URI associated with the friend list.
uri | The URI to associate with the friend list. |
LINPHONECXX_PUBLIC bool linphone::FriendList::subscriptionsEnabled | ( | ) |
Gets whether subscription to NOTIFYs are enabled or not.
LINPHONECXX_PUBLIC bool linphone::FriendList::synchronizeFriendsWith | ( | const std::list< std::shared_ptr< linphone::Friend >> & | sourceFriends | ) |
Synchronize a local friendlist with another list of friends.
All friends in common will be updated using the data from the source friends. Missing friends from the source friends will be added. Extra friends from the local friendlist will be removed.
sourceFriends | the list of Friend whose data will be copied. (not a FriendList !) |
LINPHONECXX_PUBLIC void linphone::FriendList::updateRevision | ( | const std::string & | revision | ) |
Sets the revision from the last synchronization.
revision | The revision. |
LINPHONECXX_PUBLIC void linphone::FriendList::updateSubscriptions | ( | ) |
Update presence subscriptions for the entire list.
Calling this function is necessary when list subscriptions are enabled, ie when a RLS presence server is used.