#include <rosteritem.h>
Public Types | |
| enum | SubscriptionEnum { S10nNone, S10nNoneOut, S10nNoneIn, S10nNoneOutIn, S10nTo, S10nToIn, S10nFrom, S10nFromOut, S10nBoth } |
| typedef std::map< std::string, Resource * > | ResourceMap |
Public Member Functions | |
| RosterItem (const JID &jid, const std::string &name="") | |
| virtual | ~RosterItem () |
| virtual void | setName (const std::string &name) |
| virtual const std::string & | name () const |
| virtual const std::string & | jid () const |
| virtual SubscriptionEnum | subscription () const |
| virtual void | setGroups (const StringList &groups) |
| virtual const StringList & | groups () const |
| virtual bool | changed () const |
| virtual bool | online () const |
| virtual const ResourceMap & | resources () const |
| virtual const Resource * | resource (const std::string &res) const |
Protected Member Functions | |
| virtual void | setPresence (const std::string &resource, Presence presence) |
| virtual void | setStatus (const std::string &resource, const std::string &msg) |
| virtual void | setPriority (const std::string &resource, int priority) |
| virtual void | setSubscription (const std::string &subscription, bool ask) |
| virtual void | setSynchronized () |
| virtual void | removeResource (const std::string &resource) |
For each RosterItem all resources that are available (online in some way) are stored in a ResourceMap. This map is accessible using the resources() function.
Definition at line 37 of file rosteritem.h.
| typedef std::map<std::string, Resource*> ResourceMap |
A list of resources for the given JID.
Definition at line 45 of file rosteritem.h.
| enum SubscriptionEnum |
Describes possible subscribtion types according to RFC 3921, Section 9.
Definition at line 50 of file rosteritem.h.
| RosterItem | ( | const JID & | jid, | |
| const std::string & | name = "" | |||
| ) |
Constructs a new item of the roster.
| jid | The JID of the contact. | |
| name | The displayed name of the contact. |
Definition at line 20 of file rosteritem.cpp.
| ~RosterItem | ( | ) | [virtual] |
Virtual destructor.
Definition at line 25 of file rosteritem.cpp.
| void setName | ( | const std::string & | name | ) | [virtual] |
Sets the displayed name of a contact/roster item.
| name | The contact's new name. |
Definition at line 35 of file rosteritem.cpp.
| virtual const std::string& name | ( | ) | const [inline, virtual] |
Retrieves the displayed name of a contact/roster item.
Definition at line 97 of file rosteritem.h.
| virtual const std::string& jid | ( | ) | const [inline, virtual] |
Returns the contact's bare JID.
Definition at line 103 of file rosteritem.h.
| virtual SubscriptionEnum subscription | ( | ) | const [inline, virtual] |
Returns the current subscription type between the remote and the local entity.
Definition at line 109 of file rosteritem.h.
| void setGroups | ( | const StringList & | groups | ) | [virtual] |
Sets the groups this RosterItem belongs to.
| groups | The groups to set for this item. |
Definition at line 89 of file rosteritem.cpp.
| virtual const StringList& groups | ( | ) | const [inline, virtual] |
Returns the groups this RosterItem belongs to.
Definition at line 121 of file rosteritem.h.
| virtual bool changed | ( | ) | const [inline, virtual] |
Whether the item has unsynchronized changes.
Definition at line 127 of file rosteritem.h.
| bool online | ( | ) | const [virtual] |
Indicates whether this item has at least one resource online (in any state).
Definition at line 105 of file rosteritem.cpp.
| virtual const ResourceMap& resources | ( | ) | const [inline, virtual] |
Returns the contact's resources.
Definition at line 139 of file rosteritem.h.
| const Resource * resource | ( | const std::string & | res | ) | const [virtual] |
Returns the Resource for a specific resource string.
| res | The resource string. |
Definition at line 110 of file rosteritem.cpp.
| void setPresence | ( | const std::string & | resource, | |
| Presence | presence | |||
| ) | [protected, virtual] |
Sets the current presence of the resource.
| resource | The resource to set the presence for. | |
| presence | The current presence. |
Definition at line 41 of file rosteritem.cpp.
| void setStatus | ( | const std::string & | resource, | |
| const std::string & | msg | |||
| ) | [protected, virtual] |
Sets the current status message of the resource.
| resource | The resource to set the status message for. | |
| msg | The current status message, i.e. from the presence info. |
Definition at line 51 of file rosteritem.cpp.
| void setPriority | ( | const std::string & | resource, | |
| int | priority | |||
| ) | [protected, virtual] |
Sets the current priority of the resource.
| resource | The resource to set the status message for. | |
| priority | The resource's priority, i.e. from the presence info. |
Definition at line 61 of file rosteritem.cpp.
| void setSubscription | ( | const std::string & | subscription, | |
| bool | ask | |||
| ) | [protected, virtual] |
Sets the current subscription status of the contact.
| subscription | The current subscription. | |
| ask | Whether a subscription request is pending. |
Definition at line 71 of file rosteritem.cpp.
| virtual void setSynchronized | ( | ) | [inline, protected, virtual] |
Removes the 'changed' flag from the item.
Definition at line 180 of file rosteritem.h.
| void removeResource | ( | const std::string & | resource | ) | [protected, virtual] |
This function is called to remove subsequent resources from a RosterItem.
| resource | The resource to remove. |
Definition at line 95 of file rosteritem.cpp.
1.5.5