Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members  

jabberoo::Roster Class Reference

A Jabber Roster. More...

#include <roster.hh>

List of all members.

Public Types

enum  Subscription {
  rsNone, rsTo, rsFrom, rsBoth,
  rsRemove
}
 The Subscription you have in relation to this Roster Item. More...


Public Member Functions

iterator begin ()
 Get the first Roster::Item.

iterator end ()
 Get the last Roster::Item.

const_iterator begin () const
 Get the first Roster::Item.

const_iterator end () const
 Get the last Roster::Item.

 Roster (Session &s)
 Create a Roster for a given Session.

SessiongetSession ()
 Get the Session this Roster is using.

const Roster::Itemoperator[] (const std::string &jid) const
 Get a Roster Item in the Roster given a JabberID.

Roster & operator<< (const Item &i)
 Add a Roster Item to the Roster.

bool containsJID (const std::string &jid) const
 Whether or not this Roster contains a certain JabberID.

void update (const judo::Element &t)
 Add a Roster Item to the Roster given a judo::Element.

void update (const Presence &p, Presence::Type prev_type)
 Update the Presence for the appropriate Roster Items.

void update (const Item &i)
 Add a Roster Item.

void deleteUser (const std::string &jid)
 Remove a Roster Item based on JabberID.

void fetch () const
 Fetch the Roster from the server.

int size () const
 Get the number of items in the roster.


Public Attributes

SigC::Signal0< void, SigC::Marshal<
void > > 
evtRefresh
 This signal is emitted whenever the Roster display should be refreshed.

SigC::Signal3< void, const
std::string &, bool, Presence::Type,
SigC::Marshal< void > > 
evtPresence
 This signal is emitted whenever the Presence for a user changes.


Detailed Description

A Jabber Roster.

A Roster is a list of users, or Roster Items.

Definition at line 52 of file roster.hh.


Member Enumeration Documentation

enum jabberoo::Roster::Subscription
 

The Subscription you have in relation to this Roster Item.

The Subscription determines who can see whose Presence.

Enumeration values:
rsNone  Neither of you can see the other's presence.
rsTo  You can see their presence, but they cannot see yours.
rsFrom  You cannot see their presence, but they can see yours.
rsBoth  Both of you can see each other's presence.
rsRemove  This Roster Item is being removed.

Definition at line 60 of file roster.hh.


Constructor & Destructor Documentation

jabberoo::Roster::Roster Session   s
 

Create a Roster for a given Session.

Parameters:
s The Session.
See also:
Session

Definition at line 40 of file jabberoo-roster.cpp.


Member Function Documentation

const_iterator jabberoo::Roster::begin   const [inline]
 

Get the first Roster::Item.

Returns:
A const iterator to the first Roster Item.

Definition at line 210 of file roster.hh.

iterator jabberoo::Roster::begin   [inline]
 

Get the first Roster::Item.

Returns:
An iterator to the first Roster Item.

Definition at line 197 of file roster.hh.

bool jabberoo::Roster::containsJID const std::string &    jid const
 

Whether or not this Roster contains a certain JabberID.

Parameters:
jid The JabberID.

Definition at line 71 of file jabberoo-roster.cpp.

void jabberoo::Roster::deleteUser const std::string &    jid
 

Remove a Roster Item based on JabberID.

Parameters:
jid The JabberID.

Definition at line 163 of file jabberoo-roster.cpp.

References judo::Element::addElement(), judo::Element::putAttrib(), jabberoo::Session::queryNamespace(), and judo::Element::toString().

const_iterator jabberoo::Roster::end   const [inline]
 

Get the last Roster::Item.

Returns:
A const iterator to the end Roster Item.

Definition at line 215 of file roster.hh.

iterator jabberoo::Roster::end   [inline]
 

Get the last Roster::Item.

Returns:
An iterator to the end Roster Item.

Definition at line 202 of file roster.hh.

void jabberoo::Roster::fetch   const
 

Fetch the Roster from the server.

Definition at line 200 of file jabberoo-roster.cpp.

References judo::Element::addElement(), judo::Element::putAttrib(), and judo::Element::toString().

Session& jabberoo::Roster::getSession   [inline]
 

Get the Session this Roster is using.

Returns:
The Session.

Definition at line 230 of file roster.hh.

Roster& jabberoo::Roster::operator<< const Item   i [inline]
 

Add a Roster Item to the Roster.

Definition at line 241 of file roster.hh.

References update().

const Roster::Item & jabberoo::Roster::operator[] const std::string &    jid const
 

Get a Roster Item in the Roster given a JabberID.

Definition at line 44 of file jabberoo-roster.cpp.

void jabberoo::Roster::update const Item   i
 

Add a Roster Item.

This is generally used when an application wants to add or modify Roster Items. Note that duplicate Roster Items for a particular JabberID cannot exist, the previous one for the JabberID will be overwritten.

Parameters:
i The Roster::Item to add/modify.

Definition at line 139 of file jabberoo-roster.cpp.

References judo::Element::addElement(), jabberoo::Roster::Item::begin(), jabberoo::Roster::Item::end(), jabberoo::Roster::Item::getJID(), jabberoo::Roster::Item::getNickname(), judo::Element::putAttrib(), and judo::Element::toString().

void jabberoo::Roster::update const Presence   p,
Presence::Type    prev_type
 

Update the Presence for the appropriate Roster Items.

Parameters:
p The Presence.
prev_type The previous Presence::Type for the Roster Item the Presence refers to.

Definition at line 128 of file jabberoo-roster.cpp.

References jabberoo::Packet::getFrom().

void jabberoo::Roster::update const judo::Element   t
 

Add a Roster Item to the Roster given a judo::Element.

This is how you push Items as they're received.

Parameters:
t The judo::Element

Definition at line 79 of file jabberoo-roster.cpp.

References judo::Element::begin(), judo::Element::cmpAttrib(), judo::Element::end(), evtRefresh, and judo::Element::getAttrib().

Referenced by jabberoo::Roster::Item::Item(), and operator<<().


Member Data Documentation

SigC::Signal3<void, const std::string&, bool, Presence::Type, SigC::Marshal<void> > jabberoo::Roster::evtPresence
 

This signal is emitted whenever the Presence for a user changes.

Parameters:
jid The JabberID for the Presence.
available Whether or not this user is online.
prev_type The previous Presence::Type of this user.

Definition at line 309 of file roster.hh.

SigC::Signal0<void, SigC::Marshal<void> > jabberoo::Roster::evtRefresh
 

This signal is emitted whenever the Roster display should be refreshed.

Definition at line 302 of file roster.hh.

Referenced by update().


The documentation for this class was generated from the following files:
Generated on Thu Jul 24 13:31:54 2003 for jabberoo by doxygen1.3-rc3