gloox  1.1-svn
Public Member Functions | List of all members
FlexibleOffline Class Reference

#include <flexoff.h>

Inheritance diagram for FlexibleOffline:
Inheritance graph
[legend]

Public Member Functions

 FlexibleOffline (ClientBase *parent)
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 handleDiscoInfo (const JID &from, const Disco::Info &info, int context)
virtual void handleDiscoItems (const JID &from, const Disco::Items &items, int context)
virtual void handleDiscoError (const JID &from, const Error *error, int context)
virtual bool handleIq (const IQ &iq)
virtual void handleIqID (const IQ &iq, int context)
- Public Member Functions inherited from DiscoHandler
virtual ~DiscoHandler ()
virtual bool handleDiscoSet (const IQ &iq)
- Public Member Functions inherited from IqHandler
virtual ~IqHandler ()

Detailed Description

An implementation of XEP-0013 (Flexible Offline Message Retrieval).

Use the FlexibleOfflineHandler to receive results.

Author
Jakob Schroeter js@ca.nosp@m.maya.nosp@m..net
Since
0.7

Definition at line 34 of file flexoff.h.

Constructor & Destructor Documentation

FlexibleOffline ( ClientBase parent)

Creates a new FlexibleOffline object that manages retrieval of offline messages.

Parameters
parentThe ClientBase to use for communication.

Definition at line 68 of file flexoff.cpp.

~FlexibleOffline ( )
virtual

Virtual Destructor.

Definition at line 75 of file flexoff.cpp.

Member Function Documentation

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 81 of file flexoff.cpp.

void fetchHeaders ( )

Initiates fetching the offline message headers. The result is announced through the FlexibleOfflineHandler.

Definition at line 91 of file flexoff.cpp.

void fetchMessages ( const StringList msgs)
inline

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>).

Parameters
msgsA list of message nodes to fetch.

Definition at line 74 of file flexoff.h.

void getMsgCount ( )

Asks the server for the number of stored offline messages. The result is announced through the FlexibleOfflineHandler.

Definition at line 86 of file flexoff.cpp.

void handleDiscoError ( const JID from,
const Error error,
int  context 
)
virtual

Reimplement this function to receive disco error notifications.

Parameters
fromThe sender of the error result.
errorThe Error. May be 0.
contextA context identifier.
Since
1.0

Implements DiscoHandler.

Definition at line 145 of file flexoff.cpp.

void handleDiscoInfo ( const JID from,
const Disco::Info info,
int  context 
)
virtual

Reimplement this function if you want to be notified about the result of an disco::info query.

Parameters
fromThe sender of the disco::info result.
infoThe Info.
contextA context identifier.
Since
1.0

Implements DiscoHandler.

Definition at line 115 of file flexoff.cpp.

void handleDiscoItems ( const JID from,
const Disco::Items items,
int  context 
)
virtual

Reimplement this function if you want to be notified about the result of a disco::items query.

Parameters
fromThe sender of the disco::items result.
itemsThe Items.
contextA context identifier.
Since
1.0

Implements DiscoHandler.

Definition at line 136 of file flexoff.cpp.

virtual bool handleIq ( const IQ iq)
inlinevirtual

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

Parameters
iqThe complete IQ 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.
Since
1.0

Implements IqHandler.

Definition at line 108 of file flexoff.h.

void handleIqID ( const IQ iq,
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
iqThe complete IQ stanza.
contextA value to restore context, stored with ClientBase::trackID().
Note
Only IQ stanzas of type 'result' or 'error' can arrive here.
Since
1.0

Implements IqHandler.

Definition at line 149 of file flexoff.cpp.

void registerFlexibleOfflineHandler ( FlexibleOfflineHandler foh)

Registers a FlexibleOfflineHandler as object that receives results of XEP-0013 queries. Only one Handler at a time is possible.

Parameters
fohThe Handler object to register.

Definition at line 105 of file flexoff.cpp.

void removeFlexibleOfflineHandler ( )

Removes the registered handler.

Definition at line 110 of file flexoff.cpp.

void removeMessages ( const StringList msgs)
inline

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 83 of file flexoff.h.


The documentation for this class was generated from the following files: