15 #include "bookmarkstorage.h"
16 #include "clientbase.h"
24 m_bookmarkHandler( 0 )
34 Tag* s =
new Tag(
"storage" );
37 BookmarkList::const_iterator itb = bList.begin();
38 for( ; itb != bList.end(); ++itb )
40 Tag* i =
new Tag( s,
"url",
"name", (*itb).
name );
44 ConferenceList::const_iterator itc = cList.begin();
45 for( ; itc != cList.end(); ++itc )
47 Tag* i =
new Tag( s,
"conference",
"name", (*itc).
name );
49 i->
addAttribute(
"autojoin", (*itc).autojoin ?
"true" :
"false" );
51 new Tag( i,
"nick", (*itc).nick );
52 new Tag( i,
"password", (*itc).password );
71 TagList::const_iterator it = l.begin();
72 for( ; it != l.end(); ++it )
74 if( (*it)->name() ==
"url" )
76 const std::string& url = (*it)->findAttribute(
"url" );
77 const std::string& name = (*it)->findAttribute(
"name" );
84 bList.push_back( item );
87 else if( (*it)->name() ==
"conference" )
89 const std::string& jid = (*it)->findAttribute(
"jid" );
90 const std::string& name = (*it)->findAttribute(
"name" );
94 const std::string& join = (*it)->findAttribute(
"autojoin" );
104 item.
autojoin = ( join ==
"true" || join ==
"1" );
105 cList.push_back( item );
110 if( m_bookmarkHandler )
virtual void handleBookmarks(const BookmarkList &bList, const ConferenceList &cList)=0
void storeBookmarks(const BookmarkList &bList, const ConferenceList &cList)
virtual ~BookmarkStorage()
virtual void handlePrivateXML(const Tag *xml)
BookmarkStorage(ClientBase *parent)
virtual void handlePrivateXMLResult(const std::string &uid, PrivateXMLResult pxResult)
This is the common base class for a Jabber/XMPP Client and a Jabber Component.
This class implements XEP-0049 (Private XML Storage).
std::string requestXML(const std::string &tag, const std::string &xmlns, PrivateXMLHandler *pxh)
std::string storeXML(const Tag *tag, PrivateXMLHandler *pxh)
This is an abstraction of an XML element.
Tag * findChild(const std::string &name) const
bool addAttribute(Attribute *attr)
const std::string cdata() const
const std::string & name() const
const TagList & children() const
The namespace for the gloox library.
std::list< Tag * > TagList
std::list< BookmarkListItem > BookmarkList
const std::string XMLNS_BOOKMARKS
std::list< ConferenceListItem > ConferenceList