00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef FLEXOFF_H__
00015 #define FLEXOFF_H__
00016
00017 #include "clientbase.h"
00018 #include "disco.h"
00019 #include "discohandler.h"
00020 #include "flexoffhandler.h"
00021 #include "iqhandler.h"
00022
00023 namespace gloox
00024 {
00025
00033 class GLOOX_API FlexibleOffline : public DiscoHandler, IqHandler
00034 {
00035 public:
00041 FlexibleOffline( ClientBase *parent, Disco *disco );
00042
00046 virtual ~FlexibleOffline();
00047
00053 void checkSupport();
00054
00059 void getMsgCount();
00060
00065 void fetchHeaders();
00066
00074 void fetchMessages( const StringList& msgs );
00075
00082 void removeMessages( const StringList& msgs );
00083
00089 void registerFlexibleOfflineHandler( FlexibleOfflineHandler *foh );
00090
00094 void removeFlexibleOfflineHandler();
00095
00096
00097 virtual void handleDiscoInfoResult( Stanza *stanza, int context );
00098
00099
00100 virtual void handleDiscoItemsResult( Stanza *stanza, int context );
00101
00102
00103 virtual void handleDiscoError( Stanza *stanza, int context );
00104
00105
00106 virtual bool handleIqID( Stanza *stanza, int context );
00107
00108
00109 virtual bool handleIq( Stanza *stanza );
00110
00111 private:
00112 enum FOContext
00113 {
00114 FO_CHECK_SUPPORT,
00115 FO_REQUEST_NUM,
00116 FO_REQUEST_HEADERS,
00117 FO_REQUEST_MSGS,
00118 FO_REMOVE_MSGS
00119 };
00120
00121 ClientBase *m_parent;
00122 Disco *m_disco;
00123 FlexibleOfflineHandler *m_flexibleOfflineHandler;
00124 };
00125
00126 }
00127
00128 #endif // FLEXOFF_H__