QXmpp Version: 1.15.0
Loading...
Searching...
No Matches
QXmppBookmarkSet.h
1// SPDX-FileCopyrightText: 2012 Jeremy Lainé <jeremy.laine@m4x.org>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPBOOKMARKSET_H
6#define QXMPPBOOKMARKSET_H
7
8#include "QXmppConstants_p.h"
9#include "QXmppStanza.h"
10
11#include <QList>
12#include <QUrl>
13
18class QXMPP_EXPORT QXmppBookmarkConference
19{
20public:
22
23 bool autoJoin() const;
24 void setAutoJoin(bool autoJoin);
25
26 QString jid() const;
27 void setJid(const QString &jid);
28
29 QString name() const;
30 void setName(const QString &name);
31
32 QString nickName() const;
33 void setNickName(const QString &nickName);
34
36 static constexpr std::tuple XmlTag = { u"conference", QXmpp::Private::ns_bookmarks };
37 static std::optional<QXmppBookmarkConference> fromDom(const QDomElement &el);
38 void toXml(QXmlStreamWriter *writer) const;
40
41private:
42 bool m_autoJoin;
43 QString m_jid;
44 QString m_name;
45 QString m_nickName;
46};
47
52class QXMPP_EXPORT QXmppBookmarkUrl
53{
54public:
55 QString name() const;
56 void setName(const QString &name);
57
58 QUrl url() const;
59 void setUrl(const QUrl &url);
60
62 static constexpr std::tuple XmlTag = { u"url", QXmpp::Private::ns_bookmarks };
63 static std::optional<QXmppBookmarkUrl> fromDom(const QDomElement &el);
64 void toXml(QXmlStreamWriter *writer) const;
66
67private:
68 QString m_name;
69 QUrl m_url;
70};
71
76class QXMPP_EXPORT QXmppBookmarkSet
77{
78public:
79 QList<QXmppBookmarkConference> conferences() const;
80 void setConferences(const QList<QXmppBookmarkConference> &conferences);
81
82 QList<QXmppBookmarkUrl> urls() const;
83 void setUrls(const QList<QXmppBookmarkUrl> &urls);
84
86 static bool isBookmarkSet(const QDomElement &element);
87 static constexpr std::tuple XmlTag = { u"storage", QXmpp::Private::ns_bookmarks };
88 void parse(const QDomElement &element);
89 void toXml(QXmlStreamWriter *writer) const;
91
92private:
93 QList<QXmppBookmarkConference> m_conferences;
94 QList<QXmppBookmarkUrl> m_urls;
95};
96
97#endif
QXmppBookmarkConference()
Constructs a new conference room bookmark.
Definition QXmppBookmarkSet.cpp:18
QString nickName() const
Returns the preferred nickname for the conference room.
Definition QXmppBookmarkSet.cpp:62
QString jid() const
Returns the JID of the conference room.
Definition QXmppBookmarkSet.cpp:38
QString name() const
Returns the friendly name for the bookmark.
Definition QXmppBookmarkSet.cpp:50
void setJid(const QString &jid)
Sets the JID of the conference room.
Definition QXmppBookmarkSet.cpp:44
void setNickName(const QString &nickName)
Sets the preferred nickname for the conference room.
Definition QXmppBookmarkSet.cpp:68
void setAutoJoin(bool autoJoin)
Definition QXmppBookmarkSet.cpp:32
void setName(const QString &name)
Sets the friendly name for the bookmark.
Definition QXmppBookmarkSet.cpp:56
bool autoJoin() const
Definition QXmppBookmarkSet.cpp:25
The QXmppbookmarkSets class represents a set of bookmarks, as defined by XEP-0048: Bookmarks.
Definition QXmppBookmarkSet.h:77
QList< QXmppBookmarkConference > conferences() const
Returns the conference rooms bookmarks in this bookmark set.
Definition QXmppBookmarkSet.cpp:140
void setUrls(const QList< QXmppBookmarkUrl > &urls)
Sets the web page bookmarks in this bookmark set.
Definition QXmppBookmarkSet.cpp:158
void setConferences(const QList< QXmppBookmarkConference > &conferences)
Sets the conference rooms bookmarks in this bookmark set.
Definition QXmppBookmarkSet.cpp:146
QList< QXmppBookmarkUrl > urls() const
Returns the web page bookmarks in this bookmark set.
Definition QXmppBookmarkSet.cpp:152
The QXmppBookmarkUrl class represents a bookmark for a web page, as defined by XEP-0048: Bookmarks.
Definition QXmppBookmarkSet.h:53
void setUrl(const QUrl &url)
Sets the URL for the web page.
Definition QXmppBookmarkSet.cpp:115
QString name() const
Returns the friendly name for the bookmark.
Definition QXmppBookmarkSet.cpp:97
QUrl url() const
Returns the URL for the web page.
Definition QXmppBookmarkSet.cpp:109
void setName(const QString &name)
Sets the friendly name for the bookmark.
Definition QXmppBookmarkSet.cpp:103