QXmpp Version:0.3.0
QXmppBookmarkSet.h
00001 /*
00002  * Copyright (C) 2008-2011 The QXmpp developers
00003  *
00004  * Author:
00005  *  Jeremy Lainé
00006  *
00007  * Source:
00008  *  http://code.google.com/p/qxmpp
00009  *
00010  * This file is a part of QXmpp library.
00011  *
00012  * This library is free software; you can redistribute it and/or
00013  * modify it under the terms of the GNU Lesser General Public
00014  * License as published by the Free Software Foundation; either
00015  * version 2.1 of the License, or (at your option) any later version.
00016  *
00017  * This library is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020  * Lesser General Public License for more details.
00021  *
00022  */
00023 
00024 #ifndef QXMPPBOOKMARKSET_H
00025 #define QXMPPBOOKMARKSET_H
00026 
00027 #include <QList>
00028 #include <QString>
00029 #include <QXmlStreamWriter>
00030 
00031 class QDomElement;
00032 
00036 class QXmppBookmarkConference
00037 {
00038 public:
00039     QXmppBookmarkConference();
00040 
00041     bool autoJoin() const;
00042     void setAutoJoin(bool autoJoin);
00043 
00044     QString jid() const;
00045     void setJid(const QString &jid);
00046 
00047     QString name() const;
00048     void setName(const QString &name);
00049 
00050     QString nickName() const;
00051     void setNickName(const QString &nickName);
00052 
00053 private:
00054     bool m_autoJoin;
00055     QString m_jid;
00056     QString m_name;
00057     QString m_nickName;
00058 };
00059 
00063 class QXmppBookmarkUrl
00064 {
00065 public:
00066     QString name() const;
00067     void setName(const QString &name);
00068 
00069     QString url() const;
00070     void setUrl(const QString &url);
00071 
00072 private:
00073     QString m_name;
00074     QString m_url;
00075 };
00076 
00080 class QXmppBookmarkSet
00081 {
00082 public:
00083     QList<QXmppBookmarkConference> conferences() const;
00084     void setConferences(const QList<QXmppBookmarkConference> &conferences);
00085 
00086     QList<QXmppBookmarkUrl> urls() const;
00087     void setUrls(const QList<QXmppBookmarkUrl> &urls);
00088 
00090     static bool isBookmarkSet(const QDomElement &element);
00091     void parse(const QDomElement &element);
00092     void toXml(QXmlStreamWriter *writer) const;
00094 
00095 private:
00096     QList<QXmppBookmarkConference> m_conferences;
00097     QList<QXmppBookmarkUrl> m_urls;
00098 };
00099 
00100 #endif
 All Classes Functions Enumerations Enumerator Properties