RosterItem Class Reference

An abstraction of a roster item. More...

#include <rosteritem.h>

List of all members.

Public Types

enum  SubscriptionEnum {
  S10N_NONE, S10N_NONE_OUT, S10N_NONE_IN, S10N_NONE_OUT_IN,
  S10N_TO, S10N_TO_IN, S10N_FROM, S10N_FROM_OUT,
  S10N_BOTH
}

Public Member Functions

 RosterItem (const std::string &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 StringListgroups ()
virtual PresenceStatus status () const
virtual const std::string statusMsg () const
virtual bool changed () const

Protected Member Functions

virtual void setStatus (PresenceStatus status)
virtual void setStatusMsg (const std::string &msg)
virtual void setSubscription (const std::string &subscription, bool ask)
virtual void setSynchronized ()

Friends

class RosterManager


Detailed Description

An abstraction of a roster item.

Author:
Jakob Schroeter <js@camaya.net>
Since:
0.3

Definition at line 32 of file rosteritem.h.


Member Enumeration Documentation

enum SubscriptionEnum
 

Describes possible subscribtion types according to RFC 3921, Section 9.

Enumerator:
S10N_NONE  Contact and user are not subscribed to each other, and neither has requested a subscription from the other.
S10N_NONE_OUT  Contact and user are not subscribed to each other, and user has sent contact a subscription request but contact has not replied yet.
S10N_NONE_IN  Contact and user are not subscribed to each other, and contact has sent user a subscription request but user has not replied yet (note: contact's server SHOULD NOT push or deliver roster items in this state, but instead SHOULD wait until contact has approved subscription request from user).
S10N_NONE_OUT_IN  Contact and user are not subscribed to each other, contact has sent user a subscription request but user has not replied yet, and user has sent contact a subscription request but contact has not replied yet.
S10N_TO  User is subscribed to contact (one-way).
S10N_TO_IN  User is subscribed to contact, and contact has sent user a subscription request but user has not replied yet.
S10N_FROM  Contact is subscribed to user (one-way).
S10N_FROM_OUT  Contact is subscribed to user, and user has sent contact a subscription request but contact has not replied yet.
S10N_BOTH  User and contact are subscribed to each other (two-way).

Definition at line 40 of file rosteritem.h.


Constructor & Destructor Documentation

RosterItem const std::string &  jid,
const std::string &  name = ""
 

Constructs a new item of the roster.

Parameters:
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.


Member Function Documentation

virtual bool changed  )  const [inline, virtual]
 

Whether the item has unsynchronized changes.

Returns:
True if the item has unsynchronized changes, false otherwise.

Definition at line 129 of file rosteritem.h.

virtual StringList& groups  )  [inline, virtual]
 

Returns the groups this RosterItem belongs to.

Returns:
The groups this item belongs to.

Definition at line 111 of file rosteritem.h.

virtual const std::string jid  )  const [inline, virtual]
 

Returns the contact's JID.

Returns:
The contact's JID.

Definition at line 93 of file rosteritem.h.

virtual const std::string name  )  const [inline, virtual]
 

Retrieves the displayed name of a contact/roster item.

Returns:
The contact's name.

Definition at line 87 of file rosteritem.h.

void setGroups const StringList groups  )  [virtual]
 

Sets the groups this RosterItem belongs to.

Parameters:
groups The groups to set for this item.

Definition at line 65 of file rosteritem.cpp.

void setName const std::string &  name  )  [virtual]
 

Sets the displayed name of a contact/roster item.

Parameters:
name The contact's new name.

Definition at line 29 of file rosteritem.cpp.

void setStatus PresenceStatus  status  )  [protected, virtual]
 

Sets the current status of the contact.

Parameters:
status The current status, i.e. presence info.

Definition at line 35 of file rosteritem.cpp.

void setStatusMsg const std::string &  msg  )  [protected, virtual]
 

Sets the current status message of the contact.

Parameters:
msg The current status message, i.e. from the presence info.

Definition at line 41 of file rosteritem.cpp.

void setSubscription const std::string &  subscription,
bool  ask
[protected, virtual]
 

Sets the current subscription status of the contact.

Parameters:
subscription The current subscription.
ask Whether a subscription request is pending.

Definition at line 47 of file rosteritem.cpp.

References RosterItem::S10N_BOTH, RosterItem::S10N_FROM, RosterItem::S10N_FROM_OUT, RosterItem::S10N_NONE, RosterItem::S10N_NONE_OUT, RosterItem::S10N_TO, and RosterItem::S10N_TO_IN.

virtual void setSynchronized  )  [inline, protected, virtual]
 

Removes the 'changed' flag from the item.

Definition at line 154 of file rosteritem.h.

virtual PresenceStatus status  )  const [inline, virtual]
 

Returns the contact's status.

Returns:
The status of the contact.

Definition at line 117 of file rosteritem.h.

virtual const std::string statusMsg  )  const [inline, virtual]
 

Returns the contact's status message.

Returns:
The contact's status message.

Definition at line 123 of file rosteritem.h.

virtual SubscriptionEnum subscription  )  const [inline, virtual]
 

Returns the current subscription type between the remote and the local entity.

Returns:
The subscription type.

Definition at line 99 of file rosteritem.h.


The documentation for this class was generated from the following files:
Generated on Mon Jan 16 16:20:01 2006 for gloox by  doxygen 1.4.6