adhoc.h

00001 /*
00002   Copyright (c) 2004-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 
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 
00072   class GLOOX_API Adhoc : public DiscoNodeHandler, IqHandler
00073   {
00074     public:
00081       Adhoc( ClientBase *parent, Disco *disco );
00082 
00086       virtual ~Adhoc();
00087 
00088       // reimplemented from DiscoNodeHandler
00089       virtual StringList handleDiscoNodeFeatures( const std::string& node );
00090 
00091       // reimplemented from DiscoNodeHandler
00092       virtual StringMap handleDiscoNodeIdentities( const std::string& node, std::string& name );
00093 
00094       // reimplemented from DiscoNodeHandler
00095       virtual StringMap handleDiscoNodeItems( const std::string& node );
00096 
00097       // reimplemented from IqHandler
00098       virtual bool handleIq( Stanza *stanza );
00099 
00100       // reimplemented from IqHandler
00101       virtual bool handleIqID( Stanza *stanza, int context );
00102 
00110       void registerAdhocCommandProvider( AdhocCommandProvider *acp, const std::string& command,
00111                                          const std::string& name );
00112 
00118       void removeAdhocCommandProvider( const std::string& command );
00119 
00120     private:
00121       typedef std::map<const std::string, AdhocCommandProvider*> AdhocCommandProviderMap;
00122 
00123       ClientBase *m_parent;
00124       Disco *m_disco;
00125 
00126       AdhocCommandProviderMap m_adhocCommandProviders;
00127       StringMap m_items;
00128 
00129   };
00130 
00131 }
00132 
00133 #endif // ADHOC_H__

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