Public Member Functions | Public Attributes

Swift::XMPPRoster Class Reference

This class represents the roster of an account, as stored on the XMPP server. More...

List of all members.

Public Member Functions

 XMPPRoster ()
virtual ~XMPPRoster ()
virtual bool containsJID (const JID &jid)=0
 Checks whether the bare jid of the given jid is in the roster.
virtual
RosterItemPayload::Subscription 
getSubscriptionStateForJID (const JID &jid)=0
 Retrieves the subscription state for the given jid.
virtual std::string getNameForJID (const JID &jid) const =0
 Retrieves the stored roster name for the given jid.
virtual std::vector< std::string > getGroupsForJID (const JID &jid)=0
 Returns the list of groups for the given JID.
virtual std::vector
< XMPPRosterItem > 
getItems () const =0
 Retrieve the items in the roster.
virtual boost::optional
< XMPPRosterItem > 
getItem (const JID &) const =0
 Retrieve the item with the given JID.
virtual std::set< std::string > getGroups () const =0
 Retrieve the list of (existing) groups.

Public Attributes

boost::signal< void(const JID &)> onJIDAdded
 Emitted when the given JID is added to the roster.
boost::signal< void(const JID &)> onJIDRemoved
 Emitted when the given JID is removed from the roster.
boost::signal< void(const JID
&, const std::string &, const
std::vector< std::string > &)> 
onJIDUpdated
 Emitted when the name or the groups of the roster item with the given JID changes.
boost::signal< void()> onRosterCleared
 Emitted when the roster is reset (e.g.
boost::signal< void()> onInitialRosterPopulated
 Emitted after the last contact of the initial roster request response was added.

Detailed Description

This class represents the roster of an account, as stored on the XMPP server.

Changes to the roster (either due to subscription requests or by going online/offline) are emitted through signals.

Definition at line 25 of file XMPPRoster.h.


Constructor & Destructor Documentation

Swift::XMPPRoster::XMPPRoster (  ) 
virtual Swift::XMPPRoster::~XMPPRoster (  )  [virtual]

Member Function Documentation

virtual bool Swift::XMPPRoster::containsJID ( const JID jid  )  [pure virtual]

Checks whether the bare jid of the given jid is in the roster.

virtual std::set<std::string> Swift::XMPPRoster::getGroups (  )  const [pure virtual]

Retrieve the list of (existing) groups.

virtual std::vector<std::string> Swift::XMPPRoster::getGroupsForJID ( const JID jid  )  [pure virtual]

Returns the list of groups for the given JID.

virtual boost::optional<XMPPRosterItem> Swift::XMPPRoster::getItem ( const JID  )  const [pure virtual]

Retrieve the item with the given JID.

virtual std::vector<XMPPRosterItem> Swift::XMPPRoster::getItems (  )  const [pure virtual]

Retrieve the items in the roster.

virtual std::string Swift::XMPPRoster::getNameForJID ( const JID jid  )  const [pure virtual]

Retrieves the stored roster name for the given jid.

virtual RosterItemPayload::Subscription Swift::XMPPRoster::getSubscriptionStateForJID ( const JID jid  )  [pure virtual]

Retrieves the subscription state for the given jid.


Member Data Documentation

Emitted after the last contact of the initial roster request response was added.

Definition at line 86 of file XMPPRoster.h.

boost::signal<void (const JID&)> Swift::XMPPRoster::onJIDAdded

Emitted when the given JID is added to the roster.

Definition at line 62 of file XMPPRoster.h.

boost::signal<void (const JID&)> Swift::XMPPRoster::onJIDRemoved

Emitted when the given JID is removed from the roster.

Definition at line 67 of file XMPPRoster.h.

boost::signal<void (const JID&, const std::string&, const std::vector<std::string>&)> Swift::XMPPRoster::onJIDUpdated

Emitted when the name or the groups of the roster item with the given JID changes.

Definition at line 73 of file XMPPRoster.h.

boost::signal<void ()> Swift::XMPPRoster::onRosterCleared

Emitted when the roster is reset (e.g.

due to logging in/logging out). After this signal is emitted, the roster is empty. It will be repopulated through onJIDAdded and onJIDRemoved events.

Definition at line 80 of file XMPPRoster.h.