QXmpp  Version:0.4.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 <QUrl>
00030 #include <QXmlStreamWriter>
00031 
00032 class QDomElement;
00033 
00037 class QXmppBookmarkConference
00038 {
00039 public:
00040     QXmppBookmarkConference();
00041 
00042     bool autoJoin() const;
00043     void setAutoJoin(bool autoJoin);
00044 
00045     QString jid() const;
00046     void setJid(const QString &jid);
00047 
00048     QString name() const;
00049     void setName(const QString &name);
00050 
00051     QString nickName() const;
00052     void setNickName(const QString &nickName);
00053 
00054 private:
00055     bool m_autoJoin;
00056     QString m_jid;
00057     QString m_name;
00058     QString m_nickName;
00059 };
00060 
00064 class QXmppBookmarkUrl
00065 {
00066 public:
00067     QString name() const;
00068     void setName(const QString &name);
00069 
00070     QUrl url() const;
00071     void setUrl(const QUrl &url);
00072 
00073 private:
00074     QString m_name;
00075     QUrl m_url;
00076 };
00077 
00081 class QXmppBookmarkSet
00082 {
00083 public:
00084     QList<QXmppBookmarkConference> conferences() const;
00085     void setConferences(const QList<QXmppBookmarkConference> &conferences);
00086 
00087     QList<QXmppBookmarkUrl> urls() const;
00088     void setUrls(const QList<QXmppBookmarkUrl> &urls);
00089 
00091     static bool isBookmarkSet(const QDomElement &element);
00092     void parse(const QDomElement &element);
00093     void toXml(QXmlStreamWriter *writer) const;
00095 
00096 private:
00097     QList<QXmppBookmarkConference> m_conferences;
00098     QList<QXmppBookmarkUrl> m_urls;
00099 };
00100 
00101 #endif
 All Classes Functions Enumerations Enumerator Properties