gloox
1.1-svn
|
#include <annotations.h>
Public Member Functions | |
Annotations (ClientBase *parent) | |
virtual | ~Annotations () |
void | storeAnnotations (const AnnotationsList &aList) |
void | requestAnnotations () |
void | registerAnnotationsHandler (AnnotationsHandler *ah) |
void | removeAnnotationsHandler () |
virtual void | handlePrivateXML (const Tag *xml) |
virtual void | handlePrivateXMLResult (const std::string &uid, PrivateXMLResult pxResult) |
Public Member Functions inherited from PrivateXML | |
PrivateXML (ClientBase *parent) | |
virtual | ~PrivateXML () |
std::string | requestXML (const std::string &tag, const std::string &xmlns, PrivateXMLHandler *pxh) |
std::string | storeXML (const Tag *tag, PrivateXMLHandler *pxh) |
virtual bool | handleIq (const IQ &iq) |
virtual void | handleIqID (const IQ &iq, int context) |
Public Member Functions inherited from IqHandler | |
virtual | ~IqHandler () |
Public Member Functions inherited from PrivateXMLHandler | |
virtual | ~PrivateXMLHandler () |
Additional Inherited Members | |
Public Types inherited from PrivateXMLHandler | |
enum | PrivateXMLResult { PxmlStoreOk, PxmlStoreError, PxmlRequestError } |
This is an implementation of XEP-0145 (Annotations).
You can use this class to store arbitrary notes about a roster item on the server (and to retrieve them later on). To retrieve all stored annotations for the current user's roster you have to create a class which inherits from AnnotationsHandler. This handler receives retrieved notes.
To store an additional note you have to fetch the currently stored notes first, add your new note to the list of notes, and transfer them all together back to the server. This protocol does not support storage of 'deltas', that is, when saving notes all previously saved notes are overwritten.
Definition at line 94 of file annotations.h.
Annotations | ( | ClientBase * | parent | ) |
Constructs a new Annotations object.
parent | The ClientBase to use for communication. |
Definition at line 22 of file annotations.cpp.
|
virtual |
Virtual destructor.
Definition at line 28 of file annotations.cpp.
|
virtual |
Reimplement this function to receive the private XML that was requested earlier using PrivateXML::requestXML()
.
xml | The private xml, i.e. the first child of the <query> tag. May be 0. You should not delete the object. |
Implements PrivateXMLHandler.
Definition at line 53 of file annotations.cpp.
|
virtual |
This function is called to notify about the result of a 'store' or 'request' operation (successful requests are announced by means of handlePrivateXML()).
uid | The ID of the query. |
pxResult | The result of the operation. |
Implements PrivateXMLHandler.
Definition at line 86 of file annotations.cpp.
|
inline |
Use this function to register a AnnotationsHandler.
ah | The AnnotationsHandler which shall receive retrieved notes. |
Definition at line 125 of file annotations.h.
|
inline |
Use this function to un-register the AnnotationsHandler.
Definition at line 131 of file annotations.h.
void requestAnnotations | ( | ) |
Use this function to initiate retrieval of annotations. Use registerAnnotationsHandler() to register an object which will receive the lists of notes.
Definition at line 48 of file annotations.cpp.
void storeAnnotations | ( | const AnnotationsList & | aList | ) |
Use this function to store notes (annotations to contacts in a roster) on the server. Make sure you store the whole set of annotations, not a 'delta'.
aList | A list of notes to store. |
Definition at line 32 of file annotations.cpp.