18 #include "adhocplugin.h"
20 #include "disconodehandler.h"
21 #include "discohandler.h"
22 #include "iqhandler.h"
23 #include "stanzaextension.h"
36 class AdhocCommandProvider;
156 : m_severity( sev ), m_note( note ) {}
173 const std::string&
content()
const {
return m_note; }
182 #ifdef ADHOC_COMMANDS_TEST
210 Command(
const std::string& node,
const std::string& sessionid,
Action action,
222 Command(
const std::string& node,
const std::string& sessionid,
Status status,
237 Command(
const std::string& node,
const std::string& sessionid,
Status status,
238 Action executeAction,
int allowedActions = Complete,
268 const std::string&
node()
const {
return m_node; }
274 const std::string&
sessionID()
const {
return m_sessionid; }
300 const NoteList&
notes()
const {
return m_notes; }
323 virtual const std::string& filterString()
const;
332 virtual Tag* tag()
const;
339 NoteList::const_iterator it = m_notes.begin();
340 for( ; it != m_notes.end(); ++it )
341 c->m_notes.push_back(
new Note( *(*it) ) );
344 c->m_sessionid = m_sessionid;
345 c->m_plugin = m_plugin ?
static_cast<AdhocPlugin*
>( m_plugin->clone() ) : 0;
346 c->m_action = m_action;
347 c->m_status = m_status;
348 c->m_actions = m_actions;
354 #ifdef ADHOC_COMMANDS_TEST
360 std::string m_sessionid;
385 void checkSupport(
const JID& remote,
AdhocHandler* ah,
int context = 0 );
394 void getCommands(
const JID& remote,
AdhocHandler* ah,
int context = 0 );
431 const std::string& name );
438 void removeAdhocCommandProvider(
const std::string& command );
441 virtual StringList handleDiscoNodeFeatures(
const JID& from,
const std::string& node );
445 const std::string& node );
448 virtual Disco::ItemList handleDiscoNodeItems(
const JID& from,
const JID& to,
const std::string& node );
451 virtual bool handleIq(
const IQ& iq );
454 virtual void handleIqID(
const IQ& iq,
int context );
457 virtual void handleDiscoInfo(
const JID& from,
const Disco::Info& info,
int context );
460 virtual void handleDiscoItems(
const JID& from,
const Disco::Items& items,
int context );
463 virtual void handleDiscoError(
const JID& from,
const Error* error,
int context );
469 typedef std::map<const std::string, AdhocCommandProvider*> AdhocCommandProviderMap;
470 AdhocCommandProviderMap m_adhocCommandProviders;
482 AdhocContext context;
487 typedef std::map<std::string, TrackStruct> AdhocTrackMap;
488 AdhocTrackMap m_adhocTrackMap;
489 util::Mutex m_adhocTrackMapMutex;
491 ClientBase* m_parent;
std::list< const Note * > NoteList
An abstraction of a Disco query element (from Service Discovery, XEP-0030) in the disco::items namesp...
virtual StanzaExtension * newInstance(const Tag *tag) const
std::list< Item * > ItemList
virtual StanzaExtension * clone() const
std::list< std::string > StringList
An abstraction of an IQ stanza.
std::list< Identity * > IdentityList
const std::string & node() const
Note(Severity sev, const std::string ¬e)
Severity severity() const
A virtual interface for an Ad-hoc Command users according to XEP-0050.
A stanza error abstraction implemented as a StanzaExtension.
An abstraction of an Adhoc Command element (from Adhoc Commands, XEP-0050) as a StanzaExtension.
const std::string & sessionID() const
Derived classes can be registered as NodeHandlers for certain nodes with the Disco object...
The namespace for the gloox library.
This class abstracts a stanza extension, which is usually an element in a specific namespace...
std::map< std::string, std::string > StringMap
const std::string & content() const
An abstraction of a Disco Info element (from Service Discovery, XEP-0030) as a StanzaExtension.
const AdhocPlugin * plugin() const
A virtual interface which can be reimplemented to receive IQ stanzas.
A virtual interface that enables objects to receive Service Discovery (XEP-0030) events.
A virtual interface for an Ad-hoc Command Provider according to XEP-0050.
void addNote(const Note *note)
GLOOX_DEPRECATED const AdhocPlugin * form() const
This class implements a provider for XEP-0050 (Ad-hoc Commands).
const NoteList & notes() const
This is the common base class for a Jabber/XMPP Client and a Jabber Component.
This is an abstraction of an XML element.
A base class for Adhoc Command plugins (DataForm, IO Data, ...).