summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Elements/PubSubError.h')
-rw-r--r--Swiften/Elements/PubSubError.h111
1 files changed, 111 insertions, 0 deletions
diff --git a/Swiften/Elements/PubSubError.h b/Swiften/Elements/PubSubError.h
new file mode 100644
index 0000000..3748e44
--- /dev/null
+++ b/Swiften/Elements/PubSubError.h
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2013 Remko Tronçon
+ * Licensed under the GNU General Public License.
+ * See the COPYING file for more information.
+ */
+
+#pragma once
+
+#include <Swiften/Elements/Payload.h>
+
+namespace Swift {
+ class SWIFTEN_API PubSubError : public Payload {
+ public:
+ enum Type {
+ UnknownType = 0,
+ ClosedNode,
+ ConfigurationRequired,
+ InvalidJID,
+ InvalidOptions,
+ InvalidPayload,
+ InvalidSubscriptionID,
+ ItemForbidden,
+ ItemRequired,
+ JIDRequired,
+ MaximumItemsExceeded,
+ MaximumNodesExceeded,
+ NodeIDRequired,
+ NotInRosterGroup,
+ NotSubscribed,
+ PayloadTooBig,
+ PayloadRequired,
+ PendingSubscription,
+ PresenceSubscriptionRequired,
+ SubscriptionIDRequired,
+ TooManySubscriptions,
+ Unsupported,
+ UnsupportedAccessModel
+ };
+
+ enum UnsupportedFeatureType {
+ UnknownUnsupportedFeatureType = 0,
+ AccessAuthorize,
+ AccessOpen,
+ AccessPresence,
+ AccessRoster,
+ AccessWhitelist,
+ AutoCreate,
+ AutoSubscribe,
+ Collections,
+ ConfigNode,
+ CreateAndConfigure,
+ CreateNodes,
+ DeleteItems,
+ DeleteNodes,
+ FilteredNotifications,
+ GetPending,
+ InstantNodes,
+ ItemIDs,
+ LastPublished,
+ LeasedSubscription,
+ ManageSubscriptions,
+ MemberAffiliation,
+ MetaData,
+ ModifyAffiliations,
+ MultiCollection,
+ MultiSubscribe,
+ OutcastAffiliation,
+ PersistentItems,
+ PresenceNotifications,
+ PresenceSubscribe,
+ Publish,
+ PublishOptions,
+ PublishOnlyAffiliation,
+ PublisherAffiliation,
+ PurgeNodes,
+ RetractItems,
+ RetrieveAffiliations,
+ RetrieveDefault,
+ RetrieveItems,
+ RetrieveSubscriptions,
+ Subscribe,
+ SubscriptionOptions,
+ SubscriptionNotifications
+ };
+
+ PubSubError(Type type = UnknownType) : type(type), unsupportedType(UnknownUnsupportedFeatureType) {
+ }
+
+ virtual ~PubSubError();
+
+ Type getType() const {
+ return type;
+ }
+
+ void setType(Type type) {
+ this->type = type;
+ }
+
+ UnsupportedFeatureType getUnsupportedFeatureType() const {
+ return unsupportedType;
+ }
+
+ void setUnsupportedFeatureType(UnsupportedFeatureType unsupportedType) {
+ this->unsupportedType = unsupportedType;
+ }
+
+ private:
+ Type type;
+ UnsupportedFeatureType unsupportedType;
+ };
+}