Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

Subscription Class Reference

An abstraction of a subscription stanza. More...

#include <subscription.h>

Inherits Stanza.

Inheritance diagram for Subscription:

Inheritance graph
[legend]
List of all members.

Public Types

enum  S10nType { , Subscribed, Unsubscribe, Unsubscribed, Invalid }

Public Member Functions

 Subscription (S10nType type, const JID &to, const std::string &status=EmptyString, const std::string &xmllang=EmptyString)
virtual ~Subscription ()
S10nType subtype () const
const std::string status (const std::string &lang="default") const
virtual Tagtag () const

Detailed Description

An abstraction of a subscription stanza.

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

Definition at line 31 of file subscription.h.


Member Enumeration Documentation

enum S10nType
 

Describes the different valid message types.

Enumeration values:
Subscribed  A subscription notification.
Unsubscribe  An unsubscription request.
Unsubscribed  An unsubscription notification.
Invalid  The stanza is invalid.

Definition at line 41 of file subscription.h.


Constructor & Destructor Documentation

Subscription S10nType  type,
const JID to,
const std::string &  status = EmptyString,
const std::string &  xmllang = EmptyString
 

Creates a Subscription request.

Parameters:
type The presence type.
to The intended receiver. Use an empty JID to create a broadcast packet.
status An optional status message (e.g. "please authorize me").
xmllang An optional xml:lang for the status message.

Definition at line 43 of file subscription.cpp.

~Subscription  )  [virtual]
 

Destructor.

Definition at line 50 of file subscription.cpp.


Member Function Documentation

const std::string status const std::string &  lang = "default"  )  const [inline]
 

Returns the status text of a presence stanza for the given language if available. If the requested language is not available, the default status text (without a xml:lang attribute) will be returned.

Parameters:
lang The language identifier for the desired language. It must conform to section 2.12 of the XML specification and RFC 3066. If empty, the default body will be returned, if any.
Returns:
The status text set by the sender.

Definition at line 80 of file subscription.h.

S10nType subtype  )  const [inline]
 

Returns the subscription stanza's type.

Returns:
The subscription stanza's type.

Definition at line 69 of file subscription.h.

Tag * tag  )  const [virtual]
 

Creates a Tag representation of the Stanza. The Tag is completely independent of the Stanza and will not be updated when the Stanza is modified.

Returns:
A pointer to a Tag representation. It is the job of the caller to delete the Tag.

Implements Stanza.

Definition at line 55 of file subscription.cpp.


The documentation for this class was generated from the following files:
Generated on Sat Oct 31 19:54:41 2009 for gloox by  doxygen 1.4.1