gloox
0.9.9.12
|
#include <bookmarkstorage.h>
Public Member Functions | |
BookmarkStorage (ClientBase *parent) | |
virtual | ~BookmarkStorage () |
void | storeBookmarks (const BookmarkList &bList, const ConferenceList &cList) |
void | requestBookmarks () |
void | registerBookmarkHandler (BookmarkHandler *bmh) |
void | removeBookmarkHandler () |
virtual void | handlePrivateXML (const std::string &tag, 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 (Tag *tag, PrivateXMLHandler *pxh) |
virtual bool | handleIq (Stanza *stanza) |
virtual bool | handleIqID (Stanza *stanza, 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-0048 (Bookmark Storage).
You can use this class to store bookmarks to multi-user chat rooms or ordinary URLs on the server (and to retrieve them later on). To retrieve all stored bookmarks for the current user you have to create a class which inherits from BookmarkHandler. This handler receives retrieved bookmarks.
To store additional bookmarks you have to fetch the currently stored ones first, add your new bookmark to the list, and transfer them all together back to the server. This protocol does not support storage of 'deltas', that is, when saving bookmarks all previously saved bookmarks are overwritten.
Definition at line 97 of file bookmarkstorage.h.
BookmarkStorage | ( | ClientBase * | parent | ) |
Constructs a new BookmarkStorage object.
parent | The ClientBase to use for communication. |
Definition at line 22 of file bookmarkstorage.cpp.
|
virtual |
Virtual destructor.
Definition at line 28 of file bookmarkstorage.cpp.
|
virtual |
Reimplement this function to receive the private XML that was requested earlier using PrivateXML::requestXML()
.
tag | The tag of the storage packet. |
xml | The private xml, i.e. the first child of the <query> tag. |
Implements PrivateXMLHandler.
Definition at line 74 of file bookmarkstorage.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 129 of file bookmarkstorage.cpp.
void registerBookmarkHandler | ( | BookmarkHandler * | bmh | ) |
Use this function to register a BookmarkHandler.
bmh | The BookmarkHandler which shall receive retrieved bookmarks. |
Definition at line 133 of file bookmarkstorage.cpp.
void removeBookmarkHandler | ( | ) |
Use this function to un-register the BookmarkHandler.
Definition at line 138 of file bookmarkstorage.cpp.
void requestBookmarks | ( | ) |
Use this function to initiate retrieval of bookmarks. Use registerBookmarkHandler() to register an object which will receive the lists of bookmarks.
Definition at line 69 of file bookmarkstorage.cpp.
void storeBookmarks | ( | const BookmarkList & | bList, |
const ConferenceList & | cList | ||
) |
Use this function to store a number of URL and conference bookmarks on the server. Make sure you store the whole set of bookmarks, not a 'delta'.
bList | A list of URLs to store. |
cList | A list of conferences to store. |
Definition at line 32 of file bookmarkstorage.cpp.