5#ifndef QXMPPPUBSUBNODECONFIG_H
6#define QXMPPPUBSUBNODECONFIG_H
8#include "QXmppDataForm.h"
9#include "QXmppDataFormBase.h"
13class QXmppPubSubNodeConfigPrivate;
20 using ItemLimit = std::variant<Unset, uint64_t, Max>;
22 enum AccessModel : uint8_t {
29 static std::optional<AccessModel> accessModelFromString(
const QString &);
30 static QString accessModelToString(AccessModel);
32 enum PublishModel : uint8_t {
37 static std::optional<PublishModel> publishModelFromString(
const QString &);
38 static QString publishModelToString(PublishModel);
40 enum class ChildAssociationPolicy : uint8_t {
45 static std::optional<ChildAssociationPolicy> childAssociatationPolicyFromString(
const QString &);
46 static QString childAssociationPolicyToString(ChildAssociationPolicy);
48 enum ItemPublisher : uint8_t {
52 static std::optional<ItemPublisher> itemPublisherFromString(
const QString &);
53 static QString itemPublisherToString(ItemPublisher);
55 enum NodeType : uint8_t {
59 static std::optional<NodeType> nodeTypeFromString(
const QString &);
60 static QString nodeTypeToString(NodeType);
62 enum NotificationType : uint8_t {
66 static std::optional<NotificationType> notificationTypeFromString(
const QString &);
67 static QString notificationTypeToString(NotificationType);
69 enum SendLastItemType : uint8_t {
72 OnSubscriptionAndPresence
74 static std::optional<SendLastItemType> sendLastItemTypeFromString(
const QString &);
75 static QString sendLastItemTypeToString(SendLastItemType);
79 QXmppPubSubNodeConfig();
80 QXmppPubSubNodeConfig(
const QXmppPubSubNodeConfig &);
81 QXmppPubSubNodeConfig(QXmppPubSubNodeConfig &&);
82 ~QXmppPubSubNodeConfig()
override;
84 QXmppPubSubNodeConfig &operator=(
const QXmppPubSubNodeConfig &);
85 QXmppPubSubNodeConfig &operator=(QXmppPubSubNodeConfig &&);
87 std::optional<AccessModel> accessModel()
const;
88 void setAccessModel(std::optional<AccessModel> accessModel);
90 QString bodyXslt()
const;
91 void setBodyXslt(
const QString &bodyXslt);
93 std::optional<ChildAssociationPolicy> childAssociationPolicy()
const;
94 void setChildAssociationPolicy(std::optional<ChildAssociationPolicy> childAssociationPolicy);
96 QStringList childAssociationAllowlist()
const;
97 void setChildAssociationAllowlist(
const QStringList &childAssociationWhitelist);
99 QStringList childNodes()
const;
100 void setChildNodes(
const QStringList &childNodes);
102 std::optional<quint32> childNodesMax()
const;
103 void setChildNodesMax(std::optional<quint32> childNodesMax);
105 QStringList collections()
const;
106 void setCollections(
const QStringList &collections);
108 QStringList contactJids()
const;
109 void setContactJids(
const QStringList &contactJids);
111 QString dataFormXslt()
const;
112 void setDataFormXslt(
const QString &dataFormXslt);
114 std::optional<bool> notificationsEnabled()
const;
115 void setNotificationsEnabled(std::optional<bool> notificationsEnabled);
117 std::optional<bool> includePayloads()
const;
118 void setIncludePayloads(std::optional<bool> includePayloads);
120 QString description()
const;
121 void setDescription(
const QString &description);
123 std::optional<quint32> itemExpiry()
const;
124 void setItemExpiry(std::optional<quint32> itemExpiry);
126 std::optional<ItemPublisher> notificationItemPublisher()
const;
127 void setNotificationItemPublisher(std::optional<ItemPublisher> notificationItemPublisher);
129 QString language()
const;
130 void setLanguage(
const QString &language);
132 ItemLimit maxItems()
const;
133 void setMaxItems(ItemLimit maxItems);
134 inline void resetMaxItems() { setMaxItems(Unset()); }
136 std::optional<quint32> maxPayloadSize()
const;
137 void setMaxPayloadSize(std::optional<quint32> maxPayloadSize);
139 std::optional<NodeType> nodeType()
const;
140 void setNodeType(std::optional<NodeType> nodeType);
142 std::optional<QXmppPubSubNodeConfig::NotificationType> notificationType()
const;
143 void setNotificationType(std::optional<QXmppPubSubNodeConfig::NotificationType> notificationType);
145 std::optional<bool> configNotificationsEnabled()
const;
146 void setConfigNotificationsEnabled(std::optional<bool> configNotificationsEnabled);
148 std::optional<bool> deleteNotificationsEnabled()
const;
149 void setDeleteNotificationsEnabled(std::optional<bool> nodeDeleteNotificationsEnabled);
151 std::optional<bool> retractNotificationsEnabled()
const;
152 void setRetractNotificationsEnabled(std::optional<bool> retractNotificationsEnabled);
154 std::optional<bool> subNotificationsEnabled()
const;
155 void setSubNotificationsEnabled(std::optional<bool> subNotificationsEnabled);
157 std::optional<bool> persistItems()
const;
158 void setPersistItems(std::optional<bool> persistItems);
160 std::optional<bool> presenceBasedNotifications()
const;
161 void setPresenceBasedNotifications(std::optional<bool> presenceBasedNotifications);
163 std::optional<PublishModel> publishModel()
const;
164 void setPublishModel(std::optional<PublishModel> publishModel);
166 std::optional<bool> purgeWhenOffline()
const;
167 void setPurgeWhenOffline(std::optional<bool> purgeWhenOffline);
169 QStringList allowedRosterGroups()
const;
170 void setAllowedRosterGroups(
const QStringList &allowedRosterGroups);
172 std::optional<SendLastItemType> sendLastItem()
const;
173 void setSendLastItem(std::optional<SendLastItemType> sendLastItem);
175 std::optional<bool> temporarySubscriptions()
const;
176 void setTemporarySubscriptions(std::optional<bool> temporarySubscriptions);
178 std::optional<bool> allowSubscriptions()
const;
179 void setAllowSubscriptions(std::optional<bool> allowSubscriptions);
181 QString title()
const;
182 void setTitle(
const QString &title);
184 QString payloadType()
const;
185 void setPayloadType(
const QString &payloadType);
193 QSharedDataPointer<QXmppPubSubNodeConfigPrivate> d;
196class QXMPP_EXPORT QXmppPubSubPublishOptions :
public QXmppPubSubNodeConfig
205Q_DECLARE_METATYPE(QXmppPubSubNodeConfig);
206Q_DECLARE_METATYPE(QXmppPubSubPublishOptions);