PrivateXML Class Reference

This class implements JEP-0049 (Private XML Storage). More...

#include <privatexml.h>

Inherits IqHandler.

Inherited by Annotations, and BookmarkStorage.

Inheritance diagram for PrivateXML:

Inheritance graph
[legend]
Collaboration diagram for PrivateXML:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PrivateXML (ClientBase *parent)
virtual ~PrivateXML ()
std::string requestXML (const std::string &tag, const std::string &xmlns, PrivateXMLHandler *pxh)
std::string storeXML (Tag *tag, PrivateXMLHandler *pxh)
virtual bool handleIq (Stanza *)
virtual bool handleIqID (Stanza *stanza, int context)

Protected Attributes

ClientBasem_parent

Detailed Description

This class implements JEP-0049 (Private XML Storage).

Author:
Jakob Schroeter <js@camaya.net>

Definition at line 37 of file privatexml.h.


Constructor & Destructor Documentation

PrivateXML ClientBase parent  ) 
 

Constructor. Creates a new PrivateXML client that registers as IqHandler with ClientBase.

Parameters:
parent The ClientBase used for XMPP communication

Definition at line 21 of file privatexml.cpp.

References PrivateXML::m_parent, and ClientBase::registerIqHandler().

~PrivateXML  )  [virtual]
 

Virtual destructor.

Definition at line 28 of file privatexml.cpp.

References PrivateXML::m_parent, and ClientBase::removeIqHandler().


Member Function Documentation

virtual bool handleIq Stanza  )  [inline, virtual]
 

Reimplement this function if you want to be notified about incoming IQs.

Parameters:
stanza The complete Stanza.
Returns:
Indicates whether a request of type 'get' or 'set' has been handled. This includes the obligatory 'result' answer. If you return false, a 'error' will be sent.

Implements IqHandler.

Definition at line 72 of file privatexml.h.

bool handleIqID Stanza stanza,
int  context
[virtual]
 

Reimplement this function if you want to be notified about incoming IQs with a specific value of the id attribute. You have to enable tracking of those IDs using Client::trackID(). This is usually useful for IDs that generate a positive reply, i.e. <iq type='result' id='reg'/> where a namespace filter wouldn't work.

Parameters:
stanza The complete Stanza.
context A value to restore context, stored with ClientBase::trackID().
Returns:
Indicates whether a request of type 'get' or 'set' has been handled. This includes the obligatory 'result' answer. If you return false, a 'error' will be sent.

Implements IqHandler.

Definition at line 76 of file privatexml.cpp.

References Tag::children(), Tag::findChild(), Stanza::id(), PrivateXMLHandler::PXML_STORE_OK, gloox::STANZA_IQ_RESULT, and Stanza::subtype().

std::string requestXML const std::string &  tag,
const std::string &  xmlns,
PrivateXMLHandler pxh
 

Use this function to request the private XML stored in the given namespace.

Parameters:
tag Child element of the query element used to identify the requested XML fragment.
xmlns The namespace which qualifies the tag.
pxh The handler to receive the result.
Returns:
The ID of the sent query.

Definition at line 35 of file privatexml.cpp.

References Tag::addAttrib(), Tag::addChild(), ClientBase::getID(), PrivateXML::m_parent, ClientBase::send(), and ClientBase::trackID().

Referenced by RosterManager::fill(), Annotations::requestAnnotations(), and BookmarkStorage::requestBookmarks().

std::string storeXML Tag tag,
PrivateXMLHandler pxh
 

Use this function to store private XML stored in the given namespace.

Parameters:
tag The XML to store. This is the complete tag including the unique namespace. It is deleted automatically after sending it.
pxh The handler to receive the result.
Returns:
The ID of the sent query.

Definition at line 57 of file privatexml.cpp.

References Tag::addAttrib(), Tag::addChild(), ClientBase::getID(), PrivateXML::m_parent, ClientBase::send(), and ClientBase::trackID().

Referenced by RosterManager::setDelimiter().


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