QXmpp: QXmppPubSubMetadata.h Source File

QXmpp Version: 1.14.2

Loading...
Searching...
No Matches
QXmppPubSubMetadata.h
1// SPDX-FileCopyrightText: 2020 Linus Jahn <lnj@kaidan.im>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#ifndef QXMPPPUBSUBMETADATA_H
6#define QXMPPPUBSUBMETADATA_H
7
8#include "QXmppDataFormBase.h"
9#include "QXmppPubSubNodeConfig.h"
10
11#include <variant>
12
13class QXmppPubSubMetadataPrivate;
14
15class QXMPP_EXPORT QXmppPubSubMetadata : public QXmppExtensibleDataFormBase
16{
17public:
18 struct Unset { };
19 struct Max { };
20 using ItemLimit = std::variant<Unset, quint64, Max>;
21
22 QXmppPubSubMetadata();
23 QXmppPubSubMetadata(const QXmppPubSubMetadata &);
24 QXmppPubSubMetadata(QXmppPubSubMetadata &&);
25 ~QXmppPubSubMetadata();
26
27 QXmppPubSubMetadata &operator=(const QXmppPubSubMetadata &);
28 QXmppPubSubMetadata &operator=(QXmppPubSubMetadata &&);
29
30 QStringList contactJids() const;
31 void setContactJids(const QStringList &contactJids);
32
33 QDateTime creationDate() const;
34 void setCreationDate(const QDateTime &creationDate);
35
36 QString creatorJid() const;
37 void setCreatorJid(const QString &creatorJid);
38
39 QString description() const;
40 void setDescription(const QString &description);
41
42 QString language() const;
43 void setLanguage(const QString &language);
44
45 std::optional<QXmppPubSubNodeConfig::AccessModel> accessModel() const;
46 void setAccessModel(std::optional<QXmppPubSubNodeConfig::AccessModel> accessModel);
47
48 std::optional<QXmppPubSubNodeConfig::PublishModel> publishModel() const;
49 void setPublishModel(std::optional<QXmppPubSubNodeConfig::PublishModel> publishModel);
50
51 std::optional<quint64> numberOfSubscribers() const;
52 void setNumberOfSubscribers(const std::optional<quint64> &numberOfSubscribers);
53
54 QStringList ownerJids() const;
55 void setOwnerJids(const QStringList &ownerJids);
56
57 QStringList publisherJids() const;
58 void setPublisherJids(const QStringList &publisherJids);
59
60 QString title() const;
61 void setTitle(const QString &title);
62
63 QString type() const;
64 void setType(const QString &type);
65
66 ItemLimit maxItems() const;
67 void setMaxItems(ItemLimit maxItems);
68
69protected:
70 QString formType() const override;
71 bool parseField(const QXmppDataForm::Field &) override;
72 void serializeForm(QXmppDataForm &) const override;
73
74private:
75 QSharedDataPointer<QXmppPubSubMetadataPrivate> d;
76};
77
78#endif // QXMPPPUBSUBMETADATA_H
QXmppDataFormBase::formType
virtual QString formType() const =0
QXmppExtensibleDataFormBase
Definition QXmppDataFormBase.h:112
QXmppExtensibleDataFormBase::serializeForm
void serializeForm(QXmppDataForm &) const override
Definition QXmppDataFormBase.cpp:204
QXmppExtensibleDataFormBase::parseField
virtual bool parseField(const QXmppDataForm::Field &)
Definition QXmppDataFormBase.cpp:215