adhoc.h

00001 /*
00002   Copyright (c) 2004-2005 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 
00015 #ifndef ADHOC_H__
00016 #define ADHOC_H__
00017 
00018 #include "adhoccommandprovider.h"
00019 #include "disconodehandler.h"
00020 #include "iqhandler.h"
00021 
00022 #include <string>
00023 #include <list>
00024 #include <map>
00025 
00026 namespace gloox
00027 {
00028 
00029   class ClientBase;
00030   class Disco;
00031   class Stanza;
00032 
00038   class GLOOX_EXPORT Adhoc : public DiscoNodeHandler, IqHandler
00039   {
00040     public:
00047       Adhoc( ClientBase *parent, Disco *disco );
00048 
00052       virtual ~Adhoc();
00053 
00054       // reimplemented from DiscoNodeHandler
00055       virtual StringList handleDiscoNodeFeatures( const std::string& node );
00056 
00057       // reimplemented from DiscoNodeHandler
00058       virtual StringMap handleDiscoNodeIdentities( const std::string& node, std::string& name );
00059 
00060       // reimplemented from DiscoNodeHandler
00061       virtual StringMap handleDiscoNodeItems( const std::string& node );
00062 
00063       // reimplemented from IqHandler
00064       virtual bool handleIq( Stanza *stanza );
00065 
00066       // reimplemented from IqHandler
00067       virtual bool handleIqID( Stanza * /*stanza*/, int /*context*/ ) { return false; };
00068 
00076       void registerAdhocCommandProvider( AdhocCommandProvider *acp, const std::string& command,
00077                                          const std::string& name );
00078 
00079     private:
00080       typedef std::map<const std::string, AdhocCommandProvider*> AdhocCommandProviderMap;
00081 
00082       ClientBase *m_parent;
00083       Disco *m_disco;
00084 
00085       AdhocCommandProviderMap m_adhocCommandProviders;
00086       StringMap m_items;
00087 
00088   };
00089 
00090 }
00091 
00092 #endif // ADHOC_H__

Generated on Mon Jan 16 16:19:54 2006 for gloox by  doxygen 1.4.6