5#ifndef QXMPPPUBSUBNODECONFIG_H
6#define QXMPPPUBSUBNODECONFIG_H
8#include "QXmppDataForm.h"
9#include "QXmppDataFormBase.h"
13class QXmppPubSubNodeConfigPrivate;
24 using ItemLimit = std::variant<Unset, uint64_t, Max>;
26 enum AccessModel : uint8_t {
33 static std::optional<AccessModel> accessModelFromString(
const QString &);
34 static QString accessModelToString(AccessModel);
36 enum PublishModel : uint8_t {
41 static std::optional<PublishModel> publishModelFromString(
const QString &);
42 static QString publishModelToString(PublishModel);
44 enum class ChildAssociationPolicy : uint8_t {
49 static std::optional<ChildAssociationPolicy> childAssociatationPolicyFromString(
const QString &);
50 static QString childAssociationPolicyToString(ChildAssociationPolicy);
52 enum ItemPublisher : uint8_t {
56 static std::optional<ItemPublisher> itemPublisherFromString(
const QString &);
57 static QString itemPublisherToString(ItemPublisher);
59 enum NodeType : uint8_t {
63 static std::optional<NodeType> nodeTypeFromString(
const QString &);
64 static QString nodeTypeToString(NodeType);
66 enum NotificationType : uint8_t {
70 static std::optional<NotificationType> notificationTypeFromString(
const QString &);
71 static QString notificationTypeToString(NotificationType);
73 enum SendLastItemType : uint8_t {
76 OnSubscriptionAndPresence
78 static std::optional<SendLastItemType> sendLastItemTypeFromString(
const QString &);
79 static QString sendLastItemTypeToString(SendLastItemType);
83 QXmppPubSubNodeConfig();
84 QXmppPubSubNodeConfig(
const QXmppPubSubNodeConfig &);
85 QXmppPubSubNodeConfig(QXmppPubSubNodeConfig &&);
86 ~QXmppPubSubNodeConfig();
88 QXmppPubSubNodeConfig &operator=(
const QXmppPubSubNodeConfig &);
89 QXmppPubSubNodeConfig &operator=(QXmppPubSubNodeConfig &&);
91 std::optional<AccessModel> accessModel()
const;
92 void setAccessModel(std::optional<AccessModel> accessModel);
94 QString bodyXslt()
const;
95 void setBodyXslt(
const QString &bodyXslt);
97 std::optional<ChildAssociationPolicy> childAssociationPolicy()
const;
98 void setChildAssociationPolicy(std::optional<ChildAssociationPolicy> childAssociationPolicy);
100 QStringList childAssociationAllowlist()
const;
101 void setChildAssociationAllowlist(
const QStringList &childAssociationWhitelist);
103 QStringList childNodes()
const;
104 void setChildNodes(
const QStringList &childNodes);
106 std::optional<quint32> childNodesMax()
const;
107 void setChildNodesMax(std::optional<quint32> childNodesMax);
109 QStringList collections()
const;
110 void setCollections(
const QStringList &collections);
112 QStringList contactJids()
const;
113 void setContactJids(
const QStringList &contactJids);
115 QString dataFormXslt()
const;
116 void setDataFormXslt(
const QString &dataFormXslt);
118 std::optional<bool> notificationsEnabled()
const;
119 void setNotificationsEnabled(std::optional<bool> notificationsEnabled);
121 std::optional<bool> includePayloads()
const;
122 void setIncludePayloads(std::optional<bool> includePayloads);
124 QString description()
const;
125 void setDescription(
const QString &description);
127 std::optional<quint32> itemExpiry()
const;
128 void setItemExpiry(std::optional<quint32> itemExpiry);
130 std::optional<ItemPublisher> notificationItemPublisher()
const;
131 void setNotificationItemPublisher(std::optional<ItemPublisher> notificationItemPublisher);
133 QString language()
const;
134 void setLanguage(
const QString &language);
136 ItemLimit maxItems()
const;
137 void setMaxItems(ItemLimit maxItems);
138 inline void resetMaxItems() { setMaxItems(Unset()); }
140 std::optional<quint32> maxPayloadSize()
const;
141 void setMaxPayloadSize(std::optional<quint32> maxPayloadSize);
143 std::optional<NodeType> nodeType()
const;
144 void setNodeType(std::optional<NodeType> nodeType);
146 std::optional<QXmppPubSubNodeConfig::NotificationType> notificationType()
const;
147 void setNotificationType(std::optional<QXmppPubSubNodeConfig::NotificationType> notificationType);
149 std::optional<bool> configNotificationsEnabled()
const;
150 void setConfigNotificationsEnabled(std::optional<bool> configNotificationsEnabled);
152 std::optional<bool> deleteNotificationsEnabled()
const;
153 void setDeleteNotificationsEnabled(std::optional<bool> nodeDeleteNotificationsEnabled);
155 std::optional<bool> retractNotificationsEnabled()
const;
156 void setRetractNotificationsEnabled(std::optional<bool> retractNotificationsEnabled);
158 std::optional<bool> subNotificationsEnabled()
const;
159 void setSubNotificationsEnabled(std::optional<bool> subNotificationsEnabled);
161 std::optional<bool> persistItems()
const;
162 void setPersistItems(std::optional<bool> persistItems);
164 std::optional<bool> presenceBasedNotifications()
const;
165 void setPresenceBasedNotifications(std::optional<bool> presenceBasedNotifications);
167 std::optional<PublishModel> publishModel()
const;
168 void setPublishModel(std::optional<PublishModel> publishModel);
170 std::optional<bool> purgeWhenOffline()
const;
171 void setPurgeWhenOffline(std::optional<bool> purgeWhenOffline);
173 QStringList allowedRosterGroups()
const;
174 void setAllowedRosterGroups(
const QStringList &allowedRosterGroups);
176 std::optional<SendLastItemType> sendLastItem()
const;
177 void setSendLastItem(std::optional<SendLastItemType> sendLastItem);
179 std::optional<bool> temporarySubscriptions()
const;
180 void setTemporarySubscriptions(std::optional<bool> temporarySubscriptions);
182 std::optional<bool> allowSubscriptions()
const;
183 void setAllowSubscriptions(std::optional<bool> allowSubscriptions);
185 QString title()
const;
186 void setTitle(
const QString &title);
188 QString payloadType()
const;
189 void setPayloadType(
const QString &payloadType);
197 QSharedDataPointer<QXmppPubSubNodeConfigPrivate> d;
200class QXMPP_EXPORT QXmppPubSubPublishOptions :
public QXmppPubSubNodeConfig
209Q_DECLARE_METATYPE(QXmppPubSubNodeConfig);
210Q_DECLARE_METATYPE(QXmppPubSubPublishOptions);