Loading...
Searching...
No Matches
QXmppBookmarkSet.h
// SPDX-FileCopyrightText: 2012 Jeremy Lainé <jeremy.laine@m4x.org>
//
// SPDX-License-Identifier: LGPL-2.1-or-later
#ifndef QXMPPBOOKMARKSET_H
#define QXMPPBOOKMARKSET_H
#include "QXmppConstants_p.h"
#include "QXmppStanza.h"
#include <QList>
#include <QUrl>
class QXMPP_EXPORT QXmppBookmarkConference
{
public:
QXmppBookmarkConference();
bool autoJoin() const;
void setAutoJoin(bool autoJoin);
QString jid() const;
void setJid(const QString &jid);
QString name() const;
void setName(const QString &name);
QString nickName() const;
void setNickName(const QString &nickName);
static constexpr std::tuple XmlTag = { u"conference", QXmpp::Private::ns_bookmarks };
static std::optional<QXmppBookmarkConference> fromDom(const QDomElement &el);
void toXml(QXmlStreamWriter *writer) const;
private:
bool m_autoJoin;
QString m_jid;
QString m_name;
QString m_nickName;
};
class QXMPP_EXPORT QXmppBookmarkUrl
{
public:
QString name() const;
void setName(const QString &name);
QUrl url() const;
void setUrl(const QUrl &url);
static constexpr std::tuple XmlTag = { u"url", QXmpp::Private::ns_bookmarks };
static std::optional<QXmppBookmarkUrl> fromDom(const QDomElement &el);
void toXml(QXmlStreamWriter *writer) const;
private:
QString m_name;
QUrl m_url;
};
class QXMPP_EXPORT QXmppBookmarkSet
{
public:
QList<QXmppBookmarkConference> conferences() const;
void setConferences(const QList<QXmppBookmarkConference> &conferences);
QList<QXmppBookmarkUrl> urls() const;
void setUrls(const QList<QXmppBookmarkUrl> &urls);
static bool isBookmarkSet(const QDomElement &element);
static constexpr std::tuple XmlTag = { u"storage", QXmpp::Private::ns_bookmarks };
void parse(const QDomElement &element);
void toXml(QXmlStreamWriter *writer) const;
private:
QList<QXmppBookmarkConference> m_conferences;
QList<QXmppBookmarkUrl> m_urls;
};
#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