#include <flexoff.h>
Inherits DiscoHandler, and IqHandler.
Inheritance diagram for FlexibleOffline:
Public Member Functions | |
FlexibleOffline (ClientBase *parent, Disco *disco) | |
virtual | ~FlexibleOffline () |
void | checkSupport () |
void | getMsgCount () |
void | fetchHeaders () |
void | fetchMessages (const StringList &msgs) |
void | removeMessages (const StringList &msgs) |
void | registerFlexibleOfflineHandler (FlexibleOfflineHandler *foh) |
void | removeFlexibleOfflineHandler () |
virtual void | handleDiscoInfoResult (Stanza *stanza, int context) |
virtual void | handleDiscoItemsResult (Stanza *stanza, int context) |
virtual void | handleDiscoError (Stanza *stanza, int context) |
virtual bool | handleIqID (Stanza *stanza, int context) |
virtual bool | handleIq (Stanza *stanza) |
Use the FlexibleOfflineHandler to receive results.
Definition at line 33 of file flexoff.h.
FlexibleOffline | ( | ClientBase * | parent, | |
Disco * | disco | |||
) |
Creates a new FlexibleOffline object that manages retrieval of offline messages.
parent | The ClientBase to use for communication. | |
disco | The disco object to use. |
Definition at line 21 of file flexoff.cpp.
~FlexibleOffline | ( | ) | [virtual] |
Virtual Destructor.
Definition at line 26 of file flexoff.cpp.
void checkSupport | ( | ) |
Initiates querying the server for Flexible Offline Message Retrieval-support. The result is announced through the FlexibleOfflineHandler. An application could cache the result on a per-server basis to eliminate the associated delay.
Definition at line 30 of file flexoff.cpp.
void getMsgCount | ( | ) |
Asks the server for the number of stored offline messages. The result is announced through the FlexibleOfflineHandler.
Definition at line 35 of file flexoff.cpp.
void fetchHeaders | ( | ) |
Initiates fetching the offline message headers. The result is announced through the FlexibleOfflineHandler.
Definition at line 40 of file flexoff.cpp.
void fetchMessages | ( | const StringList & | msgs | ) |
Initiates fetching of one or more specific messages, or all messages. The result is announced through the FlexibleOfflineHandler. If the list of message nodes contains one or more nodes, the corresponding messages are fetched. If the list is empty all messages are fetched (<fetch>).
msgs | A list of message nodes to fetch. |
Definition at line 45 of file flexoff.cpp.
void removeMessages | ( | const StringList & | msgs | ) |
Initiates removing of one or more specific messages, or all messages. The result is announced through the FlexibleOfflineHandler. If the list of message nodes contains one or more nodes, the corresponding messages are removed. If the list is empty all messages are removed (<purge>).
Definition at line 71 of file flexoff.cpp.
void registerFlexibleOfflineHandler | ( | FlexibleOfflineHandler * | foh | ) |
Registers a FlexibleOfflineHandler as object that receives results of JEP-0013 queries. Only one Handler at a time is possible.
foh | The Handler object to register. |
Definition at line 97 of file flexoff.cpp.
void removeFlexibleOfflineHandler | ( | ) |
Removes the registered handler.
Definition at line 102 of file flexoff.cpp.
void handleDiscoInfoResult | ( | Stanza * | stanza, | |
int | context | |||
) | [virtual] |
Reimplement this function if you want to be notified about the result of an disco::info query.
stanza | The full Stanza. | |
context | A context identifier. |
Implements DiscoHandler.
Definition at line 107 of file flexoff.cpp.
void handleDiscoItemsResult | ( | Stanza * | stanza, | |
int | context | |||
) | [virtual] |
Reimplement this function if you want to be notified about the result of an disco::items query.
stanza | The full Stanza. | |
context | A context identifier. |
Implements DiscoHandler.
Definition at line 130 of file flexoff.cpp.
void handleDiscoError | ( | Stanza * | stanza, | |
int | context | |||
) | [virtual] |
Reimplement this function to receive disco error notifications.
stanza | The full Stanza. | |
context | A context identifier. |
Implements DiscoHandler.
Definition at line 149 of file flexoff.cpp.
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.
stanza | The complete Stanza. | |
context | A value to restore context, stored with ClientBase::trackID(). |
Implements IqHandler.
Definition at line 153 of file flexoff.cpp.
bool handleIq | ( | Stanza * | stanza | ) | [virtual] |
Reimplement this function if you want to be notified about incoming IQs.
stanza | The complete Stanza. |
Implements IqHandler.
Definition at line 221 of file flexoff.cpp.