QXmpp: QXmppBookmarkSet.h Source File

QXmpp Version: 1.14.4

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
18 class QXMPP_EXPORT QXmppBookmarkConference
19{
20public:
21 QXmppBookmarkConference();
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
52 class 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
76 class 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::QXmppBookmarkConference
QXmppBookmarkConference()
Constructs a new conference room bookmark.
Definition QXmppBookmarkSet.cpp:18
QXmppBookmarkConference::nickName
QString nickName() const
Returns the preferred nickname for the conference room.
Definition QXmppBookmarkSet.cpp:62
QXmppBookmarkConference::jid
QString jid() const
Returns the JID of the conference room.
Definition QXmppBookmarkSet.cpp:38
QXmppBookmarkConference::name
QString name() const
Returns the friendly name for the bookmark.
Definition QXmppBookmarkSet.cpp:50
QXmppBookmarkConference::setJid
void setJid(const QString &jid)
Sets the JID of the conference room.
Definition QXmppBookmarkSet.cpp:44
QXmppBookmarkConference::setNickName
void setNickName(const QString &nickName)
Sets the preferred nickname for the conference room.
Definition QXmppBookmarkSet.cpp:68
QXmppBookmarkConference::setAutoJoin
void setAutoJoin(bool autoJoin)
Definition QXmppBookmarkSet.cpp:32
QXmppBookmarkConference::setName
void setName(const QString &name)
Sets the friendly name for the bookmark.
Definition QXmppBookmarkSet.cpp:56
QXmppBookmarkConference::autoJoin
bool autoJoin() const
Definition QXmppBookmarkSet.cpp:25
QXmppBookmarkSet
The QXmppbookmarkSets class represents a set of bookmarks, as defined by XEP-0048: Bookmarks.
Definition QXmppBookmarkSet.h:77
QXmppBookmarkSet::conferences
QList< QXmppBookmarkConference > conferences() const
Returns the conference rooms bookmarks in this bookmark set.
Definition QXmppBookmarkSet.cpp:140
QXmppBookmarkSet::setUrls
void setUrls(const QList< QXmppBookmarkUrl > &urls)
Sets the web page bookmarks in this bookmark set.
Definition QXmppBookmarkSet.cpp:158
QXmppBookmarkSet::setConferences
void setConferences(const QList< QXmppBookmarkConference > &conferences)
Sets the conference rooms bookmarks in this bookmark set.
Definition QXmppBookmarkSet.cpp:146
QXmppBookmarkSet::urls
QList< QXmppBookmarkUrl > urls() const
Returns the web page bookmarks in this bookmark set.
Definition QXmppBookmarkSet.cpp:152
QXmppBookmarkUrl
The QXmppBookmarkUrl class represents a bookmark for a web page, as defined by XEP-0048: Bookmarks.
Definition QXmppBookmarkSet.h:53
QXmppBookmarkUrl::setUrl
void setUrl(const QUrl &url)
Sets the URL for the web page.
Definition QXmppBookmarkSet.cpp:115
QXmppBookmarkUrl::name
QString name() const
Returns the friendly name for the bookmark.
Definition QXmppBookmarkSet.cpp:97
QXmppBookmarkUrl::url
QUrl url() const
Returns the URL for the web page.
Definition QXmppBookmarkSet.cpp:109
QXmppBookmarkUrl::setName
void setName(const QString &name)
Sets the friendly name for the bookmark.
Definition QXmppBookmarkSet.cpp:103