QXmpp Version: 1.5.6
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 {
20 };
21 struct Max
22 {
23 };
24 using ItemLimit = std::variant<Unset, quint64, Max>;
25
26 QXmppPubSubMetadata();
27 QXmppPubSubMetadata(const QXmppPubSubMetadata &);
28 QXmppPubSubMetadata(QXmppPubSubMetadata &&);
29 ~QXmppPubSubMetadata();
30
31 QXmppPubSubMetadata &operator=(const QXmppPubSubMetadata &);
32 QXmppPubSubMetadata &operator=(QXmppPubSubMetadata &&);
33
34 QStringList contactJids() const;
35 void setContactJids(const QStringList &contactJids);
36
37 QDateTime creationDate() const;
38 void setCreationDate(const QDateTime &creationDate);
39
40 QString creatorJid() const;
41 void setCreatorJid(const QString &creatorJid);
42
43 QString description() const;
44 void setDescription(const QString &description);
45
46 QString language() const;
47 void setLanguage(const QString &language);
48
49 std::optional<QXmppPubSubNodeConfig::AccessModel> accessModel() const;
50 void setAccessModel(std::optional<QXmppPubSubNodeConfig::AccessModel> accessModel);
51
52 std::optional<QXmppPubSubNodeConfig::PublishModel> publishModel() const;
53 void setPublishModel(std::optional<QXmppPubSubNodeConfig::PublishModel> publishModel);
54
55 std::optional<quint64> numberOfSubscribers() const;
56 void setNumberOfSubscribers(const std::optional<quint64> &numberOfSubscribers);
57
58 QStringList ownerJids() const;
59 void setOwnerJids(const QStringList &ownerJids);
60
61 QStringList publisherJids() const;
62 void setPublisherJids(const QStringList &publisherJids);
63
64 QString title() const;
65 void setTitle(const QString &title);
66
67 QString type() const;
68 void setType(const QString &type);
69
70 ItemLimit maxItems() const;
71 void setMaxItems(ItemLimit maxItems);
72
73protected:
74 QString formType() const override;
75 bool parseField(const QXmppDataForm::Field &) override;
76 void serializeForm(QXmppDataForm &) const override;
77
78private:
79 QSharedDataPointer<QXmppPubSubMetadataPrivate> d;
80};
81
82#endif // QXMPPPUBSUBMETADATA_H
virtual QString formType() const =0
Definition QXmppDataForm.h:89
Definition QXmppDataForm.h:27
Definition QXmppDataFormBase.h:99
void serializeForm(QXmppDataForm &) const override
Definition QXmppDataFormBase.cpp:202
virtual bool parseField(const QXmppDataForm::Field &)
Definition QXmppDataFormBase.cpp:213