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 )
virtual void handleIqID(const IQ &iq, int context)
std::string requestXML(const std::string &tag, const std::string &xmlns, PrivateXMLHandler *pxh)
std::string storeXML(const Tag *tag, PrivateXMLHandler *pxh)
void removeIDHandler(IqHandler *ih)
An abstraction of an IQ stanza.
void removeIqHandler(IqHandler *ih, int exttype)
PrivateXML(ClientBase *parent)
void registerIqHandler(IqHandler *ih, int exttype)
void addExtension(const StanzaExtension *se)
void registerStanzaExtension(StanzaExtension *ext)
bool removeStanzaExtension(int ext)
The namespace for the gloox library.
const std::string XMLNS_PRIVATE_XML
const std::string getID()
A virtual interface which can be reimplemented to store and receive private XML data.
const std::string & id() const
This is the common base class for a Jabber/XMPP Client and a Jabber Component.
const StanzaExtension * findExtension(int type) const
This is an abstraction of an XML element.