14 #include "privatexml.h"
15 #include "clientbase.h"
22 PrivateXML::Query::Query(
const Tag* tag )
30 if( tag->children().size() )
31 m_privateXML = tag->children().front()->clone();
37 const std::string& PrivateXML::Query::filterString()
const
39 static const std::string filter =
"/iq/query[@xmlns='" +
XMLNS_PRIVATE_XML +
"']";
43 Tag* PrivateXML::Query::tag()
const
45 Tag* t =
new Tag(
"query" );
48 t->addChild( m_privateXML->clone() );
77 const std::string&
id = m_parent->
getID();
83 m_parent->
send( iq,
this, RequestXml );
90 const std::string&
id = m_parent->
getID();
96 m_parent->
send( iq,
this, StoreXml );
103 TrackMap::iterator t = m_track.find( iq.
id() );
104 if( t == m_track.end() )
109 if( context == RequestXml )
113 (*t).second->handlePrivateXML( q->privateXML() );
115 else if( context == StoreXml )
120 if( context == RequestXml )
122 else if( context == StoreXml )
const std::string getID()
bool removeStanzaExtension(int ext)
const std::string XMLNS_PRIVATE_XML
std::string storeXML(const Tag *tag, PrivateXMLHandler *pxh)
void addExtension(const StanzaExtension *se)
const StanzaExtension * findExtension(int type) const
virtual void handleIqID(const IQ &iq, int context)
A virtual interface which can be reimplemented to store and receive private XML data.
The namespace for the gloox library.
This is an abstraction of an XML element.
An abstraction of an IQ stanza.
This is the common base class for a Jabber/XMPP Client and a Jabber Component.
const std::string & id() const
void registerIqHandler(IqHandler *ih, int exttype)
void registerStanzaExtension(StanzaExtension *ext)
void removeIDHandler(IqHandler *ih)
void removeIqHandler(IqHandler *ih, int exttype)
PrivateXML(ClientBase *parent)
std::string requestXML(const std::string &tag, const std::string &xmlns, PrivateXMLHandler *pxh)