#include <pubsubmanager.h>
Inherits IqHandler.
Inheritance diagram for Manager:

Public Member Functions | |
| Manager (ClientBase *parent) | |
| virtual | ~Manager () |
| void | subscribe (const JID &service, const std::string &node, ResultHandler *handler, const JID &jid=JID(), SubscriptionObject type=SubscriptionNodes, int depth=1) |
| void | unsubscribe (const JID &service, const std::string &node, ResultHandler *handler, const JID &jid=JID()) |
| void | getSubscriptions (const JID &service, ResultHandler *handler) |
| void | getAffiliations (const JID &service, ResultHandler *handler) |
| void | getSubscriptionOptions (const JID &service, const JID &jid, const std::string &node, ResultHandler *handler) |
| void | setSubscriptionOptions (const JID &service, const JID &jid, const std::string &node, const DataForm &df, ResultHandler *handler) |
| void | getAffiliations (const JID &service, const std::string &node, ResultHandler *handler) |
| void | publishItem (const JID &service, const std::string &node, Tag *item, ResultHandler *handler) |
| void | deleteItem (const JID &service, const std::string &node, const std::string &item, ResultHandler *handler) |
| void | getItems (const JID &service, const std::string &node, ResultHandler *handler) |
| void | createNode (NodeType type, const JID &service, const std::string &node, ResultHandler *handler, const std::string &name=EmptyString, const std::string &parent=EmptyString, AccessModel access=AccessDefault, const StringMap *config=0) |
| void | createLeafNode (const JID &service, const std::string &node, ResultHandler *handler, const std::string &name, const std::string &parent=EmptyString, AccessModel access=AccessDefault, const StringMap *config=0) |
| void | createCollectionNode (const JID &service, const std::string &node, ResultHandler *handler, const std::string &name, const std::string &parent=EmptyString, AccessModel access=AccessDefault, const StringMap *config=0) |
| void | deleteNode (const JID &service, const std::string &node, ResultHandler *handler) |
| void | getDefaultNodeConfig (const JID &service, NodeType type, ResultHandler *handler) |
| void | purgeNode (const JID &service, const std::string &node, ResultHandler *handler) |
| void | getSubscribers (const JID &service, const std::string &node, ResultHandler *handler) |
| void | setSubscribers (const JID &service, const std::string &node, const SubscriberList &list, ResultHandler *handler) |
| void | getAffiliates (const JID &service, const std::string &node, ResultHandler *handler) |
| void | setAffiliates (const JID &service, const std::string &node, const AffiliateList &list, ResultHandler *handler) |
| void | getNodeConfig (const JID &service, const std::string &node, ResultHandler *handler) |
| void | setNodeConfig (const JID &service, const std::string &node, const DataForm &config, ResultHandler *handler) |
| void | registerEventHandler (EventHandler *handler) |
| void | removeEventHandler (EventHandler *handler) |
| virtual bool | handleIq (const IQ &iq) |
| virtual void | handleIqID (const IQ &iq, int context) |
Note that many PubSub queries will both trigger a notification from registered EventHandler's and from the ResultHandler specific to the query.
To get started with PubSub in gloox, create a Manager, implement the PubSub::EventHandler virtuals and register an instance with a Manager. This will get you notified of PubSub events sent to you.
Next, to be able to interact with PubSub services, you will need to implement the ResultHandler virtuals interfaces to be notified of the result of requests and pass these along to these requests (null handlers are not allowed).
EventHandler::handleItemPublication() can be called with or without the actual tag, depending on if the notification actually includes the payload. From there you could only record the event and be done with it, or decide to retrieve the full payload. Eg:
class MyEventHandler : public gloox::EventHandler { // ... }; void MyEventHandler::handleItemPublication( const JID& service, const std::string& node, const std::string& item, const Tag* entry ) { // we want to retrieve the payload everytime if( !entry ) { m_manager->requestItem( service, node, item, this ); } else { do_something_useful( entry ); } }
In response to this request, MyResultHandler::handleItem() will be called.
XEP Version: 1.9
Definition at line 112 of file pubsubmanager.h.
|
|
Initialize the manager.
Definition at line 108 of file pubsubmanager.cpp. |
|
|
Default virtual destructor. Definition at line 125 of file pubsubmanager.h. |
|
||||||||||||||||||||||||||||||||
|
Creates a new collection node.
Definition at line 349 of file pubsubmanager.h. |
|
||||||||||||||||||||||||||||||||
|
Creates a new leaf node.
Definition at line 322 of file pubsubmanager.h. |
|
||||||||||||||||||||||||||||||||||||
|
Creates a new node.
Definition at line 365 of file pubsubmanager.cpp. |
|
||||||||||||||||||||
|
Delete an item from a node.
Definition at line 347 of file pubsubmanager.cpp. |
|
||||||||||||||||
|
Deletes a node.
Definition at line 423 of file pubsubmanager.cpp. |
|
||||||||||||||||
|
Requests the affiliate list for a node.
Definition at line 444 of file pubsubmanager.h. |
|
||||||||||||||||
|
Requests the affiliation list for a node.
|
|
||||||||||||
|
Requests the affiliation list from a service.
Definition at line 253 of file pubsubmanager.cpp. |
|
||||||||||||||||
|
Retrieves the default configuration for a specific NodeType.
Definition at line 439 of file pubsubmanager.cpp. |
|
||||||||||||||||
|
Ask for the item list of a specific node.
Definition at line 537 of file pubsubmanager.cpp. |
|
||||||||||||||||
|
Retrieve the configuration (options) of a node.
Definition at line 473 of file pubsubmanager.h. |
|
||||||||||||||||
|
Requests the subscriber list for a node.
Definition at line 414 of file pubsubmanager.h. |
|
||||||||||||||||||||
|
Requests subscription options.
Definition at line 199 of file pubsubmanager.h. |
|
||||||||||||
|
Requests the subscription list from a service.
Definition at line 240 of file pubsubmanager.cpp. |
|
|
Reimplement this function if you want to be notified about incoming IQs.
Implements IqHandler. Definition at line 515 of file pubsubmanager.h. |
|
||||||||||||
|
Implements IqHandler. Definition at line 572 of file pubsubmanager.cpp. |
|
||||||||||||||||||||
|
Publish an item to a node. The Tag to publish is destroyed by the function before returning.
Definition at line 326 of file pubsubmanager.cpp. |
|
||||||||||||||||
|
Removes all the items from a node.
Definition at line 552 of file pubsubmanager.cpp. |
|
|
Registers an handler to receive notification of events.
Definition at line 498 of file pubsubmanager.h. |
|
|
Removes an handler from the list of event handlers.
Definition at line 505 of file pubsubmanager.h. |
|
||||||||||||||||||||
|
Modifies the affiliate list for a node.
Definition at line 458 of file pubsubmanager.h. |
|
||||||||||||||||||||
|
Changes a node's configuration (options).
Definition at line 487 of file pubsubmanager.h. |
|
||||||||||||||||||||
|
Modifies the subscriber list for a node. This function SHOULD only set the subscriber list to those which needs modification.
Definition at line 429 of file pubsubmanager.h. |
|
||||||||||||||||||||||||
|
Modifies subscription options.
Definition at line 215 of file pubsubmanager.h. |
|
||||||||||||||||||||||||||||
|
Subscribe to a node.
Definition at line 266 of file pubsubmanager.cpp. |
|
||||||||||||||||||||
|
Unsubscribe from a node.
Definition at line 307 of file pubsubmanager.cpp. |
1.4.1