QXmpp  Version:0.7.3
 All Classes Functions Variables Enumerations Enumerator Properties Groups
QXmppBookmarkSet.h
1 /*
2  * Copyright (C) 2008-2012 The QXmpp developers
3  *
4  * Author:
5  * Jeremy LainĂ©
6  *
7  * Source:
8  * http://code.google.com/p/qxmpp
9  *
10  * This file is a part of QXmpp library.
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public
14  * License as published by the Free Software Foundation; either
15  * version 2.1 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * Lesser General Public License for more details.
21  *
22  */
23 
24 #ifndef QXMPPBOOKMARKSET_H
25 #define QXMPPBOOKMARKSET_H
26 
27 #include <QList>
28 #include <QString>
29 #include <QUrl>
30 #include <QXmlStreamWriter>
31 
32 #include "QXmppGlobal.h"
33 
34 class QDomElement;
35 
39 class QXMPP_EXPORT QXmppBookmarkConference
40 {
41 public:
43 
44  bool autoJoin() const;
45  void setAutoJoin(bool autoJoin);
46 
47  QString jid() const;
48  void setJid(const QString &jid);
49 
50  QString name() const;
51  void setName(const QString &name);
52 
53  QString nickName() const;
54  void setNickName(const QString &nickName);
55 
56 private:
57  bool m_autoJoin;
58  QString m_jid;
59  QString m_name;
60  QString m_nickName;
61 };
62 
66 class QXMPP_EXPORT QXmppBookmarkUrl
67 {
68 public:
69  QString name() const;
70  void setName(const QString &name);
71 
72  QUrl url() const;
73  void setUrl(const QUrl &url);
74 
75 private:
76  QString m_name;
77  QUrl m_url;
78 };
79 
83 class QXMPP_EXPORT QXmppBookmarkSet
84 {
85 public:
86  QList<QXmppBookmarkConference> conferences() const;
87  void setConferences(const QList<QXmppBookmarkConference> &conferences);
88 
89  QList<QXmppBookmarkUrl> urls() const;
90  void setUrls(const QList<QXmppBookmarkUrl> &urls);
91 
93  static bool isBookmarkSet(const QDomElement &element);
94  void parse(const QDomElement &element);
95  void toXml(QXmlStreamWriter *writer) const;
97 
98 private:
99  QList<QXmppBookmarkConference> m_conferences;
100  QList<QXmppBookmarkUrl> m_urls;
101 };
102 
103 #endif