flexoff.h

00001 /*
00002   Copyright (c) 2005-2006 by Jakob Schroeter <js@camaya.net>
00003   This file is part of the gloox library. http://camaya.net/gloox
00004 
00005   This software is distributed under a license. The full license
00006   agreement can be found in the file LICENSE in this distribution.
00007   This software may not be copied, modified, sold or distributed
00008   other than expressed in the named license agreement.
00009 
00010   This software is distributed without any warranty.
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       // reimplemented from DiscoHandler
00097       virtual void handleDiscoInfoResult( Stanza *stanza, int context );
00098 
00099       // reimplemented from DiscoHandler
00100       virtual void handleDiscoItemsResult( Stanza *stanza, int context );
00101 
00102       // reimplemented from DiscoHandler
00103       virtual void handleDiscoError( Stanza *stanza, int context );
00104 
00105       // reimplemented from IqHandler
00106       virtual bool handleIqID( Stanza *stanza, int context );
00107 
00108       // reimplemented from IqHandler
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__

Generated on Tue May 1 14:20:20 2007 for gloox by  doxygen 1.5.1