summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Elements')
-rw-r--r--Swiften/Elements/AuthChallenge.h42
-rw-r--r--Swiften/Elements/AuthFailure.h21
-rw-r--r--Swiften/Elements/AuthRequest.h78
-rw-r--r--Swiften/Elements/AuthResponse.h44
-rw-r--r--Swiften/Elements/AuthSuccess.h34
-rw-r--r--Swiften/Elements/BlockListPayload.h35
-rw-r--r--Swiften/Elements/BlockPayload.h35
-rw-r--r--Swiften/Elements/Body.h33
-rw-r--r--Swiften/Elements/Bytestreams.h80
-rw-r--r--Swiften/Elements/CapsInfo.h97
-rw-r--r--Swiften/Elements/CarbonsDisable.cpp12
-rw-r--r--Swiften/Elements/CarbonsDisable.h22
-rw-r--r--Swiften/Elements/CarbonsEnable.cpp12
-rw-r--r--Swiften/Elements/CarbonsEnable.h22
-rw-r--r--Swiften/Elements/CarbonsPrivate.cpp12
-rw-r--r--Swiften/Elements/CarbonsPrivate.h22
-rw-r--r--Swiften/Elements/CarbonsReceived.cpp21
-rw-r--r--Swiften/Elements/CarbonsReceived.h28
-rw-r--r--Swiften/Elements/CarbonsSent.cpp21
-rw-r--r--Swiften/Elements/CarbonsSent.h28
-rw-r--r--Swiften/Elements/ChatState.h32
-rw-r--r--Swiften/Elements/ClientState.h31
-rw-r--r--Swiften/Elements/Command.h141
-rw-r--r--Swiften/Elements/ComponentHandshake.h39
-rw-r--r--Swiften/Elements/CompressFailure.h18
-rw-r--r--Swiften/Elements/CompressRequest.h37
-rw-r--r--Swiften/Elements/Compressed.h17
-rw-r--r--Swiften/Elements/ContainerPayload.h40
-rw-r--r--Swiften/Elements/Delay.h31
-rw-r--r--Swiften/Elements/DeliveryReceipt.h37
-rw-r--r--Swiften/Elements/DeliveryReceiptRequest.h17
-rw-r--r--Swiften/Elements/DiscoInfo.cpp45
-rw-r--r--Swiften/Elements/DiscoInfo.h205
-rw-r--r--Swiften/Elements/DiscoItems.h97
-rw-r--r--Swiften/Elements/Element.cpp6
-rw-r--r--Swiften/Elements/Element.h18
-rw-r--r--Swiften/Elements/EnableStreamManagement.h18
-rw-r--r--Swiften/Elements/ErrorPayload.h151
-rw-r--r--Swiften/Elements/Form.cpp57
-rw-r--r--Swiften/Elements/Form.h172
-rw-r--r--Swiften/Elements/FormField.cpp22
-rw-r--r--Swiften/Elements/FormField.h254
-rw-r--r--Swiften/Elements/FormPage.cpp64
-rw-r--r--Swiften/Elements/FormPage.h46
-rw-r--r--Swiften/Elements/FormReportedRef.h19
-rw-r--r--Swiften/Elements/FormSection.cpp64
-rw-r--r--Swiften/Elements/FormSection.h45
-rw-r--r--Swiften/Elements/FormText.cpp24
-rw-r--r--Swiften/Elements/FormText.h27
-rw-r--r--Swiften/Elements/Forwarded.cpp12
-rw-r--r--Swiften/Elements/Forwarded.h35
-rw-r--r--Swiften/Elements/HashElement.h45
-rw-r--r--Swiften/Elements/IBB.h190
-rw-r--r--Swiften/Elements/IQ.cpp98
-rw-r--r--Swiften/Elements/IQ.h94
-rw-r--r--Swiften/Elements/Idle.h42
-rw-r--r--Swiften/Elements/InBandRegistrationPayload.h360
-rw-r--r--Swiften/Elements/IsodeIQDelegation.cpp15
-rw-r--r--Swiften/Elements/IsodeIQDelegation.h35
-rw-r--r--Swiften/Elements/JingleContentPayload.h173
-rw-r--r--Swiften/Elements/JingleDescription.h17
-rw-r--r--Swiften/Elements/JingleFileTransferDescription.h45
-rw-r--r--Swiften/Elements/JingleFileTransferFileInfo.h121
-rw-r--r--Swiften/Elements/JingleFileTransferHash.h32
-rw-r--r--Swiften/Elements/JingleFileTransferReceived.h33
-rw-r--r--Swiften/Elements/JingleIBBTransportPayload.h73
-rw-r--r--Swiften/Elements/JinglePayload.h309
-rw-r--r--Swiften/Elements/JingleS5BTransportPayload.h208
-rw-r--r--Swiften/Elements/JingleTransportPayload.h36
-rw-r--r--Swiften/Elements/Last.h23
-rw-r--r--Swiften/Elements/MAMFin.cpp14
-rw-r--r--Swiften/Elements/MAMFin.h63
-rw-r--r--Swiften/Elements/MAMQuery.cpp12
-rw-r--r--Swiften/Elements/MAMQuery.h42
-rw-r--r--Swiften/Elements/MAMResult.cpp12
-rw-r--r--Swiften/Elements/MAMResult.h32
-rw-r--r--Swiften/Elements/MIXCreate.h46
-rw-r--r--Swiften/Elements/MIXDestroy.h35
-rw-r--r--Swiften/Elements/MIXJoin.h77
-rw-r--r--Swiften/Elements/MIXLeave.h37
-rw-r--r--Swiften/Elements/MIXParticipant.h47
-rw-r--r--Swiften/Elements/MIXPayload.h56
-rw-r--r--Swiften/Elements/MIXRegisterNick.h35
-rw-r--r--Swiften/Elements/MIXSetNick.h35
-rw-r--r--Swiften/Elements/MIXUpdateSubscription.h56
-rw-r--r--Swiften/Elements/MIXUserPreference.h36
-rw-r--r--Swiften/Elements/MUCAdminPayload.h38
-rw-r--r--Swiften/Elements/MUCDestroyPayload.h49
-rw-r--r--Swiften/Elements/MUCInvitationPayload.h131
-rw-r--r--Swiften/Elements/MUCItem.h23
-rw-r--r--Swiften/Elements/MUCOccupant.cpp28
-rw-r--r--Swiften/Elements/MUCOccupant.h59
-rw-r--r--Swiften/Elements/MUCOwnerPayload.h43
-rw-r--r--Swiften/Elements/MUCPayload.h128
-rw-r--r--Swiften/Elements/MUCUserPayload.h130
-rw-r--r--Swiften/Elements/Message.h123
-rw-r--r--Swiften/Elements/Nickname.h36
-rw-r--r--Swiften/Elements/Payload.cpp6
-rw-r--r--Swiften/Elements/Payload.h25
-rw-r--r--Swiften/Elements/Presence.cpp31
-rw-r--r--Swiften/Elements/Presence.h91
-rw-r--r--Swiften/Elements/Priority.h33
-rw-r--r--Swiften/Elements/PrivateStorage.h35
-rw-r--r--Swiften/Elements/ProtocolHeader.h68
-rw-r--r--Swiften/Elements/PubSub.cpp4
-rw-r--r--Swiften/Elements/PubSub.h16
-rw-r--r--Swiften/Elements/PubSubAffiliation.cpp4
-rw-r--r--Swiften/Elements/PubSubAffiliation.h82
-rw-r--r--Swiften/Elements/PubSubAffiliations.cpp4
-rw-r--r--Swiften/Elements/PubSubAffiliations.h80
-rw-r--r--Swiften/Elements/PubSubConfigure.cpp4
-rw-r--r--Swiften/Elements/PubSubConfigure.h41
-rw-r--r--Swiften/Elements/PubSubCreate.cpp4
-rw-r--r--Swiften/Elements/PubSubCreate.h67
-rw-r--r--Swiften/Elements/PubSubDefault.cpp4
-rw-r--r--Swiften/Elements/PubSubDefault.h78
-rw-r--r--Swiften/Elements/PubSubError.cpp4
-rw-r--r--Swiften/Elements/PubSubError.h186
-rw-r--r--Swiften/Elements/PubSubEvent.cpp4
-rw-r--r--Swiften/Elements/PubSubEvent.h21
-rw-r--r--Swiften/Elements/PubSubEventAssociate.cpp4
-rw-r--r--Swiften/Elements/PubSubEventAssociate.h38
-rw-r--r--Swiften/Elements/PubSubEventCollection.cpp4
-rw-r--r--Swiften/Elements/PubSubEventCollection.h90
-rw-r--r--Swiften/Elements/PubSubEventConfiguration.cpp4
-rw-r--r--Swiften/Elements/PubSubEventConfiguration.h67
-rw-r--r--Swiften/Elements/PubSubEventDelete.cpp4
-rw-r--r--Swiften/Elements/PubSubEventDelete.h69
-rw-r--r--Swiften/Elements/PubSubEventDisassociate.cpp4
-rw-r--r--Swiften/Elements/PubSubEventDisassociate.h38
-rw-r--r--Swiften/Elements/PubSubEventItem.cpp4
-rw-r--r--Swiften/Elements/PubSubEventItem.h115
-rw-r--r--Swiften/Elements/PubSubEventItems.cpp4
-rw-r--r--Swiften/Elements/PubSubEventItems.h105
-rw-r--r--Swiften/Elements/PubSubEventPayload.cpp4
-rw-r--r--Swiften/Elements/PubSubEventPayload.h12
-rw-r--r--Swiften/Elements/PubSubEventPurge.cpp4
-rw-r--r--Swiften/Elements/PubSubEventPurge.h39
-rw-r--r--Swiften/Elements/PubSubEventRedirect.cpp4
-rw-r--r--Swiften/Elements/PubSubEventRedirect.h38
-rw-r--r--Swiften/Elements/PubSubEventRetract.cpp4
-rw-r--r--Swiften/Elements/PubSubEventRetract.h38
-rw-r--r--Swiften/Elements/PubSubEventSubscription.cpp4
-rw-r--r--Swiften/Elements/PubSubEventSubscription.h136
-rw-r--r--Swiften/Elements/PubSubItem.cpp7
-rw-r--r--Swiften/Elements/PubSubItem.h76
-rw-r--r--Swiften/Elements/PubSubItems.cpp4
-rw-r--r--Swiften/Elements/PubSubItems.h115
-rw-r--r--Swiften/Elements/PubSubOptions.cpp4
-rw-r--r--Swiften/Elements/PubSubOptions.h106
-rw-r--r--Swiften/Elements/PubSubOwnerAffiliation.cpp4
-rw-r--r--Swiften/Elements/PubSubOwnerAffiliation.h79
-rw-r--r--Swiften/Elements/PubSubOwnerAffiliations.cpp4
-rw-r--r--Swiften/Elements/PubSubOwnerAffiliations.h79
-rw-r--r--Swiften/Elements/PubSubOwnerConfigure.cpp4
-rw-r--r--Swiften/Elements/PubSubOwnerConfigure.h72
-rw-r--r--Swiften/Elements/PubSubOwnerDefault.cpp4
-rw-r--r--Swiften/Elements/PubSubOwnerDefault.h41
-rw-r--r--Swiften/Elements/PubSubOwnerDelete.cpp4
-rw-r--r--Swiften/Elements/PubSubOwnerDelete.h67
-rw-r--r--Swiften/Elements/PubSubOwnerPayload.cpp4
-rw-r--r--Swiften/Elements/PubSubOwnerPayload.h12
-rw-r--r--Swiften/Elements/PubSubOwnerPubSub.cpp4
-rw-r--r--Swiften/Elements/PubSubOwnerPubSub.h16
-rw-r--r--Swiften/Elements/PubSubOwnerPurge.cpp4
-rw-r--r--Swiften/Elements/PubSubOwnerPurge.h39
-rw-r--r--Swiften/Elements/PubSubOwnerRedirect.cpp4
-rw-r--r--Swiften/Elements/PubSubOwnerRedirect.h38
-rw-r--r--Swiften/Elements/PubSubOwnerSubscription.cpp4
-rw-r--r--Swiften/Elements/PubSubOwnerSubscription.h75
-rw-r--r--Swiften/Elements/PubSubOwnerSubscriptions.cpp4
-rw-r--r--Swiften/Elements/PubSubOwnerSubscriptions.h77
-rw-r--r--Swiften/Elements/PubSubPayload.cpp4
-rw-r--r--Swiften/Elements/PubSubPayload.h12
-rw-r--r--Swiften/Elements/PubSubPublish.cpp4
-rw-r--r--Swiften/Elements/PubSubPublish.h77
-rw-r--r--Swiften/Elements/PubSubRetract.cpp4
-rw-r--r--Swiften/Elements/PubSubRetract.h97
-rw-r--r--Swiften/Elements/PubSubSubscribe.cpp4
-rw-r--r--Swiften/Elements/PubSubSubscribe.h88
-rw-r--r--Swiften/Elements/PubSubSubscribeOptions.cpp6
-rw-r--r--Swiften/Elements/PubSubSubscribeOptions.h36
-rw-r--r--Swiften/Elements/PubSubSubscription.cpp4
-rw-r--r--Swiften/Elements/PubSubSubscription.h138
-rw-r--r--Swiften/Elements/PubSubSubscriptions.cpp4
-rw-r--r--Swiften/Elements/PubSubSubscriptions.h82
-rw-r--r--Swiften/Elements/PubSubUnsubscribe.cpp4
-rw-r--r--Swiften/Elements/PubSubUnsubscribe.h86
-rw-r--r--Swiften/Elements/RawXMLPayload.h31
-rw-r--r--Swiften/Elements/ReferencePayload.cpp63
-rw-r--r--Swiften/Elements/ReferencePayload.h62
-rw-r--r--Swiften/Elements/Replace.h35
-rw-r--r--Swiften/Elements/ResourceBind.h56
-rw-r--r--Swiften/Elements/ResultSet.cpp12
-rw-r--r--Swiften/Elements/ResultSet.h56
-rw-r--r--Swiften/Elements/RosterItemExchangePayload.cpp7
-rw-r--r--Swiften/Elements/RosterItemExchangePayload.h114
-rw-r--r--Swiften/Elements/RosterItemPayload.h81
-rw-r--r--Swiften/Elements/RosterPayload.cpp23
-rw-r--r--Swiften/Elements/RosterPayload.h58
-rw-r--r--Swiften/Elements/S5BProxyRequest.h62
-rw-r--r--Swiften/Elements/SearchPayload.h168
-rw-r--r--Swiften/Elements/SecurityLabel.cpp15
-rw-r--r--Swiften/Elements/SecurityLabel.h93
-rw-r--r--Swiften/Elements/SecurityLabelsCatalog.h152
-rw-r--r--Swiften/Elements/SoftwareVersion.h86
-rw-r--r--Swiften/Elements/Stanza.cpp73
-rw-r--r--Swiften/Elements/Stanza.h160
-rw-r--r--Swiften/Elements/StanzaAck.cpp14
-rw-r--r--Swiften/Elements/StanzaAck.h45
-rw-r--r--Swiften/Elements/StanzaAckRequest.h14
-rw-r--r--Swiften/Elements/StartSession.h16
-rw-r--r--Swiften/Elements/StartTLSFailure.h17
-rw-r--r--Swiften/Elements/StartTLSRequest.h17
-rw-r--r--Swiften/Elements/Status.h36
-rw-r--r--Swiften/Elements/StatusShow.cpp6
-rw-r--r--Swiften/Elements/StatusShow.h77
-rw-r--r--Swiften/Elements/Storage.h105
-rw-r--r--Swiften/Elements/StreamError.h107
-rw-r--r--Swiften/Elements/StreamFeatures.cpp10
-rw-r--r--Swiften/Elements/StreamFeatures.h181
-rw-r--r--Swiften/Elements/StreamInitiation.h118
-rw-r--r--Swiften/Elements/StreamInitiationFileInfo.h172
-rw-r--r--Swiften/Elements/StreamManagementEnabled.cpp8
-rw-r--r--Swiften/Elements/StreamManagementEnabled.h58
-rw-r--r--Swiften/Elements/StreamManagementFailed.h18
-rw-r--r--Swiften/Elements/StreamResume.cpp6
-rw-r--r--Swiften/Elements/StreamResume.h60
-rw-r--r--Swiften/Elements/StreamResumed.cpp6
-rw-r--r--Swiften/Elements/StreamResumed.h60
-rw-r--r--Swiften/Elements/StreamType.h16
-rw-r--r--Swiften/Elements/Subject.h36
-rw-r--r--Swiften/Elements/TLSProceed.h17
-rw-r--r--Swiften/Elements/Thread.cpp34
-rw-r--r--Swiften/Elements/Thread.h28
-rw-r--r--Swiften/Elements/ToplevelElement.cpp14
-rw-r--r--Swiften/Elements/ToplevelElement.h19
-rw-r--r--Swiften/Elements/UnblockPayload.h35
-rw-r--r--Swiften/Elements/UnitTest/FormTest.cpp64
-rw-r--r--Swiften/Elements/UnitTest/IQTest.cpp83
-rw-r--r--Swiften/Elements/UnitTest/StanzaTest.cpp434
-rw-r--r--Swiften/Elements/UnknownElement.h17
-rw-r--r--Swiften/Elements/UserLocation.cpp4
-rw-r--r--Swiften/Elements/UserLocation.h387
-rw-r--r--Swiften/Elements/UserTune.cpp15
-rw-r--r--Swiften/Elements/UserTune.h90
-rw-r--r--Swiften/Elements/VCard.cpp26
-rw-r--r--Swiften/Elements/VCard.h554
-rw-r--r--Swiften/Elements/VCardUpdate.h24
-rw-r--r--Swiften/Elements/Version.h30
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardColor.cpp91
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardColor.h30
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h39
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardElement.h40
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardElementVisitor.h32
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardEllipseElement.h131
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardFreehandPathElement.h97
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h39
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardLineElement.h94
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardOperation.h83
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardPolygonElement.h111
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardRectElement.h131
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardTextElement.h91
-rw-r--r--Swiften/Elements/Whiteboard/WhiteboardUpdateOperation.h61
-rw-r--r--Swiften/Elements/WhiteboardPayload.h103
265 files changed, 8522 insertions, 6354 deletions
diff --git a/Swiften/Elements/AuthChallenge.h b/Swiften/Elements/AuthChallenge.h
index f7f2796..0c43980 100644
--- a/Swiften/Elements/AuthChallenge.h
+++ b/Swiften/Elements/AuthChallenge.h
@@ -1,34 +1,36 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/optional.hpp>
#include <vector>
-#include <Swiften/Elements/Element.h>
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/ToplevelElement.h>
namespace Swift {
- class AuthChallenge : public Element {
- public:
- AuthChallenge() {
- }
+ class SWIFTEN_API AuthChallenge : public ToplevelElement {
+ public:
+ AuthChallenge() {
+ }
- AuthChallenge(const std::vector<unsigned char>& value) : value(value) {
- }
+ AuthChallenge(const std::vector<unsigned char>& value) : value(value) {
+ }
- const boost::optional< std::vector<unsigned char> >& getValue() const {
- return value;
- }
+ const boost::optional< std::vector<unsigned char> >& getValue() const {
+ return value;
+ }
- void setValue(const std::vector<unsigned char>& value) {
- this->value = boost::optional<std::vector<unsigned char> >(value);
- }
+ void setValue(const std::vector<unsigned char>& value) {
+ this->value = boost::optional<std::vector<unsigned char> >(value);
+ }
- private:
- boost::optional< std::vector<unsigned char> > value;
- };
+ private:
+ boost::optional< std::vector<unsigned char> > value;
+ };
}
diff --git a/Swiften/Elements/AuthFailure.h b/Swiften/Elements/AuthFailure.h
index ac40956..9546b0d 100644
--- a/Swiften/Elements/AuthFailure.h
+++ b/Swiften/Elements/AuthFailure.h
@@ -1,20 +1,21 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
-#include <Swiften/Elements/Element.h>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/ToplevelElement.h>
namespace Swift {
- class AuthFailure : public Element {
- public:
- typedef boost::shared_ptr<AuthFailure> ref;
+ class SWIFTEN_API AuthFailure : public ToplevelElement {
+ public:
+ typedef std::shared_ptr<AuthFailure> ref;
- AuthFailure() {}
- };
+ AuthFailure() {}
+ };
}
diff --git a/Swiften/Elements/AuthRequest.h b/Swiften/Elements/AuthRequest.h
index bfc86c2..33b25b4 100644
--- a/Swiften/Elements/AuthRequest.h
+++ b/Swiften/Elements/AuthRequest.h
@@ -1,50 +1,52 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <vector>
#include <string>
+#include <vector>
+
#include <boost/optional.hpp>
-#include <Swiften/Elements/Element.h>
+#include <Swiften/Base/API.h>
#include <Swiften/Base/SafeByteArray.h>
+#include <Swiften/Elements/ToplevelElement.h>
namespace Swift {
- class AuthRequest : public Element {
- public:
- AuthRequest(const std::string& mechanism = "") : mechanism_(mechanism) {
- }
-
- AuthRequest(const std::string& mechanism, const SafeByteArray& message) :
- mechanism_(mechanism), message_(message) {
- }
-
- AuthRequest(const std::string& mechanism, const boost::optional<SafeByteArray>& message) :
- mechanism_(mechanism), message_(message) {
- }
-
- const boost::optional<SafeByteArray>& getMessage() const {
- return message_;
- }
-
- void setMessage(const SafeByteArray& message) {
- message_ = boost::optional<SafeByteArray>(message);
- }
-
- const std::string& getMechanism() const {
- return mechanism_;
- }
-
- void setMechanism(const std::string& mechanism) {
- mechanism_ = mechanism;
- }
-
- private:
- std::string mechanism_;
- boost::optional<SafeByteArray> message_;
- };
+ class SWIFTEN_API AuthRequest : public ToplevelElement {
+ public:
+ AuthRequest(const std::string& mechanism = "") : mechanism_(mechanism) {
+ }
+
+ AuthRequest(const std::string& mechanism, const SafeByteArray& message) :
+ mechanism_(mechanism), message_(message) {
+ }
+
+ AuthRequest(const std::string& mechanism, const boost::optional<SafeByteArray>& message) :
+ mechanism_(mechanism), message_(message) {
+ }
+
+ const boost::optional<SafeByteArray>& getMessage() const {
+ return message_;
+ }
+
+ void setMessage(const SafeByteArray& message) {
+ message_ = boost::optional<SafeByteArray>(message);
+ }
+
+ const std::string& getMechanism() const {
+ return mechanism_;
+ }
+
+ void setMechanism(const std::string& mechanism) {
+ mechanism_ = mechanism;
+ }
+
+ private:
+ std::string mechanism_;
+ boost::optional<SafeByteArray> message_;
+ };
}
diff --git a/Swiften/Elements/AuthResponse.h b/Swiften/Elements/AuthResponse.h
index db2dcea..a88e8d0 100644
--- a/Swiften/Elements/AuthResponse.h
+++ b/Swiften/Elements/AuthResponse.h
@@ -1,38 +1,40 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
#include <vector>
+
#include <boost/optional.hpp>
-#include <Swiften/Elements/Element.h>
+#include <Swiften/Base/API.h>
#include <Swiften/Base/SafeByteArray.h>
+#include <Swiften/Elements/ToplevelElement.h>
namespace Swift {
- class AuthResponse : public Element {
- public:
- AuthResponse() {
- }
+ class SWIFTEN_API AuthResponse : public ToplevelElement {
+ public:
+ AuthResponse() {
+ }
- AuthResponse(const SafeByteArray& value) : value(value) {
- }
+ AuthResponse(const SafeByteArray& value) : value(value) {
+ }
- AuthResponse(const boost::optional<SafeByteArray>& value) : value(value) {
- }
+ AuthResponse(const boost::optional<SafeByteArray>& value) : value(value) {
+ }
- const boost::optional<SafeByteArray>& getValue() const {
- return value;
- }
+ const boost::optional<SafeByteArray>& getValue() const {
+ return value;
+ }
- void setValue(const SafeByteArray& value) {
- this->value = boost::optional<SafeByteArray>(value);
- }
+ void setValue(const SafeByteArray& value) {
+ this->value = boost::optional<SafeByteArray>(value);
+ }
- private:
- boost::optional<SafeByteArray> value;
- };
+ private:
+ boost::optional<SafeByteArray> value;
+ };
}
diff --git a/Swiften/Elements/AuthSuccess.h b/Swiften/Elements/AuthSuccess.h
index 3c0f329..860702c 100644
--- a/Swiften/Elements/AuthSuccess.h
+++ b/Swiften/Elements/AuthSuccess.h
@@ -1,30 +1,32 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
#include <vector>
+
#include <boost/optional.hpp>
-#include <Swiften/Elements/Element.h>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/ToplevelElement.h>
namespace Swift {
- class AuthSuccess : public Element {
- public:
- AuthSuccess() {}
+ class SWIFTEN_API AuthSuccess : public ToplevelElement {
+ public:
+ AuthSuccess() {}
- const boost::optional<std::vector<unsigned char> >& getValue() const {
- return value;
- }
+ const boost::optional<std::vector<unsigned char> >& getValue() const {
+ return value;
+ }
- void setValue(const std::vector<unsigned char>& value) {
- this->value = boost::optional<std::vector<unsigned char> >(value);
- }
+ void setValue(const std::vector<unsigned char>& value) {
+ this->value = boost::optional<std::vector<unsigned char> >(value);
+ }
- private:
- boost::optional<std::vector<unsigned char> > value;
- };
+ private:
+ boost::optional<std::vector<unsigned char> > value;
+ };
}
diff --git a/Swiften/Elements/BlockListPayload.h b/Swiften/Elements/BlockListPayload.h
index 49df75f..acc9df4 100644
--- a/Swiften/Elements/BlockListPayload.h
+++ b/Swiften/Elements/BlockListPayload.h
@@ -1,31 +1,32 @@
/*
- * Copyright (c) 2011 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2011-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
#include <vector>
-#include <Swiften/JID/JID.h>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
+#include <Swiften/JID/JID.h>
namespace Swift {
- class BlockListPayload : public Payload {
- public:
- BlockListPayload(const std::vector<JID>& items = std::vector<JID>()) : items(items) {
- }
+ class SWIFTEN_API BlockListPayload : public Payload {
+ public:
+ BlockListPayload(const std::vector<JID>& items = std::vector<JID>()) : items(items) {
+ }
- void addItem(const JID& item) {
- items.push_back(item);
- }
+ void addItem(const JID& item) {
+ items.push_back(item);
+ }
- const std::vector<JID>& getItems() const {
- return items;
- }
+ const std::vector<JID>& getItems() const {
+ return items;
+ }
- private:
- std::vector<JID> items;
- };
+ private:
+ std::vector<JID> items;
+ };
}
diff --git a/Swiften/Elements/BlockPayload.h b/Swiften/Elements/BlockPayload.h
index 49a0463..df8d150 100644
--- a/Swiften/Elements/BlockPayload.h
+++ b/Swiften/Elements/BlockPayload.h
@@ -1,31 +1,32 @@
/*
- * Copyright (c) 2011 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2011-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
#include <vector>
-#include <Swiften/JID/JID.h>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
+#include <Swiften/JID/JID.h>
namespace Swift {
- class BlockPayload : public Payload {
- public:
- BlockPayload(const std::vector<JID>& jids = std::vector<JID>()) : items(jids) {
- }
+ class SWIFTEN_API BlockPayload : public Payload {
+ public:
+ BlockPayload(const std::vector<JID>& jids = std::vector<JID>()) : items(jids) {
+ }
- void addItem(const JID& jid) {
- items.push_back(jid);
- }
+ void addItem(const JID& jid) {
+ items.push_back(jid);
+ }
- const std::vector<JID>& getItems() const {
- return items;
- }
+ const std::vector<JID>& getItems() const {
+ return items;
+ }
- private:
- std::vector<JID> items;
- };
+ private:
+ std::vector<JID> items;
+ };
}
diff --git a/Swiften/Elements/Body.h b/Swiften/Elements/Body.h
index a2497f7..8761d5a 100644
--- a/Swiften/Elements/Body.h
+++ b/Swiften/Elements/Body.h
@@ -1,30 +1,31 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
#include <string>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
- class Body : public Payload {
- public:
- Body(const std::string& text = "") : text_(text) {
- }
+ class SWIFTEN_API Body : public Payload {
+ public:
+ Body(const std::string& text = "") : text_(text) {
+ }
- void setText(const std::string& text) {
- text_ = text;
- }
+ void setText(const std::string& text) {
+ text_ = text;
+ }
- const std::string& getText() const {
- return text_;
- }
+ const std::string& getText() const {
+ return text_;
+ }
- private:
- std::string text_;
- };
+ private:
+ std::string text_;
+ };
}
diff --git a/Swiften/Elements/Bytestreams.h b/Swiften/Elements/Bytestreams.h
index 9724a54..599ed46 100644
--- a/Swiften/Elements/Bytestreams.h
+++ b/Swiften/Elements/Bytestreams.h
@@ -1,61 +1,63 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2018 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
+#include <memory>
+#include <string>
#include <vector>
+
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
-#include <string>
-#include <Swiften/JID/JID.h>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
+#include <Swiften/JID/JID.h>
namespace Swift {
- class Bytestreams : public Payload {
- public:
- typedef boost::shared_ptr<Bytestreams> ref;
+ class SWIFTEN_API Bytestreams : public Payload {
+ public:
+ typedef std::shared_ptr<Bytestreams> ref;
- struct StreamHost {
- StreamHost(const std::string& host = "", const JID& jid = JID(), int port = -1) : host(host), jid(jid), port(port) {}
+ struct StreamHost {
+ StreamHost(const std::string& host = "", const JID& jid = JID(), unsigned short port = 0) : host(host), jid(jid), port(port) {}
- std::string host;
- JID jid;
- int port;
- };
+ std::string host;
+ JID jid;
+ unsigned short port;
+ };
- Bytestreams() {}
+ Bytestreams() {}
- const std::string& getStreamID() const {
- return id;
- }
+ const std::string& getStreamID() const {
+ return id;
+ }
- void setStreamID(const std::string& id) {
- this->id = id;
- }
+ void setStreamID(const std::string& id) {
+ this->id = id;
+ }
- const boost::optional<JID>& getUsedStreamHost() const {
- return usedStreamHost;
- }
+ const boost::optional<JID>& getUsedStreamHost() const {
+ return usedStreamHost;
+ }
- void setUsedStreamHost(const JID& host) {
- usedStreamHost = host;
- }
+ void setUsedStreamHost(const JID& host) {
+ usedStreamHost = host;
+ }
- const std::vector<StreamHost>& getStreamHosts() const {
- return streamHosts;
- }
+ const std::vector<StreamHost>& getStreamHosts() const {
+ return streamHosts;
+ }
- void addStreamHost(const StreamHost& streamHost) {
- streamHosts.push_back(streamHost);
- }
+ void addStreamHost(const StreamHost& streamHost) {
+ streamHosts.push_back(streamHost);
+ }
- private:
- std::string id;
- boost::optional<JID> usedStreamHost;
- std::vector<StreamHost> streamHosts;
- };
+ private:
+ std::string id;
+ boost::optional<JID> usedStreamHost;
+ std::vector<StreamHost> streamHosts;
+ };
}
diff --git a/Swiften/Elements/CapsInfo.h b/Swiften/Elements/CapsInfo.h
index c6d3b64..d1e5103 100644
--- a/Swiften/Elements/CapsInfo.h
+++ b/Swiften/Elements/CapsInfo.h
@@ -1,59 +1,60 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <string>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
- class CapsInfo : public Payload {
- public:
- typedef boost::shared_ptr<CapsInfo> ref;
-
- CapsInfo(const std::string& node = "", const std::string& version = "", const std::string& hash = "sha-1") : node_(node), version_(version), hash_(hash) {}
-
- bool operator==(const CapsInfo& o) const {
- return o.node_ == node_ && o.version_ == version_ && o.hash_ == hash_;
- }
-
- bool operator<(const CapsInfo& o) const {
- if (o.node_ == node_) {
- if (o.version_ == version_) {
- return hash_ < o.hash_;
- }
- else {
- return version_ < o.version_;
- }
- }
- else {
- return node_ < o.node_;
- }
- }
-
- const std::string& getNode() const { return node_; }
- void setNode(const std::string& node) {
- node_ = node;
- }
-
- const std::string& getVersion() const { return version_; }
- void setVersion(const std::string& version) {
- version_ = version;
- }
-
- const std::string& getHash() const { return hash_; }
- void setHash(const std::string& hash) {
- hash_ = hash;
- }
-
- private:
- std::string node_;
- std::string version_;
- std::string hash_;
- };
+ class SWIFTEN_API CapsInfo : public Payload {
+ public:
+ typedef std::shared_ptr<CapsInfo> ref;
+
+ CapsInfo(const std::string& node = "", const std::string& version = "", const std::string& hash = "sha-1") : node_(node), version_(version), hash_(hash) {}
+
+ bool operator==(const CapsInfo& o) const {
+ return o.node_ == node_ && o.version_ == version_ && o.hash_ == hash_;
+ }
+
+ bool operator<(const CapsInfo& o) const {
+ if (o.node_ == node_) {
+ if (o.version_ == version_) {
+ return hash_ < o.hash_;
+ }
+ else {
+ return version_ < o.version_;
+ }
+ }
+ else {
+ return node_ < o.node_;
+ }
+ }
+
+ const std::string& getNode() const { return node_; }
+ void setNode(const std::string& node) {
+ node_ = node;
+ }
+
+ const std::string& getVersion() const { return version_; }
+ void setVersion(const std::string& version) {
+ version_ = version;
+ }
+
+ const std::string& getHash() const { return hash_; }
+ void setHash(const std::string& hash) {
+ hash_ = hash;
+ }
+
+ private:
+ std::string node_;
+ std::string version_;
+ std::string hash_;
+ };
}
diff --git a/Swiften/Elements/CarbonsDisable.cpp b/Swiften/Elements/CarbonsDisable.cpp
new file mode 100644
index 0000000..848fa92
--- /dev/null
+++ b/Swiften/Elements/CarbonsDisable.cpp
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#include <Swiften/Elements/CarbonsDisable.h>
+
+namespace Swift {
+ CarbonsDisable::~CarbonsDisable() {
+ }
+}
diff --git a/Swiften/Elements/CarbonsDisable.h b/Swiften/Elements/CarbonsDisable.h
new file mode 100644
index 0000000..9526061
--- /dev/null
+++ b/Swiften/Elements/CarbonsDisable.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#pragma once
+
+#include <memory>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
+
+namespace Swift {
+ class SWIFTEN_API CarbonsDisable : public Payload {
+ public:
+ typedef std::shared_ptr<CarbonsDisable> ref;
+
+ public:
+ virtual ~CarbonsDisable();
+ };
+}
diff --git a/Swiften/Elements/CarbonsEnable.cpp b/Swiften/Elements/CarbonsEnable.cpp
new file mode 100644
index 0000000..c927cfb
--- /dev/null
+++ b/Swiften/Elements/CarbonsEnable.cpp
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#include <Swiften/Elements/CarbonsEnable.h>
+
+namespace Swift {
+ CarbonsEnable::~CarbonsEnable() {
+ }
+}
diff --git a/Swiften/Elements/CarbonsEnable.h b/Swiften/Elements/CarbonsEnable.h
new file mode 100644
index 0000000..bcb27a2
--- /dev/null
+++ b/Swiften/Elements/CarbonsEnable.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#pragma once
+
+#include <memory>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
+
+namespace Swift {
+ class SWIFTEN_API CarbonsEnable : public Payload {
+ public:
+ typedef std::shared_ptr<CarbonsEnable> ref;
+
+ public:
+ virtual ~CarbonsEnable();
+ };
+}
diff --git a/Swiften/Elements/CarbonsPrivate.cpp b/Swiften/Elements/CarbonsPrivate.cpp
new file mode 100644
index 0000000..4ebcd31
--- /dev/null
+++ b/Swiften/Elements/CarbonsPrivate.cpp
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#include <Swiften/Elements/CarbonsPrivate.h>
+
+namespace Swift {
+ CarbonsPrivate::~CarbonsPrivate() {
+ }
+}
diff --git a/Swiften/Elements/CarbonsPrivate.h b/Swiften/Elements/CarbonsPrivate.h
new file mode 100644
index 0000000..5cc25ff
--- /dev/null
+++ b/Swiften/Elements/CarbonsPrivate.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#pragma once
+
+#include <memory>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
+
+namespace Swift {
+ class SWIFTEN_API CarbonsPrivate : public Payload {
+ public:
+ typedef std::shared_ptr<CarbonsPrivate> ref;
+
+ public:
+ virtual ~CarbonsPrivate();
+ };
+}
diff --git a/Swiften/Elements/CarbonsReceived.cpp b/Swiften/Elements/CarbonsReceived.cpp
new file mode 100644
index 0000000..7c233a3
--- /dev/null
+++ b/Swiften/Elements/CarbonsReceived.cpp
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#include <Swiften/Elements/CarbonsReceived.h>
+
+namespace Swift {
+ CarbonsReceived::~CarbonsReceived() {
+
+ }
+
+ void CarbonsReceived::setForwarded(std::shared_ptr<Forwarded> forwarded) {
+ forwarded_ = forwarded;
+ }
+
+ std::shared_ptr<Forwarded> CarbonsReceived::getForwarded() const {
+ return forwarded_;
+ }
+}
diff --git a/Swiften/Elements/CarbonsReceived.h b/Swiften/Elements/CarbonsReceived.h
new file mode 100644
index 0000000..c33b600
--- /dev/null
+++ b/Swiften/Elements/CarbonsReceived.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#pragma once
+
+#include <memory>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Forwarded.h>
+#include <Swiften/Elements/Payload.h>
+
+namespace Swift {
+ class SWIFTEN_API CarbonsReceived : public Payload {
+ public:
+ typedef std::shared_ptr<CarbonsReceived> ref;
+
+ public:
+ virtual ~CarbonsReceived();
+ void setForwarded(std::shared_ptr<Forwarded> forwarded);
+ std::shared_ptr<Forwarded> getForwarded() const;
+
+ private:
+ std::shared_ptr<Forwarded> forwarded_;
+ };
+}
diff --git a/Swiften/Elements/CarbonsSent.cpp b/Swiften/Elements/CarbonsSent.cpp
new file mode 100644
index 0000000..a026871
--- /dev/null
+++ b/Swiften/Elements/CarbonsSent.cpp
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#include <Swiften/Elements/CarbonsSent.h>
+
+namespace Swift {
+ CarbonsSent::~CarbonsSent() {
+
+ }
+
+ void CarbonsSent::setForwarded(std::shared_ptr<Forwarded> forwarded) {
+ forwarded_ = forwarded;
+ }
+
+ std::shared_ptr<Forwarded> CarbonsSent::getForwarded() const {
+ return forwarded_;
+ }
+}
diff --git a/Swiften/Elements/CarbonsSent.h b/Swiften/Elements/CarbonsSent.h
new file mode 100644
index 0000000..89739de
--- /dev/null
+++ b/Swiften/Elements/CarbonsSent.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#pragma once
+
+#include <memory>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Forwarded.h>
+#include <Swiften/Elements/Payload.h>
+
+namespace Swift {
+ class SWIFTEN_API CarbonsSent : public Payload {
+ public:
+ typedef std::shared_ptr<CarbonsSent> ref;
+
+ public:
+ virtual ~CarbonsSent();
+ void setForwarded(std::shared_ptr<Forwarded> forwarded);
+ std::shared_ptr<Forwarded> getForwarded() const;
+
+ private:
+ std::shared_ptr<Forwarded> forwarded_;
+ };
+}
diff --git a/Swiften/Elements/ChatState.h b/Swiften/Elements/ChatState.h
index 477fd27..4288398 100644
--- a/Swiften/Elements/ChatState.h
+++ b/Swiften/Elements/ChatState.h
@@ -1,27 +1,31 @@
/*
- * Copyright (c) 2010 Kevin Smith
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
#include <string>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
- class ChatState : public Payload {
- public:
- enum ChatStateType {Active, Composing, Paused, Inactive, Gone};
- ChatState(ChatStateType state = Active) {
- state_ = state;
- }
+ class SWIFTEN_API ChatState : public Payload {
+ public:
+ typedef std::shared_ptr<ChatState> ref;
- ChatStateType getChatState() const { return state_; }
- void setChatState(ChatStateType state) {state_ = state;}
+ public:
+ enum ChatStateType {Active, Composing, Paused, Inactive, Gone};
+ ChatState(ChatStateType state = Active) {
+ state_ = state;
+ }
- private:
- ChatStateType state_;
- };
+ ChatStateType getChatState() const { return state_; }
+ void setChatState(ChatStateType state) {state_ = state;}
+
+ private:
+ ChatStateType state_;
+ };
}
diff --git a/Swiften/Elements/ClientState.h b/Swiften/Elements/ClientState.h
new file mode 100644
index 0000000..868d352
--- /dev/null
+++ b/Swiften/Elements/ClientState.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2017 Tarun Gupta.
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#pragma once
+
+#include <string>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
+
+namespace Swift {
+ class SWIFTEN_API ClientState : public Payload {
+ public:
+ typedef std::shared_ptr<ClientState> ref;
+
+ public:
+ enum class ClientStateType {Active, Inactive};
+ ClientState(ClientStateType state = ClientStateType::Active) : state_(state) {
+
+ }
+
+ ClientStateType getClientState() const { return state_; }
+ void setClientState(ClientStateType state) {state_ = state;}
+
+ private:
+ ClientStateType state_;
+ };
+}
diff --git a/Swiften/Elements/Command.h b/Swiften/Elements/Command.h
index 5454d8d..33aadd5 100644
--- a/Swiften/Elements/Command.h
+++ b/Swiften/Elements/Command.h
@@ -1,81 +1,82 @@
/*
- * Copyright (c) 2010 Kevin Smith
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <string>
-#include <Swiften/Elements/Payload.h>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Form.h>
+#include <Swiften/Elements/Payload.h>
namespace Swift {
- /**
- * Ad-Hoc Command (XEP-0050).
- */
- class Command : public Payload {
- public:
- typedef boost::shared_ptr<Command> ref;
-
- enum Status {Executing, Completed, Canceled, NoStatus};
- enum Action {Cancel, Execute, Complete, Prev, Next, NoAction};
-
- struct Note {
- enum Type {Info, Warn, Error};
-
- Note(std::string note, Type type) : note(note), type(type) {}
-
- std::string note;
- Type type;
- };
-
- public:
- Command(const std::string& node, const std::string& sessionID, Status status) { constructor(node, sessionID, NoAction, status);}
- Command(const std::string& node = "", const std::string& sessionID = "", Action action = Execute) { constructor(node, sessionID, action, NoStatus); }
-
- const std::string& getNode() const { return node_; }
- void setNode(const std::string& node) { node_ = node; }
-
- const std::string& getSessionID() const { return sessionID_; }
- void setSessionID(const std::string& id) { sessionID_ = id; }
-
- Action getAction() const { return action_; }
- void setAction(Action action) { action_ = action; }
-
- void setExecuteAction(Action action) { executeAction_ = action; }
- Action getExecuteAction() const { return executeAction_; }
-
- Status getStatus() const { return status_; }
- void setStatus(Status status) { status_ = status; }
-
- void addAvailableAction(Action action) { availableActions_.push_back(action); }
- const std::vector<Action>& getAvailableActions() const { return availableActions_; }
- void addNote(const Note& note) { notes_.push_back(note); }
- const std::vector<Note>& getNotes() const { return notes_; }
-
- Form::ref getForm() const { return form_; }
- void setForm(Form::ref payload) { form_ = payload; }
-
- private:
- void constructor(const std::string& node, const std::string& sessionID, Action action, Status status) {
- node_ = node;
- sessionID_ = sessionID;
- action_ = action;
- status_ = status;
- executeAction_ = NoAction;
- }
-
- private:
- std::string node_;
- std::string sessionID_;
- Action action_;
- Status status_;
- Action executeAction_;
- std::vector<Action> availableActions_;
- std::vector<Note> notes_;
- Form::ref form_;
- };
+ /**
+ * Ad-Hoc Command (XEP-0050).
+ */
+ class SWIFTEN_API Command : public Payload {
+ public:
+ typedef std::shared_ptr<Command> ref;
+
+ enum Status {Executing, Completed, Canceled, NoStatus};
+ enum Action {Cancel, Execute, Complete, Prev, Next, NoAction};
+
+ struct Note {
+ enum Type {Info, Warn, Error};
+
+ Note(std::string note, Type type) : note(note), type(type) {}
+
+ std::string note;
+ Type type;
+ };
+
+ public:
+ Command(const std::string& node, const std::string& sessionID, Status status) { constructor(node, sessionID, NoAction, status);}
+ Command(const std::string& node = "", const std::string& sessionID = "", Action action = Execute) { constructor(node, sessionID, action, NoStatus); }
+
+ const std::string& getNode() const { return node_; }
+ void setNode(const std::string& node) { node_ = node; }
+
+ const std::string& getSessionID() const { return sessionID_; }
+ void setSessionID(const std::string& id) { sessionID_ = id; }
+
+ Action getAction() const { return action_; }
+ void setAction(Action action) { action_ = action; }
+
+ void setExecuteAction(Action action) { executeAction_ = action; }
+ Action getExecuteAction() const { return executeAction_; }
+
+ Status getStatus() const { return status_; }
+ void setStatus(Status status) { status_ = status; }
+
+ void addAvailableAction(Action action) { availableActions_.push_back(action); }
+ const std::vector<Action>& getAvailableActions() const { return availableActions_; }
+ void addNote(const Note& note) { notes_.push_back(note); }
+ const std::vector<Note>& getNotes() const { return notes_; }
+
+ Form::ref getForm() const { return form_; }
+ void setForm(Form::ref payload) { form_ = payload; }
+
+ private:
+ void constructor(const std::string& node, const std::string& sessionID, Action action, Status status) {
+ node_ = node;
+ sessionID_ = sessionID;
+ action_ = action;
+ status_ = status;
+ executeAction_ = NoAction;
+ }
+
+ private:
+ std::string node_;
+ std::string sessionID_;
+ Action action_;
+ Status status_;
+ Action executeAction_;
+ std::vector<Action> availableActions_;
+ std::vector<Note> notes_;
+ Form::ref form_;
+ };
}
diff --git a/Swiften/Elements/ComponentHandshake.h b/Swiften/Elements/ComponentHandshake.h
index 5992b8c..4d6d059 100644
--- a/Swiften/Elements/ComponentHandshake.h
+++ b/Swiften/Elements/ComponentHandshake.h
@@ -1,33 +1,34 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <string>
-#include <Swiften/Elements/Element.h>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/ToplevelElement.h>
namespace Swift {
- class ComponentHandshake : public Element {
- public:
- typedef boost::shared_ptr<ComponentHandshake> ref;
+ class SWIFTEN_API ComponentHandshake : public ToplevelElement {
+ public:
+ typedef std::shared_ptr<ComponentHandshake> ref;
- ComponentHandshake(const std::string& data = "") : data(data) {
- }
+ ComponentHandshake(const std::string& data = "") : data(data) {
+ }
- void setData(const std::string& d) {
- data = d;
- }
+ void setData(const std::string& d) {
+ data = d;
+ }
- const std::string& getData() const {
- return data;
- }
+ const std::string& getData() const {
+ return data;
+ }
- private:
- std::string data;
- };
+ private:
+ std::string data;
+ };
}
diff --git a/Swiften/Elements/CompressFailure.h b/Swiften/Elements/CompressFailure.h
index 7dd8867..8cdd268 100644
--- a/Swiften/Elements/CompressFailure.h
+++ b/Swiften/Elements/CompressFailure.h
@@ -1,17 +1,17 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-
-#include <Swiften/Elements/Element.h>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/ToplevelElement.h>
namespace Swift {
- class CompressFailure : public Element {
- public:
- CompressFailure() {}
- };
+ class SWIFTEN_API CompressFailure : public ToplevelElement {
+ public:
+ CompressFailure() {}
+ };
}
diff --git a/Swiften/Elements/CompressRequest.h b/Swiften/Elements/CompressRequest.h
index b6fcc64..7e813b9 100644
--- a/Swiften/Elements/CompressRequest.h
+++ b/Swiften/Elements/CompressRequest.h
@@ -1,28 +1,31 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Elements/Element.h>
+#include <string>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/ToplevelElement.h>
namespace Swift {
- class CompressRequest : public Element
- {
- public:
- CompressRequest(const std::string& method = "") : method_(method) {}
+ class SWIFTEN_API CompressRequest : public ToplevelElement
+ {
+ public:
+ CompressRequest(const std::string& method = "") : method_(method) {}
- const std::string& getMethod() const {
- return method_;
- }
+ const std::string& getMethod() const {
+ return method_;
+ }
- void setMethod(const std::string& method) {
- method_ = method;
- }
+ void setMethod(const std::string& method) {
+ method_ = method;
+ }
- private:
- std::string method_;
- };
+ private:
+ std::string method_;
+ };
}
diff --git a/Swiften/Elements/Compressed.h b/Swiften/Elements/Compressed.h
index 2affec5..a2e236f 100644
--- a/Swiften/Elements/Compressed.h
+++ b/Swiften/Elements/Compressed.h
@@ -1,16 +1,17 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Elements/Element.h>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/ToplevelElement.h>
namespace Swift {
- class Compressed : public Element {
- public:
- Compressed() {}
- };
+ class SWIFTEN_API Compressed : public ToplevelElement {
+ public:
+ Compressed() {}
+ };
}
diff --git a/Swiften/Elements/ContainerPayload.h b/Swiften/Elements/ContainerPayload.h
index e2a4682..033575a 100644
--- a/Swiften/Elements/ContainerPayload.h
+++ b/Swiften/Elements/ContainerPayload.h
@@ -1,33 +1,33 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
+#include <memory>
+#include <vector>
+
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
-#include <boost/shared_ptr.hpp>
-#include <vector>
namespace Swift {
- template<typename T>
- class SWIFTEN_API ContainerPayload : public Payload {
- public:
- ContainerPayload() {}
- ContainerPayload(boost::shared_ptr<T> payload) : payload(payload) {}
+ template<typename T>
+ class SWIFTEN_API ContainerPayload : public Payload {
+ public:
+ ContainerPayload() {}
+ ContainerPayload(std::shared_ptr<T> payload) : payload(payload) {}
+
+ void setPayload(std::shared_ptr<T> payload) {
+ this->payload = payload;
+ }
- void setPayload(boost::shared_ptr<T> payload) {
- this->payload = payload;
- }
-
- boost::shared_ptr<T> getPayload() const {
- return payload;
- }
+ std::shared_ptr<T> getPayload() const {
+ return payload;
+ }
- private:
- boost::shared_ptr<T> payload;
- };
+ private:
+ std::shared_ptr<T> payload;
+ };
}
diff --git a/Swiften/Elements/Delay.h b/Swiften/Elements/Delay.h
index f4376dc..b154dea 100644
--- a/Swiften/Elements/Delay.h
+++ b/Swiften/Elements/Delay.h
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2010 Kevin Smith
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
@@ -9,23 +9,24 @@
#include <boost/date_time/posix_time/posix_time_types.hpp>
#include <boost/optional.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
#include <Swiften/JID/JID.h>
namespace Swift {
- class Delay : public Payload {
- public:
- Delay() {}
- Delay(const boost::posix_time::ptime& time, const JID& from = JID()) : time_(time), from_(from) {}
+ class SWIFTEN_API Delay : public Payload {
+ public:
+ Delay() {}
+ Delay(const boost::posix_time::ptime& time, const JID& from = JID()) : time_(time), from_(from) {}
- const boost::posix_time::ptime& getStamp() const {return time_;}
- void setStamp(const boost::posix_time::ptime& time) {time_ = time;}
+ const boost::posix_time::ptime& getStamp() const {return time_;}
+ void setStamp(const boost::posix_time::ptime& time) {time_ = time;}
- const boost::optional<JID>& getFrom() const {return from_;}
- void setFrom(const JID& from) {from_ = from;}
+ const boost::optional<JID>& getFrom() const {return from_;}
+ void setFrom(const JID& from) {from_ = from;}
- private:
- boost::posix_time::ptime time_;
- boost::optional<JID> from_;
- };
+ private:
+ boost::posix_time::ptime time_;
+ boost::optional<JID> from_;
+ };
}
diff --git a/Swiften/Elements/DeliveryReceipt.h b/Swiften/Elements/DeliveryReceipt.h
index bd634db..238485d 100644
--- a/Swiften/Elements/DeliveryReceipt.h
+++ b/Swiften/Elements/DeliveryReceipt.h
@@ -4,35 +4,40 @@
* See http://www.opensource.org/licenses/bsd-license.php for more information.
*/
-#pragma once
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
-#include <string>
+#pragma once
#include <string>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
-class DeliveryReceipt : public Payload {
- public:
- typedef boost::shared_ptr<DeliveryReceipt> ref;
+class SWIFTEN_API DeliveryReceipt : public Payload {
+ public:
+ typedef std::shared_ptr<DeliveryReceipt> ref;
- public:
- DeliveryReceipt() {}
+ public:
+ DeliveryReceipt() {}
- DeliveryReceipt(const std::string& msgId) : receivedID_(msgId) {}
+ DeliveryReceipt(const std::string& msgId) : receivedID_(msgId) {}
- void setReceivedID(const std::string& msgId) {
- receivedID_ = msgId;
- }
+ void setReceivedID(const std::string& msgId) {
+ receivedID_ = msgId;
+ }
- std::string getReceivedID() const {
- return receivedID_;
- }
+ std::string getReceivedID() const {
+ return receivedID_;
+ }
- private:
- std::string receivedID_;
+ private:
+ std::string receivedID_;
};
}
diff --git a/Swiften/Elements/DeliveryReceiptRequest.h b/Swiften/Elements/DeliveryReceiptRequest.h
index 3998785..9a7d478 100644
--- a/Swiften/Elements/DeliveryReceiptRequest.h
+++ b/Swiften/Elements/DeliveryReceiptRequest.h
@@ -4,18 +4,25 @@
* See http://www.opensource.org/licenses/bsd-license.php for more information.
*/
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#pragma once
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
-class DeliveryReceiptRequest : public Payload {
- public:
- typedef boost::shared_ptr<DeliveryReceiptRequest> ref;
+class SWIFTEN_API DeliveryReceiptRequest : public Payload {
+ public:
+ typedef std::shared_ptr<DeliveryReceiptRequest> ref;
- public:
- DeliveryReceiptRequest() {}
+ public:
+ DeliveryReceiptRequest() {}
};
}
diff --git a/Swiften/Elements/DiscoInfo.cpp b/Swiften/Elements/DiscoInfo.cpp
index f353c42..701ed40 100644
--- a/Swiften/Elements/DiscoInfo.cpp
+++ b/Swiften/Elements/DiscoInfo.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2018 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#include <Swiften/Elements/DiscoInfo.h>
@@ -11,41 +11,44 @@
namespace Swift {
const std::string DiscoInfo::ChatStatesFeature = std::string("http://jabber.org/protocol/chatstates");
+const std::string DiscoInfo::ClientStatesFeature = std::string("urn:xmpp:csi:0");
const std::string DiscoInfo::SecurityLabelsFeature = std::string("urn:xmpp:sec-label:0");
const std::string DiscoInfo::SecurityLabelsCatalogFeature = std::string("urn:xmpp:sec-label:catalog:2");
const std::string DiscoInfo::JabberSearchFeature = std::string("jabber:iq:search");
const std::string DiscoInfo::CommandsFeature = std::string("http://jabber.org/protocol/commands");
const std::string DiscoInfo::MessageCorrectionFeature = std::string("urn:xmpp:message-correct:0");
const std::string DiscoInfo::JingleFeature = std::string("urn:xmpp:jingle:1");
-const std::string DiscoInfo::JingleFTFeature = std::string("urn:xmpp:jingle:apps:file-transfer:3");
+const std::string DiscoInfo::JingleFTFeature = std::string("urn:xmpp:jingle:apps:file-transfer:4");
const std::string DiscoInfo::JingleTransportsIBBFeature = std::string("urn:xmpp:jingle:transports:ibb:1");
const std::string DiscoInfo::JingleTransportsS5BFeature = std::string("urn:xmpp:jingle:transports:s5b:1");
const std::string DiscoInfo::Bytestream = std::string("http://jabber.org/protocol/bytestreams");
const std::string DiscoInfo::MessageDeliveryReceiptsFeature = std::string("urn:xmpp:receipts");
const std::string DiscoInfo::WhiteboardFeature = std::string("http://swift.im/whiteboard");
const std::string DiscoInfo::BlockingCommandFeature = std::string("urn:xmpp:blocking");
+const std::string DiscoInfo::MessageCarbonsFeature = std::string("urn:xmpp:carbons:2");
+const std::string DiscoInfo::ReferencesFeature = std::string("urn:xmpp:references:0");
bool DiscoInfo::Identity::operator<(const Identity& other) const {
- if (category_ == other.category_) {
- if (type_ == other.type_) {
- if (lang_ == other.lang_) {
- return name_ < other.name_;
- }
- else {
- return lang_ < other.lang_;
- }
- }
- else {
- return type_ < other.type_;
- }
- }
- else {
- return category_ < other.category_;
- }
+ if (category_ == other.category_) {
+ if (type_ == other.type_) {
+ if (lang_ == other.lang_) {
+ return name_ < other.name_;
+ }
+ else {
+ return lang_ < other.lang_;
+ }
+ }
+ else {
+ return type_ < other.type_;
+ }
+ }
+ else {
+ return category_ < other.category_;
+ }
}
bool DiscoInfo::hasFeature(const std::string& feature) const {
- return std::find(features_.begin(), features_.end(), feature) != features_.end();
+ return std::find(features_.begin(), features_.end(), feature) != features_.end();
}
}
diff --git a/Swiften/Elements/DiscoInfo.h b/Swiften/Elements/DiscoInfo.h
index 3701096..713eaba 100644
--- a/Swiften/Elements/DiscoInfo.h
+++ b/Swiften/Elements/DiscoInfo.h
@@ -1,113 +1,116 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2018 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <vector>
#include <string>
+#include <vector>
#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/Form.h>
+#include <Swiften/Elements/Payload.h>
namespace Swift {
- /**
- * disco#info from XEP-0030
- */
- class SWIFTEN_API DiscoInfo : public Payload {
- public:
- typedef boost::shared_ptr<DiscoInfo> ref;
-
- static const std::string ChatStatesFeature;
- static const std::string SecurityLabelsFeature;
- static const std::string SecurityLabelsCatalogFeature;
- static const std::string JabberSearchFeature;
- static const std::string CommandsFeature;
- static const std::string MessageCorrectionFeature;
- static const std::string JingleFeature;
- static const std::string JingleFTFeature;
- static const std::string JingleTransportsIBBFeature;
- static const std::string JingleTransportsS5BFeature;
- static const std::string Bytestream;
- static const std::string MessageDeliveryReceiptsFeature;
- static const std::string WhiteboardFeature;
- static const std::string BlockingCommandFeature;
-
- class Identity {
- public:
- Identity(const std::string& name, const std::string& category = "client", const std::string& type = "pc", const std::string& lang = "") : name_(name), category_(category), type_(type), lang_(lang) {
- }
-
- const std::string& getCategory() const {
- return category_;
- }
-
- const std::string& getType() const {
- return type_;
- }
-
- const std::string& getLanguage() const {
- return lang_;
- }
-
- const std::string& getName() const {
- return name_;
- }
-
- // Sorted according to XEP-115 rules
- bool operator<(const Identity& other) const;
-
- private:
- std::string name_;
- std::string category_;
- std::string type_;
- std::string lang_;
- };
-
- DiscoInfo() {
- }
-
- const std::string& getNode() const {
- return node_;
- }
-
- void setNode(const std::string& node) {
- node_ = node;
- }
-
- const std::vector<Identity>& getIdentities() const {
- return identities_;
- }
-
- void addIdentity(const Identity& identity) {
- identities_.push_back(identity);
- }
-
- const std::vector<std::string>& getFeatures() const {
- return features_;
- }
-
- void addFeature(const std::string& feature) {
- features_.push_back(feature);
- }
-
- bool hasFeature(const std::string& feature) const;
-
- void addExtension(Form::ref form) {
- extensions_.push_back(form);
- }
-
- const std::vector<Form::ref>& getExtensions() const {
- return extensions_;
- }
-
- private:
- std::string node_;
- std::vector<Identity> identities_;
- std::vector<std::string> features_;
- std::vector<Form::ref> extensions_;
- };
+ /**
+ * disco#info from XEP-0030
+ */
+ class SWIFTEN_API DiscoInfo : public Payload {
+ public:
+ typedef std::shared_ptr<DiscoInfo> ref;
+
+ static const std::string ChatStatesFeature;
+ static const std::string ClientStatesFeature;
+ static const std::string SecurityLabelsFeature;
+ static const std::string SecurityLabelsCatalogFeature;
+ static const std::string JabberSearchFeature;
+ static const std::string CommandsFeature;
+ static const std::string MessageCorrectionFeature;
+ static const std::string JingleFeature;
+ static const std::string JingleFTFeature;
+ static const std::string JingleTransportsIBBFeature;
+ static const std::string JingleTransportsS5BFeature;
+ static const std::string Bytestream;
+ static const std::string MessageDeliveryReceiptsFeature;
+ static const std::string WhiteboardFeature;
+ static const std::string BlockingCommandFeature;
+ static const std::string MessageCarbonsFeature;
+ static const std::string ReferencesFeature;
+
+ class Identity {
+ public:
+ Identity(const std::string& name, const std::string& category = "client", const std::string& type = "pc", const std::string& lang = "") : name_(name), category_(category), type_(type), lang_(lang) {
+ }
+
+ const std::string& getCategory() const {
+ return category_;
+ }
+
+ const std::string& getType() const {
+ return type_;
+ }
+
+ const std::string& getLanguage() const {
+ return lang_;
+ }
+
+ const std::string& getName() const {
+ return name_;
+ }
+
+ // Sorted according to XEP-115 rules
+ bool operator<(const Identity& other) const;
+
+ private:
+ std::string name_;
+ std::string category_;
+ std::string type_;
+ std::string lang_;
+ };
+
+ DiscoInfo() {
+ }
+
+ const std::string& getNode() const {
+ return node_;
+ }
+
+ void setNode(const std::string& node) {
+ node_ = node;
+ }
+
+ const std::vector<Identity>& getIdentities() const {
+ return identities_;
+ }
+
+ void addIdentity(const Identity& identity) {
+ identities_.push_back(identity);
+ }
+
+ const std::vector<std::string>& getFeatures() const {
+ return features_;
+ }
+
+ void addFeature(const std::string& feature) {
+ features_.push_back(feature);
+ }
+
+ bool hasFeature(const std::string& feature) const;
+
+ void addExtension(Form::ref form) {
+ extensions_.push_back(form);
+ }
+
+ const std::vector<Form::ref>& getExtensions() const {
+ return extensions_;
+ }
+
+ private:
+ std::string node_;
+ std::vector<Identity> identities_;
+ std::vector<std::string> features_;
+ std::vector<Form::ref> extensions_;
+ };
}
diff --git a/Swiften/Elements/DiscoItems.h b/Swiften/Elements/DiscoItems.h
index cbca399..9c06b8d 100644
--- a/Swiften/Elements/DiscoItems.h
+++ b/Swiften/Elements/DiscoItems.h
@@ -1,70 +1,71 @@
/*
- * Copyright (c) 2010 Kevin Smith
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <vector>
#include <string>
+#include <vector>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
#include <Swiften/JID/JID.h>
namespace Swift {
- /**
- * Service discovery disco#items from XEP-0030.
- */
- class DiscoItems : public Payload {
- public:
- /**
- * A single result item.
- */
- class Item {
- public:
- Item(const std::string& name, const JID& jid, const std::string& node="") : name_(name), jid_(jid), node_(node) {
- }
+ /**
+ * Service discovery disco#items from XEP-0030.
+ */
+ class SWIFTEN_API DiscoItems : public Payload {
+ public:
+ /**
+ * A single result item.
+ */
+ class Item {
+ public:
+ Item(const std::string& name, const JID& jid, const std::string& node="") : name_(name), jid_(jid), node_(node) {
+ }
- const std::string& getName() const {
- return name_;
- }
+ const std::string& getName() const {
+ return name_;
+ }
- const std::string& getNode() const {
- return node_;
- }
+ const std::string& getNode() const {
+ return node_;
+ }
- const JID& getJID() const {
- return jid_;
- }
+ const JID& getJID() const {
+ return jid_;
+ }
- private:
- std::string name_;
- JID jid_;
- std::string node_;
- };
+ private:
+ std::string name_;
+ JID jid_;
+ std::string node_;
+ };
- DiscoItems() {
- }
+ DiscoItems() {
+ }
- const std::string& getNode() const {
- return node_;
- }
+ const std::string& getNode() const {
+ return node_;
+ }
- void setNode(const std::string& node) {
- node_ = node;
- }
+ void setNode(const std::string& node) {
+ node_ = node;
+ }
- const std::vector<Item>& getItems() const {
- return items_;
- }
+ const std::vector<Item>& getItems() const {
+ return items_;
+ }
- void addItem(const Item& item) {
- items_.push_back(item);
- }
+ void addItem(const Item& item) {
+ items_.push_back(item);
+ }
- private:
- std::string node_;
- std::vector<Item> items_;
- };
+ private:
+ std::string node_;
+ std::vector<Item> items_;
+ };
}
diff --git a/Swiften/Elements/Element.cpp b/Swiften/Elements/Element.cpp
index 94829ba..7b176be 100644
--- a/Swiften/Elements/Element.cpp
+++ b/Swiften/Elements/Element.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2014 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#include <Swiften/Elements/Element.h>
diff --git a/Swiften/Elements/Element.h b/Swiften/Elements/Element.h
index 638418d..b036a29 100644
--- a/Swiften/Elements/Element.h
+++ b/Swiften/Elements/Element.h
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2014 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
@@ -9,8 +9,12 @@
#include <Swiften/Base/API.h>
namespace Swift {
- class SWIFTEN_API Element {
- public:
- virtual ~Element();
- };
+ class SWIFTEN_API Element {
+ public:
+ Element() {}
+ SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(Element)
+ virtual ~Element();
+
+ SWIFTEN_DEFAULT_COPY_ASSIGMNENT_OPERATOR(Element)
+ };
}
diff --git a/Swiften/Elements/EnableStreamManagement.h b/Swiften/Elements/EnableStreamManagement.h
index 15a091e..bf867e2 100644
--- a/Swiften/Elements/EnableStreamManagement.h
+++ b/Swiften/Elements/EnableStreamManagement.h
@@ -1,17 +1,17 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Elements/Element.h>
-
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/ToplevelElement.h>
namespace Swift {
- class EnableStreamManagement : public Element {
- public:
- EnableStreamManagement() {}
- };
+ class SWIFTEN_API EnableStreamManagement : public ToplevelElement {
+ public:
+ EnableStreamManagement() {}
+ };
}
diff --git a/Swiften/Elements/ErrorPayload.h b/Swiften/Elements/ErrorPayload.h
index f21ba98..0269e4d 100644
--- a/Swiften/Elements/ErrorPayload.h
+++ b/Swiften/Elements/ErrorPayload.h
@@ -1,86 +1,87 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <string>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
- class ErrorPayload : public Payload {
- public:
- typedef boost::shared_ptr<ErrorPayload> ref;
-
- enum Type { Cancel, Continue, Modify, Auth, Wait };
-
- enum Condition {
- BadRequest,
- Conflict,
- FeatureNotImplemented,
- Forbidden,
- Gone,
- InternalServerError,
- ItemNotFound,
- JIDMalformed,
- NotAcceptable,
- NotAllowed,
- NotAuthorized,
- PaymentRequired,
- RecipientUnavailable,
- Redirect,
- RegistrationRequired,
- RemoteServerNotFound,
- RemoteServerTimeout,
- ResourceConstraint,
- ServiceUnavailable,
- SubscriptionRequired,
- UndefinedCondition,
- UnexpectedRequest
- };
-
- ErrorPayload(Condition condition = UndefinedCondition, Type type = Cancel, const std::string& text = std::string()) : type_(type), condition_(condition), text_(text) { }
-
- Type getType() const {
- return type_;
- }
-
- void setType(Type type) {
- type_ = type;
- }
-
- Condition getCondition() const {
- return condition_;
- }
-
- void setCondition(Condition condition) {
- condition_ = condition;
- }
-
- void setText(const std::string& text) {
- text_ = text;
- }
-
- const std::string& getText() const {
- return text_;
- }
-
- void setPayload(boost::shared_ptr<Payload> payload) {
- payload_ = payload;
- }
-
- boost::shared_ptr<Payload> getPayload() const {
- return payload_;
- }
-
- private:
- Type type_;
- Condition condition_;
- std::string text_;
- boost::shared_ptr<Payload> payload_;
- };
+ class SWIFTEN_API ErrorPayload : public Payload {
+ public:
+ typedef std::shared_ptr<ErrorPayload> ref;
+
+ enum Type { Cancel, Continue, Modify, Auth, Wait };
+
+ enum Condition {
+ BadRequest,
+ Conflict,
+ FeatureNotImplemented,
+ Forbidden,
+ Gone,
+ InternalServerError,
+ ItemNotFound,
+ JIDMalformed,
+ NotAcceptable,
+ NotAllowed,
+ NotAuthorized,
+ PaymentRequired,
+ RecipientUnavailable,
+ Redirect,
+ RegistrationRequired,
+ RemoteServerNotFound,
+ RemoteServerTimeout,
+ ResourceConstraint,
+ ServiceUnavailable,
+ SubscriptionRequired,
+ UndefinedCondition,
+ UnexpectedRequest
+ };
+
+ ErrorPayload(Condition condition = UndefinedCondition, Type type = Cancel, const std::string& text = std::string()) : type_(type), condition_(condition), text_(text) { }
+
+ Type getType() const {
+ return type_;
+ }
+
+ void setType(Type type) {
+ type_ = type;
+ }
+
+ Condition getCondition() const {
+ return condition_;
+ }
+
+ void setCondition(Condition condition) {
+ condition_ = condition;
+ }
+
+ void setText(const std::string& text) {
+ text_ = text;
+ }
+
+ const std::string& getText() const {
+ return text_;
+ }
+
+ void setPayload(std::shared_ptr<Payload> payload) {
+ payload_ = payload;
+ }
+
+ std::shared_ptr<Payload> getPayload() const {
+ return payload_;
+ }
+
+ private:
+ Type type_;
+ Condition condition_;
+ std::string text_;
+ std::shared_ptr<Payload> payload_;
+ };
}
diff --git a/Swiften/Elements/Form.cpp b/Swiften/Elements/Form.cpp
index c4ae410..dc4bd72 100644
--- a/Swiften/Elements/Form.cpp
+++ b/Swiften/Elements/Form.cpp
@@ -1,45 +1,64 @@
/*
- * Copyright (c) 2010-2013 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#include <Swiften/Elements/Form.h>
-#include <Swiften/Base/foreach.h>
namespace Swift {
std::string Form::getFormType() const {
- FormField::ref field = getField("FORM_TYPE");
- if (field && field->getType() == FormField::HiddenType) {
- return field->getValues().empty() ? "" : field->getValues()[0];
- }
- return "";
+ FormField::ref field = getField("FORM_TYPE");
+ if (field && field->getType() == FormField::HiddenType) {
+ return field->getValues().empty() ? "" : field->getValues()[0];
+ }
+ return "";
}
FormField::ref Form::getField(const std::string& name) const {
- foreach(FormField::ref field, fields_) {
- if (field->getName() == name) {
- return field;
- }
- }
- return FormField::ref();
+ for (const auto& field : fields_) {
+ if (field->getName() == name) {
+ return field;
+ }
+ }
+ return FormField::ref();
}
void Form::addReportedField(FormField::ref field) {
- reportedFields_.push_back(field);
+ reportedFields_.push_back(field);
}
const std::vector<FormField::ref>& Form::getReportedFields() const {
- return reportedFields_;
+ return reportedFields_;
}
void Form::addItem(const Form::FormItem& item) {
- items_.push_back(item);
+ items_.push_back(item);
}
const std::vector<Form::FormItem>& Form::getItems() const {
- return items_;
+ return items_;
+}
+
+void Form::clearEmptyTextFields() {
+ std::vector<FormField::ref> populatedFields;
+ for (const auto& field : fields_) {
+ if (field->getType() == FormField::TextSingleType) {
+ if (!field->getTextSingleValue().empty()) {
+ populatedFields.push_back(field);
+ }
+ }
+ else if (field->getType() == FormField::TextMultiType) {
+ if (!field->getTextMultiValue().empty()) {
+ populatedFields.push_back(field);
+ }
+ }
+ else {
+ populatedFields.push_back(field);
+ }
+ }
+ fields_ = populatedFields;
}
}
diff --git a/Swiften/Elements/Form.h b/Swiften/Elements/Form.h
index 76ed674..827e497 100644
--- a/Swiften/Elements/Form.h
+++ b/Swiften/Elements/Form.h
@@ -1,68 +1,130 @@
/*
- * Copyright (c) 2010 Kevin Smith
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <vector>
+#include <cassert>
#include <string>
+#include <vector>
#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/FormField.h>
+#include <Swiften/Elements/FormPage.h>
+#include <Swiften/Elements/FormSection.h>
+#include <Swiften/Elements/Payload.h>
#include <Swiften/JID/JID.h>
namespace Swift {
- /**
- * XEP-0004 Data form.
- * For the relevant Fields, the parsers and serialisers protect the API user against
- * the strange multi-value instead of newline thing by transforming them.
- */
- class SWIFTEN_API Form : public Payload {
- public:
- typedef boost::shared_ptr<Form> ref;
- typedef std::vector<FormField::ref> FormItem;
-
- enum Type { FormType, SubmitType, CancelType, ResultType };
-
- public:
- Form(Type type = FormType) : type_(type) {}
-
- /** Add a field to the form.
- * @param field New field - must not be null.
- */
- void addField(boost::shared_ptr<FormField> field) {assert(field); fields_.push_back(field); }
- const std::vector<boost::shared_ptr<FormField> >& getFields() const { return fields_; }
- void clearFields() { fields_.clear(); }
- void setTitle(const std::string& title) { title_ = title; }
- const std::string& getTitle() const { return title_; }
-
- void setInstructions(const std::string& instructions) { instructions_ = instructions; }
- const std::string& getInstructions() const { return instructions_; }
-
- Type getType() const { return type_; }
- void setType(Type type) { type_ = type; }
-
- std::string getFormType() const;
-
- FormField::ref getField(const std::string& name) const;
-
- void addReportedField(FormField::ref field);
- const std::vector<FormField::ref>& getReportedFields() const;
- void clearReportedFields() { reportedFields_.clear(); }
-
- void addItem(const FormItem& item);
- const std::vector<FormItem>& getItems() const;
- void clearItems() { items_.clear(); }
-
- private:
- std::vector<boost::shared_ptr<FormField> > fields_;
- std::vector<boost::shared_ptr<FormField> > reportedFields_;
- std::vector<FormItem> items_;
- std::string title_;
- std::string instructions_;
- Type type_;
- };
+ /**
+ * XEP-0004 Data form.
+ * For the relevant Fields, the parsers and serialisers protect the API user against
+ * the strange multi-value instead of newline thing by transforming them.
+ */
+ class SWIFTEN_API Form : public Payload {
+ public:
+ typedef std::shared_ptr<Form> ref;
+ typedef std::vector<FormField::ref> FormItem;
+
+ enum Type { FormType, SubmitType, CancelType, ResultType };
+
+ public:
+ Form(Type type = FormType) : type_(type) {}
+
+ void addPage(std::shared_ptr<FormPage> page) {
+ assert(page);
+ pages_.push_back(page);
+ }
+
+ const std::vector<std::shared_ptr<FormPage> >& getPages() const {
+ return pages_;
+ }
+
+ void addField(std::shared_ptr<FormField> field) {
+ assert(field);
+ fields_.push_back(field);
+ }
+
+ const std::vector<std::shared_ptr<FormField> >& getFields() const {
+ return fields_;
+ }
+
+ void clearFields() {
+ fields_.clear();
+ }
+
+ void addTextElement(std::shared_ptr<FormText> text) {
+ assert(text);
+ textElements_.push_back(text);
+ }
+
+ const std::vector<std::shared_ptr<FormText> >& getTextElements() const {
+ return textElements_;
+ }
+
+ void addReportedRef(std::shared_ptr<FormReportedRef> reportedRef) {
+ assert(reportedRef);
+ reportedRefs_.push_back(reportedRef);
+ }
+
+ const std::vector<std::shared_ptr<FormReportedRef> >& getReportedRefs() const {
+ return reportedRefs_;
+ }
+
+ void setTitle(const std::string& title) {
+ title_ = title;
+ }
+
+ const std::string& getTitle() const {
+ return title_;
+ }
+
+ void setInstructions(const std::string& instructions) {
+ instructions_ = instructions;
+ }
+
+ const std::string& getInstructions() const {
+ return instructions_;
+ }
+
+ /** Returns the Form::Type enum (ie. ResultType, CancelType etc.).
+ * NOT to be confused with Form::getFormType().
+ */
+ Type getType() const {
+ return type_;
+ }
+
+ void setType(Type type) {
+ type_ = type;
+ }
+
+ /** Returns the value of the field FORM_TYPE
+ * NOT to be confused with Form::getType().
+ */
+ std::string getFormType() const;
+ FormField::ref getField(const std::string& name) const;
+ void addItem(const FormItem& item);
+ const std::vector<FormItem>& getItems() const;
+ void clearItems() { items_.clear(); }
+
+ void clearEmptyTextFields();
+
+ void addReportedField(FormField::ref field);
+ const std::vector<FormField::ref> & getReportedFields() const;
+ void clearReportedFields() { reportedFields_.clear(); }
+
+ private:
+ std::vector<std::shared_ptr<FormReportedRef> >reportedRefs_;
+ std::vector<std::shared_ptr<FormText> > textElements_;
+ std::vector<std::shared_ptr<FormPage> > pages_;
+ std::vector<std::shared_ptr<FormField> > fields_;
+ std::vector<std::shared_ptr<FormField> > reportedFields_;
+ std::vector<FormItem> items_;
+ std::shared_ptr<FormReportedRef> reportedRef_;
+ std::string title_;
+ std::string instructions_;
+ Type type_;
+ };
}
diff --git a/Swiften/Elements/FormField.cpp b/Swiften/Elements/FormField.cpp
index e9e4f77..d4bc9f4 100644
--- a/Swiften/Elements/FormField.cpp
+++ b/Swiften/Elements/FormField.cpp
@@ -1,14 +1,14 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2016 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#include <Swiften/Elements/FormField.h>
-#include <boost/algorithm/string/split.hpp>
-#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/classification.hpp>
+#include <boost/algorithm/string/join.hpp>
+#include <boost/algorithm/string/split.hpp>
using namespace Swift;
@@ -16,17 +16,17 @@ FormField::~FormField() {
}
std::string FormField::getTextMultiValue() const {
- assert(type == TextMultiType || type == UnknownType);
- return boost::algorithm::join(values, "\n");
+ assert(type == TextMultiType || type == UnknownType);
+ return boost::algorithm::join(values, "\n");
}
void FormField::setTextMultiValue(const std::string& value) {
- assert(type == TextMultiType || type == UnknownType);
- values.clear();
- boost::split(values, value, boost::is_any_of("\n"));
+ assert(type == TextMultiType || type == UnknownType);
+ values.clear();
+ boost::split(values, value, boost::is_any_of("\n"));
}
void FormField::setBoolValue(bool b) {
- values.clear();
- values.push_back(b ? "1" : "0");
+ values.clear();
+ values.push_back(b ? "1" : "0");
}
diff --git a/Swiften/Elements/FormField.h b/Swiften/Elements/FormField.h
index f0bebd9..194589c 100644
--- a/Swiften/Elements/FormField.h
+++ b/Swiften/Elements/FormField.h
@@ -1,138 +1,140 @@
/*
- * Copyright (c) 2010-2013 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <vector>
-#include <boost/shared_ptr.hpp>
+#include <cassert>
+#include <memory>
#include <string>
+#include <vector>
+#include <Swiften/Base/API.h>
#include <Swiften/JID/JID.h>
namespace Swift {
- class FormField {
- public:
- typedef boost::shared_ptr<FormField> ref;
-
- enum Type {
- UnknownType,
- BooleanType,
- FixedType,
- HiddenType,
- ListSingleType,
- TextMultiType,
- TextPrivateType,
- TextSingleType,
- JIDSingleType,
- JIDMultiType,
- ListMultiType
- };
-
- FormField(Type type = UnknownType) : type(type), required(false) {}
- FormField(Type type, const std::string& value) : type(type), required(false) {
- addValue(value);
- }
- virtual ~FormField();
-
- struct Option {
- Option(const std::string& label, const std::string& value) : label(label), value(value) {}
- std::string label;
- std::string value;
- };
-
- void setName(const std::string& name) { this->name = name; }
- const std::string& getName() const { return name; }
-
- void setLabel(const std::string& label) { this->label = label; }
- const std::string& getLabel() const { return label; }
-
- void setDescription(const std::string& description) { this->description = description; }
- const std::string& getDescription() const { return description; }
-
- void setRequired(bool required) { this->required = required; }
- bool getRequired() const { return required; }
-
- void addOption(const Option& option) {
- options.push_back(option);
- }
-
- const std::vector<Option>& getOptions() const {
- return options;
- }
-
- void clearOptions() {
- options.clear();
- }
-
- const std::vector<std::string>& getValues() const {
- return values;
- }
-
- void addValue(const std::string& value) {
- values.push_back(value);
- }
-
- Type getType() const {
- return type;
- }
-
- void setType(Type type) {
- this->type = type;
- }
-
- // Type specific
-
- bool getBoolValue() const {
- assert(type == BooleanType || type == UnknownType);
- if (values.empty()) {
- return false;
- }
- return values[0] == "true" || values[0] == "1";
- }
-
- void setBoolValue(bool b);
-
- JID getJIDSingleValue() const {
- assert(type == JIDSingleType || type == UnknownType);
- return values.empty() ? JID() : JID(values[0]);
- }
-
- JID getJIDMultiValue(size_t index) const {
- assert(type == JIDMultiType || type == UnknownType);
- return values.empty() ? JID() : JID(values[index]);
- }
-
- std::string getTextPrivateValue() const {
- assert(type == TextPrivateType || type == UnknownType);
- return values.empty() ? "" : values[0];
- }
-
- std::string getFixedValue() const {
- assert(type == FixedType || type == UnknownType);
- return values.empty() ? "" : values[0];
- }
-
- std::string getTextSingleValue() const {
- assert(type == TextSingleType || type == UnknownType);
- return values.empty() ? "" : values[0];
- }
-
- std::string getTextMultiValue() const;
- void setTextMultiValue(const std::string& value);
-
- protected:
-
- private:
- Type type;
- std::string name;
- std::string label;
- std::string description;
- bool required;
- std::vector<Option> options;
- std::vector<std::string> values;
- };
+ class SWIFTEN_API FormField {
+ public:
+ typedef std::shared_ptr<FormField> ref;
+
+ enum Type {
+ UnknownType,
+ BooleanType,
+ FixedType,
+ HiddenType,
+ ListSingleType,
+ TextMultiType,
+ TextPrivateType,
+ TextSingleType,
+ JIDSingleType,
+ JIDMultiType,
+ ListMultiType
+ };
+
+ FormField(Type type = UnknownType) : type(type), required(false) {}
+ FormField(Type type, const std::string& value) : type(type), required(false) {
+ addValue(value);
+ }
+ virtual ~FormField();
+
+ struct Option {
+ Option(const std::string& label, const std::string& value) : label(label), value(value) {}
+ std::string label;
+ std::string value;
+ };
+
+ void setName(const std::string& name) { this->name = name; }
+ const std::string& getName() const { return name; }
+
+ void setLabel(const std::string& label) { this->label = label; }
+ const std::string& getLabel() const { return label; }
+
+ void setDescription(const std::string& description) { this->description = description; }
+ const std::string& getDescription() const { return description; }
+
+ void setRequired(bool required) { this->required = required; }
+ bool getRequired() const { return required; }
+
+ void addOption(const Option& option) {
+ options.push_back(option);
+ }
+
+ const std::vector<Option>& getOptions() const {
+ return options;
+ }
+
+ void clearOptions() {
+ options.clear();
+ }
+
+ const std::vector<std::string>& getValues() const {
+ return values;
+ }
+
+ void addValue(const std::string& value) {
+ values.push_back(value);
+ }
+
+ Type getType() const {
+ return type;
+ }
+
+ void setType(Type type) {
+ this->type = type;
+ }
+
+ // Type specific
+
+ bool getBoolValue() const {
+ assert(type == BooleanType || type == UnknownType);
+ if (values.empty()) {
+ return false;
+ }
+ return values[0] == "true" || values[0] == "1";
+ }
+
+ void setBoolValue(bool b);
+
+ JID getJIDSingleValue() const {
+ assert(type == JIDSingleType || type == UnknownType);
+ return values.empty() ? JID() : JID(values[0]);
+ }
+
+ JID getJIDMultiValue(size_t index) const {
+ assert(type == JIDMultiType || type == UnknownType);
+ return values.empty() ? JID() : JID(values[index]);
+ }
+
+ std::string getTextPrivateValue() const {
+ assert(type == TextPrivateType || type == UnknownType);
+ return values.empty() ? "" : values[0];
+ }
+
+ std::string getFixedValue() const {
+ assert(type == FixedType || type == UnknownType);
+ return values.empty() ? "" : values[0];
+ }
+
+ std::string getTextSingleValue() const {
+ assert(type == TextSingleType || type == UnknownType);
+ return values.empty() ? "" : values[0];
+ }
+
+ std::string getTextMultiValue() const;
+ void setTextMultiValue(const std::string& value);
+
+ protected:
+
+ private:
+ Type type;
+ std::string name;
+ std::string label;
+ std::string description;
+ bool required;
+ std::vector<Option> options;
+ std::vector<std::string> values;
+ };
}
diff --git a/Swiften/Elements/FormPage.cpp b/Swiften/Elements/FormPage.cpp
new file mode 100644
index 0000000..0afa112
--- /dev/null
+++ b/Swiften/Elements/FormPage.cpp
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+#include <Swiften/Elements/FormPage.h>
+
+namespace Swift {
+
+FormPage::FormPage() {
+}
+
+FormPage::~FormPage() {
+}
+
+void FormPage::setLabel(const std::string& label) {
+ label_ = label;
+}
+
+const std::string& FormPage::getLabel() const {
+ return label_;
+}
+
+void FormPage::addChildSection(std::shared_ptr<FormSection> section) {
+ childSections_.push_back(section);
+}
+
+const std::vector<std::shared_ptr<FormSection> >& FormPage::getChildSections() const {
+ return childSections_;
+}
+
+void FormPage::addTextElement(std::shared_ptr<FormText> textElement) {
+ textElements_.push_back(textElement);
+}
+
+const std::vector<std::shared_ptr<FormText> >& FormPage::getTextElements() const {
+ return textElements_;
+}
+
+void FormPage::addReportedRef(std::shared_ptr<FormReportedRef> reportedRef) {
+ reportedRefs_.push_back(reportedRef);
+}
+
+const std::vector<std::shared_ptr<FormReportedRef> >& FormPage::getReportedRefs() const {
+ return reportedRefs_;
+}
+
+void FormPage::addField(std::shared_ptr<FormField> field) {
+ fields_.push_back(field);
+}
+
+const std::vector<std::shared_ptr<FormField> >& FormPage::getFields() const {
+ return fields_;
+}
+
+void FormPage::addFieldRef(std::string ref) {
+ fieldRefs_.push_back(ref);
+}
+
+const std::vector<std::string> FormPage::getFieldRefs() const {
+ return fieldRefs_;
+}
+
+}
diff --git a/Swiften/Elements/FormPage.h b/Swiften/Elements/FormPage.h
new file mode 100644
index 0000000..8412d9e
--- /dev/null
+++ b/Swiften/Elements/FormPage.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+#pragma once
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/FormField.h>
+#include <Swiften/Elements/FormReportedRef.h>
+#include <Swiften/Elements/FormSection.h>
+#include <Swiften/Elements/FormText.h>
+
+namespace Swift {
+
+ class SWIFTEN_API FormPage {
+ public:
+ typedef std::shared_ptr<FormPage> page;
+ FormPage ();
+ ~FormPage();
+ void setLabel(const std::string& label);
+ const std::string& getLabel() const;
+ void addChildSection(std::shared_ptr<FormSection> section);
+ const std::vector<std::shared_ptr<FormSection> >& getChildSections() const;
+ void addTextElement(std::shared_ptr<FormText> textElement);
+ const std::vector<std::shared_ptr<FormText> >& getTextElements() const;
+ void addReportedRef(std::shared_ptr<FormReportedRef> reportedRef);
+ const std::vector<std::shared_ptr<FormReportedRef> >& getReportedRefs() const;
+ void addField(std::shared_ptr<FormField> field);
+ const std::vector<std::shared_ptr<FormField> >& getFields() const;
+ void addFieldRef(std::string ref);
+ const std::vector<std::string> getFieldRefs() const;
+
+ private:
+ std::string label_;
+ std::vector<std::shared_ptr<FormText> > textElements_;
+ std::vector<std::shared_ptr<FormSection> > childSections_;
+ std::vector<std::shared_ptr<FormReportedRef> > reportedRefs_;
+ std::vector<std::shared_ptr<FormField> > fields_;
+ std::vector<std::string> fieldRefs_;
+ };
+}
diff --git a/Swiften/Elements/FormReportedRef.h b/Swiften/Elements/FormReportedRef.h
new file mode 100644
index 0000000..d6dc718
--- /dev/null
+++ b/Swiften/Elements/FormReportedRef.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+#pragma once
+
+#include <memory>
+
+#include <Swiften/Base/API.h>
+
+namespace Swift {
+
+ class SWIFTEN_API FormReportedRef {
+
+ public:
+ typedef std::shared_ptr<FormReportedRef> ref;
+ };
+}
diff --git a/Swiften/Elements/FormSection.cpp b/Swiften/Elements/FormSection.cpp
new file mode 100644
index 0000000..9ca3b4d
--- /dev/null
+++ b/Swiften/Elements/FormSection.cpp
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+#include <Swiften/Elements/FormSection.h>
+
+namespace Swift {
+
+FormSection::FormSection() {
+}
+
+FormSection::~FormSection() {
+}
+
+void FormSection::setLabel(const std::string& label) {
+ label_ = label;
+}
+
+const std::string& FormSection::getLabel() const {
+ return label_;
+}
+
+void FormSection::addTextElement(std::shared_ptr<FormText> textElement) {
+ textElements_.push_back(textElement);
+}
+
+const std::vector<std::shared_ptr<FormText> >& FormSection::getTextElements() const {
+ return textElements_;
+}
+
+void FormSection::addReportedRef(std::shared_ptr<FormReportedRef> reportedRef) {
+ reportedRefs_.push_back(reportedRef);
+}
+
+const std::vector<std::shared_ptr<FormReportedRef> >& FormSection::getReportedRefs() const {
+ return reportedRefs_;
+}
+
+void FormSection::addChildSection(std::shared_ptr<FormSection> childSection) {
+ childSections_.push_back(childSection);
+}
+
+const std::vector<std::shared_ptr<FormSection> >& FormSection::getChildSections() const {
+ return childSections_;
+}
+
+void FormSection::addField(std::shared_ptr<FormField> field) {
+ fields_.push_back(field);
+}
+
+const std::vector<std::shared_ptr<FormField> >& FormSection::getFields() const {
+ return fields_;
+}
+
+void FormSection::addFieldRef(std::string ref) {
+ fieldRefs_.push_back(ref);
+}
+
+const std::vector<std::string> FormSection::getFieldRefs() const {
+ return fieldRefs_;
+}
+
+}
diff --git a/Swiften/Elements/FormSection.h b/Swiften/Elements/FormSection.h
new file mode 100644
index 0000000..b1d60bc
--- /dev/null
+++ b/Swiften/Elements/FormSection.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+#pragma once
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/FormField.h>
+#include <Swiften/Elements/FormReportedRef.h>
+#include <Swiften/Elements/FormText.h>
+
+namespace Swift {
+
+ class SWIFTEN_API FormSection {
+ public:
+ typedef std::shared_ptr<FormSection> section;
+ FormSection();
+ ~FormSection();
+ void setLabel(const std::string& label);
+ const std::string& getLabel() const;
+ void addTextElement(std::shared_ptr<FormText> textElement);
+ const std::vector<std::shared_ptr<FormText> >& getTextElements() const;
+ void addReportedRef(std::shared_ptr<FormReportedRef> reportedRef);
+ const std::vector<std::shared_ptr<FormReportedRef> >& getReportedRefs() const;
+ void addChildSection(std::shared_ptr<FormSection> childSection);
+ const std::vector<std::shared_ptr<FormSection> >& getChildSections() const;
+ void addField(std::shared_ptr<FormField> field);
+ const std::vector<std::shared_ptr<FormField> >& getFields() const;
+ void addFieldRef(std::string ref);
+ const std::vector<std::string> getFieldRefs() const;
+
+ private:
+ std::string label_;
+ std::vector<std::shared_ptr<FormText> > textElements_;
+ std::vector<std::shared_ptr<FormReportedRef> > reportedRefs_;
+ std::vector<std::shared_ptr<FormSection> > childSections_;
+ std::vector<std::shared_ptr<FormField> > fields_;
+ std::vector<std::string> fieldRefs_;
+ };
+}
diff --git a/Swiften/Elements/FormText.cpp b/Swiften/Elements/FormText.cpp
new file mode 100644
index 0000000..2180e13
--- /dev/null
+++ b/Swiften/Elements/FormText.cpp
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+#include <Swiften/Elements/FormText.h>
+
+namespace Swift {
+
+FormText::FormText() {
+}
+
+FormText::~FormText() {
+}
+
+void FormText::setTextString(const std::string& text) {
+ text_ = text;
+}
+
+const std::string& FormText::getTextString() const {
+ return text_;
+}
+
+}
diff --git a/Swiften/Elements/FormText.h b/Swiften/Elements/FormText.h
new file mode 100644
index 0000000..a0c8d56
--- /dev/null
+++ b/Swiften/Elements/FormText.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+#pragma once
+
+#include <memory>
+#include <string>
+
+#include <Swiften/Base/API.h>
+
+namespace Swift {
+
+ class SWIFTEN_API FormText{
+
+ public:
+ typedef std::shared_ptr<FormText> text;
+ FormText();
+ virtual ~FormText();
+ void setTextString(const std::string& text);
+ const std::string& getTextString() const;
+
+ private:
+ std::string text_;
+ };
+}
diff --git a/Swiften/Elements/Forwarded.cpp b/Swiften/Elements/Forwarded.cpp
new file mode 100644
index 0000000..0ba604c
--- /dev/null
+++ b/Swiften/Elements/Forwarded.cpp
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2014 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#include <Swiften/Elements/Forwarded.h>
+
+using namespace Swift;
+
+Forwarded::~Forwarded() {
+}
diff --git a/Swiften/Elements/Forwarded.h b/Swiften/Elements/Forwarded.h
new file mode 100644
index 0000000..a7eb492
--- /dev/null
+++ b/Swiften/Elements/Forwarded.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2014-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#pragma once
+
+#include <memory>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
+
+namespace Swift {
+ class Delay;
+ class Stanza;
+
+ class SWIFTEN_API Forwarded : public Payload {
+ public:
+ typedef std::shared_ptr<Forwarded> ref;
+
+ public:
+ virtual ~Forwarded();
+
+ void setDelay(std::shared_ptr<Delay> delay) { delay_ = delay; }
+ const std::shared_ptr<Delay>& getDelay() const { return delay_; }
+
+ void setStanza(std::shared_ptr<Stanza> stanza) { stanza_ = stanza; }
+ const std::shared_ptr<Stanza>& getStanza() const { return stanza_; }
+
+ private:
+ std::shared_ptr<Delay> delay_;
+ std::shared_ptr<Stanza> stanza_;
+ };
+}
diff --git a/Swiften/Elements/HashElement.h b/Swiften/Elements/HashElement.h
new file mode 100644
index 0000000..bbe4d1c
--- /dev/null
+++ b/Swiften/Elements/HashElement.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2014-2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#pragma once
+
+#include <string>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Base/ByteArray.h>
+
+namespace Swift {
+ /*
+ * @brief This class represents a XEP-0300 <hash/> element.
+ */
+ class SWIFTEN_API HashElement {
+ public:
+ HashElement(const std::string& algorithm, const ByteArray& hash) : algorithm_(algorithm), hash_(hash) {
+ }
+
+ void setHashValue(const std::string& algorithm, const ByteArray& hash) {
+ algorithm_ = algorithm;
+ hash_ = hash;
+ }
+
+ const std::string& getAlgorithm() const {
+ return algorithm_;
+ }
+
+ const ByteArray& getHashValue() const {
+ return hash_;
+ }
+
+ bool operator==(const HashElement& rhs) const {
+ return (algorithm_ == rhs.algorithm_) && (hash_ == rhs.hash_);
+ }
+
+
+ private:
+ std::string algorithm_;
+ ByteArray hash_;
+ };
+}
diff --git a/Swiften/Elements/IBB.h b/Swiften/Elements/IBB.h
index fb33eaf..6ebe66e 100644
--- a/Swiften/Elements/IBB.h
+++ b/Swiften/Elements/IBB.h
@@ -1,107 +1,107 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2018 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
+#include <memory>
#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
- class IBB : public Payload {
- public:
- typedef boost::shared_ptr<IBB> ref;
-
- enum Action {
- Open,
- Close,
- Data
- };
- enum StanzaType {
- IQStanza,
- MessageStanza
- };
-
- IBB(Action action = Open, const std::string& streamID = "") : action(action), streamID(streamID), stanzaType(IQStanza), blockSize(-1), sequenceNumber(-1) {
- }
-
- static IBB::ref createIBBOpen(const std::string& streamID, int blockSize) {
- IBB::ref result = boost::make_shared<IBB>(Open, streamID);
- result->setBlockSize(blockSize);
- return result;
- }
-
- static IBB::ref createIBBData(const std::string& streamID, int sequenceNumber, const std::vector<unsigned char>& data) {
- IBB::ref result = boost::make_shared<IBB>(Data, streamID);
- result->setSequenceNumber(sequenceNumber);
- result->setData(data);
- return result;
- }
-
- static IBB::ref createIBBClose(const std::string& streamID) {
- return boost::make_shared<IBB>(Close, streamID);
- }
-
- void setAction(Action action) {
- this->action = action;
- }
-
- Action getAction() const {
- return action;
- }
-
- void setStanzaType(StanzaType stanzaType) {
- this->stanzaType = stanzaType;
- }
-
- StanzaType getStanzaType() const {
- return stanzaType;
- }
-
- void setStreamID(const std::string& id) {
- streamID = id;
- }
-
- const std::string& getStreamID() const {
- return streamID;
- }
-
- const std::vector<unsigned char>& getData() const {
- return data;
- }
-
- void setData(const std::vector<unsigned char>& data) {
- this->data = data;
- }
-
- int getBlockSize() const {
- return blockSize;
- }
-
- void setBlockSize(int blockSize) {
- this->blockSize = blockSize;
- }
-
- int getSequenceNumber() const {
- return sequenceNumber;
- }
-
- void setSequenceNumber(int i) {
- sequenceNumber = i;
- }
-
- private:
- Action action;
- std::string streamID;
- std::vector<unsigned char> data;
- StanzaType stanzaType;
- int blockSize;
- int sequenceNumber;
- };
+ class SWIFTEN_API IBB : public Payload {
+ public:
+ typedef std::shared_ptr<IBB> ref;
+
+ enum Action {
+ Open,
+ Close,
+ Data
+ };
+ enum StanzaType {
+ IQStanza,
+ MessageStanza
+ };
+
+ IBB(Action action = Open, const std::string& streamID = "") : action(action), streamID(streamID), stanzaType(IQStanza), blockSize(0), sequenceNumber(-1) {
+ }
+
+ static IBB::ref createIBBOpen(const std::string& streamID, unsigned int blockSize) {
+ IBB::ref result = std::make_shared<IBB>(Open, streamID);
+ result->setBlockSize(blockSize);
+ return result;
+ }
+
+ static IBB::ref createIBBData(const std::string& streamID, int sequenceNumber, const std::vector<unsigned char>& data) {
+ IBB::ref result = std::make_shared<IBB>(Data, streamID);
+ result->setSequenceNumber(sequenceNumber);
+ result->setData(data);
+ return result;
+ }
+
+ static IBB::ref createIBBClose(const std::string& streamID) {
+ return std::make_shared<IBB>(Close, streamID);
+ }
+
+ void setAction(Action action) {
+ this->action = action;
+ }
+
+ Action getAction() const {
+ return action;
+ }
+
+ void setStanzaType(StanzaType stanzaType) {
+ this->stanzaType = stanzaType;
+ }
+
+ StanzaType getStanzaType() const {
+ return stanzaType;
+ }
+
+ void setStreamID(const std::string& id) {
+ streamID = id;
+ }
+
+ const std::string& getStreamID() const {
+ return streamID;
+ }
+
+ const std::vector<unsigned char>& getData() const {
+ return data;
+ }
+
+ void setData(const std::vector<unsigned char>& data) {
+ this->data = data;
+ }
+
+ unsigned int getBlockSize() const {
+ return blockSize;
+ }
+
+ void setBlockSize(unsigned int blockSize) {
+ this->blockSize = blockSize;
+ }
+
+ int getSequenceNumber() const {
+ return sequenceNumber;
+ }
+
+ void setSequenceNumber(int i) {
+ sequenceNumber = i;
+ }
+
+ private:
+ Action action;
+ std::string streamID;
+ std::vector<unsigned char> data;
+ StanzaType stanzaType;
+ unsigned int blockSize;
+ int sequenceNumber;
+ };
}
diff --git a/Swiften/Elements/IQ.cpp b/Swiften/Elements/IQ.cpp
index 8c0f692..31a654f 100644
--- a/Swiften/Elements/IQ.cpp
+++ b/Swiften/Elements/IQ.cpp
@@ -1,68 +1,68 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#include <Swiften/Elements/IQ.h>
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
namespace Swift {
-boost::shared_ptr<IQ> IQ::createRequest(
- Type type, const JID& to, const std::string& id, boost::shared_ptr<Payload> payload) {
- boost::shared_ptr<IQ> iq = boost::make_shared<IQ>(type);
- if (to.isValid()) {
- iq->setTo(to);
- }
- iq->setID(id);
- if (payload) {
- iq->addPayload(payload);
- }
- return iq;
+std::shared_ptr<IQ> IQ::createRequest(
+ Type type, const JID& to, const std::string& id, std::shared_ptr<Payload> payload) {
+ std::shared_ptr<IQ> iq = std::make_shared<IQ>(type);
+ if (to.isValid()) {
+ iq->setTo(to);
+ }
+ iq->setID(id);
+ if (payload) {
+ iq->addPayload(payload);
+ }
+ return iq;
}
-boost::shared_ptr<IQ> IQ::createResult(const JID& to, const std::string& id, boost::shared_ptr<Payload> payload) {
- boost::shared_ptr<IQ> iq = boost::make_shared<IQ>(Result);
- iq->setTo(to);
- iq->setID(id);
- if (payload) {
- iq->addPayload(payload);
- }
- return iq;
+std::shared_ptr<IQ> IQ::createResult(const JID& to, const std::string& id, std::shared_ptr<Payload> payload) {
+ std::shared_ptr<IQ> iq = std::make_shared<IQ>(Result);
+ iq->setTo(to);
+ iq->setID(id);
+ if (payload) {
+ iq->addPayload(payload);
+ }
+ return iq;
}
-boost::shared_ptr<IQ> IQ::createResult(const JID& to, const JID& from, const std::string& id, boost::shared_ptr<Payload> payload) {
- boost::shared_ptr<IQ> iq = boost::make_shared<IQ>(Result);
- iq->setTo(to);
- iq->setFrom(from);
- iq->setID(id);
- if (payload) {
- iq->addPayload(payload);
- }
- return iq;
+std::shared_ptr<IQ> IQ::createResult(const JID& to, const JID& from, const std::string& id, std::shared_ptr<Payload> payload) {
+ std::shared_ptr<IQ> iq = std::make_shared<IQ>(Result);
+ iq->setTo(to);
+ iq->setFrom(from);
+ iq->setID(id);
+ if (payload) {
+ iq->addPayload(payload);
+ }
+ return iq;
}
-boost::shared_ptr<IQ> IQ::createError(const JID& to, const std::string& id, ErrorPayload::Condition condition, ErrorPayload::Type type, boost::shared_ptr<Payload> payload) {
- boost::shared_ptr<IQ> iq = boost::make_shared<IQ>(IQ::Error);
- iq->setTo(to);
- iq->setID(id);
- boost::shared_ptr<ErrorPayload> errorPayload = boost::make_shared<Swift::ErrorPayload>(condition, type);
- errorPayload->setPayload(payload);
- iq->addPayload(errorPayload);
- return iq;
+std::shared_ptr<IQ> IQ::createError(const JID& to, const std::string& id, ErrorPayload::Condition condition, ErrorPayload::Type type, std::shared_ptr<Payload> payload) {
+ std::shared_ptr<IQ> iq = std::make_shared<IQ>(IQ::Error);
+ iq->setTo(to);
+ iq->setID(id);
+ std::shared_ptr<ErrorPayload> errorPayload = std::make_shared<Swift::ErrorPayload>(condition, type);
+ errorPayload->setPayload(payload);
+ iq->addPayload(errorPayload);
+ return iq;
}
-boost::shared_ptr<IQ> IQ::createError(const JID& to, const JID& from, const std::string& id, ErrorPayload::Condition condition, ErrorPayload::Type type, boost::shared_ptr<Payload> payload) {
- boost::shared_ptr<IQ> iq = boost::make_shared<IQ>(IQ::Error);
- iq->setTo(to);
- iq->setFrom(from);
- iq->setID(id);
- boost::shared_ptr<ErrorPayload> errorPayload = boost::make_shared<Swift::ErrorPayload>(condition, type);
- errorPayload->setPayload(payload);
- iq->addPayload(errorPayload);
- return iq;
+std::shared_ptr<IQ> IQ::createError(const JID& to, const JID& from, const std::string& id, ErrorPayload::Condition condition, ErrorPayload::Type type, std::shared_ptr<Payload> payload) {
+ std::shared_ptr<IQ> iq = std::make_shared<IQ>(IQ::Error);
+ iq->setTo(to);
+ iq->setFrom(from);
+ iq->setID(id);
+ std::shared_ptr<ErrorPayload> errorPayload = std::make_shared<Swift::ErrorPayload>(condition, type);
+ errorPayload->setPayload(payload);
+ iq->addPayload(errorPayload);
+ return iq;
}
}
diff --git a/Swiften/Elements/IQ.h b/Swiften/Elements/IQ.h
index ff978b3..00ed848 100644
--- a/Swiften/Elements/IQ.h
+++ b/Swiften/Elements/IQ.h
@@ -1,58 +1,58 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Stanza.h>
#include <Swiften/Elements/ErrorPayload.h>
+#include <Swiften/Elements/Stanza.h>
namespace Swift {
- class SWIFTEN_API IQ : public Stanza {
- public:
- typedef boost::shared_ptr<IQ> ref;
-
- enum Type { Get, Set, Result, Error };
-
- IQ(Type type = Get) : type_(type) { }
-
- Type getType() const { return type_; }
- void setType(Type type) { type_ = type; }
-
- static boost::shared_ptr<IQ> createRequest(
- Type type,
- const JID& to,
- const std::string& id,
- boost::shared_ptr<Payload> payload);
- static boost::shared_ptr<IQ> createResult(
- const JID& to,
- const std::string& id,
- boost::shared_ptr<Payload> payload = boost::shared_ptr<Payload>());
- static boost::shared_ptr<IQ> createResult(
- const JID& to,
- const JID& from,
- const std::string& id,
- boost::shared_ptr<Payload> payload = boost::shared_ptr<Payload>());
- static boost::shared_ptr<IQ> createError(
- const JID& to,
- const std::string& id,
- ErrorPayload::Condition condition = ErrorPayload::BadRequest,
- ErrorPayload::Type type = ErrorPayload::Cancel,
- boost::shared_ptr<Payload> payload = boost::shared_ptr<Payload>());
- static boost::shared_ptr<IQ> createError(
- const JID& to,
- const JID& from,
- const std::string& id,
- ErrorPayload::Condition condition = ErrorPayload::BadRequest,
- ErrorPayload::Type type = ErrorPayload::Cancel,
- boost::shared_ptr<Payload> payload = boost::shared_ptr<Payload>());
-
- private:
- Type type_;
- };
+ class SWIFTEN_API IQ : public Stanza {
+ public:
+ typedef std::shared_ptr<IQ> ref;
+
+ enum Type { Get, Set, Result, Error };
+
+ IQ(Type type = Get) : type_(type) { }
+
+ Type getType() const { return type_; }
+ void setType(Type type) { type_ = type; }
+
+ static std::shared_ptr<IQ> createRequest(
+ Type type,
+ const JID& to,
+ const std::string& id,
+ std::shared_ptr<Payload> payload);
+ static std::shared_ptr<IQ> createResult(
+ const JID& to,
+ const std::string& id,
+ std::shared_ptr<Payload> payload = std::shared_ptr<Payload>());
+ static std::shared_ptr<IQ> createResult(
+ const JID& to,
+ const JID& from,
+ const std::string& id,
+ std::shared_ptr<Payload> payload = std::shared_ptr<Payload>());
+ static std::shared_ptr<IQ> createError(
+ const JID& to,
+ const std::string& id,
+ ErrorPayload::Condition condition = ErrorPayload::BadRequest,
+ ErrorPayload::Type type = ErrorPayload::Cancel,
+ std::shared_ptr<Payload> payload = std::shared_ptr<Payload>());
+ static std::shared_ptr<IQ> createError(
+ const JID& to,
+ const JID& from,
+ const std::string& id,
+ ErrorPayload::Condition condition = ErrorPayload::BadRequest,
+ ErrorPayload::Type type = ErrorPayload::Cancel,
+ std::shared_ptr<Payload> payload = std::shared_ptr<Payload>());
+
+ private:
+ Type type_;
+ };
}
diff --git a/Swiften/Elements/Idle.h b/Swiften/Elements/Idle.h
index 572eba2..9f721aa 100644
--- a/Swiften/Elements/Idle.h
+++ b/Swiften/Elements/Idle.h
@@ -4,34 +4,42 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
+
#include <boost/date_time/posix_time/posix_time_types.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
- class Idle : public Payload {
- public:
- typedef boost::shared_ptr<Idle> ref;
+ class SWIFTEN_API Idle : public Payload {
+ public:
+ typedef std::shared_ptr<Idle> ref;
- public:
- Idle() {}
- Idle(boost::posix_time::ptime since) : since_(since) {
- }
+ public:
+ Idle() {}
+ Idle(boost::posix_time::ptime since) : since_(since) {
+ }
- void setSince(boost::posix_time::ptime since) {
- since_ = since;
- }
+ void setSince(boost::posix_time::ptime since) {
+ since_ = since;
+ }
- boost::posix_time::ptime getSince() const {
- return since_;
- }
+ boost::posix_time::ptime getSince() const {
+ return since_;
+ }
- private:
- boost::posix_time::ptime since_;
- };
+ private:
+ boost::posix_time::ptime since_;
+ };
}
diff --git a/Swiften/Elements/InBandRegistrationPayload.h b/Swiften/Elements/InBandRegistrationPayload.h
index 8f6a9f1..4fad248 100644
--- a/Swiften/Elements/InBandRegistrationPayload.h
+++ b/Swiften/Elements/InBandRegistrationPayload.h
@@ -1,209 +1,211 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
-#include <boost/optional.hpp>
+#include <memory>
#include <string>
-#include <Swiften/Elements/Payload.h>
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Form.h>
+#include <Swiften/Elements/Payload.h>
namespace Swift {
- class InBandRegistrationPayload : public Payload {
- public:
- typedef boost::shared_ptr<InBandRegistrationPayload> ref;
+ class SWIFTEN_API InBandRegistrationPayload : public Payload {
+ public:
+ typedef std::shared_ptr<InBandRegistrationPayload> ref;
- InBandRegistrationPayload() : registered(false), remove(false) {}
+ InBandRegistrationPayload() : registered(false), remove(false) {}
- Form::ref getForm() const { return form; }
- void setForm(Form::ref f) { form = f; }
+ Form::ref getForm() const { return form; }
+ void setForm(Form::ref f) { form = f; }
- bool isRegistered() const {
- return registered;
- }
+ bool isRegistered() const {
+ return registered;
+ }
- void setRegistered(bool b) {
- registered = b;
- }
+ void setRegistered(bool b) {
+ registered = b;
+ }
- bool isRemove() const {
- return remove;
- }
+ bool isRemove() const {
+ return remove;
+ }
- void setRemove(bool b) {
- remove = b;
- }
+ void setRemove(bool b) {
+ remove = b;
+ }
- const boost::optional<std::string>& getInstructions() const {
- return instructions;
- }
+ const boost::optional<std::string>& getInstructions() const {
+ return instructions;
+ }
- const boost::optional<std::string>& getUsername() const {
- return username;
- }
+ const boost::optional<std::string>& getUsername() const {
+ return username;
+ }
- const boost::optional<std::string>& getNick() const {
- return nick;
- }
+ const boost::optional<std::string>& getNick() const {
+ return nick;
+ }
- const boost::optional<std::string>& getPassword() const {
- return password;
- }
+ const boost::optional<std::string>& getPassword() const {
+ return password;
+ }
- const boost::optional<std::string>& getName() const {
- return name;
- }
+ const boost::optional<std::string>& getName() const {
+ return name;
+ }
- const boost::optional<std::string>& getFirst() const {
- return first;
- }
+ const boost::optional<std::string>& getFirst() const {
+ return first;
+ }
- const boost::optional<std::string>& getLast() const {
- return last;
- }
+ const boost::optional<std::string>& getLast() const {
+ return last;
+ }
- const boost::optional<std::string>& getEMail() const {
- return email;
- }
+ const boost::optional<std::string>& getEMail() const {
+ return email;
+ }
- const boost::optional<std::string>& getAddress() const {
- return address;
- }
+ const boost::optional<std::string>& getAddress() const {
+ return address;
+ }
- const boost::optional<std::string>& getCity() const {
- return city;
- }
+ const boost::optional<std::string>& getCity() const {
+ return city;
+ }
- const boost::optional<std::string>& getState() const {
- return state;
- }
+ const boost::optional<std::string>& getState() const {
+ return state;
+ }
- const boost::optional<std::string>& getZip() const {
- return zip;
- }
+ const boost::optional<std::string>& getZip() const {
+ return zip;
+ }
- const boost::optional<std::string>& getPhone() const {
- return phone;
- }
-
- const boost::optional<std::string>& getURL() const {
- return url;
- }
-
- const boost::optional<std::string>& getDate() const {
- return date;
- }
-
- const boost::optional<std::string>& getMisc() const {
- return misc;
- }
-
- const boost::optional<std::string>& getText() const {
- return text;
- }
-
- const boost::optional<std::string>& getKey() const {
- return key;
- }
-
- void setInstructions(const std::string& v) {
- this->instructions = v;
- }
-
- void setUsername(const std::string& v) {
- this->username = v;
- }
-
- void setNick(const std::string& v) {
- this->nick = v;
- }
-
- void setPassword(const std::string& v) {
- this->password = v;
- }
-
- void setName(const std::string& v) {
- this->name = v;
- }
-
- void setFirst(const std::string& v) {
- this->first = v;
- }
-
- void setLast(const std::string& v) {
- this->last = v;
- }
-
- void setEMail(const std::string& v) {
- this->email = v;
- }
-
- void setAddress(const std::string& v) {
- this->address = v;
- }
-
- void setCity(const std::string& v) {
- this->city = v;
- }
-
- void setState(const std::string& v) {
- this->state = v;
- }
-
- void setZip(const std::string& v) {
- this->zip = v;
- }
-
- void setPhone(const std::string& v) {
- this->phone = v;
- }
-
- void setURL(const std::string& v) {
- this->url = v;
- }
-
- void setDate(const std::string& v) {
- this->date = v;
- }
-
- void setMisc(const std::string& v) {
- this->misc = v;
- }
-
- void setText(const std::string& v) {
- this->text = v;
- }
-
- void setKey(const std::string& v) {
- this->key = v;
- }
-
- private:
- Form::ref form;
- bool registered;
- bool remove;
- boost::optional<std::string> instructions;
- boost::optional<std::string> username;
- boost::optional<std::string> nick;
- boost::optional<std::string> password;
- boost::optional<std::string> name;
- boost::optional<std::string> first;
- boost::optional<std::string> last;
- boost::optional<std::string> email;
- boost::optional<std::string> address;
- boost::optional<std::string> city;
- boost::optional<std::string> state;
- boost::optional<std::string> zip;
- boost::optional<std::string> phone;
- boost::optional<std::string> url;
- boost::optional<std::string> date;
- boost::optional<std::string> misc;
- boost::optional<std::string> text;
- boost::optional<std::string> key;
- };
+ const boost::optional<std::string>& getPhone() const {
+ return phone;
+ }
+
+ const boost::optional<std::string>& getURL() const {
+ return url;
+ }
+
+ const boost::optional<std::string>& getDate() const {
+ return date;
+ }
+
+ const boost::optional<std::string>& getMisc() const {
+ return misc;
+ }
+
+ const boost::optional<std::string>& getText() const {
+ return text;
+ }
+
+ const boost::optional<std::string>& getKey() const {
+ return key;
+ }
+
+ void setInstructions(const std::string& v) {
+ this->instructions = v;
+ }
+
+ void setUsername(const std::string& v) {
+ this->username = v;
+ }
+
+ void setNick(const std::string& v) {
+ this->nick = v;
+ }
+
+ void setPassword(const std::string& v) {
+ this->password = v;
+ }
+
+ void setName(const std::string& v) {
+ this->name = v;
+ }
+
+ void setFirst(const std::string& v) {
+ this->first = v;
+ }
+
+ void setLast(const std::string& v) {
+ this->last = v;
+ }
+
+ void setEMail(const std::string& v) {
+ this->email = v;
+ }
+
+ void setAddress(const std::string& v) {
+ this->address = v;
+ }
+
+ void setCity(const std::string& v) {
+ this->city = v;
+ }
+
+ void setState(const std::string& v) {
+ this->state = v;
+ }
+
+ void setZip(const std::string& v) {
+ this->zip = v;
+ }
+
+ void setPhone(const std::string& v) {
+ this->phone = v;
+ }
+
+ void setURL(const std::string& v) {
+ this->url = v;
+ }
+
+ void setDate(const std::string& v) {
+ this->date = v;
+ }
+
+ void setMisc(const std::string& v) {
+ this->misc = v;
+ }
+
+ void setText(const std::string& v) {
+ this->text = v;
+ }
+
+ void setKey(const std::string& v) {
+ this->key = v;
+ }
+
+ private:
+ Form::ref form;
+ bool registered;
+ bool remove;
+ boost::optional<std::string> instructions;
+ boost::optional<std::string> username;
+ boost::optional<std::string> nick;
+ boost::optional<std::string> password;
+ boost::optional<std::string> name;
+ boost::optional<std::string> first;
+ boost::optional<std::string> last;
+ boost::optional<std::string> email;
+ boost::optional<std::string> address;
+ boost::optional<std::string> city;
+ boost::optional<std::string> state;
+ boost::optional<std::string> zip;
+ boost::optional<std::string> phone;
+ boost::optional<std::string> url;
+ boost::optional<std::string> date;
+ boost::optional<std::string> misc;
+ boost::optional<std::string> text;
+ boost::optional<std::string> key;
+ };
}
diff --git a/Swiften/Elements/IsodeIQDelegation.cpp b/Swiften/Elements/IsodeIQDelegation.cpp
new file mode 100644
index 0000000..e84b4ed
--- /dev/null
+++ b/Swiften/Elements/IsodeIQDelegation.cpp
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2014 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#include <Swiften/Elements/IsodeIQDelegation.h>
+
+using namespace Swift;
+
+IsodeIQDelegation::IsodeIQDelegation() {
+}
+
+IsodeIQDelegation::~IsodeIQDelegation() {
+}
diff --git a/Swiften/Elements/IsodeIQDelegation.h b/Swiften/Elements/IsodeIQDelegation.h
new file mode 100644
index 0000000..074a06d
--- /dev/null
+++ b/Swiften/Elements/IsodeIQDelegation.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2014-2017 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#pragma once
+
+#include <memory>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Forwarded.h>
+#include <Swiften/Elements/Payload.h>
+
+namespace Swift {
+ class SWIFTEN_API IsodeIQDelegation : public Payload {
+ public:
+
+ IsodeIQDelegation();
+
+ virtual ~IsodeIQDelegation();
+
+ std::shared_ptr<Forwarded> getForward() const {
+ return forward;
+ }
+
+ void setForward(std::shared_ptr<Forwarded> value) {
+ this->forward = value ;
+ }
+
+
+ private:
+ std::shared_ptr<Forwarded> forward;
+ };
+}
diff --git a/Swiften/Elements/JingleContentPayload.h b/Swiften/Elements/JingleContentPayload.h
index 547fc70..744ac09 100644
--- a/Swiften/Elements/JingleContentPayload.h
+++ b/Swiften/Elements/JingleContentPayload.h
@@ -1,97 +1,102 @@
/*
- * Copyright (c) 2011 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2011-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
+#include <string>
#include <vector>
+
#include <boost/optional.hpp>
-#include <string>
-#include <Swiften/JID/JID.h>
-#include <Swiften/Elements/Payload.h>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/JingleDescription.h>
#include <Swiften/Elements/JingleTransportPayload.h>
+#include <Swiften/Elements/Payload.h>
+#include <Swiften/JID/JID.h>
namespace Swift {
- class JingleContentPayload : public Payload {
- public:
- typedef boost::shared_ptr<JingleContentPayload> ref;
-
- enum Creator {
- UnknownCreator,
- InitiatorCreator,
- ResponderCreator
- };
-
- /*enum Senders {
- NoSenders,
- InitiatorSender,
- ResponderSender,
- BothSenders,
- };*/
-
- Creator getCreator() const {
- return creator;
- }
-
- void setCreator(Creator creator) {
- this->creator = creator;
- }
-
- const std::string& getName() const {
- return name;
- }
-
- void setName(const std::string& name) {
- this->name = name;
- }
-
- const std::vector<JingleDescription::ref>& getDescriptions() const {
- return descriptions;
- }
-
- void addDescription(JingleDescription::ref description) {
- descriptions.push_back(description);
- }
-
- const std::vector<boost::shared_ptr<JingleTransportPayload> >& getTransports() const {
- return transports;
- }
-
- void addTransport(boost::shared_ptr<JingleTransportPayload> transport) {
- transports.push_back(transport);
- }
-
- template<typename T>
- boost::shared_ptr<T> getDescription() const {
- for (size_t i = 0; i < descriptions.size(); ++i) {
- boost::shared_ptr<T> result(boost::dynamic_pointer_cast<T>(descriptions[i]));
- if (result) {
- return result;
- }
- }
- return boost::shared_ptr<T>();
- }
-
- template<typename T>
- boost::shared_ptr<T> getTransport() const {
- for (size_t i = 0; i < transports.size(); ++i) {
- boost::shared_ptr<T> result(boost::dynamic_pointer_cast<T>(transports[i]));
- if (result) {
- return result;
- }
- }
- return boost::shared_ptr<T>();
- }
-
- private:
- Creator creator;
- std::string name;
- //Senders senders;
- std::vector<JingleDescription::ref> descriptions;
- std::vector<boost::shared_ptr<JingleTransportPayload> > transports;
- };
+ class SWIFTEN_API JingleContentPayload : public Payload {
+ public:
+ typedef std::shared_ptr<JingleContentPayload> ref;
+
+ enum Creator {
+ UnknownCreator,
+ InitiatorCreator,
+ ResponderCreator
+ };
+
+ JingleContentPayload() : creator(UnknownCreator) {
+ }
+
+ /*enum Senders {
+ NoSenders,
+ InitiatorSender,
+ ResponderSender,
+ BothSenders,
+ };*/
+
+ Creator getCreator() const {
+ return creator;
+ }
+
+ void setCreator(Creator creator) {
+ this->creator = creator;
+ }
+
+ const std::string& getName() const {
+ return name;
+ }
+
+ void setName(const std::string& name) {
+ this->name = name;
+ }
+
+ const std::vector<JingleDescription::ref>& getDescriptions() const {
+ return descriptions;
+ }
+
+ void addDescription(JingleDescription::ref description) {
+ descriptions.push_back(description);
+ }
+
+ const std::vector<std::shared_ptr<JingleTransportPayload> >& getTransports() const {
+ return transports;
+ }
+
+ void addTransport(std::shared_ptr<JingleTransportPayload> transport) {
+ transports.push_back(transport);
+ }
+
+ template<typename T>
+ std::shared_ptr<T> getDescription() const {
+ for (const auto& description : descriptions) {
+ std::shared_ptr<T> result(std::dynamic_pointer_cast<T>(description));
+ if (result) {
+ return result;
+ }
+ }
+ return std::shared_ptr<T>();
+ }
+
+ template<typename T>
+ std::shared_ptr<T> getTransport() const {
+ for (const auto& transport : transports) {
+ std::shared_ptr<T> result(std::dynamic_pointer_cast<T>(transport));
+ if (result) {
+ return result;
+ }
+ }
+ return std::shared_ptr<T>();
+ }
+
+ private:
+ Creator creator;
+ std::string name;
+ //Senders senders;
+ std::vector<JingleDescription::ref> descriptions;
+ std::vector<std::shared_ptr<JingleTransportPayload> > transports;
+ };
}
diff --git a/Swiften/Elements/JingleDescription.h b/Swiften/Elements/JingleDescription.h
index 775c0f7..ee3dcae 100644
--- a/Swiften/Elements/JingleDescription.h
+++ b/Swiften/Elements/JingleDescription.h
@@ -1,18 +1,19 @@
/*
- * Copyright (c) 2011 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2011-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
- class JingleDescription : public Payload {
- public:
- typedef boost::shared_ptr<JingleDescription> ref;
- };
+ class SWIFTEN_API JingleDescription : public Payload {
+ public:
+ typedef std::shared_ptr<JingleDescription> ref;
+ };
}
diff --git a/Swiften/Elements/JingleFileTransferDescription.h b/Swiften/Elements/JingleFileTransferDescription.h
index 04f3f1f..2418f3b 100644
--- a/Swiften/Elements/JingleFileTransferDescription.h
+++ b/Swiften/Elements/JingleFileTransferDescription.h
@@ -1,41 +1,32 @@
/*
- * Copyright (c) 2011 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2011-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <vector>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/JingleDescription.h>
-#include <Swiften/Elements/StreamInitiationFileInfo.h>
+#include <Swiften/Elements/JingleFileTransferFileInfo.h>
namespace Swift {
- class JingleFileTransferDescription : public JingleDescription {
- public:
- typedef boost::shared_ptr<JingleFileTransferDescription> ref;
+ class SWIFTEN_API JingleFileTransferDescription : public JingleDescription {
+ public:
+ typedef std::shared_ptr<JingleFileTransferDescription> ref;
- void addOffer(const StreamInitiationFileInfo& offer) {
- offers.push_back(offer);
- }
-
+ void setFileInfo(const JingleFileTransferFileInfo& fileInfo) {
+ fileInfo_ = fileInfo;
+ }
- const std::vector<StreamInitiationFileInfo>& getOffers() const {
- return offers;
- }
-
- void addRequest(const StreamInitiationFileInfo& request) {
- reqeusts.push_back(request);
- }
-
- const std::vector<StreamInitiationFileInfo>& getRequests() const {
- return reqeusts;
- }
+ const JingleFileTransferFileInfo& getFileInfo() {
+ return fileInfo_;
+ }
- private:
- std::vector<StreamInitiationFileInfo> offers;
- std::vector<StreamInitiationFileInfo> reqeusts;
- };
+ private:
+ JingleFileTransferFileInfo fileInfo_;
+ };
}
diff --git a/Swiften/Elements/JingleFileTransferFileInfo.h b/Swiften/Elements/JingleFileTransferFileInfo.h
new file mode 100644
index 0000000..0e8ccd4
--- /dev/null
+++ b/Swiften/Elements/JingleFileTransferFileInfo.h
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2014-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#pragma once
+
+#include <map>
+#include <memory>
+#include <string>
+#include <vector>
+
+#include <boost/date_time/posix_time/posix_time_types.hpp>
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/HashElement.h>
+#include <Swiften/Elements/Payload.h>
+
+namespace Swift {
+
+ /**
+ * @brief This class represents the file info used in XEP-0234.
+ */
+ class SWIFTEN_API JingleFileTransferFileInfo : public Payload {
+ typedef std::shared_ptr<JingleFileTransferFileInfo> ref;
+
+ public:
+ JingleFileTransferFileInfo(const std::string& name = "", const std::string& description = "", unsigned long long size = 0, const boost::posix_time::ptime &date = boost::posix_time::ptime()) :
+ name_(name), description_(description), size_(size), date_(date), supportsRangeRequests_(false), rangeOffset_(0) {
+ }
+
+ public:
+ typedef std::map<std::string, ByteArray> HashElementMap;
+
+ public:
+ void setName(const std::string& name) {
+ name_ = name;
+ }
+
+ const std::string& getName() const {
+ return name_;
+ }
+
+ void setDescription(const std::string& description) {
+ description_ = description;
+ }
+
+ const std::string& getDescription() const {
+ return description_;
+ }
+
+ void setMediaType(const std::string& mediaType) {
+ mediaType_ = mediaType;
+ }
+
+ const std::string& getMediaType() const {
+ return mediaType_;
+ }
+
+ void setSize(const boost::uintmax_t size) {
+ size_ = size;
+ }
+
+ boost::uintmax_t getSize() const {
+ return size_;
+ }
+
+ void setDate(const boost::posix_time::ptime& date) {
+ date_ = date;
+ }
+
+ const boost::posix_time::ptime& getDate() const {
+ return date_;
+ }
+
+ void setSupportsRangeRequests(const bool supportsIt) {
+ supportsRangeRequests_ = supportsIt;
+ }
+
+ bool getSupportsRangeRequests() const {
+ return supportsRangeRequests_;
+ }
+
+ void setRangeOffset(const boost::uintmax_t offset) {
+ supportsRangeRequests_ = true;
+ rangeOffset_ = offset;
+ }
+
+ boost::uintmax_t getRangeOffset() const {
+ return rangeOffset_;
+ }
+
+ void addHash(const HashElement& hash) {
+ hashes_[hash.getAlgorithm()] = hash.getHashValue();
+ }
+
+ const std::map<std::string, ByteArray>& getHashes() const {
+ return hashes_;
+ }
+
+ boost::optional<ByteArray> getHash(const std::string& algorithm) const {
+ boost::optional<ByteArray> ret;
+ if (hashes_.find(algorithm) != hashes_.end()) {
+ ret = boost::optional<ByteArray>(hashes_.find(algorithm)->second);
+ }
+ return ret;
+ }
+
+ private:
+ std::string name_;
+ std::string description_;
+ std::string mediaType_;
+ boost::uintmax_t size_;
+ boost::posix_time::ptime date_;
+ bool supportsRangeRequests_;
+ boost::uintmax_t rangeOffset_;
+ HashElementMap hashes_;
+ };
+}
diff --git a/Swiften/Elements/JingleFileTransferHash.h b/Swiften/Elements/JingleFileTransferHash.h
index 5603531..4669e1c 100644
--- a/Swiften/Elements/JingleFileTransferHash.h
+++ b/Swiften/Elements/JingleFileTransferHash.h
@@ -4,32 +4,38 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2014-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#pragma once
-#include <boost/shared_ptr.hpp>
#include <map>
+#include <memory>
#include <string>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/JingleDescription.h>
+#include <Swiften/Elements/JingleFileTransferFileInfo.h>
namespace Swift {
-class JingleFileTransferHash : public Payload {
+class SWIFTEN_API JingleFileTransferHash : public Payload {
public:
- typedef std::map<std::string, std::string> HashesMap;
-public:
- typedef boost::shared_ptr<JingleFileTransferHash> ref;
+ typedef std::shared_ptr<JingleFileTransferHash> ref;
- void setHash(const std::string& algo, const std::string& hash) {
- hashes[algo] = hash;
- }
+ void setFileInfo(const JingleFileTransferFileInfo& fileInfo) {
+ fileInfo_ = fileInfo;
+ }
- const HashesMap& getHashes() const {
- return hashes;
- }
+ JingleFileTransferFileInfo& getFileInfo() {
+ return fileInfo_;
+ }
private:
- HashesMap hashes;
+ JingleFileTransferFileInfo fileInfo_;
};
-
+
}
diff --git a/Swiften/Elements/JingleFileTransferReceived.h b/Swiften/Elements/JingleFileTransferReceived.h
deleted file mode 100644
index 75c95d9..0000000
--- a/Swiften/Elements/JingleFileTransferReceived.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2011 Tobias Markmann
- * Licensed under the simplified BSD license.
- * See Documentation/Licenses/BSD-simplified.txt for more information.
- */
-
-#pragma once
-
-#include <boost/shared_ptr.hpp>
-#include <vector>
-
-#include <Swiften/Elements/StreamInitiationFileInfo.h>
-#include <Swiften/Elements/Payload.h>
-
-namespace Swift {
-
-class JingleFileTransferReceived : public Payload {
- public:
- typedef boost::shared_ptr<JingleFileTransferReceived> ref;
-
- void setFileInfo(const StreamInitiationFileInfo& fileInfo) {
- this->fileInfo = fileInfo;
- }
-
- const StreamInitiationFileInfo& getFileInfo() const {
- return this->fileInfo;
- }
- private:
- StreamInitiationFileInfo fileInfo;
-
-};
-
-}
diff --git a/Swiften/Elements/JingleIBBTransportPayload.h b/Swiften/Elements/JingleIBBTransportPayload.h
index a329ff0..8f0a369 100644
--- a/Swiften/Elements/JingleIBBTransportPayload.h
+++ b/Swiften/Elements/JingleIBBTransportPayload.h
@@ -1,45 +1,50 @@
/*
- * Copyright (c) 2011-2013 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2011-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
-#include <boost/optional.hpp>
+#include <memory>
#include <string>
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/JingleTransportPayload.h>
namespace Swift {
- class JingleIBBTransportPayload : public JingleTransportPayload {
- public:
- typedef boost::shared_ptr<JingleIBBTransportPayload> ref;
-
- enum StanzaType {
- IQStanza,
- MessageStanza
- };
-
- void setStanzaType(StanzaType stanzaType) {
- this->stanzaType = stanzaType;
- }
-
- StanzaType getStanzaType() const {
- return stanzaType;
- }
-
- boost::optional<unsigned int> getBlockSize() const {
- return blockSize;
- }
-
- void setBlockSize(unsigned int blockSize) {
- this->blockSize = blockSize;
- }
-
- private:
- boost::optional<unsigned int> blockSize;
- StanzaType stanzaType;
- };
+ class SWIFTEN_API JingleIBBTransportPayload : public JingleTransportPayload {
+ public:
+ typedef std::shared_ptr<JingleIBBTransportPayload> ref;
+
+ enum StanzaType {
+ IQStanza,
+ MessageStanza
+ };
+
+ JingleIBBTransportPayload() : stanzaType(IQStanza) {
+ }
+
+ void setStanzaType(StanzaType stanzaType) {
+ this->stanzaType = stanzaType;
+ }
+
+ StanzaType getStanzaType() const {
+ return stanzaType;
+ }
+
+ boost::optional<unsigned int> getBlockSize() const {
+ return blockSize;
+ }
+
+ void setBlockSize(unsigned int blockSize) {
+ this->blockSize = blockSize;
+ }
+
+ private:
+ boost::optional<unsigned int> blockSize;
+ StanzaType stanzaType;
+ };
}
diff --git a/Swiften/Elements/JinglePayload.h b/Swiften/Elements/JinglePayload.h
index 5f12e90..a1e8500 100644
--- a/Swiften/Elements/JinglePayload.h
+++ b/Swiften/Elements/JinglePayload.h
@@ -1,166 +1,167 @@
/*
- * Copyright (c) 2011 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2011-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
+#include <memory>
+#include <string>
#include <vector>
-#include <boost/shared_ptr.hpp>
+
#include <boost/optional.hpp>
-#include <string>
-#include <Swiften/JID/JID.h>
-#include <Swiften/Elements/Payload.h>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/JingleContentPayload.h>
+#include <Swiften/Elements/Payload.h>
+#include <Swiften/JID/JID.h>
namespace Swift {
- class JinglePayload : public Payload {
- public:
- typedef boost::shared_ptr<JinglePayload> ref;
- struct Reason : public Payload {
- enum Type {
- UnknownType,
- AlternativeSession,
- Busy,
- Cancel,
- ConnectivityError,
- Decline,
- Expired,
- FailedApplication,
- FailedTransport,
- GeneralError,
- Gone,
- IncompatibleParameters,
- MediaError,
- SecurityError,
- Success,
- Timeout,
- UnsupportedApplications,
- UnsupportedTransports
- };
- Reason() : type(UnknownType), text("") {}
- Reason(Type type, const std::string& text = "") : type(type), text(text) {}
- ~Reason() {}
- Type type;
- std::string text;
- };
-
- enum Action {
- UnknownAction,
- ContentAccept,
- ContentAdd,
- ContentModify,
- ContentReject,
- ContentRemove,
- DescriptionInfo,
- SecurityInfo,
- SessionAccept,
- SessionInfo,
- SessionInitiate,
- SessionTerminate,
- TransportAccept,
- TransportInfo,
- TransportReject,
- TransportReplace
- };
- JinglePayload() : action(SessionTerminate), sessionID("") {
- }
-
- JinglePayload(Action action, const std::string& sessionID) : action(action), sessionID(sessionID) {
-
- }
-
- void setAction(Action action) {
- this->action = action;
- }
-
- Action getAction() const {
- return action;
- }
-
- void setInitiator(const JID& initiator) {
- this->initiator = initiator;
- }
-
- const JID& getInitiator() const {
- return initiator;
- }
-
- void setResponder(const JID& responder) {
- this->responder = responder;
- }
-
- const JID& getResponder() const {
- return responder;
- }
-
- void setSessionID(const std::string& id) {
- sessionID = id;
- }
-
- const std::string& getSessionID() const {
- return sessionID;
- }
-
- void addContent(JingleContentPayload::ref content) {
- this->payloads.push_back(content);
- }
-
- void addPayload(boost::shared_ptr<Payload> payload) {
- this->payloads.push_back(payload);
- }
-
- const std::vector<JingleContentPayload::ref> getContents() const {
- return getPayloads<JingleContentPayload>();
- }
-
- const std::vector<boost::shared_ptr<Payload> > getPayloads() const {
- return payloads;
- }
-
- template<typename T>
- const std::vector<boost::shared_ptr<T> > getPayloads() const {
- std::vector<boost::shared_ptr<T> > matched_payloads;
- for (std::vector<boost::shared_ptr<Payload> >::const_iterator i = payloads.begin(); i != payloads.end(); ++i) {
- boost::shared_ptr<T> result = boost::dynamic_pointer_cast<T>(*i);
- if (result) {
- matched_payloads.push_back(result);
- }
- }
-
- return matched_payloads;
-
- }
-
- template<typename T>
- const boost::shared_ptr<T> getPayload() const {
- boost::shared_ptr<T> result;
- for (std::vector<boost::shared_ptr<Payload> >::const_iterator i = payloads.begin(); i != payloads.end(); ++i) {
- result = boost::dynamic_pointer_cast<T>(*i);
- if (result) {
- return result;
- }
- }
-
- return result;
- }
-
- void setReason(const Reason& reason) {
- this->reason = reason;
- }
-
- const boost::optional<Reason>& getReason() const {
- return reason;
- }
-
- private:
- Action action;
- JID initiator;
- JID responder;
- std::string sessionID;
- std::vector<boost::shared_ptr<Payload> > payloads;
- boost::optional<Reason> reason;
- };
+ class SWIFTEN_API JinglePayload : public Payload {
+ public:
+ typedef std::shared_ptr<JinglePayload> ref;
+ struct Reason : public Payload {
+ enum Type {
+ UnknownType,
+ AlternativeSession,
+ Busy,
+ Cancel,
+ ConnectivityError,
+ Decline,
+ Expired,
+ FailedApplication,
+ FailedTransport,
+ GeneralError,
+ Gone,
+ IncompatibleParameters,
+ MediaError,
+ SecurityError,
+ Success,
+ Timeout,
+ UnsupportedApplications,
+ UnsupportedTransports
+ };
+ Reason() : type(UnknownType), text("") {}
+ Reason(Type type, const std::string& text = "") : type(type), text(text) {}
+ Type type;
+ std::string text;
+ };
+
+ enum Action {
+ UnknownAction,
+ ContentAccept,
+ ContentAdd,
+ ContentModify,
+ ContentReject,
+ ContentRemove,
+ DescriptionInfo,
+ SecurityInfo,
+ SessionAccept,
+ SessionInfo,
+ SessionInitiate,
+ SessionTerminate,
+ TransportAccept,
+ TransportInfo,
+ TransportReject,
+ TransportReplace
+ };
+ JinglePayload() : action(SessionTerminate), sessionID("") {
+ }
+
+ JinglePayload(Action action, const std::string& sessionID) : action(action), sessionID(sessionID) {
+
+ }
+
+ void setAction(Action action) {
+ this->action = action;
+ }
+
+ Action getAction() const {
+ return action;
+ }
+
+ void setInitiator(const JID& initiator) {
+ this->initiator = initiator;
+ }
+
+ const JID& getInitiator() const {
+ return initiator;
+ }
+
+ void setResponder(const JID& responder) {
+ this->responder = responder;
+ }
+
+ const JID& getResponder() const {
+ return responder;
+ }
+
+ void setSessionID(const std::string& id) {
+ sessionID = id;
+ }
+
+ const std::string& getSessionID() const {
+ return sessionID;
+ }
+
+ void addContent(JingleContentPayload::ref content) {
+ this->payloads.push_back(content);
+ }
+
+ void addPayload(std::shared_ptr<Payload> payload) {
+ this->payloads.push_back(payload);
+ }
+
+ const std::vector<JingleContentPayload::ref> getContents() const {
+ return getPayloads<JingleContentPayload>();
+ }
+
+ const std::vector<std::shared_ptr<Payload> > getPayloads() const {
+ return payloads;
+ }
+
+ template<typename T>
+ const std::vector<std::shared_ptr<T> > getPayloads() const {
+ std::vector<std::shared_ptr<T> > matched_payloads;
+ for (const auto& payload : payloads) {
+ std::shared_ptr<T> result = std::dynamic_pointer_cast<T>(payload);
+ if (result) {
+ matched_payloads.push_back(result);
+ }
+ }
+
+ return matched_payloads;
+
+ }
+
+ template<typename T>
+ const std::shared_ptr<T> getPayload() const {
+ std::shared_ptr<T> result;
+ for (const auto& payload : payloads) {
+ result = std::dynamic_pointer_cast<T>(payload);
+ if (result) {
+ return result;
+ }
+ }
+
+ return result;
+ }
+
+ void setReason(const Reason& reason) {
+ this->reason = reason;
+ }
+
+ const boost::optional<Reason>& getReason() const {
+ return reason;
+ }
+
+ private:
+ Action action;
+ JID initiator;
+ JID responder;
+ std::string sessionID;
+ std::vector<std::shared_ptr<Payload> > payloads;
+ boost::optional<Reason> reason;
+ };
}
diff --git a/Swiften/Elements/JingleS5BTransportPayload.h b/Swiften/Elements/JingleS5BTransportPayload.h
index 41bf809..5e16243 100644
--- a/Swiften/Elements/JingleS5BTransportPayload.h
+++ b/Swiften/Elements/JingleS5BTransportPayload.h
@@ -1,112 +1,120 @@
/*
- * Copyright (c) 2011 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2011-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
+#include <memory>
#include <vector>
-#include <boost/shared_ptr.hpp>
-
-#include <Swiften/Elements/JingleTransportPayload.h>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Bytestreams.h>
+#include <Swiften/Elements/JingleTransportPayload.h>
#include <Swiften/Network/HostAddressPort.h>
-
namespace Swift {
- class JingleS5BTransportPayload : public JingleTransportPayload {
- public:
- enum Mode {
- TCPMode, // default case
- UDPMode
- };
-
- struct Candidate {
- enum Type {
- DirectType, // default case
- AssistedType,
- TunnelType,
- ProxyType
- };
-
- Candidate() : priority(0), type(DirectType) {}
-
- std::string cid;
- JID jid;
- HostAddressPort hostPort;
- int priority;
- Type type;
- };
-
- struct CompareCandidate {
- bool operator() (const JingleS5BTransportPayload::Candidate& c1, const JingleS5BTransportPayload::Candidate& c2) const {
- if (c1.priority < c2.priority) return true;
- return false;
- }
- };
-
- public:
- JingleS5BTransportPayload() : mode(TCPMode), candidateError(false), proxyError(false) {}
-
- Mode getMode() const {
- return mode;
- }
-
- void setMode(Mode mode) {
- this->mode = mode;
- }
-
- const std::vector<Candidate>& getCandidates() const {
- return candidates;
- }
-
- void addCandidate(const Candidate& candidate) {
- candidates.push_back(candidate);
- }
-
- void setCandidateUsed(const std::string& cid) {
- candidateUsedCID = cid;
- }
-
- const std::string& getCandidateUsed() const {
- return candidateUsedCID;
- }
-
- void setActivated(const std::string& cid) {
- activatedCID = cid;
- }
-
- const std::string& getActivated() const {
- return activatedCID;
- }
-
- void setCandidateError(bool hasError) {
- candidateError = hasError;
- }
-
- bool hasCandidateError() const {
- return candidateError;
- }
-
- void setProxyError(bool hasError) {
- proxyError = hasError;
- }
-
- bool hasProxyError() const {
- return proxyError;
- }
- public:
- typedef boost::shared_ptr<JingleS5BTransportPayload> ref;
-
- private:
- Mode mode;
- std::vector<Candidate> candidates;
-
- std::string candidateUsedCID;
- std::string activatedCID;
- bool candidateError;
- bool proxyError;
- };
+ class SWIFTEN_API JingleS5BTransportPayload : public JingleTransportPayload {
+ public:
+ enum Mode {
+ TCPMode, // default case
+ UDPMode
+ };
+
+ struct Candidate {
+ enum Type {
+ DirectType, // default case
+ AssistedType,
+ TunnelType,
+ ProxyType
+ };
+
+ Candidate() : priority(0), type(DirectType) {}
+
+ std::string cid;
+ JID jid;
+ HostAddressPort hostPort;
+ int priority;
+ Type type;
+ };
+
+ struct CompareCandidate {
+ bool operator() (const JingleS5BTransportPayload::Candidate& c1, const JingleS5BTransportPayload::Candidate& c2) const {
+ if (c1.priority < c2.priority) return true;
+ return false;
+ }
+ };
+
+ public:
+ JingleS5BTransportPayload() : mode(TCPMode), candidateError(false), proxyError(false) {}
+
+ Mode getMode() const {
+ return mode;
+ }
+
+ void setMode(Mode mode) {
+ this->mode = mode;
+ }
+
+ const std::vector<Candidate>& getCandidates() const {
+ return candidates;
+ }
+
+ void addCandidate(const Candidate& candidate) {
+ candidates.push_back(candidate);
+ }
+
+ void setCandidateUsed(const std::string& cid) {
+ candidateUsedCID = cid;
+ }
+
+ const std::string& getCandidateUsed() const {
+ return candidateUsedCID;
+ }
+
+ void setActivated(const std::string& cid) {
+ activatedCID = cid;
+ }
+
+ const std::string& getActivated() const {
+ return activatedCID;
+ }
+
+ void setDstAddr(const std::string& addr) {
+ dstAddr = addr;
+ }
+
+ const std::string& getDstAddr() const {
+ return dstAddr;
+ }
+
+ void setCandidateError(bool hasError) {
+ candidateError = hasError;
+ }
+
+ bool hasCandidateError() const {
+ return candidateError;
+ }
+
+ void setProxyError(bool hasError) {
+ proxyError = hasError;
+ }
+
+ bool hasProxyError() const {
+ return proxyError;
+ }
+ public:
+ typedef std::shared_ptr<JingleS5BTransportPayload> ref;
+
+ private:
+ Mode mode;
+ std::vector<Candidate> candidates;
+
+ std::string candidateUsedCID;
+ std::string activatedCID;
+ std::string dstAddr;
+ bool candidateError;
+ bool proxyError;
+ };
}
diff --git a/Swiften/Elements/JingleTransportPayload.h b/Swiften/Elements/JingleTransportPayload.h
index b870be9..dfd9d22 100644
--- a/Swiften/Elements/JingleTransportPayload.h
+++ b/Swiften/Elements/JingleTransportPayload.h
@@ -1,30 +1,32 @@
/*
- * Copyright (c) 2011 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2011-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
+#include <string>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
- class JingleTransportPayload : public Payload {
- public:
- void setSessionID(const std::string& id) {
- sessionID = id;
- }
+ class SWIFTEN_API JingleTransportPayload : public Payload {
+ public:
+ void setSessionID(const std::string& id) {
+ sessionID = id;
+ }
- const std::string& getSessionID() const {
- return sessionID;
- }
+ const std::string& getSessionID() const {
+ return sessionID;
+ }
- public:
- typedef boost::shared_ptr<JingleTransportPayload> ref;
+ public:
+ typedef std::shared_ptr<JingleTransportPayload> ref;
- private:
- std::string sessionID;
- };
+ private:
+ std::string sessionID;
+ };
}
diff --git a/Swiften/Elements/Last.h b/Swiften/Elements/Last.h
index cb7e0c6..869dab4 100644
--- a/Swiften/Elements/Last.h
+++ b/Swiften/Elements/Last.h
@@ -1,22 +1,23 @@
/*
- * Copyright (c) 2011 Kevin Smith
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2011-2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
- class Last : public Payload {
- public:
- Last(int seconds = 0) : seconds_(seconds) {}
+ class SWIFTEN_API Last : public Payload {
+ public:
+ Last(int seconds = 0) : seconds_(seconds) {}
- int getSeconds() const {return seconds_;}
- void setSeconds(int seconds) {seconds_ = seconds;}
+ int getSeconds() const {return seconds_;}
+ void setSeconds(int seconds) {seconds_ = seconds;}
- private:
- int seconds_;
- };
+ private:
+ int seconds_;
+ };
}
diff --git a/Swiften/Elements/MAMFin.cpp b/Swiften/Elements/MAMFin.cpp
new file mode 100644
index 0000000..24e7aa3
--- /dev/null
+++ b/Swiften/Elements/MAMFin.cpp
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2014 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#include <Swiften/Elements/MAMFin.h>
+
+namespace Swift {
+
+MAMFin::~MAMFin() {
+}
+
+}
diff --git a/Swiften/Elements/MAMFin.h b/Swiften/Elements/MAMFin.h
new file mode 100644
index 0000000..e5e719b
--- /dev/null
+++ b/Swiften/Elements/MAMFin.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2014-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#pragma once
+
+#include <memory>
+#include <string>
+
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
+#include <Swiften/Elements/ResultSet.h>
+
+namespace Swift {
+ class SWIFTEN_API MAMFin : public Payload {
+ public:
+ MAMFin() : isComplete_(false), isStable_(true) {}
+ virtual ~MAMFin();
+
+ void setComplete(const bool isComplete) {
+ isComplete_ = isComplete;
+ }
+
+ bool isComplete() const {
+ return isComplete_;
+ }
+
+ void setStable(const bool isStable) {
+ isStable_ = isStable;
+ }
+
+ bool isStable() const {
+ return isStable_;
+ }
+
+ void setResultSet(std::shared_ptr<ResultSet> resultSet) {
+ resultSet_ = resultSet;
+ }
+
+ std::shared_ptr<ResultSet> getResultSet() const {
+ return resultSet_;
+ }
+
+ void setQueryID(const std::string& queryID) {
+ queryID_ = queryID;
+ }
+
+ const boost::optional<std::string>& getQueryID() const {
+ return queryID_;
+ }
+
+
+ private:
+ bool isComplete_;
+ bool isStable_;
+ std::shared_ptr<ResultSet> resultSet_;
+ boost::optional<std::string> queryID_;
+ };
+}
diff --git a/Swiften/Elements/MAMQuery.cpp b/Swiften/Elements/MAMQuery.cpp
new file mode 100644
index 0000000..abd4280
--- /dev/null
+++ b/Swiften/Elements/MAMQuery.cpp
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2014 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#include <Swiften/Elements/MAMQuery.h>
+
+using namespace Swift;
+
+MAMQuery::~MAMQuery() {
+}
diff --git a/Swiften/Elements/MAMQuery.h b/Swiften/Elements/MAMQuery.h
new file mode 100644
index 0000000..764c238
--- /dev/null
+++ b/Swiften/Elements/MAMQuery.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2014-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#pragma once
+
+#include <memory>
+#include <string>
+
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Form.h>
+#include <Swiften/Elements/Payload.h>
+#include <Swiften/Elements/ResultSet.h>
+
+namespace Swift {
+ class SWIFTEN_API MAMQuery : public Payload {
+ public:
+ virtual ~MAMQuery();
+
+ void setQueryID(const boost::optional<std::string>& queryID) { queryID_ = queryID; }
+ const boost::optional<std::string>& getQueryID() const { return queryID_; }
+
+ void setNode(const boost::optional<std::string>& node) { node_ = node; }
+ const boost::optional<std::string>& getNode() const { return node_; }
+
+ void setForm(std::shared_ptr<Form> form) { form_ = form; }
+ const std::shared_ptr<Form>& getForm() const { return form_; }
+
+ void setResultSet(std::shared_ptr<ResultSet> resultSet) { resultSet_ = resultSet; }
+ const std::shared_ptr<ResultSet>& getResultSet() const { return resultSet_; }
+
+ private:
+ boost::optional<std::string> queryID_;
+ boost::optional<std::string> node_;
+ std::shared_ptr<Form> form_;
+ std::shared_ptr<ResultSet> resultSet_;
+ };
+}
diff --git a/Swiften/Elements/MAMResult.cpp b/Swiften/Elements/MAMResult.cpp
new file mode 100644
index 0000000..68048ac
--- /dev/null
+++ b/Swiften/Elements/MAMResult.cpp
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2014 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#include <Swiften/Elements/MAMResult.h>
+
+using namespace Swift;
+
+MAMResult::~MAMResult() {
+}
diff --git a/Swiften/Elements/MAMResult.h b/Swiften/Elements/MAMResult.h
new file mode 100644
index 0000000..88ec8f0
--- /dev/null
+++ b/Swiften/Elements/MAMResult.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2014 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#pragma once
+
+#include <string>
+
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/ContainerPayload.h>
+#include <Swiften/Elements/Forwarded.h>
+
+namespace Swift {
+ class SWIFTEN_API MAMResult : public ContainerPayload<Forwarded> {
+ public:
+ virtual ~MAMResult();
+
+ void setID(const std::string& id) { id_ = id; }
+ const std::string& getID() const { return id_; }
+
+ void setQueryID(const boost::optional<std::string>& queryID) { queryID_ = queryID; }
+ const boost::optional<std::string>& getQueryID() const { return queryID_; }
+
+ private:
+ std::string id_;
+ boost::optional<std::string> queryID_;
+ };
+}
diff --git a/Swiften/Elements/MIXCreate.h b/Swiften/Elements/MIXCreate.h
new file mode 100644
index 0000000..0fab463
--- /dev/null
+++ b/Swiften/Elements/MIXCreate.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2017 Tarun Gupta
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#pragma once
+
+#include <memory>
+
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Form.h>
+#include <Swiften/Elements/Payload.h>
+
+namespace Swift {
+ class SWIFTEN_API MIXCreate : public Payload {
+ public:
+ using ref = std::shared_ptr<MIXCreate>;
+
+ public:
+
+ MIXCreate() {}
+
+ std::shared_ptr<Form> getData() const {
+ return data_;
+ }
+
+ void setData(std::shared_ptr<Form> value) {
+ this->data_ = value ;
+ }
+
+ const boost::optional<std::string>& getChannel() const {
+ return channel_;
+ }
+
+ void setChannel(const std::string& channel) {
+ this->channel_ = channel;
+ }
+
+ private:
+ boost::optional<std::string> channel_;
+ std::shared_ptr<Form> data_;
+ };
+}
diff --git a/Swiften/Elements/MIXDestroy.h b/Swiften/Elements/MIXDestroy.h
new file mode 100644
index 0000000..a674638
--- /dev/null
+++ b/Swiften/Elements/MIXDestroy.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2017 Tarun Gupta
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#pragma once
+
+#include <memory>
+#include <string>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
+
+namespace Swift {
+ class SWIFTEN_API MIXDestroy : public Payload {
+ public:
+ using ref = std::shared_ptr<MIXDestroy>;
+
+ public:
+ MIXDestroy() {}
+ virtual ~MIXDestroy() {}
+
+ const std::string& getChannel() const {
+ return channel_;
+ }
+
+ void setChannel(const std::string& channel) {
+ this->channel_ = channel;
+ }
+
+ private:
+ std::string channel_;
+ };
+}
diff --git a/Swiften/Elements/MIXJoin.h b/Swiften/Elements/MIXJoin.h
new file mode 100644
index 0000000..ecd7b12
--- /dev/null
+++ b/Swiften/Elements/MIXJoin.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2017 Tarun Gupta
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#pragma once
+
+#include <memory>
+#include <string>
+#include <unordered_set>
+
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
+#include <Swiften/Elements/Form.h>
+#include <Swiften/JID/JID.h>
+
+namespace Swift {
+ class SWIFTEN_API MIXJoin : public Payload {
+
+ public:
+ using ref = std::shared_ptr<MIXJoin>;
+
+ public:
+
+ MIXJoin() {}
+
+ const boost::optional<JID>& getChannel() const {
+ return channel_;
+ }
+
+ void setChannel(JID channel) {
+ channel_ = channel;
+ }
+
+ const boost::optional<JID>& getJID() const {
+ return jid_;
+ }
+
+ void setJID(JID jid) {
+ jid_ = jid;
+ }
+
+ const std::unordered_set<std::string>& getSubscriptions() const {
+ return subscribeItems_;
+ }
+
+ void setSubscriptions(std::unordered_set<std::string> values) {
+ subscribeItems_ = values ;
+ }
+
+ void addSubscription(std::string value) {
+ subscribeItems_.insert(value);
+ }
+
+ bool hasSubscription(const std::string& value) const {
+ return std::find(subscribeItems_.begin(), subscribeItems_.end(), value) != subscribeItems_.end();
+ }
+
+ void setForm(std::shared_ptr<Form> form) {
+ form_ = form;
+ }
+
+ const std::shared_ptr<Form>& getForm() const {
+ return form_;
+ }
+
+ private:
+ boost::optional<JID> jid_;
+ boost::optional<JID> channel_;
+ std::unordered_set<std::string> subscribeItems_;
+ std::shared_ptr<Form> form_;
+ // FIXME: MIXInvitation to be implemented. boost::optional<MIXInvitation> invitation_;
+ };
+}
diff --git a/Swiften/Elements/MIXLeave.h b/Swiften/Elements/MIXLeave.h
new file mode 100644
index 0000000..76ca09d
--- /dev/null
+++ b/Swiften/Elements/MIXLeave.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2017 Tarun Gupta
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#pragma once
+
+#include <memory>
+
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/JID/JID.h>
+#include <Swiften/Elements/Payload.h>
+
+namespace Swift {
+ class SWIFTEN_API MIXLeave : public Payload {
+ public:
+ using ref = std::shared_ptr<MIXLeave>;
+
+ public:
+
+ MIXLeave() {}
+
+ const boost::optional<JID>& getChannel() const {
+ return channel_;
+ }
+
+ void setChannel(const JID& channel) {
+ channel_ = channel;
+ }
+
+ private:
+ boost::optional<JID> channel_;
+ };
+}
diff --git a/Swiften/Elements/MIXParticipant.h b/Swiften/Elements/MIXParticipant.h
new file mode 100644
index 0000000..22133b8
--- /dev/null
+++ b/Swiften/Elements/MIXParticipant.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2017 Tarun Gupta
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#pragma once
+
+#include <memory>
+#include <string>
+
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
+#include <Swiften/JID/JID.h>
+
+namespace Swift {
+ class SWIFTEN_API MIXParticipant : public Payload {
+ public:
+ using ref = std::shared_ptr<MIXParticipant>;
+
+ public:
+
+ MIXParticipant() {}
+
+ const boost::optional<std::string>& getNick() const {
+ return nick_;
+ }
+
+ void setNick(const std::string& nick) {
+ nick_ = nick;
+ }
+
+ const boost::optional<JID>& getJID() const {
+ return jid_;
+ }
+
+ void setJID(const JID& jid) {
+ jid_ = jid;
+ }
+
+ private:
+ boost::optional<JID> jid_;
+ boost::optional<std::string> nick_;
+ };
+}
diff --git a/Swiften/Elements/MIXPayload.h b/Swiften/Elements/MIXPayload.h
new file mode 100644
index 0000000..3989c18
--- /dev/null
+++ b/Swiften/Elements/MIXPayload.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2017 Tarun Gupta
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#pragma once
+
+#include <memory>
+#include <string>
+
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
+#include <Swiften/JID/JID.h>
+
+namespace Swift {
+ class SWIFTEN_API MIXPayload : public Payload {
+ public:
+ using ref = std::shared_ptr<MIXPayload>;
+
+ public:
+
+ MIXPayload() {}
+
+ const boost::optional<std::string>& getNick() const {
+ return nick_;
+ }
+
+ void setNick(const std::string& nick) {
+ nick_ = nick;
+ }
+
+ const boost::optional<JID>& getJID() const {
+ return jid_;
+ }
+
+ void setJID(const JID& jid) {
+ jid_ = jid;
+ }
+
+ const boost::optional<std::string>& getSubmissionID() const {
+ return submissionId_;
+ }
+
+ void setSubmissionID(const std::string& submissionId) {
+ submissionId_ = submissionId;
+ }
+
+ private:
+ boost::optional<JID> jid_;
+ boost::optional<std::string> nick_;
+ boost::optional<std::string> submissionId_;
+ };
+}
diff --git a/Swiften/Elements/MIXRegisterNick.h b/Swiften/Elements/MIXRegisterNick.h
new file mode 100644
index 0000000..3bd8c4a
--- /dev/null
+++ b/Swiften/Elements/MIXRegisterNick.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2017 Tarun Gupta
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#pragma once
+
+#include <memory>
+#include <string>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
+
+namespace Swift {
+ class SWIFTEN_API MIXRegisterNick : public Payload {
+ public:
+ using ref = std::shared_ptr<MIXRegisterNick>;
+
+ public:
+
+ MIXRegisterNick() {}
+
+ const std::string& getNick() const {
+ return nick_;
+ }
+
+ void setNick(const std::string& nick) {
+ nick_ = nick;
+ }
+
+ private:
+ std::string nick_;
+ };
+}
diff --git a/Swiften/Elements/MIXSetNick.h b/Swiften/Elements/MIXSetNick.h
new file mode 100644
index 0000000..94c5a3b
--- /dev/null
+++ b/Swiften/Elements/MIXSetNick.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2017 Tarun Gupta
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#pragma once
+
+#include <memory>
+#include <string>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
+
+namespace Swift {
+ class SWIFTEN_API MIXSetNick : public Payload {
+ public:
+ using ref = std::shared_ptr<MIXSetNick>;
+
+ public:
+
+ MIXSetNick() {}
+
+ const std::string& getNick() const {
+ return nick_;
+ }
+
+ void setNick(const std::string& nick) {
+ nick_ = nick;
+ }
+
+ private:
+ std::string nick_;
+ };
+}
diff --git a/Swiften/Elements/MIXUpdateSubscription.h b/Swiften/Elements/MIXUpdateSubscription.h
new file mode 100644
index 0000000..dc6ed27
--- /dev/null
+++ b/Swiften/Elements/MIXUpdateSubscription.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2017 Tarun Gupta
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#pragma once
+
+#include <memory>
+#include <unordered_set>
+
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
+#include <Swiften/JID/JID.h>
+
+namespace Swift {
+ class SWIFTEN_API MIXUpdateSubscription : public Payload {
+
+ public:
+ using ref = std::shared_ptr<MIXUpdateSubscription>;
+
+ public:
+
+ MIXUpdateSubscription() {}
+
+ const boost::optional<JID>& getJID() const {
+ return jid_;
+ }
+
+ void setJID(JID jid) {
+ jid_ = jid;
+ }
+
+ const std::unordered_set<std::string>& getSubscriptions() const {
+ return subscribeItems_;
+ }
+
+ void setSubscriptions(std::unordered_set<std::string> values) {
+ subscribeItems_ = values ;
+ }
+
+ void addSubscription(std::string value) {
+ subscribeItems_.insert(value);
+ }
+
+ bool hasSubscription(const std::string& value) const {
+ return std::find(subscribeItems_.begin(), subscribeItems_.end(), value) != subscribeItems_.end();
+ }
+
+ private:
+ boost::optional<JID> jid_;
+ std::unordered_set<std::string> subscribeItems_;
+ };
+}
diff --git a/Swiften/Elements/MIXUserPreference.h b/Swiften/Elements/MIXUserPreference.h
new file mode 100644
index 0000000..cd1311c
--- /dev/null
+++ b/Swiften/Elements/MIXUserPreference.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2017 Tarun Gupta
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#pragma once
+
+#include <memory>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Form.h>
+#include <Swiften/Elements/Payload.h>
+
+namespace Swift {
+ class SWIFTEN_API MIXUserPreference : public Payload {
+ public:
+ using ref = std::shared_ptr<MIXUserPreference>;
+
+ public:
+
+ MIXUserPreference() {}
+
+ std::shared_ptr<Form> getData() const {
+ return data_;
+ }
+
+ void setData(std::shared_ptr<Form> value) {
+ this->data_ = value ;
+ }
+
+
+ private:
+ std::shared_ptr<Form> data_;
+ };
+}
diff --git a/Swiften/Elements/MUCAdminPayload.h b/Swiften/Elements/MUCAdminPayload.h
index dc09a24..3f78cc8 100644
--- a/Swiften/Elements/MUCAdminPayload.h
+++ b/Swiften/Elements/MUCAdminPayload.h
@@ -1,35 +1,37 @@
/*
- * Copyright (c) 2010 Kevin Smith
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <string>
#include <vector>
-#include <Swiften/JID/JID.h>
-#include <Swiften/Elements/Payload.h>
-#include <Swiften/Elements/MUCOccupant.h>
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/MUCItem.h>
+#include <Swiften/Elements/MUCOccupant.h>
+#include <Swiften/Elements/Payload.h>
+#include <Swiften/JID/JID.h>
namespace Swift {
- class MUCAdminPayload : public Payload {
- public:
- typedef boost::shared_ptr<MUCAdminPayload> ref;
+ class SWIFTEN_API MUCAdminPayload : public Payload {
+ public:
+ typedef std::shared_ptr<MUCAdminPayload> ref;
- MUCAdminPayload() {
- }
+ MUCAdminPayload() {
+ }
- void addItem(const MUCItem& item) {items_.push_back(item);}
+ void addItem(const MUCItem& item) {items_.push_back(item);}
- const std::vector<MUCItem>& getItems() const {return items_;}
+ const std::vector<MUCItem>& getItems() const {return items_;}
- private:
- std::vector<MUCItem> items_;
- };
+ private:
+ std::vector<MUCItem> items_;
+ };
}
diff --git a/Swiften/Elements/MUCDestroyPayload.h b/Swiften/Elements/MUCDestroyPayload.h
index f743ad0..ad1bda2 100644
--- a/Swiften/Elements/MUCDestroyPayload.h
+++ b/Swiften/Elements/MUCDestroyPayload.h
@@ -1,42 +1,43 @@
/*
- * Copyright (c) 2011 Kevin Smith
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2011-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
#include <string>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
#include <Swiften/JID/JID.h>
namespace Swift {
- class MUCDestroyPayload : public Payload {
- public:
- typedef boost::shared_ptr<MUCDestroyPayload> ref;
+ class SWIFTEN_API MUCDestroyPayload : public Payload {
+ public:
+ typedef std::shared_ptr<MUCDestroyPayload> ref;
- MUCDestroyPayload() {
- }
+ MUCDestroyPayload() {
+ }
- void setNewVenue(const JID& jid) {
- newVenue_ = jid;
- }
+ void setNewVenue(const JID& jid) {
+ newVenue_ = jid;
+ }
- const JID& getNewVenue() const {
- return newVenue_;
- }
+ const JID& getNewVenue() const {
+ return newVenue_;
+ }
- void setReason(const std::string& reason) {
- reason_ = reason;
- }
+ void setReason(const std::string& reason) {
+ reason_ = reason;
+ }
- const std::string& getReason() const {
- return reason_;
- }
+ const std::string& getReason() const {
+ return reason_;
+ }
- private:
- JID newVenue_;
- std::string reason_;
- };
+ private:
+ JID newVenue_;
+ std::string reason_;
+ };
}
diff --git a/Swiften/Elements/MUCInvitationPayload.h b/Swiften/Elements/MUCInvitationPayload.h
index 290c585..545e60f 100644
--- a/Swiften/Elements/MUCInvitationPayload.h
+++ b/Swiften/Elements/MUCInvitationPayload.h
@@ -1,77 +1,78 @@
/*
- * Copyright (c) 2011 Kevin Smith
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2011-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
#include <string>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
#include <Swiften/JID/JID.h>
namespace Swift {
- class MUCInvitationPayload : public Payload {
- public:
- typedef boost::shared_ptr<MUCInvitationPayload> ref;
- MUCInvitationPayload() : continuation_(false), impromptu_(false) {
- }
-
- void setIsContinuation(bool b) {
- continuation_ = b;
- }
-
- bool getIsContinuation() const {
- return continuation_;
- }
-
- void setIsImpromptu(bool b) {
- impromptu_ = b;
- }
-
- bool getIsImpromptu() const {
- return impromptu_;
- }
-
- void setJID(const JID& jid) {
- jid_ = jid;
- }
-
- const JID& getJID() const {
- return jid_;
- }
-
- void setPassword(const std::string& password) {
- password_ = password;
- }
-
- const std::string& getPassword() const {
- return password_;
- }
-
- void setReason(const std::string& text) {
- reason_ = text;
- }
-
- const std::string& getReason() const {
- return reason_;
- }
-
- void setThread(const std::string& thread) {
- thread_ = thread;
- }
-
- const std::string& getThread() const {
- return thread_;
- }
-
- private:
- bool continuation_;
- bool impromptu_;
- JID jid_;
- std::string password_;
- std::string reason_;
- std::string thread_;
- };
+ class SWIFTEN_API MUCInvitationPayload : public Payload {
+ public:
+ typedef std::shared_ptr<MUCInvitationPayload> ref;
+ MUCInvitationPayload() : continuation_(false), impromptu_(false) {
+ }
+
+ void setIsContinuation(bool b) {
+ continuation_ = b;
+ }
+
+ bool getIsContinuation() const {
+ return continuation_;
+ }
+
+ void setIsImpromptu(bool b) {
+ impromptu_ = b;
+ }
+
+ bool getIsImpromptu() const {
+ return impromptu_;
+ }
+
+ void setJID(const JID& jid) {
+ jid_ = jid;
+ }
+
+ const JID& getJID() const {
+ return jid_;
+ }
+
+ void setPassword(const std::string& password) {
+ password_ = password;
+ }
+
+ const std::string& getPassword() const {
+ return password_;
+ }
+
+ void setReason(const std::string& text) {
+ reason_ = text;
+ }
+
+ const std::string& getReason() const {
+ return reason_;
+ }
+
+ void setThread(const std::string& thread) {
+ thread_ = thread;
+ }
+
+ const std::string& getThread() const {
+ return thread_;
+ }
+
+ private:
+ bool continuation_;
+ bool impromptu_;
+ JID jid_;
+ std::string password_;
+ std::string reason_;
+ std::string thread_;
+ };
}
diff --git a/Swiften/Elements/MUCItem.h b/Swiften/Elements/MUCItem.h
index 86217ec..3c89e68 100644
--- a/Swiften/Elements/MUCItem.h
+++ b/Swiften/Elements/MUCItem.h
@@ -1,21 +1,24 @@
/*
- * Copyright (c) 2011 Kevin Smith
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2011-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
#include <Swiften/Elements/MUCOccupant.h>
#include <Swiften/JID/JID.h>
+
namespace Swift {
struct MUCItem {
- MUCItem() {}
- boost::optional<JID> realJID;
- boost::optional<std::string> nick;
- boost::optional<MUCOccupant::Affiliation> affiliation;
- boost::optional<MUCOccupant::Role> role;
- boost::optional<JID> actor;
- boost::optional<std::string> reason;
+ MUCItem() {}
+ MUCItem(MUCOccupant::Affiliation affiliation, const JID& jid, MUCOccupant::Role role) : realJID(jid), affiliation(affiliation), role(role) {}
+ MUCItem(MUCOccupant::Affiliation affiliation, MUCOccupant::Role role) : affiliation(affiliation), role(role) {}
+ boost::optional<JID> realJID;
+ boost::optional<std::string> nick;
+ boost::optional<MUCOccupant::Affiliation> affiliation;
+ boost::optional<MUCOccupant::Role> role;
+ boost::optional<JID> actor;
+ boost::optional<std::string> reason;
};
}
diff --git a/Swiften/Elements/MUCOccupant.cpp b/Swiften/Elements/MUCOccupant.cpp
index 57034ad..65fb8c2 100644
--- a/Swiften/Elements/MUCOccupant.cpp
+++ b/Swiften/Elements/MUCOccupant.cpp
@@ -1,11 +1,13 @@
/*
- * Copyright (c) 2010 Kevin Smith
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#include <Swiften/Elements/MUCOccupant.h>
+#include <utility>
+
namespace Swift {
MUCOccupant::MUCOccupant(const std::string &nick, Role role, Affiliation affiliation) : nick_(nick), role_(role), affiliation_(affiliation) {
@@ -18,29 +20,37 @@ MUCOccupant::MUCOccupant(const MUCOccupant& other) : nick_(other.getNick()), rol
}
+MUCOccupant& MUCOccupant::operator=(MUCOccupant other) {
+ std::swap(nick_, other.nick_);
+ std::swap(role_, other.role_);
+ std::swap(affiliation_, other.affiliation_);
+ std::swap(realJID_, other.realJID_);
+ return *this;
+}
+
std::string MUCOccupant::getNick() const {
- return nick_;
+ return nick_;
}
MUCOccupant::Role MUCOccupant::getRole() const {
- return role_;
+ return role_;
}
MUCOccupant::Affiliation MUCOccupant::getAffiliation() const {
- return affiliation_;
+ return affiliation_;
}
void MUCOccupant::setRealJID(const JID& realJID) {
- realJID_ = realJID;
+ realJID_ = realJID;
}
void MUCOccupant::setNick(const std::string& nick) {
- nick_ = nick;
+ nick_ = nick;
}
boost::optional<JID> MUCOccupant::getRealJID() const {
- return realJID_;
+ return realJID_;
}
}
diff --git a/Swiften/Elements/MUCOccupant.h b/Swiften/Elements/MUCOccupant.h
index 023643c..260502e 100644
--- a/Swiften/Elements/MUCOccupant.h
+++ b/Swiften/Elements/MUCOccupant.h
@@ -1,42 +1,43 @@
/*
- * Copyright (c) 2010 Kevin Smith
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2017 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/optional.hpp>
#include <string>
+#include <boost/optional.hpp>
+
#include <Swiften/Base/API.h>
#include <Swiften/JID/JID.h>
namespace Swift {
- class Client;
-
- class SWIFTEN_API MUCOccupant {
- public:
- enum Role {Moderator, Participant, Visitor, NoRole};
- enum Affiliation {Owner, Admin, Member, Outcast, NoAffiliation};
-
- MUCOccupant(const std::string &nick, Role role, Affiliation affiliation);
- MUCOccupant(const MUCOccupant& other);
- ~MUCOccupant();
-
- std::string getNick() const;
- Role getRole() const;
- Affiliation getAffiliation() const;
- boost::optional<JID> getRealJID() const;
- void setRealJID(const JID& jid);
- void setNick(const std::string& nick);
-
- private:
- std::string nick_;
- Role role_;
- Affiliation affiliation_;
- boost::optional<JID> realJID_;
- /* If you add a field, remember to update the const copy constructor */
- };
+ class SWIFTEN_API MUCOccupant {
+ public:
+ enum Role {Moderator, Participant, Visitor, NoRole};
+ enum Affiliation {Owner, Admin, Member, Outcast, NoAffiliation};
+
+ MUCOccupant(const std::string &nick, Role role, Affiliation affiliation);
+ MUCOccupant(const MUCOccupant& other);
+ ~MUCOccupant();
+
+ MUCOccupant& operator=(MUCOccupant other);
+
+ std::string getNick() const;
+ Role getRole() const;
+ Affiliation getAffiliation() const;
+ boost::optional<JID> getRealJID() const;
+ void setRealJID(const JID& jid);
+ void setNick(const std::string& nick);
+
+ private:
+ std::string nick_;
+ Role role_;
+ Affiliation affiliation_;
+ boost::optional<JID> realJID_;
+ /* If you add a field, remember to update the const copy constructor */
+ };
}
diff --git a/Swiften/Elements/MUCOwnerPayload.h b/Swiften/Elements/MUCOwnerPayload.h
index 5ccc755..5f3c633 100644
--- a/Swiften/Elements/MUCOwnerPayload.h
+++ b/Swiften/Elements/MUCOwnerPayload.h
@@ -1,37 +1,38 @@
/*
- * Copyright (c) 2010 Kevin Smith
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
#include <boost/optional.hpp>
-#include <Swiften/Elements/Payload.h>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Form.h>
+#include <Swiften/Elements/Payload.h>
namespace Swift {
- class MUCOwnerPayload : public Payload {
- public:
- typedef boost::shared_ptr<MUCOwnerPayload> ref;
+ class SWIFTEN_API MUCOwnerPayload : public Payload {
+ public:
+ typedef std::shared_ptr<MUCOwnerPayload> ref;
- MUCOwnerPayload() {
- }
+ MUCOwnerPayload() {
+ }
- boost::shared_ptr<Payload> getPayload() const {
- return payload;
- }
+ std::shared_ptr<Payload> getPayload() const {
+ return payload;
+ }
- void setPayload(boost::shared_ptr<Payload> p) {
- payload = p;
- }
+ void setPayload(std::shared_ptr<Payload> p) {
+ payload = p;
+ }
- Form::ref getForm() {
- return boost::dynamic_pointer_cast<Form>(payload);
- }
+ Form::ref getForm() {
+ return std::dynamic_pointer_cast<Form>(payload);
+ }
- private:
- boost::shared_ptr<Payload> payload;
- };
+ private:
+ std::shared_ptr<Payload> payload;
+ };
}
diff --git a/Swiften/Elements/MUCPayload.h b/Swiften/Elements/MUCPayload.h
index 29cab8d..6e199e5 100644
--- a/Swiften/Elements/MUCPayload.h
+++ b/Swiften/Elements/MUCPayload.h
@@ -1,74 +1,76 @@
/*
- * Copyright (c) 2010 Kevin Smith
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/optional.hpp>
+#include <string>
+
#include <boost/date_time/posix_time/posix_time_types.hpp>
+#include <boost/optional.hpp>
-#include <Swiften/JID/JID.h>
-#include <string>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
+#include <Swiften/JID/JID.h>
namespace Swift {
- class MUCPayload : public Payload {
- public:
- typedef boost::shared_ptr<MUCPayload> ref;
-
- MUCPayload() {
- maxChars_ = -1;
- maxStanzas_ = -1;
- seconds_ = -1;
- }
-
- void setMaxChars(int maxChars) {
- maxChars_ = maxChars;
- }
-
- void setMaxStanzas(int maxStanzas) {
- maxStanzas_ = maxStanzas;
- }
-
- void setSeconds(int seconds) {
- seconds_ = seconds;
- }
-
- void setSince(boost::posix_time::ptime since) {
- since_ = since;
- }
-
- void setPassword(const std::string& password) {
- password_ = password;
- }
-
- int getMaxChars() const{
- return maxChars_;
- }
-
- int getMaxStanzas() const{
- return maxStanzas_;
- }
-
- int getSeconds() const {
- return seconds_;
- }
-
- const boost::optional<std::string>& getPassword() const {
- return password_;
- }
-
- const boost::posix_time::ptime& getSince() const {
- return since_;
- }
-
- private:
- int maxChars_;
- int maxStanzas_;
- int seconds_;
- boost::posix_time::ptime since_;
- boost::optional<std::string> password_;
- };
+ class SWIFTEN_API MUCPayload : public Payload {
+ public:
+ typedef std::shared_ptr<MUCPayload> ref;
+
+ MUCPayload() {
+ maxChars_ = -1;
+ maxStanzas_ = -1;
+ seconds_ = -1;
+ }
+
+ void setMaxChars(int maxChars) {
+ maxChars_ = maxChars;
+ }
+
+ void setMaxStanzas(int maxStanzas) {
+ maxStanzas_ = maxStanzas;
+ }
+
+ void setSeconds(int seconds) {
+ seconds_ = seconds;
+ }
+
+ void setSince(boost::posix_time::ptime since) {
+ since_ = since;
+ }
+
+ void setPassword(const std::string& password) {
+ password_ = password;
+ }
+
+ int getMaxChars() const{
+ return maxChars_;
+ }
+
+ int getMaxStanzas() const{
+ return maxStanzas_;
+ }
+
+ int getSeconds() const {
+ return seconds_;
+ }
+
+ const boost::optional<std::string>& getPassword() const {
+ return password_;
+ }
+
+ const boost::posix_time::ptime& getSince() const {
+ return since_;
+ }
+
+ private:
+ int maxChars_;
+ int maxStanzas_;
+ int seconds_;
+ boost::posix_time::ptime since_;
+ boost::optional<std::string> password_;
+ };
}
diff --git a/Swiften/Elements/MUCUserPayload.h b/Swiften/Elements/MUCUserPayload.h
index fcb585e..dd57376 100644
--- a/Swiften/Elements/MUCUserPayload.h
+++ b/Swiften/Elements/MUCUserPayload.h
@@ -1,95 +1,97 @@
/*
- * Copyright (c) 2010 Kevin Smith
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <string>
#include <vector>
-#include <Swiften/JID/JID.h>
-#include <Swiften/Elements/Payload.h>
-#include <Swiften/Elements/MUCOccupant.h>
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/MUCItem.h>
+#include <Swiften/Elements/MUCOccupant.h>
+#include <Swiften/Elements/Payload.h>
+#include <Swiften/JID/JID.h>
namespace Swift {
- class MUCUserPayload : public Payload {
- public:
- typedef boost::shared_ptr<MUCUserPayload> ref;
+ class SWIFTEN_API MUCUserPayload : public Payload {
+ public:
+ typedef std::shared_ptr<MUCUserPayload> ref;
+
+ struct StatusCode {
+ StatusCode() : code(0) {}
+ StatusCode(int code) : code(code) {}
+ int code;
+ };
- struct StatusCode {
- StatusCode() : code(0) {}
- StatusCode(int code) : code(code) {}
- int code;
- };
+ //struct Password {
- //struct Password {
+ //}
- //}
+ // struct History {
- // struct History {
+ // }
- // }
+ /**
+ * reason is optional.
+ * from and to are mutually exclusive.
+ * From is used for MUC sending to invited client. To is used sending to MUC from inviting client.
+ * from is the JID the MUC claims the invite is from.
+ * to is the JID to send the invite to.
+ */
+ struct Invite {
+ std::string reason;
+ JID from;
+ JID to;
+ };
- /**
- * reason is optional.
- * from and to are mutually exclusive.
- * From is used for MUC sending to invited client. To is used sending to MUC from inviting client.
- * from is the JID the MUC claims the invite is from.
- * to is the JID to send the invite to.
- */
- struct Invite {
- std::string reason;
- JID from;
- JID to;
- };
+ MUCUserPayload() {
+ }
- MUCUserPayload() {
- }
+ void addItem(const MUCItem& item) {items_.push_back(item);}
- void addItem(const MUCItem& item) {items_.push_back(item);}
-
- void addStatusCode(StatusCode code) {statusCodes_.push_back(code);}
+ void addStatusCode(StatusCode code) {statusCodes_.push_back(code);}
- const std::vector<MUCItem>& getItems() const {return items_;}
+ const std::vector<MUCItem>& getItems() const {return items_;}
- const std::vector<StatusCode>& getStatusCodes() const {return statusCodes_;}
+ const std::vector<StatusCode>& getStatusCodes() const {return statusCodes_;}
- boost::shared_ptr<Payload> getPayload() const {
- return payload_;
- }
+ std::shared_ptr<Payload> getPayload() const {
+ return payload_;
+ }
- void setPayload(boost::shared_ptr<Payload> p) {
- payload_ = p;
- }
+ void setPayload(std::shared_ptr<Payload> p) {
+ payload_ = p;
+ }
- const boost::optional<std::string>& getPassword() const {
- return password_;
- }
+ const boost::optional<std::string>& getPassword() const {
+ return password_;
+ }
- void setPassword(const std::string& password) {
- password_ = password;
- }
+ void setPassword(const std::string& password) {
+ password_ = password;
+ }
- const boost::optional<Invite>& getInvite() const {
- return invite_;
- }
+ const boost::optional<Invite>& getInvite() const {
+ return invite_;
+ }
- void setInvite(const Invite& invite) {
- invite_ = invite;
- }
+ void setInvite(const Invite& invite) {
+ invite_ = invite;
+ }
- private:
- std::vector<MUCItem> items_;
- std::vector<StatusCode> statusCodes_;
- boost::shared_ptr<Payload> payload_;
- boost::optional<std::string> password_;
- boost::optional<Invite> invite_;
- };
+ private:
+ std::vector<MUCItem> items_;
+ std::vector<StatusCode> statusCodes_;
+ std::shared_ptr<Payload> payload_;
+ boost::optional<std::string> password_;
+ boost::optional<Invite> invite_;
+ };
}
diff --git a/Swiften/Elements/Message.h b/Swiften/Elements/Message.h
index ea99814..c357cd4 100644
--- a/Swiften/Elements/Message.h
+++ b/Swiften/Elements/Message.h
@@ -1,70 +1,79 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
+#include <memory>
+#include <string>
+
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
-#include <string>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Body.h>
-#include <Swiften/Elements/Subject.h>
#include <Swiften/Elements/ErrorPayload.h>
-#include <Swiften/Elements/Stanza.h>
#include <Swiften/Elements/Replace.h>
+#include <Swiften/Elements/Stanza.h>
+#include <Swiften/Elements/Subject.h>
namespace Swift {
- class Message : public Stanza {
- public:
- typedef boost::shared_ptr<Message> ref;
-
- enum Type { Normal, Chat, Error, Groupchat, Headline };
-
- Message() : type_(Chat) { }
-
- std::string getSubject() const {
- boost::shared_ptr<Subject> subject(getPayload<Subject>());
- if (subject) {
- return subject->getText();
- }
- return "";
- }
-
- void setSubject(const std::string& subject) {
- updatePayload(boost::make_shared<Subject>(subject));
- }
-
- // Explicitly convert to bool. In C++11, it would be cleaner to
- // compare to nullptr.
- bool hasSubject() {
- return static_cast<bool>(getPayload<Subject>());
- }
-
- std::string getBody() const {
- boost::shared_ptr<Body> body(getPayload<Body>());
- if (body) {
- return body->getText();
- }
- return "";
- }
-
- void setBody(const std::string& body) {
- updatePayload(boost::make_shared<Body>(body));
- }
-
- bool isError() {
- boost::shared_ptr<Swift::ErrorPayload> error(getPayload<Swift::ErrorPayload>());
- return getType() == Message::Error || error;
- }
-
- Type getType() const { return type_; }
- void setType(Type type) { type_ = type; }
-
- private:
- Type type_;
- };
+ class SWIFTEN_API Message : public Stanza {
+ public:
+ typedef std::shared_ptr<Message> ref;
+
+ enum Type { Normal, Chat, Error, Groupchat, Headline };
+
+ Message() : type_(Chat) { }
+
+ std::string getSubject() const {
+ std::shared_ptr<Subject> subject(getPayload<Subject>());
+ if (subject) {
+ return subject->getText();
+ }
+ return "";
+ }
+
+ void setSubject(const std::string& subject) {
+ updatePayload(std::make_shared<Subject>(subject));
+ }
+
+ bool hasSubject() {
+ return getPayload<Subject>() != nullptr;
+ }
+
+ boost::optional<std::string> getBody() const {
+ std::shared_ptr<Body> body(getPayload<Body>());
+ boost::optional<std::string> bodyData;
+ if (body) {
+ bodyData = body->getText();
+ }
+ return bodyData;
+ }
+
+ void setBody(const std::string& body) {
+ setBody(boost::optional<std::string>(body));
+ }
+
+ void setBody(const boost::optional<std::string>& body) {
+ if (body) {
+ updatePayload(std::make_shared<Body>(body.get()));
+ }
+ else {
+ removePayloadOfSameType(std::make_shared<Body>());
+ }
+ }
+
+ bool isError() {
+ std::shared_ptr<Swift::ErrorPayload> error(getPayload<Swift::ErrorPayload>());
+ return getType() == Message::Error || error;
+ }
+
+ Type getType() const { return type_; }
+ void setType(Type type) { type_ = type; }
+
+ private:
+ Type type_;
+ };
}
diff --git a/Swiften/Elements/Nickname.h b/Swiften/Elements/Nickname.h
index a244ce3..123c156 100644
--- a/Swiften/Elements/Nickname.h
+++ b/Swiften/Elements/Nickname.h
@@ -1,29 +1,31 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Elements/Payload.h>
#include <string>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
+
namespace Swift {
- class Nickname : public Payload {
- public:
- Nickname(const std::string& nickname = "") : nickname(nickname) {
- }
+ class SWIFTEN_API Nickname : public Payload {
+ public:
+ Nickname(const std::string& nickname = "") : nickname(nickname) {
+ }
- void setNickname(const std::string& nickname) {
- this->nickname = nickname;
- }
+ void setNickname(const std::string& nickname) {
+ this->nickname = nickname;
+ }
- const std::string& getNickname() const {
- return nickname;
- }
+ const std::string& getNickname() const {
+ return nickname;
+ }
- private:
- std::string nickname;
- };
+ private:
+ std::string nickname;
+ };
}
diff --git a/Swiften/Elements/Payload.cpp b/Swiften/Elements/Payload.cpp
index b7c3ffe..6d8a263 100644
--- a/Swiften/Elements/Payload.cpp
+++ b/Swiften/Elements/Payload.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#include <Swiften/Elements/Payload.h>
diff --git a/Swiften/Elements/Payload.h b/Swiften/Elements/Payload.h
index 15a72d5..9923f0b 100644
--- a/Swiften/Elements/Payload.h
+++ b/Swiften/Elements/Payload.h
@@ -1,20 +1,25 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Element.h>
namespace Swift {
- class SWIFTEN_API Payload {
- public:
- typedef boost::shared_ptr<Payload> ref;
- public:
- virtual ~Payload();
- };
+ class SWIFTEN_API Payload : public Element {
+ public:
+ typedef std::shared_ptr<Payload> ref;
+ public:
+ Payload() {}
+ SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(Payload)
+ virtual ~Payload();
+
+ SWIFTEN_DEFAULT_COPY_ASSIGMNENT_OPERATOR(Payload)
+ };
}
diff --git a/Swiften/Elements/Presence.cpp b/Swiften/Elements/Presence.cpp
index 38b8a4c..f75f3be 100644
--- a/Swiften/Elements/Presence.cpp
+++ b/Swiften/Elements/Presence.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#include <Swiften/Elements/Presence.h>
@@ -15,32 +15,31 @@ Presence::Presence() : type_(Available) /*, showType_(Online)*/ {
}
Presence::Presence(const std::string& status) : type_(Available) {
- setStatus(status);
+ setStatus(status);
}
Presence::~Presence() {
}
int Presence::getPriority() const {
- boost::shared_ptr<Priority> priority(getPayload<Priority>());
- return (priority ? priority->getPriority() : 0);
+ std::shared_ptr<Priority> priority(getPayload<Priority>());
+ return (priority ? priority->getPriority() : 0);
}
void Presence::setPriority(int priority) {
- updatePayload(boost::make_shared<Priority>(priority));
+ updatePayload(std::make_shared<Priority>(priority));
}
-std::string Presence::getStatus() const {
- boost::shared_ptr<Status> status(getPayload<Status>());
- if (status) {
- return status->getText();
- }
- return "";
+std::string Presence::getStatus() const {
+ std::shared_ptr<Status> status(getPayload<Status>());
+ if (status) {
+ return status->getText();
+ }
+ return "";
}
-void Presence::setStatus(const std::string& status) {
- updatePayload(boost::make_shared<Status>(status));
+void Presence::setStatus(const std::string& status) {
+ updatePayload(std::make_shared<Status>(status));
}
-
}
diff --git a/Swiften/Elements/Presence.h b/Swiften/Elements/Presence.h
index 2e9e224..e658606 100644
--- a/Swiften/Elements/Presence.h
+++ b/Swiften/Elements/Presence.h
@@ -1,70 +1,71 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/smart_ptr/make_shared.hpp>
+#include <memory>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Stanza.h>
#include <Swiften/Elements/StatusShow.h>
namespace Swift {
- class SWIFTEN_API Presence : public Stanza {
- public:
- typedef boost::shared_ptr<Presence> ref;
+ class SWIFTEN_API Presence : public Stanza {
+ public:
+ typedef std::shared_ptr<Presence> ref;
- enum Type { Available, Error, Probe, Subscribe, Subscribed, Unavailable, Unsubscribe, Unsubscribed };
+ enum Type { Available, Error, Probe, Subscribe, Subscribed, Unavailable, Unsubscribe, Unsubscribed };
- Presence();
- Presence(const std::string& status);
- virtual ~Presence();
+ Presence();
+ Presence(const std::string& status);
+ SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(Presence)
+ virtual ~Presence();
- static ref create() {
- return boost::make_shared<Presence>();
- }
+ static ref create() {
+ return std::make_shared<Presence>();
+ }
- static ref create(const std::string& status) {
- return boost::make_shared<Presence>(status);
- }
+ static ref create(const std::string& status) {
+ return std::make_shared<Presence>(status);
+ }
- static ref create(Presence::ref presence) {
- return boost::make_shared<Presence>(*presence);
- }
+ static ref create(Presence::ref presence) {
+ return std::make_shared<Presence>(*presence);
+ }
- Type getType() const { return type_; }
- void setType(Type type) { type_ = type; }
+ Type getType() const { return type_; }
+ void setType(Type type) { type_ = type; }
- StatusShow::Type getShow() const {
- boost::shared_ptr<StatusShow> show(getPayload<StatusShow>());
- if (show) {
- return show->getType();
- }
- return type_ == Available ? StatusShow::Online : StatusShow::None;
- }
+ StatusShow::Type getShow() const {
+ std::shared_ptr<StatusShow> show(getPayload<StatusShow>());
+ if (show) {
+ return show->getType();
+ }
+ return type_ == Available ? StatusShow::Online : StatusShow::None;
+ }
- void setShow(const StatusShow::Type &show) {
- updatePayload(boost::make_shared<StatusShow>(show));
- }
+ void setShow(const StatusShow::Type &show) {
+ updatePayload(std::make_shared<StatusShow>(show));
+ }
- std::string getStatus() const;
- void setStatus(const std::string& status);
+ std::string getStatus() const;
+ void setStatus(const std::string& status);
- int getPriority() const;
- void setPriority(int priority);
+ int getPriority() const;
+ void setPriority(int priority);
- boost::shared_ptr<Presence> clone() const {
- return boost::make_shared<Presence>(*this);
- }
+ std::shared_ptr<Presence> clone() const {
+ return std::make_shared<Presence>(*this);
+ }
- bool isAvailable() const {
- return type_ == Available;
- }
+ bool isAvailable() const {
+ return type_ == Available;
+ }
- private:
- Presence::Type type_;
- };
+ private:
+ Presence::Type type_;
+ };
}
diff --git a/Swiften/Elements/Priority.h b/Swiften/Elements/Priority.h
index 2c0cb9b..56e493c 100644
--- a/Swiften/Elements/Priority.h
+++ b/Swiften/Elements/Priority.h
@@ -1,28 +1,29 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
- class Priority : public Payload {
- public:
- Priority(int priority = 0) : priority_(priority) {
- }
+ class SWIFTEN_API Priority : public Payload {
+ public:
+ Priority(int priority = 0) : priority_(priority) {
+ }
- void setPriority(int priority) {
- priority_ = priority;
- }
+ void setPriority(int priority) {
+ priority_ = priority;
+ }
- int getPriority() const {
- return priority_;
- }
+ int getPriority() const {
+ return priority_;
+ }
- private:
- int priority_;
- };
+ private:
+ int priority_;
+ };
}
diff --git a/Swiften/Elements/PrivateStorage.h b/Swiften/Elements/PrivateStorage.h
index a8e1b74..dfae34c 100644
--- a/Swiften/Elements/PrivateStorage.h
+++ b/Swiften/Elements/PrivateStorage.h
@@ -1,30 +1,31 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
- class PrivateStorage : public Payload {
- public:
- PrivateStorage(boost::shared_ptr<Payload> payload = boost::shared_ptr<Payload>()) : payload(payload) {
- }
+ class SWIFTEN_API PrivateStorage : public Payload {
+ public:
+ PrivateStorage(std::shared_ptr<Payload> payload = std::shared_ptr<Payload>()) : payload(payload) {
+ }
- boost::shared_ptr<Payload> getPayload() const {
- return payload;
- }
+ std::shared_ptr<Payload> getPayload() const {
+ return payload;
+ }
- void setPayload(boost::shared_ptr<Payload> p) {
- payload = p;
- }
+ void setPayload(std::shared_ptr<Payload> p) {
+ payload = p;
+ }
- private:
- boost::shared_ptr<Payload> payload;
- };
+ private:
+ std::shared_ptr<Payload> payload;
+ };
}
diff --git a/Swiften/Elements/ProtocolHeader.h b/Swiften/Elements/ProtocolHeader.h
index 841f7a0..4ae545a 100644
--- a/Swiften/Elements/ProtocolHeader.h
+++ b/Swiften/Elements/ProtocolHeader.h
@@ -1,42 +1,44 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
#include <string>
+#include <Swiften/Base/API.h>
+
namespace Swift {
- class ProtocolHeader {
- public:
- ProtocolHeader() : version("1.0") {}
-
- const std::string& getTo() const { return to; }
- void setTo(const std::string& a) {
- to = a;
- }
-
- const std::string& getFrom() const { return from; }
- void setFrom(const std::string& a) {
- from = a;
- }
-
- const std::string& getVersion() const { return version; }
- void setVersion(const std::string& a) {
- version = a;
- }
-
- const std::string& getID() const { return id; }
- void setID(const std::string& a) {
- id = a;
- }
-
- private:
- std::string to;
- std::string from;
- std::string id;
- std::string version;
- };
+ class SWIFTEN_API ProtocolHeader {
+ public:
+ ProtocolHeader() : version("1.0") {}
+
+ const std::string& getTo() const { return to; }
+ void setTo(const std::string& a) {
+ to = a;
+ }
+
+ const std::string& getFrom() const { return from; }
+ void setFrom(const std::string& a) {
+ from = a;
+ }
+
+ const std::string& getVersion() const { return version; }
+ void setVersion(const std::string& a) {
+ version = a;
+ }
+
+ const std::string& getID() const { return id; }
+ void setID(const std::string& a) {
+ id = a;
+ }
+
+ private:
+ std::string to;
+ std::string from;
+ std::string id;
+ std::string version;
+ };
}
diff --git a/Swiften/Elements/PubSub.cpp b/Swiften/Elements/PubSub.cpp
index 30a6376..0e9b9e0 100644
--- a/Swiften/Elements/PubSub.cpp
+++ b/Swiften/Elements/PubSub.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSub.h b/Swiften/Elements/PubSub.h
index cd8bf43..47b8c3f 100644
--- a/Swiften/Elements/PubSub.h
+++ b/Swiften/Elements/PubSub.h
@@ -1,21 +1,19 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/ContainerPayload.h>
-
#include <Swiften/Elements/PubSubPayload.h>
namespace Swift {
- class SWIFTEN_API PubSub : public ContainerPayload<PubSubPayload> {
- public:
- PubSub();
- virtual ~PubSub();
- };
+ class SWIFTEN_API PubSub : public ContainerPayload<PubSubPayload> {
+ public:
+ PubSub();
+ virtual ~PubSub();
+ };
}
diff --git a/Swiften/Elements/PubSubAffiliation.cpp b/Swiften/Elements/PubSubAffiliation.cpp
index 0b04494..4e2b06b 100644
--- a/Swiften/Elements/PubSubAffiliation.cpp
+++ b/Swiften/Elements/PubSubAffiliation.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubAffiliation.h b/Swiften/Elements/PubSubAffiliation.h
index 2ea9376..058ef88 100644
--- a/Swiften/Elements/PubSubAffiliation.h
+++ b/Swiften/Elements/PubSubAffiliation.h
@@ -1,53 +1,51 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
#include <string>
-
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
namespace Swift {
- class SWIFTEN_API PubSubAffiliation : public Payload {
- public:
- enum Type {
- None,
- Member,
- Outcast,
- Owner,
- Publisher,
- PublishOnly
- };
-
- PubSubAffiliation();
- PubSubAffiliation(const std::string& node) : node(node), type(None) {}
- virtual ~PubSubAffiliation();
-
- const std::string& getNode() const {
- return node;
- }
-
- void setNode(const std::string& value) {
- this->node = value ;
- }
-
- Type getType() const {
- return type;
- }
-
- void setType(Type value) {
- this->type = value ;
- }
-
-
- private:
- std::string node;
- Type type;
- };
+ class SWIFTEN_API PubSubAffiliation : public Payload {
+ public:
+ enum Type {
+ None,
+ Member,
+ Outcast,
+ Owner,
+ Publisher,
+ PublishOnly
+ };
+
+ PubSubAffiliation();
+ PubSubAffiliation(const std::string& node) : node(node), type(None) {}
+ virtual ~PubSubAffiliation();
+
+ const std::string& getNode() const {
+ return node;
+ }
+
+ void setNode(const std::string& value) {
+ this->node = value ;
+ }
+
+ Type getType() const {
+ return type;
+ }
+
+ void setType(Type value) {
+ this->type = value ;
+ }
+
+
+ private:
+ std::string node;
+ Type type;
+ };
}
diff --git a/Swiften/Elements/PubSubAffiliations.cpp b/Swiften/Elements/PubSubAffiliations.cpp
index a53215d..49dea1b 100644
--- a/Swiften/Elements/PubSubAffiliations.cpp
+++ b/Swiften/Elements/PubSubAffiliations.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubAffiliations.h b/Swiften/Elements/PubSubAffiliations.h
index 6a413fe..f3a6dda 100644
--- a/Swiften/Elements/PubSubAffiliations.h
+++ b/Swiften/Elements/PubSubAffiliations.h
@@ -1,53 +1,53 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
-#include <vector>
+#include <memory>
#include <string>
+#include <vector>
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/PubSubAffiliation.h>
#include <Swiften/Elements/PubSubPayload.h>
namespace Swift {
- class SWIFTEN_API PubSubAffiliations : public PubSubPayload {
- public:
-
- PubSubAffiliations();
-
- virtual ~PubSubAffiliations();
-
- const boost::optional< std::string >& getNode() const {
- return node;
- }
-
- void setNode(const boost::optional< std::string >& value) {
- this->node = value ;
- }
-
- const std::vector< boost::shared_ptr<PubSubAffiliation> >& getAffiliations() const {
- return affiliations;
- }
-
- void setAffiliations(const std::vector< boost::shared_ptr<PubSubAffiliation> >& value) {
- this->affiliations = value ;
- }
-
- void addAffiliation(boost::shared_ptr<PubSubAffiliation> value) {
- this->affiliations.push_back(value);
- }
-
-
- private:
- boost::optional< std::string > node;
- std::vector< boost::shared_ptr<PubSubAffiliation> > affiliations;
- };
+ class SWIFTEN_API PubSubAffiliations : public PubSubPayload {
+ public:
+
+ PubSubAffiliations();
+
+ virtual ~PubSubAffiliations();
+
+ const boost::optional< std::string >& getNode() const {
+ return node;
+ }
+
+ void setNode(const boost::optional< std::string >& value) {
+ this->node = value ;
+ }
+
+ const std::vector< std::shared_ptr<PubSubAffiliation> >& getAffiliations() const {
+ return affiliations;
+ }
+
+ void setAffiliations(const std::vector< std::shared_ptr<PubSubAffiliation> >& value) {
+ this->affiliations = value ;
+ }
+
+ void addAffiliation(std::shared_ptr<PubSubAffiliation> value) {
+ this->affiliations.push_back(value);
+ }
+
+
+ private:
+ boost::optional< std::string > node;
+ std::vector< std::shared_ptr<PubSubAffiliation> > affiliations;
+ };
}
diff --git a/Swiften/Elements/PubSubConfigure.cpp b/Swiften/Elements/PubSubConfigure.cpp
index b1a6cb3..58c6bdc 100644
--- a/Swiften/Elements/PubSubConfigure.cpp
+++ b/Swiften/Elements/PubSubConfigure.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubConfigure.h b/Swiften/Elements/PubSubConfigure.h
index ed91832..88a1ea9 100644
--- a/Swiften/Elements/PubSubConfigure.h
+++ b/Swiften/Elements/PubSubConfigure.h
@@ -1,36 +1,35 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/shared_ptr.hpp>
+#include <memory>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Form.h>
+#include <Swiften/Elements/Payload.h>
namespace Swift {
- class SWIFTEN_API PubSubConfigure : public Payload {
- public:
-
- PubSubConfigure();
-
- virtual ~PubSubConfigure();
+ class SWIFTEN_API PubSubConfigure : public Payload {
+ public:
+
+ PubSubConfigure();
+
+ virtual ~PubSubConfigure();
- boost::shared_ptr<Form> getData() const {
- return data;
- }
+ std::shared_ptr<Form> getData() const {
+ return data;
+ }
- void setData(boost::shared_ptr<Form> value) {
- this->data = value ;
- }
+ void setData(std::shared_ptr<Form> value) {
+ this->data = value ;
+ }
- private:
- boost::shared_ptr<Form> data;
- };
+ private:
+ std::shared_ptr<Form> data;
+ };
}
diff --git a/Swiften/Elements/PubSubCreate.cpp b/Swiften/Elements/PubSubCreate.cpp
index 9c60de3..f612f92 100644
--- a/Swiften/Elements/PubSubCreate.cpp
+++ b/Swiften/Elements/PubSubCreate.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubCreate.h b/Swiften/Elements/PubSubCreate.h
index 4e4eb92..ac6b987 100644
--- a/Swiften/Elements/PubSubCreate.h
+++ b/Swiften/Elements/PubSubCreate.h
@@ -1,47 +1,46 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <string>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/PubSubConfigure.h>
#include <Swiften/Elements/PubSubPayload.h>
namespace Swift {
- class SWIFTEN_API PubSubCreate : public PubSubPayload {
- public:
-
- PubSubCreate();
- PubSubCreate(const std::string& node) : node(node) {}
- virtual ~PubSubCreate();
-
- const std::string& getNode() const {
- return node;
- }
-
- void setNode(const std::string& value) {
- this->node = value ;
- }
-
- boost::shared_ptr<PubSubConfigure> getConfigure() const {
- return configure;
- }
-
- void setConfigure(boost::shared_ptr<PubSubConfigure> value) {
- this->configure = value ;
- }
-
-
- private:
- std::string node;
- boost::shared_ptr<PubSubConfigure> configure;
- };
+ class SWIFTEN_API PubSubCreate : public PubSubPayload {
+ public:
+
+ PubSubCreate();
+ PubSubCreate(const std::string& node) : node(node) {}
+ virtual ~PubSubCreate();
+
+ const std::string& getNode() const {
+ return node;
+ }
+
+ void setNode(const std::string& value) {
+ this->node = value ;
+ }
+
+ std::shared_ptr<PubSubConfigure> getConfigure() const {
+ return configure;
+ }
+
+ void setConfigure(std::shared_ptr<PubSubConfigure> value) {
+ this->configure = value ;
+ }
+
+
+ private:
+ std::string node;
+ std::shared_ptr<PubSubConfigure> configure;
+ };
}
diff --git a/Swiften/Elements/PubSubDefault.cpp b/Swiften/Elements/PubSubDefault.cpp
index 923d0ad..575b3c1 100644
--- a/Swiften/Elements/PubSubDefault.cpp
+++ b/Swiften/Elements/PubSubDefault.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubDefault.h b/Swiften/Elements/PubSubDefault.h
index 08326e7..aa058ac 100644
--- a/Swiften/Elements/PubSubDefault.h
+++ b/Swiften/Elements/PubSubDefault.h
@@ -1,51 +1,51 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/optional.hpp>
#include <string>
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/PubSubPayload.h>
namespace Swift {
- class SWIFTEN_API PubSubDefault : public PubSubPayload {
- public:
- enum Type {
- None,
- Collection,
- Leaf
- };
-
- PubSubDefault();
-
- virtual ~PubSubDefault();
-
- const boost::optional< std::string >& getNode() const {
- return node;
- }
-
- void setNode(const boost::optional< std::string >& value) {
- this->node = value ;
- }
-
- Type getType() const {
- return type;
- }
-
- void setType(Type value) {
- this->type = value ;
- }
-
-
- private:
- boost::optional< std::string > node;
- Type type;
- };
+ class SWIFTEN_API PubSubDefault : public PubSubPayload {
+ public:
+ enum Type {
+ None,
+ Collection,
+ Leaf
+ };
+
+ PubSubDefault();
+
+ virtual ~PubSubDefault();
+
+ const boost::optional< std::string >& getNode() const {
+ return node;
+ }
+
+ void setNode(const boost::optional< std::string >& value) {
+ this->node = value ;
+ }
+
+ Type getType() const {
+ return type;
+ }
+
+ void setType(Type value) {
+ this->type = value ;
+ }
+
+
+ private:
+ boost::optional< std::string > node;
+ Type type;
+ };
}
diff --git a/Swiften/Elements/PubSubError.cpp b/Swiften/Elements/PubSubError.cpp
index db07972..3bf7187 100644
--- a/Swiften/Elements/PubSubError.cpp
+++ b/Swiften/Elements/PubSubError.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubError.h b/Swiften/Elements/PubSubError.h
index 3748e44..2d4452a 100644
--- a/Swiften/Elements/PubSubError.h
+++ b/Swiften/Elements/PubSubError.h
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
@@ -9,103 +9,103 @@
#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
- };
+ 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
- };
+ 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) {
- }
+ PubSubError(Type type = UnknownType) : type(type), unsupportedType(UnknownUnsupportedFeatureType) {
+ }
- virtual ~PubSubError();
+ virtual ~PubSubError();
- Type getType() const {
- return type;
- }
+ Type getType() const {
+ return type;
+ }
- void setType(Type type) {
- this->type = type;
- }
+ void setType(Type type) {
+ this->type = type;
+ }
- UnsupportedFeatureType getUnsupportedFeatureType() const {
- return unsupportedType;
- }
+ UnsupportedFeatureType getUnsupportedFeatureType() const {
+ return unsupportedType;
+ }
- void setUnsupportedFeatureType(UnsupportedFeatureType unsupportedType) {
- this->unsupportedType = unsupportedType;
- }
+ void setUnsupportedFeatureType(UnsupportedFeatureType unsupportedType) {
+ this->unsupportedType = unsupportedType;
+ }
- private:
- Type type;
- UnsupportedFeatureType unsupportedType;
- };
+ private:
+ Type type;
+ UnsupportedFeatureType unsupportedType;
+ };
}
diff --git a/Swiften/Elements/PubSubEvent.cpp b/Swiften/Elements/PubSubEvent.cpp
index 1b63134..3b3f59f 100644
--- a/Swiften/Elements/PubSubEvent.cpp
+++ b/Swiften/Elements/PubSubEvent.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubEvent.h b/Swiften/Elements/PubSubEvent.h
index 9ef6d89..561f731 100644
--- a/Swiften/Elements/PubSubEvent.h
+++ b/Swiften/Elements/PubSubEvent.h
@@ -1,23 +1,22 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/shared_ptr.hpp>
+#include <memory>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/ContainerPayload.h>
+#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/PubSubEventPayload.h>
namespace Swift {
- class SWIFTEN_API PubSubEvent : public ContainerPayload<PubSubEventPayload> {
- public:
- PubSubEvent();
- virtual ~PubSubEvent();
- };
+ class SWIFTEN_API PubSubEvent : public ContainerPayload<PubSubEventPayload> {
+ public:
+ PubSubEvent();
+ virtual ~PubSubEvent();
+ };
}
diff --git a/Swiften/Elements/PubSubEventAssociate.cpp b/Swiften/Elements/PubSubEventAssociate.cpp
index cb81b46..920a492 100644
--- a/Swiften/Elements/PubSubEventAssociate.cpp
+++ b/Swiften/Elements/PubSubEventAssociate.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubEventAssociate.h b/Swiften/Elements/PubSubEventAssociate.h
index a752345..b7bb839 100644
--- a/Swiften/Elements/PubSubEventAssociate.h
+++ b/Swiften/Elements/PubSubEventAssociate.h
@@ -1,36 +1,34 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
+#include <string>
+
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
-#include <string>
+namespace Swift {
+ class SWIFTEN_API PubSubEventAssociate : public Payload {
+ public:
+ PubSubEventAssociate();
-namespace Swift {
- class SWIFTEN_API PubSubEventAssociate : public Payload {
- public:
-
- PubSubEventAssociate();
-
- virtual ~PubSubEventAssociate();
+ virtual ~PubSubEventAssociate();
- const std::string& getNode() const {
- return node;
- }
+ const std::string& getNode() const {
+ return node;
+ }
- void setNode(const std::string& value) {
- this->node = value ;
- }
+ void setNode(const std::string& value) {
+ this->node = value ;
+ }
- private:
- std::string node;
- };
+ private:
+ std::string node;
+ };
}
diff --git a/Swiften/Elements/PubSubEventCollection.cpp b/Swiften/Elements/PubSubEventCollection.cpp
index a8b2a56..657fba9 100644
--- a/Swiften/Elements/PubSubEventCollection.cpp
+++ b/Swiften/Elements/PubSubEventCollection.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubEventCollection.h b/Swiften/Elements/PubSubEventCollection.h
index e4498aa..367fe02 100644
--- a/Swiften/Elements/PubSubEventCollection.h
+++ b/Swiften/Elements/PubSubEventCollection.h
@@ -1,58 +1,58 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <string>
-#include <Swiften/Elements/PubSubEventDisassociate.h>
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/PubSubEventAssociate.h>
+#include <Swiften/Elements/PubSubEventDisassociate.h>
#include <Swiften/Elements/PubSubEventPayload.h>
namespace Swift {
- class SWIFTEN_API PubSubEventCollection : public PubSubEventPayload {
- public:
-
- PubSubEventCollection();
-
- virtual ~PubSubEventCollection();
-
- const boost::optional< std::string >& getNode() const {
- return node;
- }
-
- void setNode(const boost::optional< std::string >& value) {
- this->node = value ;
- }
-
- boost::shared_ptr<PubSubEventDisassociate> getDisassociate() const {
- return disassociate;
- }
-
- void setDisassociate(boost::shared_ptr<PubSubEventDisassociate> value) {
- this->disassociate = value ;
- }
-
- boost::shared_ptr<PubSubEventAssociate> getAssociate() const {
- return associate;
- }
-
- void setAssociate(boost::shared_ptr<PubSubEventAssociate> value) {
- this->associate = value ;
- }
-
-
- private:
- boost::optional< std::string > node;
- boost::shared_ptr<PubSubEventDisassociate> disassociate;
- boost::shared_ptr<PubSubEventAssociate> associate;
- };
+ class SWIFTEN_API PubSubEventCollection : public PubSubEventPayload {
+ public:
+
+ PubSubEventCollection();
+
+ virtual ~PubSubEventCollection();
+
+ const boost::optional< std::string >& getNode() const {
+ return node;
+ }
+
+ void setNode(const boost::optional< std::string >& value) {
+ this->node = value ;
+ }
+
+ std::shared_ptr<PubSubEventDisassociate> getDisassociate() const {
+ return disassociate;
+ }
+
+ void setDisassociate(std::shared_ptr<PubSubEventDisassociate> value) {
+ this->disassociate = value ;
+ }
+
+ std::shared_ptr<PubSubEventAssociate> getAssociate() const {
+ return associate;
+ }
+
+ void setAssociate(std::shared_ptr<PubSubEventAssociate> value) {
+ this->associate = value ;
+ }
+
+
+ private:
+ boost::optional< std::string > node;
+ std::shared_ptr<PubSubEventDisassociate> disassociate;
+ std::shared_ptr<PubSubEventAssociate> associate;
+ };
}
diff --git a/Swiften/Elements/PubSubEventConfiguration.cpp b/Swiften/Elements/PubSubEventConfiguration.cpp
index 93ce6a3..64667d1 100644
--- a/Swiften/Elements/PubSubEventConfiguration.cpp
+++ b/Swiften/Elements/PubSubEventConfiguration.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubEventConfiguration.h b/Swiften/Elements/PubSubEventConfiguration.h
index 7ebfce1..e529014 100644
--- a/Swiften/Elements/PubSubEventConfiguration.h
+++ b/Swiften/Elements/PubSubEventConfiguration.h
@@ -1,47 +1,46 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <string>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Form.h>
+#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/PubSubEventPayload.h>
namespace Swift {
- class SWIFTEN_API PubSubEventConfiguration : public PubSubEventPayload {
- public:
-
- PubSubEventConfiguration();
-
- virtual ~PubSubEventConfiguration();
-
- const std::string& getNode() const {
- return node;
- }
-
- void setNode(const std::string& value) {
- this->node = value ;
- }
-
- boost::shared_ptr<Form> getData() const {
- return data;
- }
-
- void setData(boost::shared_ptr<Form> value) {
- this->data = value ;
- }
-
-
- private:
- std::string node;
- boost::shared_ptr<Form> data;
- };
+ class SWIFTEN_API PubSubEventConfiguration : public PubSubEventPayload {
+ public:
+
+ PubSubEventConfiguration();
+
+ virtual ~PubSubEventConfiguration();
+
+ const std::string& getNode() const {
+ return node;
+ }
+
+ void setNode(const std::string& value) {
+ this->node = value ;
+ }
+
+ std::shared_ptr<Form> getData() const {
+ return data;
+ }
+
+ void setData(std::shared_ptr<Form> value) {
+ this->data = value ;
+ }
+
+
+ private:
+ std::string node;
+ std::shared_ptr<Form> data;
+ };
}
diff --git a/Swiften/Elements/PubSubEventDelete.cpp b/Swiften/Elements/PubSubEventDelete.cpp
index 85bbf2e..ecd6ddf 100644
--- a/Swiften/Elements/PubSubEventDelete.cpp
+++ b/Swiften/Elements/PubSubEventDelete.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubEventDelete.h b/Swiften/Elements/PubSubEventDelete.h
index fecfb0e..f899d4e 100644
--- a/Swiften/Elements/PubSubEventDelete.h
+++ b/Swiften/Elements/PubSubEventDelete.h
@@ -1,47 +1,46 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <string>
-#include <Swiften/Elements/PubSubEventRedirect.h>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/PubSubEventPayload.h>
+#include <Swiften/Elements/PubSubEventRedirect.h>
namespace Swift {
- class SWIFTEN_API PubSubEventDelete : public PubSubEventPayload {
- public:
-
- PubSubEventDelete();
-
- virtual ~PubSubEventDelete();
-
- const std::string& getNode() const {
- return node;
- }
-
- void setNode(const std::string& value) {
- this->node = value ;
- }
-
- boost::shared_ptr<PubSubEventRedirect> getRedirects() const {
- return redirects;
- }
-
- void setRedirects(boost::shared_ptr<PubSubEventRedirect> value) {
- this->redirects = value ;
- }
-
-
- private:
- std::string node;
- boost::shared_ptr<PubSubEventRedirect> redirects;
- };
+ class SWIFTEN_API PubSubEventDelete : public PubSubEventPayload {
+ public:
+
+ PubSubEventDelete();
+
+ virtual ~PubSubEventDelete();
+
+ const std::string& getNode() const {
+ return node;
+ }
+
+ void setNode(const std::string& value) {
+ this->node = value ;
+ }
+
+ std::shared_ptr<PubSubEventRedirect> getRedirects() const {
+ return redirects;
+ }
+
+ void setRedirects(std::shared_ptr<PubSubEventRedirect> value) {
+ this->redirects = value ;
+ }
+
+
+ private:
+ std::string node;
+ std::shared_ptr<PubSubEventRedirect> redirects;
+ };
}
diff --git a/Swiften/Elements/PubSubEventDisassociate.cpp b/Swiften/Elements/PubSubEventDisassociate.cpp
index 55e1c4e..3a94952 100644
--- a/Swiften/Elements/PubSubEventDisassociate.cpp
+++ b/Swiften/Elements/PubSubEventDisassociate.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubEventDisassociate.h b/Swiften/Elements/PubSubEventDisassociate.h
index cad9843..415ac29 100644
--- a/Swiften/Elements/PubSubEventDisassociate.h
+++ b/Swiften/Elements/PubSubEventDisassociate.h
@@ -1,36 +1,34 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
+#include <string>
+
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
-#include <string>
+namespace Swift {
+ class SWIFTEN_API PubSubEventDisassociate : public Payload {
+ public:
+ PubSubEventDisassociate();
-namespace Swift {
- class SWIFTEN_API PubSubEventDisassociate : public Payload {
- public:
-
- PubSubEventDisassociate();
-
- virtual ~PubSubEventDisassociate();
+ virtual ~PubSubEventDisassociate();
- const std::string& getNode() const {
- return node;
- }
+ const std::string& getNode() const {
+ return node;
+ }
- void setNode(const std::string& value) {
- this->node = value ;
- }
+ void setNode(const std::string& value) {
+ this->node = value ;
+ }
- private:
- std::string node;
- };
+ private:
+ std::string node;
+ };
}
diff --git a/Swiften/Elements/PubSubEventItem.cpp b/Swiften/Elements/PubSubEventItem.cpp
index 6bb3823..53e5caa 100644
--- a/Swiften/Elements/PubSubEventItem.cpp
+++ b/Swiften/Elements/PubSubEventItem.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubEventItem.h b/Swiften/Elements/PubSubEventItem.h
index 25ebc82..defdbf4 100644
--- a/Swiften/Elements/PubSubEventItem.h
+++ b/Swiften/Elements/PubSubEventItem.h
@@ -1,70 +1,69 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
-#include <vector>
+#include <memory>
#include <string>
+#include <vector>
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
- class SWIFTEN_API PubSubEventItem : public Payload {
- public:
-
- PubSubEventItem();
-
- virtual ~PubSubEventItem();
-
- const boost::optional< std::string >& getNode() const {
- return node;
- }
-
- void setNode(const boost::optional< std::string >& value) {
- this->node = value ;
- }
-
- const boost::optional< std::string >& getPublisher() const {
- return publisher;
- }
-
- void setPublisher(const boost::optional< std::string >& value) {
- this->publisher = value ;
- }
-
- const std::vector< boost::shared_ptr<Payload> >& getData() const {
- return data;
- }
-
- void setData(const std::vector< boost::shared_ptr<Payload> >& value) {
- this->data = value ;
- }
-
- void addData(boost::shared_ptr<Payload> value) {
- this->data.push_back(value);
- }
-
- const boost::optional< std::string >& getID() const {
- return id;
- }
-
- void setID(const boost::optional< std::string >& value) {
- this->id = value ;
- }
-
-
- private:
- boost::optional< std::string > node;
- boost::optional< std::string > publisher;
- std::vector< boost::shared_ptr<Payload> > data;
- boost::optional< std::string > id;
- };
+ class SWIFTEN_API PubSubEventItem : public Payload {
+ public:
+
+ PubSubEventItem();
+
+ virtual ~PubSubEventItem();
+
+ const boost::optional< std::string >& getNode() const {
+ return node;
+ }
+
+ void setNode(const boost::optional< std::string >& value) {
+ this->node = value ;
+ }
+
+ const boost::optional< std::string >& getPublisher() const {
+ return publisher;
+ }
+
+ void setPublisher(const boost::optional< std::string >& value) {
+ this->publisher = value ;
+ }
+
+ const std::vector< std::shared_ptr<Payload> >& getData() const {
+ return data;
+ }
+
+ void setData(const std::vector< std::shared_ptr<Payload> >& value) {
+ this->data = value ;
+ }
+
+ void addData(std::shared_ptr<Payload> value) {
+ this->data.push_back(value);
+ }
+
+ const boost::optional< std::string >& getID() const {
+ return id;
+ }
+
+ void setID(const boost::optional< std::string >& value) {
+ this->id = value ;
+ }
+
+
+ private:
+ boost::optional< std::string > node;
+ boost::optional< std::string > publisher;
+ std::vector< std::shared_ptr<Payload> > data;
+ boost::optional< std::string > id;
+ };
}
diff --git a/Swiften/Elements/PubSubEventItems.cpp b/Swiften/Elements/PubSubEventItems.cpp
index 01f3429..86257db 100644
--- a/Swiften/Elements/PubSubEventItems.cpp
+++ b/Swiften/Elements/PubSubEventItems.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubEventItems.h b/Swiften/Elements/PubSubEventItems.h
index a121728..aade826 100644
--- a/Swiften/Elements/PubSubEventItems.h
+++ b/Swiften/Elements/PubSubEventItems.h
@@ -1,66 +1,65 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/shared_ptr.hpp>
-#include <vector>
+#include <memory>
#include <string>
+#include <vector>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/PubSubEventItem.h>
-#include <Swiften/Elements/PubSubEventRetract.h>
#include <Swiften/Elements/PubSubEventPayload.h>
+#include <Swiften/Elements/PubSubEventRetract.h>
namespace Swift {
- class SWIFTEN_API PubSubEventItems : public PubSubEventPayload {
- public:
-
- PubSubEventItems();
-
- virtual ~PubSubEventItems();
-
- const std::string& getNode() const {
- return node;
- }
-
- void setNode(const std::string& value) {
- this->node = value ;
- }
-
- const std::vector< boost::shared_ptr<PubSubEventItem> >& getItems() const {
- return items;
- }
-
- void setItems(const std::vector< boost::shared_ptr<PubSubEventItem> >& value) {
- this->items = value ;
- }
-
- void addItem(boost::shared_ptr<PubSubEventItem> value) {
- this->items.push_back(value);
- }
-
- const std::vector< boost::shared_ptr<PubSubEventRetract> >& getRetracts() const {
- return retracts;
- }
-
- void setRetracts(const std::vector< boost::shared_ptr<PubSubEventRetract> >& value) {
- this->retracts = value ;
- }
-
- void addRetract(boost::shared_ptr<PubSubEventRetract> value) {
- this->retracts.push_back(value);
- }
-
-
- private:
- std::string node;
- std::vector< boost::shared_ptr<PubSubEventItem> > items;
- std::vector< boost::shared_ptr<PubSubEventRetract> > retracts;
- };
+ class SWIFTEN_API PubSubEventItems : public PubSubEventPayload {
+ public:
+
+ PubSubEventItems();
+
+ virtual ~PubSubEventItems();
+
+ const std::string& getNode() const {
+ return node;
+ }
+
+ void setNode(const std::string& value) {
+ this->node = value ;
+ }
+
+ const std::vector< std::shared_ptr<PubSubEventItem> >& getItems() const {
+ return items;
+ }
+
+ void setItems(const std::vector< std::shared_ptr<PubSubEventItem> >& value) {
+ this->items = value ;
+ }
+
+ void addItem(std::shared_ptr<PubSubEventItem> value) {
+ this->items.push_back(value);
+ }
+
+ const std::vector< std::shared_ptr<PubSubEventRetract> >& getRetracts() const {
+ return retracts;
+ }
+
+ void setRetracts(const std::vector< std::shared_ptr<PubSubEventRetract> >& value) {
+ this->retracts = value ;
+ }
+
+ void addRetract(std::shared_ptr<PubSubEventRetract> value) {
+ this->retracts.push_back(value);
+ }
+
+
+ private:
+ std::string node;
+ std::vector< std::shared_ptr<PubSubEventItem> > items;
+ std::vector< std::shared_ptr<PubSubEventRetract> > retracts;
+ };
}
diff --git a/Swiften/Elements/PubSubEventPayload.cpp b/Swiften/Elements/PubSubEventPayload.cpp
index 0019942..90371f8 100644
--- a/Swiften/Elements/PubSubEventPayload.cpp
+++ b/Swiften/Elements/PubSubEventPayload.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubEventPayload.h b/Swiften/Elements/PubSubEventPayload.h
index 81fb9a8..f4abc06 100644
--- a/Swiften/Elements/PubSubEventPayload.h
+++ b/Swiften/Elements/PubSubEventPayload.h
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
@@ -10,8 +10,8 @@
#include <Swiften/Elements/Payload.h>
namespace Swift {
- class SWIFTEN_API PubSubEventPayload : public Payload {
- public:
- virtual ~PubSubEventPayload();
- };
+ class SWIFTEN_API PubSubEventPayload : public Payload {
+ public:
+ virtual ~PubSubEventPayload();
+ };
}
diff --git a/Swiften/Elements/PubSubEventPurge.cpp b/Swiften/Elements/PubSubEventPurge.cpp
index 3fd77ed..2383566 100644
--- a/Swiften/Elements/PubSubEventPurge.cpp
+++ b/Swiften/Elements/PubSubEventPurge.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubEventPurge.h b/Swiften/Elements/PubSubEventPurge.h
index 5f04049..647598d 100644
--- a/Swiften/Elements/PubSubEventPurge.h
+++ b/Swiften/Elements/PubSubEventPurge.h
@@ -1,36 +1,35 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
#include <string>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/PubSubEventPayload.h>
namespace Swift {
- class SWIFTEN_API PubSubEventPurge : public PubSubEventPayload {
- public:
-
- PubSubEventPurge();
-
- virtual ~PubSubEventPurge();
+ class SWIFTEN_API PubSubEventPurge : public PubSubEventPayload {
+ public:
+
+ PubSubEventPurge();
+
+ virtual ~PubSubEventPurge();
- const std::string& getNode() const {
- return node;
- }
+ const std::string& getNode() const {
+ return node;
+ }
- void setNode(const std::string& value) {
- this->node = value ;
- }
+ void setNode(const std::string& value) {
+ this->node = value ;
+ }
- private:
- std::string node;
- };
+ private:
+ std::string node;
+ };
}
diff --git a/Swiften/Elements/PubSubEventRedirect.cpp b/Swiften/Elements/PubSubEventRedirect.cpp
index adde8bc..b8fd220 100644
--- a/Swiften/Elements/PubSubEventRedirect.cpp
+++ b/Swiften/Elements/PubSubEventRedirect.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubEventRedirect.h b/Swiften/Elements/PubSubEventRedirect.h
index 918c7f4..063cf8c 100644
--- a/Swiften/Elements/PubSubEventRedirect.h
+++ b/Swiften/Elements/PubSubEventRedirect.h
@@ -1,36 +1,34 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
+#include <string>
+
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
-#include <string>
+namespace Swift {
+ class SWIFTEN_API PubSubEventRedirect : public Payload {
+ public:
+ PubSubEventRedirect();
-namespace Swift {
- class SWIFTEN_API PubSubEventRedirect : public Payload {
- public:
-
- PubSubEventRedirect();
-
- virtual ~PubSubEventRedirect();
+ virtual ~PubSubEventRedirect();
- const std::string& getURI() const {
- return uri;
- }
+ const std::string& getURI() const {
+ return uri;
+ }
- void setURI(const std::string& value) {
- this->uri = value ;
- }
+ void setURI(const std::string& value) {
+ this->uri = value ;
+ }
- private:
- std::string uri;
- };
+ private:
+ std::string uri;
+ };
}
diff --git a/Swiften/Elements/PubSubEventRetract.cpp b/Swiften/Elements/PubSubEventRetract.cpp
index bb3ebb1..cd0e4df 100644
--- a/Swiften/Elements/PubSubEventRetract.cpp
+++ b/Swiften/Elements/PubSubEventRetract.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubEventRetract.h b/Swiften/Elements/PubSubEventRetract.h
index 3c2d9c4..19e02c9 100644
--- a/Swiften/Elements/PubSubEventRetract.h
+++ b/Swiften/Elements/PubSubEventRetract.h
@@ -1,36 +1,34 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
+#include <string>
+
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
-#include <string>
+namespace Swift {
+ class SWIFTEN_API PubSubEventRetract : public Payload {
+ public:
+ PubSubEventRetract();
-namespace Swift {
- class SWIFTEN_API PubSubEventRetract : public Payload {
- public:
-
- PubSubEventRetract();
-
- virtual ~PubSubEventRetract();
+ virtual ~PubSubEventRetract();
- const std::string& getID() const {
- return id;
- }
+ const std::string& getID() const {
+ return id;
+ }
- void setID(const std::string& value) {
- this->id = value ;
- }
+ void setID(const std::string& value) {
+ this->id = value ;
+ }
- private:
- std::string id;
- };
+ private:
+ std::string id;
+ };
}
diff --git a/Swiften/Elements/PubSubEventSubscription.cpp b/Swiften/Elements/PubSubEventSubscription.cpp
index fb069f9..ebffe3b 100644
--- a/Swiften/Elements/PubSubEventSubscription.cpp
+++ b/Swiften/Elements/PubSubEventSubscription.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubEventSubscription.h b/Swiften/Elements/PubSubEventSubscription.h
index b74d4f5..37e8b74 100644
--- a/Swiften/Elements/PubSubEventSubscription.h
+++ b/Swiften/Elements/PubSubEventSubscription.h
@@ -1,81 +1,81 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/optional.hpp>
#include <string>
+
#include <boost/date_time/posix_time/posix_time_types.hpp>
+#include <boost/optional.hpp>
-#include <Swiften/JID/JID.h>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/PubSubEventPayload.h>
+#include <Swiften/JID/JID.h>
namespace Swift {
- class SWIFTEN_API PubSubEventSubscription : public PubSubEventPayload {
- public:
- enum SubscriptionType {
- None,
- Pending,
- Subscribed,
- Unconfigured
- };
-
- PubSubEventSubscription();
-
- virtual ~PubSubEventSubscription();
-
- const std::string& getNode() const {
- return node;
- }
-
- void setNode(const std::string& value) {
- this->node = value ;
- }
-
- const JID& getJID() const {
- return jid;
- }
-
- void setJID(const JID& value) {
- this->jid = value ;
- }
-
- SubscriptionType getSubscription() const {
- return subscription;
- }
-
- void setSubscription(SubscriptionType value) {
- this->subscription = value ;
- }
-
- const boost::optional< std::string >& getSubscriptionID() const {
- return subscriptionID;
- }
-
- void setSubscriptionID(const boost::optional< std::string >& value) {
- this->subscriptionID = value ;
- }
-
- const boost::posix_time::ptime& getExpiry() const {
- return expiry;
- }
-
- void setExpiry(const boost::posix_time::ptime& value) {
- this->expiry = value ;
- }
-
-
- private:
- std::string node;
- JID jid;
- SubscriptionType subscription;
- boost::optional< std::string > subscriptionID;
- boost::posix_time::ptime expiry;
- };
+ class SWIFTEN_API PubSubEventSubscription : public PubSubEventPayload {
+ public:
+ enum SubscriptionType {
+ None,
+ Pending,
+ Subscribed,
+ Unconfigured
+ };
+
+ PubSubEventSubscription();
+
+ virtual ~PubSubEventSubscription();
+
+ const std::string& getNode() const {
+ return node;
+ }
+
+ void setNode(const std::string& value) {
+ this->node = value ;
+ }
+
+ const JID& getJID() const {
+ return jid;
+ }
+
+ void setJID(const JID& value) {
+ this->jid = value ;
+ }
+
+ SubscriptionType getSubscription() const {
+ return subscription;
+ }
+
+ void setSubscription(SubscriptionType value) {
+ this->subscription = value ;
+ }
+
+ const boost::optional< std::string >& getSubscriptionID() const {
+ return subscriptionID;
+ }
+
+ void setSubscriptionID(const boost::optional< std::string >& value) {
+ this->subscriptionID = value ;
+ }
+
+ const boost::posix_time::ptime& getExpiry() const {
+ return expiry;
+ }
+
+ void setExpiry(const boost::posix_time::ptime& value) {
+ this->expiry = value ;
+ }
+
+
+ private:
+ std::string node;
+ JID jid;
+ SubscriptionType subscription;
+ boost::optional< std::string > subscriptionID;
+ boost::posix_time::ptime expiry;
+ };
}
diff --git a/Swiften/Elements/PubSubItem.cpp b/Swiften/Elements/PubSubItem.cpp
index ae6206f..b5f17cc 100644
--- a/Swiften/Elements/PubSubItem.cpp
+++ b/Swiften/Elements/PubSubItem.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2018 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
@@ -11,5 +11,8 @@ using namespace Swift;
PubSubItem::PubSubItem() {
}
+PubSubItem::PubSubItem(const std::string& id) : id_(id) {
+}
+
PubSubItem::~PubSubItem() {
}
diff --git a/Swiften/Elements/PubSubItem.h b/Swiften/Elements/PubSubItem.h
index 93ff03a..161b733 100644
--- a/Swiften/Elements/PubSubItem.h
+++ b/Swiften/Elements/PubSubItem.h
@@ -1,51 +1,49 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2018 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/shared_ptr.hpp>
-#include <vector>
+#include <memory>
#include <string>
+#include <vector>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
- class SWIFTEN_API PubSubItem : public Payload {
- public:
-
- PubSubItem();
-
- virtual ~PubSubItem();
-
- const std::vector< boost::shared_ptr<Payload> >& getData() const {
- return data;
- }
-
- void setData(const std::vector< boost::shared_ptr<Payload> >& value) {
- this->data = value ;
- }
-
- void addData(boost::shared_ptr<Payload> value) {
- this->data.push_back(value);
- }
-
- const std::string& getID() const {
- return id;
- }
-
- void setID(const std::string& value) {
- this->id = value ;
- }
-
-
- private:
- std::vector< boost::shared_ptr<Payload> > data;
- std::string id;
- };
+ class SWIFTEN_API PubSubItem : public Payload {
+ public:
+
+ PubSubItem();
+ PubSubItem(const std::string& id);
+
+ virtual ~PubSubItem();
+
+ const std::vector< std::shared_ptr<Payload> >& getData() const {
+ return data_;
+ }
+
+ void setData(const std::vector< std::shared_ptr<Payload> >& value) {
+ this->data_ = value ;
+ }
+
+ void addData(std::shared_ptr<Payload> value) {
+ this->data_.push_back(value);
+ }
+
+ const std::string& getID() const {
+ return id_;
+ }
+
+ void setID(const std::string& value) {
+ this->id_ = value ;
+ }
+
+ private:
+ std::vector< std::shared_ptr<Payload> > data_;
+ std::string id_;
+ };
}
diff --git a/Swiften/Elements/PubSubItems.cpp b/Swiften/Elements/PubSubItems.cpp
index f235e11..a20346e 100644
--- a/Swiften/Elements/PubSubItems.cpp
+++ b/Swiften/Elements/PubSubItems.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubItems.h b/Swiften/Elements/PubSubItems.h
index 7cd279b..c8b7f53 100644
--- a/Swiften/Elements/PubSubItems.h
+++ b/Swiften/Elements/PubSubItems.h
@@ -1,71 +1,70 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
-#include <vector>
+#include <memory>
#include <string>
+#include <vector>
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/PubSubItem.h>
#include <Swiften/Elements/PubSubPayload.h>
namespace Swift {
- class SWIFTEN_API PubSubItems : public PubSubPayload {
- public:
-
- PubSubItems();
- PubSubItems(const std::string& node) : node(node) {}
- virtual ~PubSubItems();
-
- const std::string& getNode() const {
- return node;
- }
-
- void setNode(const std::string& value) {
- this->node = value ;
- }
-
- const std::vector< boost::shared_ptr<PubSubItem> >& getItems() const {
- return items;
- }
-
- void setItems(const std::vector< boost::shared_ptr<PubSubItem> >& value) {
- this->items = value ;
- }
-
- void addItem(boost::shared_ptr<PubSubItem> value) {
- this->items.push_back(value);
- }
-
- const boost::optional< unsigned int >& getMaximumItems() const {
- return maximumItems;
- }
-
- void setMaximumItems(const boost::optional< unsigned int >& value) {
- this->maximumItems = value ;
- }
-
- const boost::optional< std::string >& getSubscriptionID() const {
- return subscriptionID;
- }
-
- void setSubscriptionID(const boost::optional< std::string >& value) {
- this->subscriptionID = value ;
- }
-
-
- private:
- std::string node;
- std::vector< boost::shared_ptr<PubSubItem> > items;
- boost::optional< unsigned int > maximumItems;
- boost::optional< std::string > subscriptionID;
- };
+ class SWIFTEN_API PubSubItems : public PubSubPayload {
+ public:
+
+ PubSubItems();
+ PubSubItems(const std::string& node) : node(node) {}
+ virtual ~PubSubItems();
+
+ const std::string& getNode() const {
+ return node;
+ }
+
+ void setNode(const std::string& value) {
+ this->node = value ;
+ }
+
+ const std::vector< std::shared_ptr<PubSubItem> >& getItems() const {
+ return items;
+ }
+
+ void setItems(const std::vector< std::shared_ptr<PubSubItem> >& value) {
+ this->items = value ;
+ }
+
+ void addItem(std::shared_ptr<PubSubItem> value) {
+ this->items.push_back(value);
+ }
+
+ const boost::optional< unsigned int >& getMaximumItems() const {
+ return maximumItems;
+ }
+
+ void setMaximumItems(const boost::optional< unsigned int >& value) {
+ this->maximumItems = value ;
+ }
+
+ const boost::optional< std::string >& getSubscriptionID() const {
+ return subscriptionID;
+ }
+
+ void setSubscriptionID(const boost::optional< std::string >& value) {
+ this->subscriptionID = value ;
+ }
+
+ private:
+ std::string node;
+ std::vector< std::shared_ptr<PubSubItem> > items;
+ boost::optional< unsigned int > maximumItems;
+ boost::optional< std::string > subscriptionID;
+ };
}
diff --git a/Swiften/Elements/PubSubOptions.cpp b/Swiften/Elements/PubSubOptions.cpp
index 22c4054..210f62b 100644
--- a/Swiften/Elements/PubSubOptions.cpp
+++ b/Swiften/Elements/PubSubOptions.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubOptions.h b/Swiften/Elements/PubSubOptions.h
index 0e9483e..80a3b03 100644
--- a/Swiften/Elements/PubSubOptions.h
+++ b/Swiften/Elements/PubSubOptions.h
@@ -1,67 +1,67 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <string>
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Form.h>
+#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/PubSubPayload.h>
#include <Swiften/JID/JID.h>
namespace Swift {
- class SWIFTEN_API PubSubOptions : public PubSubPayload {
- public:
-
- PubSubOptions();
-
- virtual ~PubSubOptions();
-
- const std::string& getNode() const {
- return node;
- }
-
- void setNode(const std::string& value) {
- this->node = value ;
- }
-
- const JID& getJID() const {
- return jid;
- }
-
- void setJID(const JID& value) {
- this->jid = value ;
- }
-
- boost::shared_ptr<Form> getData() const {
- return data;
- }
-
- void setData(boost::shared_ptr<Form> value) {
- this->data = value ;
- }
-
- const boost::optional< std::string >& getSubscriptionID() const {
- return subscriptionID;
- }
-
- void setSubscriptionID(const boost::optional< std::string >& value) {
- this->subscriptionID = value ;
- }
-
-
- private:
- std::string node;
- JID jid;
- boost::shared_ptr<Form> data;
- boost::optional< std::string > subscriptionID;
- };
+ class SWIFTEN_API PubSubOptions : public PubSubPayload {
+ public:
+
+ PubSubOptions();
+
+ virtual ~PubSubOptions();
+
+ const std::string& getNode() const {
+ return node;
+ }
+
+ void setNode(const std::string& value) {
+ this->node = value ;
+ }
+
+ const JID& getJID() const {
+ return jid;
+ }
+
+ void setJID(const JID& value) {
+ this->jid = value ;
+ }
+
+ std::shared_ptr<Form> getData() const {
+ return data;
+ }
+
+ void setData(std::shared_ptr<Form> value) {
+ this->data = value ;
+ }
+
+ const boost::optional< std::string >& getSubscriptionID() const {
+ return subscriptionID;
+ }
+
+ void setSubscriptionID(const boost::optional< std::string >& value) {
+ this->subscriptionID = value ;
+ }
+
+
+ private:
+ std::string node;
+ JID jid;
+ std::shared_ptr<Form> data;
+ boost::optional< std::string > subscriptionID;
+ };
}
diff --git a/Swiften/Elements/PubSubOwnerAffiliation.cpp b/Swiften/Elements/PubSubOwnerAffiliation.cpp
index 8dc8be6..c8308ec 100644
--- a/Swiften/Elements/PubSubOwnerAffiliation.cpp
+++ b/Swiften/Elements/PubSubOwnerAffiliation.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubOwnerAffiliation.h b/Swiften/Elements/PubSubOwnerAffiliation.h
index 68851d3..77886d1 100644
--- a/Swiften/Elements/PubSubOwnerAffiliation.h
+++ b/Swiften/Elements/PubSubOwnerAffiliation.h
@@ -1,53 +1,50 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
-
-
#include <Swiften/JID/JID.h>
namespace Swift {
- class SWIFTEN_API PubSubOwnerAffiliation : public Payload {
- public:
- enum Type {
- None,
- Member,
- Outcast,
- Owner,
- Publisher,
- PublishOnly
- };
-
- PubSubOwnerAffiliation();
-
- virtual ~PubSubOwnerAffiliation();
-
- const JID& getJID() const {
- return jid;
- }
-
- void setJID(const JID& value) {
- this->jid = value ;
- }
-
- Type getType() const {
- return type;
- }
-
- void setType(Type value) {
- this->type = value ;
- }
-
-
- private:
- JID jid;
- Type type;
- };
+ class SWIFTEN_API PubSubOwnerAffiliation : public Payload {
+ public:
+ enum Type {
+ None,
+ Member,
+ Outcast,
+ Owner,
+ Publisher,
+ PublishOnly
+ };
+
+ PubSubOwnerAffiliation();
+
+ virtual ~PubSubOwnerAffiliation();
+
+ const JID& getJID() const {
+ return jid;
+ }
+
+ void setJID(const JID& value) {
+ this->jid = value ;
+ }
+
+ Type getType() const {
+ return type;
+ }
+
+ void setType(Type value) {
+ this->type = value ;
+ }
+
+
+ private:
+ JID jid;
+ Type type;
+ };
}
diff --git a/Swiften/Elements/PubSubOwnerAffiliations.cpp b/Swiften/Elements/PubSubOwnerAffiliations.cpp
index b87a78a..33b03ce 100644
--- a/Swiften/Elements/PubSubOwnerAffiliations.cpp
+++ b/Swiften/Elements/PubSubOwnerAffiliations.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubOwnerAffiliations.h b/Swiften/Elements/PubSubOwnerAffiliations.h
index 75578df..2434d4e 100644
--- a/Swiften/Elements/PubSubOwnerAffiliations.h
+++ b/Swiften/Elements/PubSubOwnerAffiliations.h
@@ -1,52 +1,51 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/shared_ptr.hpp>
-#include <vector>
+#include <memory>
#include <string>
+#include <vector>
-#include <Swiften/Elements/PubSubOwnerPayload.h>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/PubSubOwnerAffiliation.h>
+#include <Swiften/Elements/PubSubOwnerPayload.h>
namespace Swift {
- class SWIFTEN_API PubSubOwnerAffiliations : public PubSubOwnerPayload {
- public:
-
- PubSubOwnerAffiliations();
-
- virtual ~PubSubOwnerAffiliations();
-
- const std::string& getNode() const {
- return node;
- }
-
- void setNode(const std::string& value) {
- this->node = value ;
- }
-
- const std::vector< boost::shared_ptr<PubSubOwnerAffiliation> >& getAffiliations() const {
- return affiliations;
- }
-
- void setAffiliations(const std::vector< boost::shared_ptr<PubSubOwnerAffiliation> >& value) {
- this->affiliations = value ;
- }
-
- void addAffiliation(boost::shared_ptr<PubSubOwnerAffiliation> value) {
- this->affiliations.push_back(value);
- }
-
-
- private:
- std::string node;
- std::vector< boost::shared_ptr<PubSubOwnerAffiliation> > affiliations;
- };
+ class SWIFTEN_API PubSubOwnerAffiliations : public PubSubOwnerPayload {
+ public:
+
+ PubSubOwnerAffiliations();
+
+ virtual ~PubSubOwnerAffiliations();
+
+ const std::string& getNode() const {
+ return node;
+ }
+
+ void setNode(const std::string& value) {
+ this->node = value ;
+ }
+
+ const std::vector< std::shared_ptr<PubSubOwnerAffiliation> >& getAffiliations() const {
+ return affiliations;
+ }
+
+ void setAffiliations(const std::vector< std::shared_ptr<PubSubOwnerAffiliation> >& value) {
+ this->affiliations = value ;
+ }
+
+ void addAffiliation(std::shared_ptr<PubSubOwnerAffiliation> value) {
+ this->affiliations.push_back(value);
+ }
+
+
+ private:
+ std::string node;
+ std::vector< std::shared_ptr<PubSubOwnerAffiliation> > affiliations;
+ };
}
diff --git a/Swiften/Elements/PubSubOwnerConfigure.cpp b/Swiften/Elements/PubSubOwnerConfigure.cpp
index 8db923d..aa511ea 100644
--- a/Swiften/Elements/PubSubOwnerConfigure.cpp
+++ b/Swiften/Elements/PubSubOwnerConfigure.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubOwnerConfigure.h b/Swiften/Elements/PubSubOwnerConfigure.h
index d882ec4..2b84753 100644
--- a/Swiften/Elements/PubSubOwnerConfigure.h
+++ b/Swiften/Elements/PubSubOwnerConfigure.h
@@ -1,48 +1,48 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <string>
-#include <Swiften/Elements/PubSubOwnerPayload.h>
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Form.h>
+#include <Swiften/Elements/Payload.h>
+#include <Swiften/Elements/PubSubOwnerPayload.h>
namespace Swift {
- class SWIFTEN_API PubSubOwnerConfigure : public PubSubOwnerPayload {
- public:
-
- PubSubOwnerConfigure();
- PubSubOwnerConfigure(const std::string& node) : node(node) {}
- virtual ~PubSubOwnerConfigure();
-
- const boost::optional< std::string >& getNode() const {
- return node;
- }
-
- void setNode(const boost::optional< std::string >& value) {
- this->node = value ;
- }
-
- boost::shared_ptr<Form> getData() const {
- return data;
- }
-
- void setData(boost::shared_ptr<Form> value) {
- this->data = value ;
- }
-
-
- private:
- boost::optional< std::string > node;
- boost::shared_ptr<Form> data;
- };
+ class SWIFTEN_API PubSubOwnerConfigure : public PubSubOwnerPayload {
+ public:
+
+ PubSubOwnerConfigure();
+ PubSubOwnerConfigure(const std::string& node) : node(node) {}
+ virtual ~PubSubOwnerConfigure();
+
+ const boost::optional< std::string >& getNode() const {
+ return node;
+ }
+
+ void setNode(const boost::optional< std::string >& value) {
+ this->node = value ;
+ }
+
+ std::shared_ptr<Form> getData() const {
+ return data;
+ }
+
+ void setData(std::shared_ptr<Form> value) {
+ this->data = value ;
+ }
+
+
+ private:
+ boost::optional< std::string > node;
+ std::shared_ptr<Form> data;
+ };
}
diff --git a/Swiften/Elements/PubSubOwnerDefault.cpp b/Swiften/Elements/PubSubOwnerDefault.cpp
index ebb51a7..4c49a08 100644
--- a/Swiften/Elements/PubSubOwnerDefault.cpp
+++ b/Swiften/Elements/PubSubOwnerDefault.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubOwnerDefault.h b/Swiften/Elements/PubSubOwnerDefault.h
index 1dbd3a2..a17d9f3 100644
--- a/Swiften/Elements/PubSubOwnerDefault.h
+++ b/Swiften/Elements/PubSubOwnerDefault.h
@@ -1,37 +1,36 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
+#include <memory>
+
#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Form.h>
#include <Swiften/Elements/Payload.h>
-#include <boost/shared_ptr.hpp>
-
#include <Swiften/Elements/PubSubOwnerPayload.h>
-#include <Swiften/Elements/Form.h>
namespace Swift {
- class SWIFTEN_API PubSubOwnerDefault : public PubSubOwnerPayload {
- public:
-
- PubSubOwnerDefault();
-
- virtual ~PubSubOwnerDefault();
+ class SWIFTEN_API PubSubOwnerDefault : public PubSubOwnerPayload {
+ public:
+
+ PubSubOwnerDefault();
+
+ virtual ~PubSubOwnerDefault();
- boost::shared_ptr<Form> getData() const {
- return data;
- }
+ std::shared_ptr<Form> getData() const {
+ return data;
+ }
- void setData(boost::shared_ptr<Form> value) {
- this->data = value ;
- }
+ void setData(std::shared_ptr<Form> value) {
+ this->data = value ;
+ }
- private:
- boost::shared_ptr<Form> data;
- };
+ private:
+ std::shared_ptr<Form> data;
+ };
}
diff --git a/Swiften/Elements/PubSubOwnerDelete.cpp b/Swiften/Elements/PubSubOwnerDelete.cpp
index a785424..9d95bdb 100644
--- a/Swiften/Elements/PubSubOwnerDelete.cpp
+++ b/Swiften/Elements/PubSubOwnerDelete.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubOwnerDelete.h b/Swiften/Elements/PubSubOwnerDelete.h
index c6bb3e9..a222e85 100644
--- a/Swiften/Elements/PubSubOwnerDelete.h
+++ b/Swiften/Elements/PubSubOwnerDelete.h
@@ -1,47 +1,46 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <string>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/PubSubOwnerPayload.h>
#include <Swiften/Elements/PubSubOwnerRedirect.h>
namespace Swift {
- class SWIFTEN_API PubSubOwnerDelete : public PubSubOwnerPayload {
- public:
-
- PubSubOwnerDelete();
- PubSubOwnerDelete(const std::string& node) : node(node) {}
- virtual ~PubSubOwnerDelete();
-
- const std::string& getNode() const {
- return node;
- }
-
- void setNode(const std::string& value) {
- this->node = value ;
- }
-
- boost::shared_ptr<PubSubOwnerRedirect> getRedirect() const {
- return redirect;
- }
-
- void setRedirect(boost::shared_ptr<PubSubOwnerRedirect> value) {
- this->redirect = value ;
- }
-
-
- private:
- std::string node;
- boost::shared_ptr<PubSubOwnerRedirect> redirect;
- };
+ class SWIFTEN_API PubSubOwnerDelete : public PubSubOwnerPayload {
+ public:
+
+ PubSubOwnerDelete();
+ PubSubOwnerDelete(const std::string& node) : node(node) {}
+ virtual ~PubSubOwnerDelete();
+
+ const std::string& getNode() const {
+ return node;
+ }
+
+ void setNode(const std::string& value) {
+ this->node = value ;
+ }
+
+ std::shared_ptr<PubSubOwnerRedirect> getRedirect() const {
+ return redirect;
+ }
+
+ void setRedirect(std::shared_ptr<PubSubOwnerRedirect> value) {
+ this->redirect = value ;
+ }
+
+
+ private:
+ std::string node;
+ std::shared_ptr<PubSubOwnerRedirect> redirect;
+ };
}
diff --git a/Swiften/Elements/PubSubOwnerPayload.cpp b/Swiften/Elements/PubSubOwnerPayload.cpp
index 92c1dd2..0d3f9d6 100644
--- a/Swiften/Elements/PubSubOwnerPayload.cpp
+++ b/Swiften/Elements/PubSubOwnerPayload.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubOwnerPayload.h b/Swiften/Elements/PubSubOwnerPayload.h
index a2ddaaa..8381a17 100644
--- a/Swiften/Elements/PubSubOwnerPayload.h
+++ b/Swiften/Elements/PubSubOwnerPayload.h
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
@@ -10,8 +10,8 @@
#include <Swiften/Elements/Payload.h>
namespace Swift {
- class SWIFTEN_API PubSubOwnerPayload : public Payload {
- public:
- virtual ~PubSubOwnerPayload();
- };
+ class SWIFTEN_API PubSubOwnerPayload : public Payload {
+ public:
+ virtual ~PubSubOwnerPayload();
+ };
}
diff --git a/Swiften/Elements/PubSubOwnerPubSub.cpp b/Swiften/Elements/PubSubOwnerPubSub.cpp
index 022452d..2407a73 100644
--- a/Swiften/Elements/PubSubOwnerPubSub.cpp
+++ b/Swiften/Elements/PubSubOwnerPubSub.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubOwnerPubSub.h b/Swiften/Elements/PubSubOwnerPubSub.h
index dd72abe..9989cde 100644
--- a/Swiften/Elements/PubSubOwnerPubSub.h
+++ b/Swiften/Elements/PubSubOwnerPubSub.h
@@ -1,21 +1,19 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/ContainerPayload.h>
-
#include <Swiften/Elements/PubSubOwnerPayload.h>
namespace Swift {
- class SWIFTEN_API PubSubOwnerPubSub : public ContainerPayload<PubSubOwnerPayload> {
- public:
- PubSubOwnerPubSub();
- virtual ~PubSubOwnerPubSub();
- };
+ class SWIFTEN_API PubSubOwnerPubSub : public ContainerPayload<PubSubOwnerPayload> {
+ public:
+ PubSubOwnerPubSub();
+ virtual ~PubSubOwnerPubSub();
+ };
}
diff --git a/Swiften/Elements/PubSubOwnerPurge.cpp b/Swiften/Elements/PubSubOwnerPurge.cpp
index d0ac57d..cb1ab8b 100644
--- a/Swiften/Elements/PubSubOwnerPurge.cpp
+++ b/Swiften/Elements/PubSubOwnerPurge.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubOwnerPurge.h b/Swiften/Elements/PubSubOwnerPurge.h
index fc410f8..3631bd9 100644
--- a/Swiften/Elements/PubSubOwnerPurge.h
+++ b/Swiften/Elements/PubSubOwnerPurge.h
@@ -1,36 +1,35 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
#include <string>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/PubSubOwnerPayload.h>
namespace Swift {
- class SWIFTEN_API PubSubOwnerPurge : public PubSubOwnerPayload {
- public:
-
- PubSubOwnerPurge();
-
- virtual ~PubSubOwnerPurge();
+ class SWIFTEN_API PubSubOwnerPurge : public PubSubOwnerPayload {
+ public:
+
+ PubSubOwnerPurge();
+
+ virtual ~PubSubOwnerPurge();
- const std::string& getNode() const {
- return node;
- }
+ const std::string& getNode() const {
+ return node;
+ }
- void setNode(const std::string& value) {
- this->node = value ;
- }
+ void setNode(const std::string& value) {
+ this->node = value ;
+ }
- private:
- std::string node;
- };
+ private:
+ std::string node;
+ };
}
diff --git a/Swiften/Elements/PubSubOwnerRedirect.cpp b/Swiften/Elements/PubSubOwnerRedirect.cpp
index 164c216..b7c6882 100644
--- a/Swiften/Elements/PubSubOwnerRedirect.cpp
+++ b/Swiften/Elements/PubSubOwnerRedirect.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubOwnerRedirect.h b/Swiften/Elements/PubSubOwnerRedirect.h
index 61db1d1..f7deca8 100644
--- a/Swiften/Elements/PubSubOwnerRedirect.h
+++ b/Swiften/Elements/PubSubOwnerRedirect.h
@@ -1,36 +1,34 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
+#include <string>
+
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
-#include <string>
+namespace Swift {
+ class SWIFTEN_API PubSubOwnerRedirect : public Payload {
+ public:
+ PubSubOwnerRedirect();
-namespace Swift {
- class SWIFTEN_API PubSubOwnerRedirect : public Payload {
- public:
-
- PubSubOwnerRedirect();
-
- virtual ~PubSubOwnerRedirect();
+ virtual ~PubSubOwnerRedirect();
- const std::string& getURI() const {
- return uri;
- }
+ const std::string& getURI() const {
+ return uri;
+ }
- void setURI(const std::string& value) {
- this->uri = value ;
- }
+ void setURI(const std::string& value) {
+ this->uri = value ;
+ }
- private:
- std::string uri;
- };
+ private:
+ std::string uri;
+ };
}
diff --git a/Swiften/Elements/PubSubOwnerSubscription.cpp b/Swiften/Elements/PubSubOwnerSubscription.cpp
index 3334e36..c5ed105 100644
--- a/Swiften/Elements/PubSubOwnerSubscription.cpp
+++ b/Swiften/Elements/PubSubOwnerSubscription.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubOwnerSubscription.h b/Swiften/Elements/PubSubOwnerSubscription.h
index 1c302df..cf2edd9 100644
--- a/Swiften/Elements/PubSubOwnerSubscription.h
+++ b/Swiften/Elements/PubSubOwnerSubscription.h
@@ -1,51 +1,48 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
-
-
#include <Swiften/JID/JID.h>
namespace Swift {
- class SWIFTEN_API PubSubOwnerSubscription : public Payload {
- public:
- enum SubscriptionType {
- None,
- Pending,
- Subscribed,
- Unconfigured
- };
-
- PubSubOwnerSubscription();
-
- virtual ~PubSubOwnerSubscription();
-
- const JID& getJID() const {
- return jid;
- }
-
- void setJID(const JID& value) {
- this->jid = value ;
- }
-
- SubscriptionType getSubscription() const {
- return subscription;
- }
-
- void setSubscription(SubscriptionType value) {
- this->subscription = value ;
- }
-
-
- private:
- JID jid;
- SubscriptionType subscription;
- };
+ class SWIFTEN_API PubSubOwnerSubscription : public Payload {
+ public:
+ enum SubscriptionType {
+ None,
+ Pending,
+ Subscribed,
+ Unconfigured
+ };
+
+ PubSubOwnerSubscription();
+
+ virtual ~PubSubOwnerSubscription();
+
+ const JID& getJID() const {
+ return jid;
+ }
+
+ void setJID(const JID& value) {
+ this->jid = value ;
+ }
+
+ SubscriptionType getSubscription() const {
+ return subscription;
+ }
+
+ void setSubscription(SubscriptionType value) {
+ this->subscription = value ;
+ }
+
+
+ private:
+ JID jid;
+ SubscriptionType subscription;
+ };
}
diff --git a/Swiften/Elements/PubSubOwnerSubscriptions.cpp b/Swiften/Elements/PubSubOwnerSubscriptions.cpp
index a4deb59..1560042 100644
--- a/Swiften/Elements/PubSubOwnerSubscriptions.cpp
+++ b/Swiften/Elements/PubSubOwnerSubscriptions.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubOwnerSubscriptions.h b/Swiften/Elements/PubSubOwnerSubscriptions.h
index 08a2f5c..d7cd8df 100644
--- a/Swiften/Elements/PubSubOwnerSubscriptions.h
+++ b/Swiften/Elements/PubSubOwnerSubscriptions.h
@@ -1,52 +1,51 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/shared_ptr.hpp>
-#include <vector>
+#include <memory>
#include <string>
+#include <vector>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/PubSubOwnerPayload.h>
#include <Swiften/Elements/PubSubOwnerSubscription.h>
namespace Swift {
- class SWIFTEN_API PubSubOwnerSubscriptions : public PubSubOwnerPayload {
- public:
-
- PubSubOwnerSubscriptions();
-
- virtual ~PubSubOwnerSubscriptions();
-
- const std::string& getNode() const {
- return node;
- }
-
- void setNode(const std::string& value) {
- this->node = value ;
- }
-
- const std::vector< boost::shared_ptr<PubSubOwnerSubscription> >& getSubscriptions() const {
- return subscriptions;
- }
-
- void setSubscriptions(const std::vector< boost::shared_ptr<PubSubOwnerSubscription> >& value) {
- this->subscriptions = value ;
- }
-
- void addSubscription(boost::shared_ptr<PubSubOwnerSubscription> value) {
- this->subscriptions.push_back(value);
- }
-
-
- private:
- std::string node;
- std::vector< boost::shared_ptr<PubSubOwnerSubscription> > subscriptions;
- };
+ class SWIFTEN_API PubSubOwnerSubscriptions : public PubSubOwnerPayload {
+ public:
+
+ PubSubOwnerSubscriptions();
+
+ virtual ~PubSubOwnerSubscriptions();
+
+ const std::string& getNode() const {
+ return node;
+ }
+
+ void setNode(const std::string& value) {
+ this->node = value ;
+ }
+
+ const std::vector< std::shared_ptr<PubSubOwnerSubscription> >& getSubscriptions() const {
+ return subscriptions;
+ }
+
+ void setSubscriptions(const std::vector< std::shared_ptr<PubSubOwnerSubscription> >& value) {
+ this->subscriptions = value ;
+ }
+
+ void addSubscription(std::shared_ptr<PubSubOwnerSubscription> value) {
+ this->subscriptions.push_back(value);
+ }
+
+
+ private:
+ std::string node;
+ std::vector< std::shared_ptr<PubSubOwnerSubscription> > subscriptions;
+ };
}
diff --git a/Swiften/Elements/PubSubPayload.cpp b/Swiften/Elements/PubSubPayload.cpp
index b529959..3f6de5e 100644
--- a/Swiften/Elements/PubSubPayload.cpp
+++ b/Swiften/Elements/PubSubPayload.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubPayload.h b/Swiften/Elements/PubSubPayload.h
index 476939b..7fc1882 100644
--- a/Swiften/Elements/PubSubPayload.h
+++ b/Swiften/Elements/PubSubPayload.h
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
@@ -10,8 +10,8 @@
#include <Swiften/Elements/Payload.h>
namespace Swift {
- class SWIFTEN_API PubSubPayload : public Payload {
- public:
- virtual ~PubSubPayload();
- };
+ class SWIFTEN_API PubSubPayload : public Payload {
+ public:
+ virtual ~PubSubPayload();
+ };
}
diff --git a/Swiften/Elements/PubSubPublish.cpp b/Swiften/Elements/PubSubPublish.cpp
index 2ee3880..ec3fb0c 100644
--- a/Swiften/Elements/PubSubPublish.cpp
+++ b/Swiften/Elements/PubSubPublish.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubPublish.h b/Swiften/Elements/PubSubPublish.h
index 1d99420..2d6d5bb 100644
--- a/Swiften/Elements/PubSubPublish.h
+++ b/Swiften/Elements/PubSubPublish.h
@@ -1,52 +1,51 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/shared_ptr.hpp>
-#include <vector>
+#include <memory>
#include <string>
+#include <vector>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/PubSubItem.h>
#include <Swiften/Elements/PubSubPayload.h>
namespace Swift {
- class SWIFTEN_API PubSubPublish : public PubSubPayload {
- public:
-
- PubSubPublish();
-
- virtual ~PubSubPublish();
-
- const std::string& getNode() const {
- return node;
- }
-
- void setNode(const std::string& value) {
- this->node = value ;
- }
-
- const std::vector< boost::shared_ptr<PubSubItem> >& getItems() const {
- return items;
- }
-
- void setItems(const std::vector< boost::shared_ptr<PubSubItem> >& value) {
- this->items = value ;
- }
-
- void addItem(boost::shared_ptr<PubSubItem> value) {
- this->items.push_back(value);
- }
-
-
- private:
- std::string node;
- std::vector< boost::shared_ptr<PubSubItem> > items;
- };
+ class SWIFTEN_API PubSubPublish : public PubSubPayload {
+ public:
+
+ PubSubPublish();
+
+ virtual ~PubSubPublish();
+
+ const std::string& getNode() const {
+ return node;
+ }
+
+ void setNode(const std::string& value) {
+ this->node = value ;
+ }
+
+ const std::vector< std::shared_ptr<PubSubItem> >& getItems() const {
+ return items;
+ }
+
+ void setItems(const std::vector< std::shared_ptr<PubSubItem> >& value) {
+ this->items = value ;
+ }
+
+ void addItem(std::shared_ptr<PubSubItem> value) {
+ this->items.push_back(value);
+ }
+
+
+ private:
+ std::string node;
+ std::vector< std::shared_ptr<PubSubItem> > items;
+ };
}
diff --git a/Swiften/Elements/PubSubRetract.cpp b/Swiften/Elements/PubSubRetract.cpp
index 7e3676e..1b188ee 100644
--- a/Swiften/Elements/PubSubRetract.cpp
+++ b/Swiften/Elements/PubSubRetract.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2016 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubRetract.h b/Swiften/Elements/PubSubRetract.h
index e55897b..2629c16 100644
--- a/Swiften/Elements/PubSubRetract.h
+++ b/Swiften/Elements/PubSubRetract.h
@@ -1,61 +1,62 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2016 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/shared_ptr.hpp>
-#include <vector>
+#include <memory>
#include <string>
+#include <vector>
+
+#include <boost/optional.hpp>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/PubSubItem.h>
#include <Swiften/Elements/PubSubPayload.h>
namespace Swift {
- class SWIFTEN_API PubSubRetract : public PubSubPayload {
- public:
-
- PubSubRetract();
-
- virtual ~PubSubRetract();
-
- const std::string& getNode() const {
- return node;
- }
-
- void setNode(const std::string& value) {
- this->node = value ;
- }
-
- const std::vector< boost::shared_ptr<PubSubItem> >& getItems() const {
- return items;
- }
-
- void setItems(const std::vector< boost::shared_ptr<PubSubItem> >& value) {
- this->items = value ;
- }
-
- void addItem(boost::shared_ptr<PubSubItem> value) {
- this->items.push_back(value);
- }
-
- bool isNotify() const {
- return notify;
- }
-
- void setNotify(bool value) {
- this->notify = value ;
- }
-
-
- private:
- std::string node;
- std::vector< boost::shared_ptr<PubSubItem> > items;
- bool notify;
- };
+ class SWIFTEN_API PubSubRetract : public PubSubPayload {
+ public:
+
+ PubSubRetract();
+
+ virtual ~PubSubRetract();
+
+ const std::string& getNode() const {
+ return node;
+ }
+
+ void setNode(const std::string& value) {
+ this->node = value ;
+ }
+
+ const std::vector< std::shared_ptr<PubSubItem> >& getItems() const {
+ return items;
+ }
+
+ void setItems(const std::vector< std::shared_ptr<PubSubItem> >& value) {
+ this->items = value ;
+ }
+
+ void addItem(std::shared_ptr<PubSubItem> value) {
+ this->items.push_back(value);
+ }
+
+ boost::optional<bool> isNotify() const {
+ return notify;
+ }
+
+ void setNotify(const boost::optional<bool>& value) {
+ this->notify = value ;
+ }
+
+
+ private:
+ std::string node;
+ std::vector< std::shared_ptr<PubSubItem> > items;
+ boost::optional<bool> notify;
+ };
}
diff --git a/Swiften/Elements/PubSubSubscribe.cpp b/Swiften/Elements/PubSubSubscribe.cpp
index 4720321..c461b54 100644
--- a/Swiften/Elements/PubSubSubscribe.cpp
+++ b/Swiften/Elements/PubSubSubscribe.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubSubscribe.h b/Swiften/Elements/PubSubSubscribe.h
index e2cc4ae..aaaca38 100644
--- a/Swiften/Elements/PubSubSubscribe.h
+++ b/Swiften/Elements/PubSubSubscribe.h
@@ -1,58 +1,58 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <string>
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/PubSubOptions.h>
#include <Swiften/Elements/PubSubPayload.h>
#include <Swiften/JID/JID.h>
namespace Swift {
- class SWIFTEN_API PubSubSubscribe : public PubSubPayload {
- public:
-
- PubSubSubscribe();
-
- virtual ~PubSubSubscribe();
-
- const boost::optional< std::string >& getNode() const {
- return node;
- }
-
- void setNode(const boost::optional< std::string >& value) {
- this->node = value ;
- }
-
- const JID& getJID() const {
- return jid;
- }
-
- void setJID(const JID& value) {
- this->jid = value ;
- }
-
- boost::shared_ptr<PubSubOptions> getOptions() const {
- return options;
- }
-
- void setOptions(boost::shared_ptr<PubSubOptions> value) {
- this->options = value ;
- }
-
-
- private:
- boost::optional< std::string > node;
- JID jid;
- boost::shared_ptr<PubSubOptions> options;
- };
+ class SWIFTEN_API PubSubSubscribe : public PubSubPayload {
+ public:
+
+ PubSubSubscribe();
+
+ virtual ~PubSubSubscribe();
+
+ const boost::optional< std::string >& getNode() const {
+ return node;
+ }
+
+ void setNode(const boost::optional< std::string >& value) {
+ this->node = value ;
+ }
+
+ const JID& getJID() const {
+ return jid;
+ }
+
+ void setJID(const JID& value) {
+ this->jid = value ;
+ }
+
+ std::shared_ptr<PubSubOptions> getOptions() const {
+ return options;
+ }
+
+ void setOptions(std::shared_ptr<PubSubOptions> value) {
+ this->options = value ;
+ }
+
+
+ private:
+ boost::optional< std::string > node;
+ JID jid;
+ std::shared_ptr<PubSubOptions> options;
+ };
}
diff --git a/Swiften/Elements/PubSubSubscribeOptions.cpp b/Swiften/Elements/PubSubSubscribeOptions.cpp
index 8770620..a4c7914 100644
--- a/Swiften/Elements/PubSubSubscribeOptions.cpp
+++ b/Swiften/Elements/PubSubSubscribeOptions.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
@@ -8,7 +8,7 @@
using namespace Swift;
-PubSubSubscribeOptions::PubSubSubscribeOptions() {
+PubSubSubscribeOptions::PubSubSubscribeOptions() : required(false) {
}
PubSubSubscribeOptions::~PubSubSubscribeOptions() {
diff --git a/Swiften/Elements/PubSubSubscribeOptions.h b/Swiften/Elements/PubSubSubscribeOptions.h
index 6612d82..1521427 100644
--- a/Swiften/Elements/PubSubSubscribeOptions.h
+++ b/Swiften/Elements/PubSubSubscribeOptions.h
@@ -1,36 +1,32 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
+namespace Swift {
+ class SWIFTEN_API PubSubSubscribeOptions : public Payload {
+ public:
+ PubSubSubscribeOptions();
+ virtual ~PubSubSubscribeOptions();
-namespace Swift {
- class SWIFTEN_API PubSubSubscribeOptions : public Payload {
- public:
-
- PubSubSubscribeOptions();
-
- virtual ~PubSubSubscribeOptions();
-
- bool isRequired() const {
- return required;
- }
+ bool isRequired() const {
+ return required;
+ }
- void setRequired(bool value) {
- this->required = value ;
- }
+ void setRequired(bool value) {
+ this->required = value ;
+ }
- private:
- bool required;
- };
+ private:
+ bool required;
+ };
}
diff --git a/Swiften/Elements/PubSubSubscription.cpp b/Swiften/Elements/PubSubSubscription.cpp
index a25fc06..2b2463e 100644
--- a/Swiften/Elements/PubSubSubscription.cpp
+++ b/Swiften/Elements/PubSubSubscription.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubSubscription.h b/Swiften/Elements/PubSubSubscription.h
index 977cd55..9645ebb 100644
--- a/Swiften/Elements/PubSubSubscription.h
+++ b/Swiften/Elements/PubSubSubscription.h
@@ -1,82 +1,82 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <string>
-#include <Swiften/Elements/PubSubSubscribeOptions.h>
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/PubSubPayload.h>
+#include <Swiften/Elements/PubSubSubscribeOptions.h>
#include <Swiften/JID/JID.h>
namespace Swift {
- class SWIFTEN_API PubSubSubscription : public PubSubPayload {
- public:
- enum SubscriptionType {
- None,
- Pending,
- Subscribed,
- Unconfigured
- };
-
- PubSubSubscription();
-
- virtual ~PubSubSubscription();
-
- const boost::optional< std::string >& getNode() const {
- return node;
- }
-
- void setNode(const boost::optional< std::string >& value) {
- this->node = value ;
- }
-
- const boost::optional< std::string >& getSubscriptionID() const {
- return subscriptionID;
- }
-
- void setSubscriptionID(const boost::optional< std::string >& value) {
- this->subscriptionID = value ;
- }
-
- const JID& getJID() const {
- return jid;
- }
-
- void setJID(const JID& value) {
- this->jid = value ;
- }
-
- boost::shared_ptr<PubSubSubscribeOptions> getOptions() const {
- return options;
- }
-
- void setOptions(boost::shared_ptr<PubSubSubscribeOptions> value) {
- this->options = value ;
- }
-
- SubscriptionType getSubscription() const {
- return subscription;
- }
-
- void setSubscription(SubscriptionType value) {
- this->subscription = value ;
- }
-
-
- private:
- boost::optional< std::string > node;
- boost::optional< std::string > subscriptionID;
- JID jid;
- boost::shared_ptr<PubSubSubscribeOptions> options;
- SubscriptionType subscription;
- };
+ class SWIFTEN_API PubSubSubscription : public PubSubPayload {
+ public:
+ enum SubscriptionType {
+ None,
+ Pending,
+ Subscribed,
+ Unconfigured
+ };
+
+ PubSubSubscription();
+
+ virtual ~PubSubSubscription();
+
+ const boost::optional< std::string >& getNode() const {
+ return node;
+ }
+
+ void setNode(const boost::optional< std::string >& value) {
+ this->node = value ;
+ }
+
+ const boost::optional< std::string >& getSubscriptionID() const {
+ return subscriptionID;
+ }
+
+ void setSubscriptionID(const boost::optional< std::string >& value) {
+ this->subscriptionID = value ;
+ }
+
+ const JID& getJID() const {
+ return jid;
+ }
+
+ void setJID(const JID& value) {
+ this->jid = value ;
+ }
+
+ std::shared_ptr<PubSubSubscribeOptions> getOptions() const {
+ return options;
+ }
+
+ void setOptions(std::shared_ptr<PubSubSubscribeOptions> value) {
+ this->options = value ;
+ }
+
+ SubscriptionType getSubscription() const {
+ return subscription;
+ }
+
+ void setSubscription(SubscriptionType value) {
+ this->subscription = value ;
+ }
+
+
+ private:
+ boost::optional< std::string > node;
+ boost::optional< std::string > subscriptionID;
+ JID jid;
+ std::shared_ptr<PubSubSubscribeOptions> options;
+ SubscriptionType subscription;
+ };
}
diff --git a/Swiften/Elements/PubSubSubscriptions.cpp b/Swiften/Elements/PubSubSubscriptions.cpp
index 626e122..0c58962 100644
--- a/Swiften/Elements/PubSubSubscriptions.cpp
+++ b/Swiften/Elements/PubSubSubscriptions.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubSubscriptions.h b/Swiften/Elements/PubSubSubscriptions.h
index c7c19c5..f721bd5 100644
--- a/Swiften/Elements/PubSubSubscriptions.h
+++ b/Swiften/Elements/PubSubSubscriptions.h
@@ -1,53 +1,53 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
-#include <vector>
+#include <memory>
#include <string>
+#include <vector>
-#include <Swiften/Elements/PubSubSubscription.h>
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/PubSubPayload.h>
+#include <Swiften/Elements/PubSubSubscription.h>
namespace Swift {
- class SWIFTEN_API PubSubSubscriptions : public PubSubPayload {
- public:
-
- PubSubSubscriptions();
- PubSubSubscriptions(const std::string& node) : node(node) {}
- virtual ~PubSubSubscriptions();
-
- const boost::optional< std::string >& getNode() const {
- return node;
- }
-
- void setNode(const boost::optional< std::string >& value) {
- this->node = value ;
- }
-
- const std::vector< boost::shared_ptr<PubSubSubscription> >& getSubscriptions() const {
- return subscriptions;
- }
-
- void setSubscriptions(const std::vector< boost::shared_ptr<PubSubSubscription> >& value) {
- this->subscriptions = value ;
- }
-
- void addSubscription(boost::shared_ptr<PubSubSubscription> value) {
- this->subscriptions.push_back(value);
- }
-
-
- private:
- boost::optional< std::string > node;
- std::vector< boost::shared_ptr<PubSubSubscription> > subscriptions;
- };
+ class SWIFTEN_API PubSubSubscriptions : public PubSubPayload {
+ public:
+
+ PubSubSubscriptions();
+ PubSubSubscriptions(const std::string& node) : node(node) {}
+ virtual ~PubSubSubscriptions();
+
+ const boost::optional< std::string >& getNode() const {
+ return node;
+ }
+
+ void setNode(const boost::optional< std::string >& value) {
+ this->node = value ;
+ }
+
+ const std::vector< std::shared_ptr<PubSubSubscription> >& getSubscriptions() const {
+ return subscriptions;
+ }
+
+ void setSubscriptions(const std::vector< std::shared_ptr<PubSubSubscription> >& value) {
+ this->subscriptions = value ;
+ }
+
+ void addSubscription(std::shared_ptr<PubSubSubscription> value) {
+ this->subscriptions.push_back(value);
+ }
+
+
+ private:
+ boost::optional< std::string > node;
+ std::vector< std::shared_ptr<PubSubSubscription> > subscriptions;
+ };
}
diff --git a/Swiften/Elements/PubSubUnsubscribe.cpp b/Swiften/Elements/PubSubUnsubscribe.cpp
index a4b8318..1438b17 100644
--- a/Swiften/Elements/PubSubUnsubscribe.cpp
+++ b/Swiften/Elements/PubSubUnsubscribe.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/PubSubUnsubscribe.h b/Swiften/Elements/PubSubUnsubscribe.h
index 3969376..c0c25bd 100644
--- a/Swiften/Elements/PubSubUnsubscribe.h
+++ b/Swiften/Elements/PubSubUnsubscribe.h
@@ -1,56 +1,56 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/optional.hpp>
#include <string>
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/PubSubPayload.h>
#include <Swiften/JID/JID.h>
namespace Swift {
- class SWIFTEN_API PubSubUnsubscribe : public PubSubPayload {
- public:
-
- PubSubUnsubscribe();
-
- virtual ~PubSubUnsubscribe();
-
- const boost::optional< std::string >& getNode() const {
- return node;
- }
-
- void setNode(const boost::optional< std::string >& value) {
- this->node = value ;
- }
-
- const JID& getJID() const {
- return jid;
- }
-
- void setJID(const JID& value) {
- this->jid = value ;
- }
-
- const boost::optional< std::string >& getSubscriptionID() const {
- return subscriptionID;
- }
-
- void setSubscriptionID(const boost::optional< std::string >& value) {
- this->subscriptionID = value ;
- }
-
-
- private:
- boost::optional< std::string > node;
- JID jid;
- boost::optional< std::string > subscriptionID;
- };
+ class SWIFTEN_API PubSubUnsubscribe : public PubSubPayload {
+ public:
+
+ PubSubUnsubscribe();
+
+ virtual ~PubSubUnsubscribe();
+
+ const boost::optional< std::string >& getNode() const {
+ return node;
+ }
+
+ void setNode(const boost::optional< std::string >& value) {
+ this->node = value ;
+ }
+
+ const JID& getJID() const {
+ return jid;
+ }
+
+ void setJID(const JID& value) {
+ this->jid = value ;
+ }
+
+ const boost::optional< std::string >& getSubscriptionID() const {
+ return subscriptionID;
+ }
+
+ void setSubscriptionID(const boost::optional< std::string >& value) {
+ this->subscriptionID = value ;
+ }
+
+
+ private:
+ boost::optional< std::string > node;
+ JID jid;
+ boost::optional< std::string > subscriptionID;
+ };
}
diff --git a/Swiften/Elements/RawXMLPayload.h b/Swiften/Elements/RawXMLPayload.h
index e583c12..65901bc 100644
--- a/Swiften/Elements/RawXMLPayload.h
+++ b/Swiften/Elements/RawXMLPayload.h
@@ -1,29 +1,30 @@
/*
- * Copyright (c) 2011 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2011-2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
#include <string>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
- class RawXMLPayload : public Payload {
- public:
- RawXMLPayload(const std::string& data = "") : rawXML_(data) {}
+ class SWIFTEN_API RawXMLPayload : public Payload {
+ public:
+ RawXMLPayload(const std::string& data = "") : rawXML_(data) {}
- void setRawXML(const std::string& data) {
- rawXML_ = data;
- }
+ void setRawXML(const std::string& data) {
+ rawXML_ = data;
+ }
- const std::string& getRawXML() const {
- return rawXML_;
- }
+ const std::string& getRawXML() const {
+ return rawXML_;
+ }
- private:
- std::string rawXML_;
- };
+ private:
+ std::string rawXML_;
+ };
}
diff --git a/Swiften/Elements/ReferencePayload.cpp b/Swiften/Elements/ReferencePayload.cpp
new file mode 100644
index 0000000..288f28f
--- /dev/null
+++ b/Swiften/Elements/ReferencePayload.cpp
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2018 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#include <Swiften/Elements/ReferencePayload.h>
+
+namespace Swift {
+
+ReferencePayload::ReferencePayload()
+ : type_(Type::Data) {
+}
+
+const ReferencePayload::Type& ReferencePayload::getType() const {
+ return type_;
+}
+
+void ReferencePayload::setType(const ReferencePayload::Type& type) {
+ type_ = type;
+}
+
+const boost::optional<std::string>& ReferencePayload::getUri() const {
+ return uri_;
+}
+
+void ReferencePayload::setUri(const boost::optional<std::string>& uri) {
+ uri_ = uri;
+}
+
+const boost::optional<std::string>& ReferencePayload::getBegin() const {
+ return begin_;
+}
+
+void ReferencePayload::setBegin(const boost::optional<std::string>& begin) {
+ begin_ = begin;
+}
+
+const boost::optional<std::string>& ReferencePayload::getEnd() const {
+ return end_;
+}
+
+void ReferencePayload::setEnd(const boost::optional<std::string>& end) {
+ end_ = end;
+}
+
+const boost::optional<std::string>& ReferencePayload::getAnchor() const {
+ return anchor_;
+}
+
+void ReferencePayload::setAnchor(const boost::optional<std::string>& anchor) {
+ anchor_ = anchor;
+}
+
+const std::vector<std::shared_ptr<Payload>>& ReferencePayload::getPayloads() const {
+ return payloads_;
+}
+
+void ReferencePayload::addPayload(const std::shared_ptr<Payload>& payload) {
+ payloads_.push_back(payload);
+}
+
+}
diff --git a/Swiften/Elements/ReferencePayload.h b/Swiften/Elements/ReferencePayload.h
new file mode 100644
index 0000000..b9a394e
--- /dev/null
+++ b/Swiften/Elements/ReferencePayload.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2018 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#pragma once
+
+#include <string>
+#include <vector>
+
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
+
+namespace Swift {
+ /**
+ * reference from XEP-0372
+ */
+ class SWIFTEN_API ReferencePayload : public Payload {
+
+ public:
+
+ typedef std::shared_ptr<ReferencePayload> ref;
+
+ enum class Type {
+ Data,
+ Mention,
+ PubSub,
+ Unknown
+ };
+
+ ReferencePayload();
+
+ const Type& getType() const;
+ const boost::optional<std::string>& getUri() const;
+ const boost::optional<std::string>& getBegin() const;
+ const boost::optional<std::string>& getEnd() const;
+ const boost::optional<std::string>& getAnchor() const;
+
+ const std::vector<std::shared_ptr<Payload>>& getPayloads() const;
+
+ void setType(const Type& type);
+ void setUri(const boost::optional<std::string>& uri);
+ void setBegin(const boost::optional<std::string>& begin);
+ void setEnd(const boost::optional<std::string>& end);
+ void setAnchor(const boost::optional<std::string>& anchor);
+
+ void addPayload(const std::shared_ptr<Payload>& payload);
+
+ private:
+
+ Type type_;
+ boost::optional<std::string> uri_;
+ boost::optional<std::string> begin_;
+ boost::optional<std::string> end_;
+ boost::optional<std::string> anchor_;
+
+ std::vector<std::shared_ptr<Payload>> payloads_;
+ };
+}
diff --git a/Swiften/Elements/Replace.h b/Swiften/Elements/Replace.h
index 96935f5..d51981d 100644
--- a/Swiften/Elements/Replace.h
+++ b/Swiften/Elements/Replace.h
@@ -4,25 +4,32 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <string>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
- class Replace : public Payload {
- public:
- typedef boost::shared_ptr<Replace> ref;
- Replace(const std::string& id = std::string()) : replaceID_(id) {}
- const std::string& getID() const {
- return replaceID_;
- }
- void setID(const std::string& id) {
- replaceID_ = id;
- }
- private:
- std::string replaceID_;
- };
+ class SWIFTEN_API Replace : public Payload {
+ public:
+ typedef std::shared_ptr<Replace> ref;
+ Replace(const std::string& id = std::string()) : replaceID_(id) {}
+ const std::string& getID() const {
+ return replaceID_;
+ }
+ void setID(const std::string& id) {
+ replaceID_ = id;
+ }
+ private:
+ std::string replaceID_;
+ };
}
diff --git a/Swiften/Elements/ResourceBind.h b/Swiften/Elements/ResourceBind.h
index f67a995..fd6d4c7 100644
--- a/Swiften/Elements/ResourceBind.h
+++ b/Swiften/Elements/ResourceBind.h
@@ -1,38 +1,40 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
#include <string>
+
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
#include <Swiften/JID/JID.h>
namespace Swift {
- class ResourceBind : public Payload {
- public:
- ResourceBind() {}
-
- void setJID(const JID& jid) {
- jid_ = jid;
- }
-
- const JID& getJID() const {
- return jid_;
- }
-
- void setResource(const std::string& resource) {
- resource_ = resource;
- }
-
- const std::string& getResource() const {
- return resource_;
- }
-
- private:
- JID jid_;
- std::string resource_;
- };
+ class SWIFTEN_API ResourceBind : public Payload {
+ public:
+ ResourceBind() {}
+
+ void setJID(const JID& jid) {
+ jid_ = jid;
+ }
+
+ const JID& getJID() const {
+ return jid_;
+ }
+
+ void setResource(const std::string& resource) {
+ resource_ = resource;
+ }
+
+ const std::string& getResource() const {
+ return resource_;
+ }
+
+ private:
+ JID jid_;
+ std::string resource_;
+ };
}
diff --git a/Swiften/Elements/ResultSet.cpp b/Swiften/Elements/ResultSet.cpp
new file mode 100644
index 0000000..4d04c38
--- /dev/null
+++ b/Swiften/Elements/ResultSet.cpp
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2014 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#include <Swiften/Elements/ResultSet.h>
+
+using namespace Swift;
+
+ResultSet::~ResultSet() {
+}
diff --git a/Swiften/Elements/ResultSet.h b/Swiften/Elements/ResultSet.h
new file mode 100644
index 0000000..c8e59d4
--- /dev/null
+++ b/Swiften/Elements/ResultSet.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2014-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#pragma once
+
+#include <string>
+
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
+
+namespace Swift {
+ class SWIFTEN_API ResultSet : public Payload {
+ public:
+ virtual ~ResultSet();
+
+ void setMaxItems(const boost::optional<int>& maxItems) { maxItems_ = maxItems; }
+ const boost::optional<int>& getMaxItems() const { return maxItems_; }
+
+ void setCount(const boost::optional<int>& count) { count_ = count; }
+ const boost::optional<int>& getCount() const { return count_; }
+
+ void setIndex(const boost::optional<int>& index) { index_ = index; }
+ const boost::optional<int>& getIndex() const { return index_; }
+
+ void setFirstIDIndex(const boost::optional<int>& firstIndex) { firstIndex_ = firstIndex; }
+ const boost::optional<int>& getFirstIDIndex() const { return firstIndex_; }
+
+ void setFirstID(const boost::optional<std::string>& firstID) { firstID_ = firstID; }
+ const boost::optional<std::string>& getFirstID() const { return firstID_; }
+
+ void setLastID(const boost::optional<std::string>& lastID) { lastID_ = lastID; }
+ const boost::optional<std::string>& getLastID() const { return lastID_; }
+
+ void setBefore(const boost::optional<std::string>& before) { before_ = before; }
+ const boost::optional<std::string>& getBefore() const { return before_; }
+
+ void setAfter(const boost::optional<std::string>& after) { after_ = after; }
+ const boost::optional<std::string>& getAfter() const { return after_; }
+
+
+ private:
+ boost::optional<int> maxItems_;
+ boost::optional<int> count_;
+ boost::optional<int> index_;
+ boost::optional<int> firstIndex_;
+ boost::optional<std::string> firstID_;
+ boost::optional<std::string> lastID_;
+ boost::optional<std::string> before_;
+ boost::optional<std::string> after_;
+ };
+}
diff --git a/Swiften/Elements/RosterItemExchangePayload.cpp b/Swiften/Elements/RosterItemExchangePayload.cpp
index abd5296..79d0371 100644
--- a/Swiften/Elements/RosterItemExchangePayload.cpp
+++ b/Swiften/Elements/RosterItemExchangePayload.cpp
@@ -4,8 +4,13 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#include <Swiften/Elements/RosterItemExchangePayload.h>
-#include <Swiften/Base/foreach.h>
namespace Swift {
diff --git a/Swiften/Elements/RosterItemExchangePayload.h b/Swiften/Elements/RosterItemExchangePayload.h
index 622c775..fc61f3d 100644
--- a/Swiften/Elements/RosterItemExchangePayload.h
+++ b/Swiften/Elements/RosterItemExchangePayload.h
@@ -4,84 +4,90 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#pragma once
-#include <vector>
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
+#include <vector>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
#include <Swiften/JID/JID.h>
namespace Swift {
- class SWIFTEN_API RosterItemExchangePayload : public Payload {
- public:
- typedef boost::shared_ptr<RosterItemExchangePayload> ref;
+ class SWIFTEN_API RosterItemExchangePayload : public Payload {
+ public:
+ typedef std::shared_ptr<RosterItemExchangePayload> ref;
- class SWIFTEN_API Item {
- public:
- enum Action { Add, Modify, Delete };
+ class SWIFTEN_API Item {
+ public:
+ enum Action { Add, Modify, Delete };
- Item(Action action = Add);
+ Item(Action action = Add);
- Action getAction() const {
- return action;
- }
+ Action getAction() const {
+ return action;
+ }
- void setAction(Action action) {
- this->action = action;
- }
+ void setAction(Action action) {
+ this->action = action;
+ }
- const JID& getJID() const {
- return jid;
- }
+ const JID& getJID() const {
+ return jid;
+ }
- void setJID(const JID& jid) {
- this->jid = jid;
- }
+ void setJID(const JID& jid) {
+ this->jid = jid;
+ }
- const std::string& getName() const {
- return name;
- }
+ const std::string& getName() const {
+ return name;
+ }
- void setName(const std::string& name) {
- this->name = name;
- }
+ void setName(const std::string& name) {
+ this->name = name;
+ }
- const std::vector<std::string>& getGroups() const {
- return groups;
- }
+ const std::vector<std::string>& getGroups() const {
+ return groups;
+ }
- void setGroups(const std::vector<std::string> &groups) {
- this->groups = groups;
- }
+ void setGroups(const std::vector<std::string> &groups) {
+ this->groups = groups;
+ }
- void addGroup(const std::string& group) {
- groups.push_back(group);
- }
+ void addGroup(const std::string& group) {
+ groups.push_back(group);
+ }
- private:
- Action action;
- JID jid;
- std::string name;
- std::vector<std::string> groups;
- };
+ private:
+ Action action;
+ JID jid;
+ std::string name;
+ std::vector<std::string> groups;
+ };
- typedef std::vector<RosterItemExchangePayload::Item> RosterItemExchangePayloadItems;
+ typedef std::vector<RosterItemExchangePayload::Item> RosterItemExchangePayloadItems;
- public:
- RosterItemExchangePayload();
+ public:
+ RosterItemExchangePayload();
- void addItem(const RosterItemExchangePayload::Item& item) {
- items_.push_back(item);
- }
+ void addItem(const RosterItemExchangePayload::Item& item) {
+ items_.push_back(item);
+ }
- const RosterItemExchangePayloadItems& getItems() const {
- return items_;
- }
+ const RosterItemExchangePayloadItems& getItems() const {
+ return items_;
+ }
- private:
- RosterItemExchangePayloadItems items_;
- };
+ private:
+ RosterItemExchangePayloadItems items_;
+ };
}
diff --git a/Swiften/Elements/RosterItemPayload.h b/Swiften/Elements/RosterItemPayload.h
index 915ae31..ea19fa5 100644
--- a/Swiften/Elements/RosterItemPayload.h
+++ b/Swiften/Elements/RosterItemPayload.h
@@ -1,51 +1,52 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <vector>
#include <string>
+#include <vector>
+#include <Swiften/Base/API.h>
#include <Swiften/JID/JID.h>
namespace Swift {
- class RosterItemPayload {
- public:
- enum Subscription { None, To, From, Both, Remove };
-
- RosterItemPayload() : subscription_(None), ask_(false) {}
- RosterItemPayload(const JID& jid, const std::string& name, Subscription subscription, const std::vector<std::string>& groups = std::vector<std::string>()) : jid_(jid), name_(name), subscription_(subscription), groups_(groups), ask_(false) { }
-
- void setJID(const JID& jid) { jid_ = jid; }
- const JID& getJID() const { return jid_; }
-
- void setName(const std::string& name) { name_ = name; }
- const std::string& getName() const { return name_; }
-
- void setSubscription(Subscription subscription) { subscription_ = subscription; }
- const Subscription& getSubscription() const { return subscription_; }
-
- void addGroup(const std::string& group) { groups_.push_back(group); }
- void setGroups(const std::vector<std::string>& groups) { groups_ = groups; }
- const std::vector<std::string>& getGroups() const { return groups_; }
-
- void setSubscriptionRequested() { ask_ = true; }
- bool getSubscriptionRequested() const { return ask_; }
-
- const std::string& getUnknownContent() const { return unknownContent_; }
- void addUnknownContent(const std::string& c) {
- unknownContent_ += c;
- }
-
- private:
- JID jid_;
- std::string name_;
- Subscription subscription_;
- std::vector<std::string> groups_;
- bool ask_;
- std::string unknownContent_;
- };
+ class SWIFTEN_API RosterItemPayload {
+ public:
+ enum Subscription { None, To, From, Both, Remove };
+
+ RosterItemPayload() : subscription_(None), ask_(false) {}
+ RosterItemPayload(const JID& jid, const std::string& name, Subscription subscription, const std::vector<std::string>& groups = std::vector<std::string>()) : jid_(jid), name_(name), subscription_(subscription), groups_(groups), ask_(false) { }
+
+ void setJID(const JID& jid) { jid_ = jid; }
+ const JID& getJID() const { return jid_; }
+
+ void setName(const std::string& name) { name_ = name; }
+ const std::string& getName() const { return name_; }
+
+ void setSubscription(Subscription subscription) { subscription_ = subscription; }
+ const Subscription& getSubscription() const { return subscription_; }
+
+ void addGroup(const std::string& group) { groups_.push_back(group); }
+ void setGroups(const std::vector<std::string>& groups) { groups_ = groups; }
+ const std::vector<std::string>& getGroups() const { return groups_; }
+
+ void setSubscriptionRequested() { ask_ = true; }
+ bool getSubscriptionRequested() const { return ask_; }
+
+ const std::string& getUnknownContent() const { return unknownContent_; }
+ void addUnknownContent(const std::string& c) {
+ unknownContent_ += c;
+ }
+
+ private:
+ JID jid_;
+ std::string name_;
+ Subscription subscription_;
+ std::vector<std::string> groups_;
+ bool ask_;
+ std::string unknownContent_;
+ };
}
diff --git a/Swiften/Elements/RosterPayload.cpp b/Swiften/Elements/RosterPayload.cpp
index 6071cbc..d745357 100644
--- a/Swiften/Elements/RosterPayload.cpp
+++ b/Swiften/Elements/RosterPayload.cpp
@@ -1,23 +1,22 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#include <Swiften/Elements/RosterPayload.h>
-#include <Swiften/Base/foreach.h>
namespace Swift {
boost::optional<RosterItemPayload> RosterPayload::getItem(const JID& jid) const {
- foreach(const RosterItemPayload& item, items_) {
- // FIXME: MSVC rejects this. Find out why.
- //if (item.getJID() == jid) {
- if (item.getJID().equals(jid, JID::WithResource)) {
- return boost::optional<RosterItemPayload>(item);
- }
- }
- return boost::optional<RosterItemPayload>();
+ for (const auto& item : items_) {
+ // FIXME: MSVC rejects this. Find out why.
+ //if (item.getJID() == jid) {
+ if (item.getJID().equals(jid, JID::WithResource)) {
+ return boost::optional<RosterItemPayload>(item);
+ }
+ }
+ return boost::optional<RosterItemPayload>();
}
}
diff --git a/Swiften/Elements/RosterPayload.h b/Swiften/Elements/RosterPayload.h
index 47d27f2..5fc6bd1 100644
--- a/Swiften/Elements/RosterPayload.h
+++ b/Swiften/Elements/RosterPayload.h
@@ -1,49 +1,49 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
+#include <memory>
#include <vector>
+
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
-#include <Swiften/Elements/RosterItemPayload.h>
#include <Swiften/Elements/Payload.h>
-
+#include <Swiften/Elements/RosterItemPayload.h>
namespace Swift {
- class SWIFTEN_API RosterPayload : public Payload {
- public:
- typedef boost::shared_ptr<RosterPayload> ref;
- typedef std::vector<RosterItemPayload> RosterItemPayloads;
+ class SWIFTEN_API RosterPayload : public Payload {
+ public:
+ typedef std::shared_ptr<RosterPayload> ref;
+ typedef std::vector<RosterItemPayload> RosterItemPayloads;
- public:
- RosterPayload() {}
+ public:
+ RosterPayload() {}
- boost::optional<RosterItemPayload> getItem(const JID& jid) const;
+ boost::optional<RosterItemPayload> getItem(const JID& jid) const;
- void addItem(const RosterItemPayload& item) {
- items_.push_back(item);
- }
+ void addItem(const RosterItemPayload& item) {
+ items_.push_back(item);
+ }
- const RosterItemPayloads& getItems() const {
- return items_;
- }
+ const RosterItemPayloads& getItems() const {
+ return items_;
+ }
- const boost::optional<std::string>& getVersion() const {
- return version_;
- }
+ const boost::optional<std::string>& getVersion() const {
+ return version_;
+ }
- void setVersion(const std::string& version) {
- version_ = version;
- }
+ void setVersion(const std::string& version) {
+ version_ = version;
+ }
- private:
- RosterItemPayloads items_;
- boost::optional<std::string> version_;
- };
+ private:
+ RosterItemPayloads items_;
+ boost::optional<std::string> version_;
+ };
}
diff --git a/Swiften/Elements/S5BProxyRequest.h b/Swiften/Elements/S5BProxyRequest.h
index fcd0cb2..2fecae4 100644
--- a/Swiften/Elements/S5BProxyRequest.h
+++ b/Swiften/Elements/S5BProxyRequest.h
@@ -4,58 +4,66 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2015-2018 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#pragma once
#include <string>
#include <boost/optional.hpp>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
#include <Swiften/JID/JID.h>
#include <Swiften/Network/HostAddressPort.h>
namespace Swift {
-class S5BProxyRequest : public Payload {
+class SWIFTEN_API S5BProxyRequest : public Payload {
public:
- typedef boost::shared_ptr<S5BProxyRequest> ref;
+ typedef std::shared_ptr<S5BProxyRequest> ref;
public:
- struct StreamHost {
- HostAddressPort addressPort;
- JID jid;
- };
+ struct StreamHost {
+ std::string host;
+ unsigned short port;
+ JID jid;
+ };
public:
- const boost::optional<StreamHost>& getStreamHost() const {
- return streamHost;
- }
+ const boost::optional<StreamHost>& getStreamHost() const {
+ return streamHost;
+ }
- void setStreamHost(const StreamHost& streamHost) {
- this->streamHost = boost::optional<StreamHost>(streamHost);
- }
+ void setStreamHost(const StreamHost& streamHost) {
+ this->streamHost = boost::optional<StreamHost>(streamHost);
+ }
- const std::string& getSID() const {
- return sid;
- }
+ const std::string& getSID() const {
+ return sid;
+ }
- void setSID(const std::string& sid) {
- this->sid = sid;
- }
+ void setSID(const std::string& sid) {
+ this->sid = sid;
+ }
- const boost::optional<JID>& getActivate() const {
- return activate;
- }
+ const boost::optional<JID>& getActivate() const {
+ return activate;
+ }
- void setActivate(const JID& activate) {
- this->activate = activate;
- }
+ void setActivate(const JID& activate) {
+ this->activate = activate;
+ }
private:
- boost::optional<StreamHost> streamHost;
+ boost::optional<StreamHost> streamHost;
- std::string sid;
- boost::optional<JID> activate;
+ std::string sid;
+ boost::optional<JID> activate;
};
}
diff --git a/Swiften/Elements/SearchPayload.h b/Swiften/Elements/SearchPayload.h
index 202007b..0fcb2b1 100644
--- a/Swiften/Elements/SearchPayload.h
+++ b/Swiften/Elements/SearchPayload.h
@@ -1,94 +1,96 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
+#include <string>
+
#include <boost/optional.hpp>
-#include <Swiften/Elements/Payload.h>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Form.h>
-#include <string>
+#include <Swiften/Elements/Payload.h>
namespace Swift {
- /**
- * XEP-0055 search payload.
- */
- class SearchPayload : public Payload {
- public:
- typedef boost::shared_ptr<SearchPayload> ref;
-
- struct Item {
- std::string first;
- std::string last;
- std::string nick;
- std::string email;
- JID jid;
- };
-
- SearchPayload() {}
-
- Form::ref getForm() const { return form; }
- void setForm(Form::ref f) { form = f; }
-
- const boost::optional<std::string>& getInstructions() const {
- return instructions;
- }
-
- const boost::optional<std::string>& getNick() const {
- return nick;
- }
-
- const boost::optional<std::string>& getFirst() const {
- return first;
- }
-
- const boost::optional<std::string>& getLast() const {
- return last;
- }
-
- const boost::optional<std::string>& getEMail() const {
- return email;
- }
-
- void setInstructions(const std::string& v) {
- this->instructions = v;
- }
-
- void setNick(const std::string& v) {
- this->nick = v;
- }
-
- void setFirst(const std::string& v) {
- this->first = v;
- }
-
- void setLast(const std::string& v) {
- this->last = v;
- }
-
- void setEMail(const std::string& v) {
- this->email = v;
- }
-
- const std::vector<Item>& getItems() const {
- return items;
- }
-
- void addItem(const Item& item) {
- items.push_back(item);
- }
-
- private:
- Form::ref form;
- boost::optional<std::string> instructions;
- boost::optional<std::string> nick;
- boost::optional<std::string> first;
- boost::optional<std::string> last;
- boost::optional<std::string> email;
- std::vector<Item> items;
- };
+ /**
+ * XEP-0055 search payload.
+ */
+ class SWIFTEN_API SearchPayload : public Payload {
+ public:
+ typedef std::shared_ptr<SearchPayload> ref;
+
+ struct Item {
+ std::string first;
+ std::string last;
+ std::string nick;
+ std::string email;
+ JID jid;
+ };
+
+ SearchPayload() {}
+
+ Form::ref getForm() const { return form; }
+ void setForm(Form::ref f) { form = f; }
+
+ const boost::optional<std::string>& getInstructions() const {
+ return instructions;
+ }
+
+ const boost::optional<std::string>& getNick() const {
+ return nick;
+ }
+
+ const boost::optional<std::string>& getFirst() const {
+ return first;
+ }
+
+ const boost::optional<std::string>& getLast() const {
+ return last;
+ }
+
+ const boost::optional<std::string>& getEMail() const {
+ return email;
+ }
+
+ void setInstructions(const std::string& v) {
+ this->instructions = v;
+ }
+
+ void setNick(const std::string& v) {
+ this->nick = v;
+ }
+
+ void setFirst(const std::string& v) {
+ this->first = v;
+ }
+
+ void setLast(const std::string& v) {
+ this->last = v;
+ }
+
+ void setEMail(const std::string& v) {
+ this->email = v;
+ }
+
+ const std::vector<Item>& getItems() const {
+ return items;
+ }
+
+ void addItem(const Item& item) {
+ items.push_back(item);
+ }
+
+ private:
+ Form::ref form;
+ boost::optional<std::string> instructions;
+ boost::optional<std::string> nick;
+ boost::optional<std::string> first;
+ boost::optional<std::string> last;
+ boost::optional<std::string> email;
+ std::vector<Item> items;
+ };
}
diff --git a/Swiften/Elements/SecurityLabel.cpp b/Swiften/Elements/SecurityLabel.cpp
new file mode 100644
index 0000000..753c07e
--- /dev/null
+++ b/Swiften/Elements/SecurityLabel.cpp
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2010-2014 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#include <Swiften/Elements/SecurityLabel.h>
+
+using namespace Swift;
+
+SecurityLabel::SecurityLabel() {
+}
+
+SecurityLabel::~SecurityLabel() {
+}
diff --git a/Swiften/Elements/SecurityLabel.h b/Swiften/Elements/SecurityLabel.h
index a1714c8..fcaa610 100644
--- a/Swiften/Elements/SecurityLabel.h
+++ b/Swiften/Elements/SecurityLabel.h
@@ -1,61 +1,76 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2017 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
+#include <string>
#include <vector>
-#include <string>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
- class SecurityLabel : public Payload {
- public:
- typedef boost::shared_ptr<SecurityLabel> ref;
- SecurityLabel() {}
+ class SWIFTEN_API SecurityLabel : public Payload {
+ public:
+ using ref = std::shared_ptr<SecurityLabel>;
+
+ SecurityLabel();
+
+ virtual ~SecurityLabel();
+
+ const std::vector< std::string >& getEquivalentLabels() const {
+ return equivalentLabels;
+ }
+
+ void setEquivalentLabels(const std::vector< std::string >& value) {
+ this->equivalentLabels = value ;
+ }
- const std::string& getDisplayMarking() const { return displayMarking_; }
+ void addEquivalentLabel(const std::string& value) {
+ this->equivalentLabels.push_back(value);
+ }
- void setDisplayMarking(const std::string& displayMarking) {
- displayMarking_ = displayMarking;
- }
+ const std::string& getForegroundColor() const {
+ return foregroundColor;
+ }
- const std::string& getForegroundColor() const {
- return foregroundColor_;
- }
+ void setForegroundColor(const std::string& value) {
+ this->foregroundColor = value ;
+ }
- void setForegroundColor(const std::string& foregroundColor) {
- foregroundColor_ = foregroundColor;
- }
+ const std::string& getDisplayMarking() const {
+ return displayMarking;
+ }
- const std::string& getBackgroundColor() const {
- return backgroundColor_;
- }
+ void setDisplayMarking(const std::string& value) {
+ this->displayMarking = value ;
+ }
- void setBackgroundColor(const std::string& backgroundColor) {
- backgroundColor_ = backgroundColor;
- }
+ const std::string& getBackgroundColor() const {
+ return backgroundColor;
+ }
- const std::string& getLabel() const { return label_; }
+ void setBackgroundColor(const std::string& value) {
+ this->backgroundColor = value ;
+ }
- void setLabel(const std::string& label) {
- label_ = label;
- }
+ const std::string& getLabel() const {
+ return label;
+ }
- const std::vector<std::string>& getEquivalentLabels() const { return equivalentLabels_; }
+ void setLabel(const std::string& value) {
+ this->label = value ;
+ }
- void addEquivalentLabel(const std::string& label) {
- equivalentLabels_.push_back(label);
- }
- private:
- std::string displayMarking_;
- std::string foregroundColor_;
- std::string backgroundColor_;
- std::string label_;
- std::vector<std::string> equivalentLabels_;
- };
+ private:
+ std::vector< std::string > equivalentLabels;
+ std::string foregroundColor;
+ std::string displayMarking;
+ std::string backgroundColor;
+ std::string label;
+ };
}
diff --git a/Swiften/Elements/SecurityLabelsCatalog.h b/Swiften/Elements/SecurityLabelsCatalog.h
index 420cf6f..ba4d294 100644
--- a/Swiften/Elements/SecurityLabelsCatalog.h
+++ b/Swiften/Elements/SecurityLabelsCatalog.h
@@ -1,89 +1,89 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <vector>
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
+#include <vector>
#include <Swiften/Base/API.h>
-#include <Swiften/JID/JID.h>
#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/SecurityLabel.h>
+#include <Swiften/JID/JID.h>
namespace Swift {
- class SWIFTEN_API SecurityLabelsCatalog : public Payload {
- public:
- typedef boost::shared_ptr<SecurityLabelsCatalog> ref;
- class Item {
- public:
- Item() : default_(false) {}
- SecurityLabel::ref getLabel() const {
- return label_;
- }
-
- void setLabel(SecurityLabel::ref label) {
- label_ = label;
- }
-
- const std::string& getSelector() const { return selector_; }
-
- void setSelector(const std::string& selector) {
- selector_ = selector;
- }
-
- bool getIsDefault() const { return default_; }
-
- void setIsDefault(bool isDefault) {
- default_ = isDefault;
- }
- private:
- SecurityLabel::ref label_;
- std::string selector_;
- bool default_;
- };
- SecurityLabelsCatalog(const JID& to = JID()) : to_(to) {}
-
- const std::vector<Item>& getItems() const {
- return items_;
- }
-
- void addItem(const Item& item) {
- items_.push_back(item);
- }
-
- const JID& getTo() const {
- return to_;
- }
-
- void setTo(const JID& to) {
- to_ = to;
- }
-
- const std::string& getName() const {
- return name_;
- }
-
- void setName(const std::string& name) {
- name_ = name;
- }
-
- const std::string& getDescription() const {
- return description_;
- }
-
- void setDescription(const std::string& description) {
- description_ = description;
- }
-
- private:
- JID to_;
- std::string name_;
- std::string description_;
- std::vector<Item> items_;
- };
+ class SWIFTEN_API SecurityLabelsCatalog : public Payload {
+ public:
+ typedef std::shared_ptr<SecurityLabelsCatalog> ref;
+ class Item {
+ public:
+ Item() : default_(false) {}
+ std::shared_ptr<SecurityLabel> getLabel() const {
+ return label_;
+ }
+
+ void setLabel(std::shared_ptr<SecurityLabel> label) {
+ label_ = label;
+ }
+
+ const std::string& getSelector() const { return selector_; }
+
+ void setSelector(const std::string& selector) {
+ selector_ = selector;
+ }
+
+ bool getIsDefault() const { return default_; }
+
+ void setIsDefault(bool isDefault) {
+ default_ = isDefault;
+ }
+ private:
+ std::shared_ptr<SecurityLabel> label_;
+ std::string selector_;
+ bool default_;
+ };
+ SecurityLabelsCatalog(const JID& to = JID()) : to_(to) {}
+
+ const std::vector<Item>& getItems() const {
+ return items_;
+ }
+
+ void addItem(const Item& item) {
+ items_.push_back(item);
+ }
+
+ const JID& getTo() const {
+ return to_;
+ }
+
+ void setTo(const JID& to) {
+ to_ = to;
+ }
+
+ const std::string& getName() const {
+ return name_;
+ }
+
+ void setName(const std::string& name) {
+ name_ = name;
+ }
+
+ const std::string& getDescription() const {
+ return description_;
+ }
+
+ void setDescription(const std::string& description) {
+ description_ = description;
+ }
+
+ private:
+ JID to_;
+ std::string name_;
+ std::string description_;
+ std::vector<Item> items_;
+ };
}
diff --git a/Swiften/Elements/SoftwareVersion.h b/Swiften/Elements/SoftwareVersion.h
index e0eeaa3..2bf582e 100644
--- a/Swiften/Elements/SoftwareVersion.h
+++ b/Swiften/Elements/SoftwareVersion.h
@@ -1,55 +1,55 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
- class SWIFTEN_API SoftwareVersion : public Payload {
- public:
- typedef boost::shared_ptr<SoftwareVersion> ref;
-
- SoftwareVersion(
- const std::string& name = "",
- const std::string& version = "",
- const std::string& os = "") :
- name_(name), version_(version), os_(os) {}
-
- const std::string& getName() const {
- return name_;
- }
-
- void setName(const std::string& name) {
- name_ = name;
- }
-
- const std::string& getVersion() const {
- return version_;
- }
-
- void setVersion(const std::string& version) {
- version_ = version;
- }
-
- const std::string& getOS() const {
- return os_;
- }
-
- void setOS(const std::string& os) {
- os_ = os;
- }
-
- private:
- std::string name_;
- std::string version_;
- std::string os_;
- };
+ class SWIFTEN_API SoftwareVersion : public Payload {
+ public:
+ typedef std::shared_ptr<SoftwareVersion> ref;
+
+ SoftwareVersion(
+ const std::string& name = "",
+ const std::string& version = "",
+ const std::string& os = "") :
+ name_(name), version_(version), os_(os) {}
+
+ const std::string& getName() const {
+ return name_;
+ }
+
+ void setName(const std::string& name) {
+ name_ = name;
+ }
+
+ const std::string& getVersion() const {
+ return version_;
+ }
+
+ void setVersion(const std::string& version) {
+ version_ = version;
+ }
+
+ const std::string& getOS() const {
+ return os_;
+ }
+
+ void setOS(const std::string& os) {
+ os_ = os;
+ }
+
+ private:
+ std::string name_;
+ std::string version_;
+ std::string os_;
+ };
}
diff --git a/Swiften/Elements/Stanza.cpp b/Swiften/Elements/Stanza.cpp
index 23f2d89..0ff6b3c 100644
--- a/Swiften/Elements/Stanza.cpp
+++ b/Swiften/Elements/Stanza.cpp
@@ -1,57 +1,68 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#include <Swiften/Elements/Stanza.h>
-#include <Swiften/Elements/Delay.h>
#include <typeinfo>
-#include <Swiften/Base/foreach.h>
+#include <boost/bind.hpp>
+
+#include <Swiften/Elements/Delay.h>
namespace Swift {
Stanza::Stanza() {
}
-
+
Stanza::~Stanza() {
- payloads_.clear();
+ payloads_.clear();
+}
+
+void Stanza::updatePayload(std::shared_ptr<Payload> payload) {
+ for (auto&& i : payloads_) {
+ if (typeid(*i.get()) == typeid(*payload.get())) {
+ i = payload;
+ return;
+ }
+ }
+ addPayload(payload);
+}
+
+static bool sameType(std::shared_ptr<Payload> a, std::shared_ptr<Payload> b) {
+ return typeid(*a.get()) == typeid(*b.get());
}
-void Stanza::updatePayload(boost::shared_ptr<Payload> payload) {
- foreach (boost::shared_ptr<Payload>& i, payloads_) {
- if (typeid(*i.get()) == typeid(*payload.get())) {
- i = payload;
- return;
- }
- }
- addPayload(payload);
+void Stanza::removePayloadOfSameType(std::shared_ptr<Payload> payload) {
+ payloads_.erase(std::remove_if(payloads_.begin(), payloads_.end(),
+ boost::bind<bool>(&sameType, payload, _1)),
+ payloads_.end());
}
-boost::shared_ptr<Payload> Stanza::getPayloadOfSameType(boost::shared_ptr<Payload> payload) const {
- foreach (const boost::shared_ptr<Payload>& i, payloads_) {
- if (typeid(*i.get()) == typeid(*payload.get())) {
- return i;
- }
- }
- return boost::shared_ptr<Payload>();
+std::shared_ptr<Payload> Stanza::getPayloadOfSameType(std::shared_ptr<Payload> payload) const {
+ for (const auto& i : payloads_) {
+ if (typeid(*i.get()) == typeid(*payload.get())) {
+ return i;
+ }
+ }
+ return std::shared_ptr<Payload>();
}
boost::optional<boost::posix_time::ptime> Stanza::getTimestamp() const {
- boost::shared_ptr<Delay> delay = getPayload<Delay>();
- return delay ? delay->getStamp() : boost::optional<boost::posix_time::ptime>();
+ std::shared_ptr<Delay> delay = getPayload<Delay>();
+ return delay ? delay->getStamp() : boost::optional<boost::posix_time::ptime>();
}
boost::optional<boost::posix_time::ptime> Stanza::getTimestampFrom(const JID& jid) const {
- std::vector< boost::shared_ptr<Delay> > delays = getPayloads<Delay>();
- for (size_t i = 0; i < delays.size(); ++i) {
- if (delays[i]->getFrom() == jid) {
- return delays[i]->getStamp();
- }
- }
- return getTimestamp();
+ std::vector< std::shared_ptr<Delay> > delays = getPayloads<Delay>();
+ for (auto& delay : delays) {
+ if (delay->getFrom() == jid) {
+ return delay->getStamp();
+ }
+ }
+ return getTimestamp();
}
diff --git a/Swiften/Elements/Stanza.h b/Swiften/Elements/Stanza.h
index fbb0139..8b4916e 100644
--- a/Swiften/Elements/Stanza.h
+++ b/Swiften/Elements/Stanza.h
@@ -1,85 +1,101 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <vector>
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
-#include <boost/optional/optional_fwd.hpp>
+#include <vector>
+
#include <boost/date_time/posix_time/ptime.hpp>
+#include <boost/optional/optional.hpp>
#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Element.h>
+#include <Swiften/Elements/ToplevelElement.h>
#include <Swiften/JID/JID.h>
namespace Swift {
- class Payload;
-
- class SWIFTEN_API Stanza : public Element {
- public:
- typedef boost::shared_ptr<Stanza> ref;
-
- Stanza();
- virtual ~Stanza();
-
- template<typename T>
- boost::shared_ptr<T> getPayload() const {
- for (size_t i = 0; i < payloads_.size(); ++i) {
- boost::shared_ptr<T> result(boost::dynamic_pointer_cast<T>(payloads_[i]));
- if (result) {
- return result;
- }
- }
- return boost::shared_ptr<T>();
- }
-
- template<typename T>
- std::vector< boost::shared_ptr<T> > getPayloads() const {
- std::vector< boost::shared_ptr<T> > results;
- for (size_t i = 0; i < payloads_.size(); ++i) {
- boost::shared_ptr<T> result(boost::dynamic_pointer_cast<T>(payloads_[i]));
- if (result) {
- results.push_back(result);
- }
- }
- return results;
- }
-
-
- const std::vector< boost::shared_ptr<Payload> >& getPayloads() const {
- return payloads_;
- }
-
- void addPayload(boost::shared_ptr<Payload> payload) {
- payloads_.push_back(payload);
- }
-
- void updatePayload(boost::shared_ptr<Payload> payload);
-
- boost::shared_ptr<Payload> getPayloadOfSameType(boost::shared_ptr<Payload>) const;
-
- const JID& getFrom() const { return from_; }
- void setFrom(const JID& from) { from_ = from; }
-
- const JID& getTo() const { return to_; }
- void setTo(const JID& to) { to_ = to; }
-
- const std::string& getID() const { return id_; }
- void setID(const std::string& id) { id_ = id; }
-
- boost::optional<boost::posix_time::ptime> getTimestamp() const;
-
- // Falls back to any timestamp if no specific timestamp for the given JID is found.
- boost::optional<boost::posix_time::ptime> getTimestampFrom(const JID& jid) const;
-
- private:
- std::string id_;
- JID from_;
- JID to_;
- std::vector< boost::shared_ptr<Payload> > payloads_;
- };
+ class Payload;
+
+ class SWIFTEN_API Stanza : public ToplevelElement {
+ public:
+ typedef std::shared_ptr<Stanza> ref;
+
+ protected:
+ Stanza();
+
+ public:
+ virtual ~Stanza();
+ SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(Stanza)
+
+ template<typename T>
+ std::shared_ptr<T> getPayload() const {
+ for (const auto& payload : payloads_) {
+ std::shared_ptr<T> result(std::dynamic_pointer_cast<T>(payload));
+ if (result) {
+ return result;
+ }
+ }
+ return std::shared_ptr<T>();
+ }
+
+ template<typename T>
+ std::vector< std::shared_ptr<T> > getPayloads() const {
+ std::vector< std::shared_ptr<T> > results;
+ for (const auto& payload : payloads_) {
+ std::shared_ptr<T> result(std::dynamic_pointer_cast<T>(payload));
+ if (result) {
+ results.push_back(result);
+ }
+ }
+ return results;
+ }
+
+
+ const std::vector< std::shared_ptr<Payload> >& getPayloads() const {
+ return payloads_;
+ }
+
+ void addPayload(std::shared_ptr<Payload> payload) {
+ payloads_.push_back(payload);
+ }
+
+ template<typename InputIterator>
+ void addPayloads(InputIterator begin, InputIterator end) {
+ payloads_.insert(payloads_.end(), begin, end);
+ }
+
+ template<typename Container>
+ void addPayloads(const Container& container) {
+ payloads_.insert(payloads_.end(), std::begin(container), std::end(container));
+ }
+
+ void updatePayload(std::shared_ptr<Payload> payload);
+
+ void removePayloadOfSameType(std::shared_ptr<Payload>);
+ std::shared_ptr<Payload> getPayloadOfSameType(std::shared_ptr<Payload>) const;
+
+ const JID& getFrom() const { return from_; }
+ void setFrom(const JID& from) { from_ = from; }
+
+ const JID& getTo() const { return to_; }
+ void setTo(const JID& to) { to_ = to; }
+
+ const std::string& getID() const { return id_; }
+ void setID(const std::string& id) { id_ = id; }
+
+ boost::optional<boost::posix_time::ptime> getTimestamp() const;
+
+ // Falls back to any timestamp if no specific timestamp for the given JID is found.
+ boost::optional<boost::posix_time::ptime> getTimestampFrom(const JID& jid) const;
+
+ private:
+ std::string id_;
+ JID from_;
+ JID to_;
+ std::vector< std::shared_ptr<Payload> > payloads_;
+ };
}
diff --git a/Swiften/Elements/StanzaAck.cpp b/Swiften/Elements/StanzaAck.cpp
index 5bcab73..dda97f5 100644
--- a/Swiften/Elements/StanzaAck.cpp
+++ b/Swiften/Elements/StanzaAck.cpp
@@ -1,19 +1,17 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2013-2018 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#include <Swiften/Elements/StanzaAck.h>
-#include <boost/numeric/conversion/cast.hpp>
-
using namespace Swift;
StanzaAck::~StanzaAck() {
}
-void StanzaAck::setHandledStanzasCount(int i) {
- handledStanzasCount = boost::numeric_cast<unsigned int>(i);
- valid = true;
+void StanzaAck::setHandledStanzasCount(unsigned int i) {
+ handledStanzasCount = i;
+ valid = true;
}
diff --git a/Swiften/Elements/StanzaAck.h b/Swiften/Elements/StanzaAck.h
index 8fe64e0..f664aca 100644
--- a/Swiften/Elements/StanzaAck.h
+++ b/Swiften/Elements/StanzaAck.h
@@ -1,36 +1,37 @@
/*
- * Copyright (c) 2010-2013 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2018 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
-#include <Swiften/Elements/Element.h>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/ToplevelElement.h>
namespace Swift {
- class StanzaAck : public Element {
- public:
- typedef boost::shared_ptr<StanzaAck> ref;
+ class SWIFTEN_API StanzaAck : public ToplevelElement {
+ public:
+ typedef std::shared_ptr<StanzaAck> ref;
- StanzaAck() : valid(false), handledStanzasCount(0) {}
- StanzaAck(unsigned int handledStanzasCount) : valid(true), handledStanzasCount(handledStanzasCount) {}
- virtual ~StanzaAck();
+ StanzaAck() : valid(false), handledStanzasCount(0) {}
+ StanzaAck(unsigned int handledStanzasCount) : valid(true), handledStanzasCount(handledStanzasCount) {}
+ virtual ~StanzaAck();
- unsigned int getHandledStanzasCount() const {
- return handledStanzasCount;
- }
+ unsigned int getHandledStanzasCount() const {
+ return handledStanzasCount;
+ }
- void setHandledStanzasCount(int i);
+ void setHandledStanzasCount(unsigned int i);
- bool isValid() const {
- return valid;
- }
+ bool isValid() const {
+ return valid;
+ }
- private:
- bool valid;
- unsigned int handledStanzasCount;
- };
+ private:
+ bool valid;
+ unsigned int handledStanzasCount;
+ };
}
diff --git a/Swiften/Elements/StanzaAckRequest.h b/Swiften/Elements/StanzaAckRequest.h
index 81b3871..e9b95b5 100644
--- a/Swiften/Elements/StanzaAckRequest.h
+++ b/Swiften/Elements/StanzaAckRequest.h
@@ -1,15 +1,15 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Elements/Element.h>
-
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/ToplevelElement.h>
namespace Swift {
- class StanzaAckRequest : public Element {
- };
+ class SWIFTEN_API StanzaAckRequest : public ToplevelElement {
+ };
}
diff --git a/Swiften/Elements/StartSession.h b/Swiften/Elements/StartSession.h
index 7aeb611..a40865e 100644
--- a/Swiften/Elements/StartSession.h
+++ b/Swiften/Elements/StartSession.h
@@ -1,17 +1,19 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
#include <string>
+
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
- class StartSession : public Payload {
- public:
- StartSession() {}
- };
+ class SWIFTEN_API StartSession : public Payload {
+ public:
+ StartSession() {}
+ };
}
diff --git a/Swiften/Elements/StartTLSFailure.h b/Swiften/Elements/StartTLSFailure.h
index 5e233fb..5867e3f 100644
--- a/Swiften/Elements/StartTLSFailure.h
+++ b/Swiften/Elements/StartTLSFailure.h
@@ -1,16 +1,17 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Elements/Element.h>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/ToplevelElement.h>
namespace Swift {
- class StartTLSFailure : public Element {
- public:
- StartTLSFailure() {}
- };
+ class SWIFTEN_API StartTLSFailure : public ToplevelElement {
+ public:
+ StartTLSFailure() {}
+ };
}
diff --git a/Swiften/Elements/StartTLSRequest.h b/Swiften/Elements/StartTLSRequest.h
index e284f75..f47a21d 100644
--- a/Swiften/Elements/StartTLSRequest.h
+++ b/Swiften/Elements/StartTLSRequest.h
@@ -1,16 +1,17 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Elements/Element.h>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/ToplevelElement.h>
namespace Swift {
- class StartTLSRequest : public Element {
- public:
- StartTLSRequest() {}
- };
+ class SWIFTEN_API StartTLSRequest : public ToplevelElement {
+ public:
+ StartTLSRequest() {}
+ };
}
diff --git a/Swiften/Elements/Status.h b/Swiften/Elements/Status.h
index 956f33d..2fd2eff 100644
--- a/Swiften/Elements/Status.h
+++ b/Swiften/Elements/Status.h
@@ -1,29 +1,31 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Elements/Payload.h>
#include <string>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
+
namespace Swift {
- class Status : public Payload {
- public:
- Status(const std::string& text = "") : text_(text) {
- }
+ class SWIFTEN_API Status : public Payload {
+ public:
+ Status(const std::string& text = "") : text_(text) {
+ }
- void setText(const std::string& text) {
- text_ = text;
- }
+ void setText(const std::string& text) {
+ text_ = text;
+ }
- const std::string& getText() const {
- return text_;
- }
+ const std::string& getText() const {
+ return text_;
+ }
- private:
- std::string text_;
- };
+ private:
+ std::string text_;
+ };
}
diff --git a/Swiften/Elements/StatusShow.cpp b/Swiften/Elements/StatusShow.cpp
index 656e5c4..633816e 100644
--- a/Swiften/Elements/StatusShow.cpp
+++ b/Swiften/Elements/StatusShow.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#include <Swiften/Elements/StatusShow.h>
diff --git a/Swiften/Elements/StatusShow.h b/Swiften/Elements/StatusShow.h
index afa30de..b339fa1 100644
--- a/Swiften/Elements/StatusShow.h
+++ b/Swiften/Elements/StatusShow.h
@@ -1,48 +1,49 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
+#include <cassert>
+
#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
-#include <cassert>
namespace Swift {
- class SWIFTEN_API StatusShow : public Payload {
- public:
- enum Type { Online, Away, FFC, XA, DND, None };
-
- StatusShow(const Type& type = Online);
-
- void setType(const Type& type) {
- type_ = type;
- }
-
- const Type& getType() const {
- return type_;
- }
-
- /**
- * Can be used for rough ordering of Types.
- * Greater magnitude = more available.
- */
- static int typeToAvailabilityOrdering(Type type) {
- switch (type) {
- case Online: return 4;
- case FFC: return 5;
- case Away: return 2;
- case XA: return 1;
- case DND: return 3;
- case None: return 0;
- }
- assert(false);
- return 0;
- }
-
- private:
- Type type_;
- };
+ class SWIFTEN_API StatusShow : public Payload {
+ public:
+ enum Type { Online, Away, FFC, XA, DND, None };
+
+ StatusShow(const Type& type = Online);
+
+ void setType(const Type& type) {
+ type_ = type;
+ }
+
+ const Type& getType() const {
+ return type_;
+ }
+
+ /**
+ * Can be used for rough ordering of Types.
+ * Greater magnitude = more available.
+ */
+ static int typeToAvailabilityOrdering(Type type) {
+ switch (type) {
+ case Online: return 4;
+ case FFC: return 5;
+ case Away: return 2;
+ case XA: return 1;
+ case DND: return 3;
+ case None: return 0;
+ }
+ assert(false);
+ return 0;
+ }
+
+ private:
+ Type type_;
+ };
}
diff --git a/Swiften/Elements/Storage.h b/Swiften/Elements/Storage.h
index 03c958c..87cfb39 100644
--- a/Swiften/Elements/Storage.h
+++ b/Swiften/Elements/Storage.h
@@ -1,66 +1,67 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
+#include <string>
#include <vector>
#include <boost/optional.hpp>
+#include <Swiften/Base/API.h>
+#include <Swiften/Base/SafeString.h>
#include <Swiften/Elements/Payload.h>
-#include <string>
#include <Swiften/JID/JID.h>
-#include <Swiften/Base/SafeString.h>
namespace Swift {
- class Storage : public Payload {
- public:
- struct Room {
- Room() : autoJoin(false) {}
-
- std::string name;
- JID jid;
- bool autoJoin;
- std::string nick;
- boost::optional<std::string> password;
- };
-
- struct URL {
- URL() {}
-
- std::string name;
- std::string url;
- };
-
- Storage() {
- }
-
-
- void clearRooms() {
- rooms.clear();
- }
-
- const std::vector<Room>& getRooms() const {
- return rooms;
- }
-
- void addRoom(const Room& room) {
- rooms.push_back(room);
- }
-
- const std::vector<URL>& getURLs() const {
- return urls;
- }
-
- void addURL(const URL& url) {
- urls.push_back(url);
- }
-
- private:
- std::vector<Room> rooms;
- std::vector<URL> urls;
- };
+ class SWIFTEN_API Storage : public Payload {
+ public:
+ struct Room {
+ Room() : autoJoin(false) {}
+
+ std::string name;
+ JID jid;
+ bool autoJoin;
+ std::string nick;
+ boost::optional<std::string> password;
+ };
+
+ struct URL {
+ URL() {}
+
+ std::string name;
+ std::string url;
+ };
+
+ Storage() {
+ }
+
+
+ void clearRooms() {
+ rooms.clear();
+ }
+
+ const std::vector<Room>& getRooms() const {
+ return rooms;
+ }
+
+ void addRoom(const Room& room) {
+ rooms.push_back(room);
+ }
+
+ const std::vector<URL>& getURLs() const {
+ return urls;
+ }
+
+ void addURL(const URL& url) {
+ urls.push_back(url);
+ }
+
+ private:
+ std::vector<Room> rooms;
+ std::vector<URL> urls;
+ };
}
diff --git a/Swiften/Elements/StreamError.h b/Swiften/Elements/StreamError.h
index a58d3ae..6dda15c 100644
--- a/Swiften/Elements/StreamError.h
+++ b/Swiften/Elements/StreamError.h
@@ -1,69 +1,70 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
-
-#include <Swiften/Elements/Element.h>
+#include <memory>
#include <string>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/ToplevelElement.h>
+
namespace Swift {
- class StreamError : public Element {
- public:
- typedef boost::shared_ptr<StreamError> ref;
+ class SWIFTEN_API StreamError : public ToplevelElement {
+ public:
+ typedef std::shared_ptr<StreamError> ref;
- enum Type {
- BadFormat,
- BadNamespacePrefix,
- Conflict,
- ConnectionTimeout,
- HostGone,
- HostUnknown,
- ImproperAddressing,
- InternalServerError,
- InvalidFrom,
- InvalidID,
- InvalidNamespace,
- InvalidXML,
- NotAuthorized,
- NotWellFormed,
- PolicyViolation,
- RemoteConnectionFailed,
- Reset,
- ResourceConstraint,
- RestrictedXML,
- SeeOtherHost,
- SystemShutdown,
- UndefinedCondition,
- UnsupportedEncoding,
- UnsupportedStanzaType,
- UnsupportedVersion
- };
+ enum Type {
+ BadFormat,
+ BadNamespacePrefix,
+ Conflict,
+ ConnectionTimeout,
+ HostGone,
+ HostUnknown,
+ ImproperAddressing,
+ InternalServerError,
+ InvalidFrom,
+ InvalidNamespace,
+ InvalidXML,
+ NotAuthorized,
+ NotWellFormed,
+ PolicyViolation,
+ RemoteConnectionFailed,
+ Reset,
+ ResourceConstraint,
+ RestrictedXML,
+ SeeOtherHost,
+ SystemShutdown,
+ UndefinedCondition,
+ UnsupportedEncoding,
+ UnsupportedFeature,
+ UnsupportedStanzaType,
+ UnsupportedVersion
+ };
- StreamError(Type type = UndefinedCondition, const std::string& text = std::string()) : type_(type), text_(text) { }
+ StreamError(Type type = UndefinedCondition, const std::string& text = std::string()) : type_(type), text_(text) { }
- Type getType() const {
- return type_;
- }
+ Type getType() const {
+ return type_;
+ }
- void setType(Type type) {
- type_ = type;
- }
+ void setType(Type type) {
+ type_ = type;
+ }
- void setText(const std::string& text) {
- text_ = text;
- }
+ void setText(const std::string& text) {
+ text_ = text;
+ }
- const std::string& getText() const {
- return text_;
- }
+ const std::string& getText() const {
+ return text_;
+ }
- private:
- Type type_;
- std::string text_;
- };
+ private:
+ Type type_;
+ std::string text_;
+ };
}
diff --git a/Swiften/Elements/StreamFeatures.cpp b/Swiften/Elements/StreamFeatures.cpp
index c6f6c04..77bafac 100644
--- a/Swiften/Elements/StreamFeatures.cpp
+++ b/Swiften/Elements/StreamFeatures.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#include <Swiften/Elements/StreamFeatures.h>
@@ -11,11 +11,11 @@
namespace Swift {
bool StreamFeatures::hasCompressionMethod(const std::string& mechanism) const {
- return std::find(compressionMethods_.begin(), compressionMethods_.end(), mechanism) != compressionMethods_.end();
+ return std::find(compressionMethods_.begin(), compressionMethods_.end(), mechanism) != compressionMethods_.end();
}
bool StreamFeatures::hasAuthenticationMechanism(const std::string& mechanism) const {
- return std::find(authenticationMechanisms_.begin(), authenticationMechanisms_.end(), mechanism) != authenticationMechanisms_.end();
+ return std::find(authenticationMechanisms_.begin(), authenticationMechanisms_.end(), mechanism) != authenticationMechanisms_.end();
}
}
diff --git a/Swiften/Elements/StreamFeatures.h b/Swiften/Elements/StreamFeatures.h
index 5e7b6c9..5832a24 100644
--- a/Swiften/Elements/StreamFeatures.h
+++ b/Swiften/Elements/StreamFeatures.h
@@ -1,96 +1,107 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <vector>
+#include <memory>
#include <string>
-#include <boost/shared_ptr.hpp>
+#include <vector>
+
+#include <boost/optional.hpp>
#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Element.h>
+#include <Swiften/Elements/ToplevelElement.h>
namespace Swift {
- class SWIFTEN_API StreamFeatures : public Element {
- public:
- typedef boost::shared_ptr<StreamFeatures> ref;
-
- StreamFeatures() : hasStartTLS_(false), hasResourceBind_(false), hasSession_(false), hasStreamManagement_(false), hasRosterVersioning_(false) {}
-
- void setHasStartTLS() {
- hasStartTLS_ = true;
- }
-
- bool hasStartTLS() const {
- return hasStartTLS_;
- }
-
- void setHasSession() {
- hasSession_ = true;
- }
-
- bool hasSession() const {
- return hasSession_;
- }
-
- void setHasResourceBind() {
- hasResourceBind_ = true;
- }
-
- bool hasResourceBind() const {
- return hasResourceBind_;
- }
-
- const std::vector<std::string>& getCompressionMethods() const {
- return compressionMethods_;
- }
-
- void addCompressionMethod(const std::string& mechanism) {
- compressionMethods_.push_back(mechanism);
- }
-
- bool hasCompressionMethod(const std::string& mechanism) const;
-
- const std::vector<std::string>& getAuthenticationMechanisms() const {
- return authenticationMechanisms_;
- }
-
- void addAuthenticationMechanism(const std::string& mechanism) {
- authenticationMechanisms_.push_back(mechanism);
- }
-
- bool hasAuthenticationMechanism(const std::string& mechanism) const;
-
- bool hasAuthenticationMechanisms() const {
- return !authenticationMechanisms_.empty();
- }
-
- bool hasStreamManagement() const {
- return hasStreamManagement_;
- }
-
- void setHasStreamManagement() {
- hasStreamManagement_ = true;
- }
-
- bool hasRosterVersioning() const {
- return hasRosterVersioning_;
- }
-
- void setHasRosterVersioning() {
- hasRosterVersioning_ = true;
- }
-
- private:
- bool hasStartTLS_;
- std::vector<std::string> compressionMethods_;
- std::vector<std::string> authenticationMechanisms_;
- bool hasResourceBind_;
- bool hasSession_;
- bool hasStreamManagement_;
- bool hasRosterVersioning_;
- };
+ class SWIFTEN_API StreamFeatures : public ToplevelElement {
+ public:
+ typedef std::shared_ptr<StreamFeatures> ref;
+
+ StreamFeatures() : hasStartTLS_(false), hasResourceBind_(false), hasSession_(false), hasStreamManagement_(false), hasRosterVersioning_(false) {}
+
+ void setHasStartTLS() {
+ hasStartTLS_ = true;
+ }
+
+ bool hasStartTLS() const {
+ return hasStartTLS_;
+ }
+
+ void setHasSession() {
+ hasSession_ = true;
+ }
+
+ bool hasSession() const {
+ return hasSession_;
+ }
+
+ void setHasResourceBind() {
+ hasResourceBind_ = true;
+ }
+
+ bool hasResourceBind() const {
+ return hasResourceBind_;
+ }
+
+ const std::vector<std::string>& getCompressionMethods() const {
+ return compressionMethods_;
+ }
+
+ void addCompressionMethod(const std::string& mechanism) {
+ compressionMethods_.push_back(mechanism);
+ }
+
+ bool hasCompressionMethod(const std::string& mechanism) const;
+
+ const std::vector<std::string>& getAuthenticationMechanisms() const {
+ return authenticationMechanisms_;
+ }
+
+ void addAuthenticationMechanism(const std::string& mechanism) {
+ authenticationMechanisms_.push_back(mechanism);
+ }
+
+ bool hasAuthenticationMechanism(const std::string& mechanism) const;
+
+ bool hasAuthenticationMechanisms() const {
+ return !authenticationMechanisms_.empty();
+ }
+
+ const boost::optional<std::string> getAuthenticationHostname() const {
+ return authenticationHostname_;
+ }
+
+ void setAuthenticationHostname(const boost::optional<std::string> authenticationHostname) {
+ authenticationHostname_ = authenticationHostname;
+ }
+
+ bool hasStreamManagement() const {
+ return hasStreamManagement_;
+ }
+
+ void setHasStreamManagement() {
+ hasStreamManagement_ = true;
+ }
+
+ bool hasRosterVersioning() const {
+ return hasRosterVersioning_;
+ }
+
+ void setHasRosterVersioning() {
+ hasRosterVersioning_ = true;
+ }
+
+ private:
+ bool hasStartTLS_;
+ std::vector<std::string> compressionMethods_;
+ std::vector<std::string> authenticationMechanisms_;
+ bool hasResourceBind_;
+ bool hasSession_;
+ bool hasStreamManagement_;
+ bool hasRosterVersioning_;
+ boost::optional<std::string> authenticationHostname_;
+ };
}
diff --git a/Swiften/Elements/StreamInitiation.h b/Swiften/Elements/StreamInitiation.h
index c1f0b4d..2bb9a0e 100644
--- a/Swiften/Elements/StreamInitiation.h
+++ b/Swiften/Elements/StreamInitiation.h
@@ -1,71 +1,73 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
+#include <memory>
+#include <string>
#include <vector>
+
#include <boost/optional.hpp>
-#include <boost/shared_ptr.hpp>
-#include <string>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/StreamInitiationFileInfo.h>
namespace Swift {
- class StreamInitiation : public Payload {
- public:
- typedef boost::shared_ptr<StreamInitiation> ref;
-
- StreamInitiation() : isFileTransfer(true) {}
-
- const std::string& getID() const {
- return id;
- }
-
- void setID(const std::string& id) {
- this->id = id;
- }
-
- const boost::optional<StreamInitiationFileInfo>& getFileInfo() const {
- return fileInfo;
- }
-
- void setFileInfo(const StreamInitiationFileInfo& info) {
- fileInfo = info;
- }
-
- const std::vector<std::string>& getProvidedMethods() const {
- return providedMethods;
- }
-
- void addProvidedMethod(const std::string& method) {
- providedMethods.push_back(method);
- }
-
- void setRequestedMethod(const std::string& method) {
- requestedMethod = method;
- }
-
- const std::string& getRequestedMethod() const {
- return requestedMethod;
- }
-
- bool getIsFileTransfer() const {
- return isFileTransfer;
- }
-
- void setIsFileTransfer(bool b) {
- isFileTransfer = b;
- }
-
- private:
- bool isFileTransfer;
- std::string id;
- boost::optional<StreamInitiationFileInfo> fileInfo;
- std::vector<std::string> providedMethods;
- std::string requestedMethod;
- };
+ class SWIFTEN_API StreamInitiation : public Payload {
+ public:
+ typedef std::shared_ptr<StreamInitiation> ref;
+
+ StreamInitiation() : isFileTransfer(true) {}
+
+ const std::string& getID() const {
+ return id;
+ }
+
+ void setID(const std::string& id) {
+ this->id = id;
+ }
+
+ const boost::optional<StreamInitiationFileInfo>& getFileInfo() const {
+ return fileInfo;
+ }
+
+ void setFileInfo(const StreamInitiationFileInfo& info) {
+ fileInfo = info;
+ }
+
+ const std::vector<std::string>& getProvidedMethods() const {
+ return providedMethods;
+ }
+
+ void addProvidedMethod(const std::string& method) {
+ providedMethods.push_back(method);
+ }
+
+ void setRequestedMethod(const std::string& method) {
+ requestedMethod = method;
+ }
+
+ const std::string& getRequestedMethod() const {
+ return requestedMethod;
+ }
+
+ bool getIsFileTransfer() const {
+ return isFileTransfer;
+ }
+
+ void setIsFileTransfer(bool b) {
+ isFileTransfer = b;
+ }
+
+ private:
+ bool isFileTransfer;
+ std::string id;
+ boost::optional<StreamInitiationFileInfo> fileInfo;
+ std::vector<std::string> providedMethods;
+ std::string requestedMethod;
+ };
}
diff --git a/Swiften/Elements/StreamInitiationFileInfo.h b/Swiften/Elements/StreamInitiationFileInfo.h
index d7907b9..773814f 100644
--- a/Swiften/Elements/StreamInitiationFileInfo.h
+++ b/Swiften/Elements/StreamInitiationFileInfo.h
@@ -1,102 +1,104 @@
/*
- * Copyright (c) 2011-2013 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2011-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Elements/Payload.h>
-#include <boost/shared_ptr.hpp>
+#include <memory>
+#include <string>
+
#include <boost/date_time/posix_time/posix_time_types.hpp>
-#include <string>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
namespace Swift {
-class StreamInitiationFileInfo : public Payload {
+class SWIFTEN_API StreamInitiationFileInfo : public Payload {
public:
- typedef boost::shared_ptr<StreamInitiationFileInfo> ref;
-
+ typedef std::shared_ptr<StreamInitiationFileInfo> ref;
+
public:
- StreamInitiationFileInfo(const std::string& name = "", const std::string& description = "", unsigned long long size = 0,
- const std::string& hash = "", const boost::posix_time::ptime &date = boost::posix_time::ptime(), const std::string& algo="md5") :
- name(name), description(description), size(size), hash(hash), date(date), algo(algo), supportsRangeRequests(false), rangeOffset(0) {}
-
- void setName(const std::string& name) {
- this->name = name;;
- }
-
- const std::string& getName() const {
- return this->name;
- }
-
- void setDescription(const std::string& description) {
- this->description = description;
- }
-
- const std::string& getDescription() const {
- return this->description;
- }
-
- void setSize(const unsigned long long size) {
- this->size = size;
- }
-
- unsigned long long getSize() const {
- return this->size;
- }
-
- void setHash(const std::string& hash) {
- this->hash = hash;
- }
-
- const std::string& getHash() const {
- return this->hash;
- }
-
- void setDate(const boost::posix_time::ptime& date) {
- this->date = date;
- }
-
- const boost::posix_time::ptime& getDate() const {
- return this->date;
- }
-
- void setAlgo(const std::string& algo) {
- this->algo = algo;
- }
-
- const std::string& getAlgo() const {
- return this->algo;
- }
-
- void setSupportsRangeRequests(const bool supportsIt) {
- supportsRangeRequests = supportsIt;
- }
-
- bool getSupportsRangeRequests() const {
- return supportsRangeRequests;
- }
-
- void setRangeOffset(unsigned long long offset) {
- supportsRangeRequests = true;
- rangeOffset = offset;
- }
-
- unsigned long long getRangeOffset() const {
- return rangeOffset;
- }
+ StreamInitiationFileInfo(const std::string& name = "", const std::string& description = "", unsigned long long size = 0,
+ const std::string& hash = "", const boost::posix_time::ptime &date = boost::posix_time::ptime(), const std::string& algo="md5") :
+ name(name), description(description), size(size), hash(hash), date(date), algo(algo), supportsRangeRequests(false), rangeOffset(0) {}
+
+ void setName(const std::string& name) {
+ this->name = name;
+ }
+
+ const std::string& getName() const {
+ return this->name;
+ }
+
+ void setDescription(const std::string& description) {
+ this->description = description;
+ }
+
+ const std::string& getDescription() const {
+ return this->description;
+ }
+
+ void setSize(const unsigned long long size) {
+ this->size = size;
+ }
+
+ unsigned long long getSize() const {
+ return this->size;
+ }
+
+ void setHash(const std::string& hash) {
+ this->hash = hash;
+ }
+
+ const std::string& getHash() const {
+ return this->hash;
+ }
+
+ void setDate(const boost::posix_time::ptime& date) {
+ this->date = date;
+ }
+
+ const boost::posix_time::ptime& getDate() const {
+ return this->date;
+ }
+
+ void setAlgo(const std::string& algo) {
+ this->algo = algo;
+ }
+
+ const std::string& getAlgo() const {
+ return this->algo;
+ }
+
+ void setSupportsRangeRequests(const bool supportsIt) {
+ supportsRangeRequests = supportsIt;
+ }
+
+ bool getSupportsRangeRequests() const {
+ return supportsRangeRequests;
+ }
+
+ void setRangeOffset(unsigned long long offset) {
+ supportsRangeRequests = true;
+ rangeOffset = offset;
+ }
+
+ unsigned long long getRangeOffset() const {
+ return rangeOffset;
+ }
private:
- std::string name;
- std::string description;
- unsigned long long size;
- std::string hash;
- boost::posix_time::ptime date;
- std::string algo;
- bool supportsRangeRequests;
- unsigned long long rangeOffset;
+ std::string name;
+ std::string description;
+ unsigned long long size;
+ std::string hash;
+ boost::posix_time::ptime date;
+ std::string algo;
+ bool supportsRangeRequests;
+ unsigned long long rangeOffset;
};
}
diff --git a/Swiften/Elements/StreamManagementEnabled.cpp b/Swiften/Elements/StreamManagementEnabled.cpp
index bab7516..8dacdab 100644
--- a/Swiften/Elements/StreamManagementEnabled.cpp
+++ b/Swiften/Elements/StreamManagementEnabled.cpp
@@ -1,14 +1,14 @@
/*
- * Copyright (c) 2011 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2011-2014 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#include <Swiften/Elements/StreamManagementEnabled.h>
using namespace Swift;
-StreamManagementEnabled::StreamManagementEnabled() {
+StreamManagementEnabled::StreamManagementEnabled() : resumeSupported(false) {
}
StreamManagementEnabled::~StreamManagementEnabled() {
diff --git a/Swiften/Elements/StreamManagementEnabled.h b/Swiften/Elements/StreamManagementEnabled.h
index 0985574..7cb640d 100644
--- a/Swiften/Elements/StreamManagementEnabled.h
+++ b/Swiften/Elements/StreamManagementEnabled.h
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2010-2011 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2014 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
@@ -9,32 +9,32 @@
#include <string>
#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Element.h>
+#include <Swiften/Elements/ToplevelElement.h>
namespace Swift {
- class SWIFTEN_API StreamManagementEnabled : public Element {
- public:
- StreamManagementEnabled();
- ~StreamManagementEnabled();
-
- void setResumeSupported() {
- resumeSupported = true;
- }
-
- bool getResumeSupported() const {
- return resumeSupported;
- }
-
- void setResumeID(const std::string& id) {
- resumeID = id;
- }
-
- const std::string& getResumeID() const {
- return resumeID;
- }
-
- private:
- bool resumeSupported;
- std::string resumeID;
- };
+ class SWIFTEN_API StreamManagementEnabled : public ToplevelElement {
+ public:
+ StreamManagementEnabled();
+ ~StreamManagementEnabled();
+
+ void setResumeSupported() {
+ resumeSupported = true;
+ }
+
+ bool getResumeSupported() const {
+ return resumeSupported;
+ }
+
+ void setResumeID(const std::string& id) {
+ resumeID = id;
+ }
+
+ const std::string& getResumeID() const {
+ return resumeID;
+ }
+
+ private:
+ bool resumeSupported;
+ std::string resumeID;
+ };
}
diff --git a/Swiften/Elements/StreamManagementFailed.h b/Swiften/Elements/StreamManagementFailed.h
index 7c6d1b7..062d9bd 100644
--- a/Swiften/Elements/StreamManagementFailed.h
+++ b/Swiften/Elements/StreamManagementFailed.h
@@ -1,17 +1,17 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Elements/Element.h>
-
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/ToplevelElement.h>
namespace Swift {
- class StreamManagementFailed : public Element {
- public:
- StreamManagementFailed() {}
- };
+ class SWIFTEN_API StreamManagementFailed : public ToplevelElement {
+ public:
+ StreamManagementFailed() {}
+ };
}
diff --git a/Swiften/Elements/StreamResume.cpp b/Swiften/Elements/StreamResume.cpp
index d55ef78..6fdc83b 100644
--- a/Swiften/Elements/StreamResume.cpp
+++ b/Swiften/Elements/StreamResume.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2011 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2011 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#include <Swiften/Elements/StreamResume.h>
diff --git a/Swiften/Elements/StreamResume.h b/Swiften/Elements/StreamResume.h
index aec0909..0ded077 100644
--- a/Swiften/Elements/StreamResume.h
+++ b/Swiften/Elements/StreamResume.h
@@ -1,40 +1,42 @@
/*
- * Copyright (c) 2011 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2011-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
#include <string>
+
#include <boost/optional.hpp>
-#include <Swiften/Elements/Element.h>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/ToplevelElement.h>
namespace Swift {
- class StreamResume : public Element {
- public:
- StreamResume();
- ~StreamResume();
-
- void setResumeID(const std::string& id) {
- resumeID = id;
- }
-
- const std::string& getResumeID() const {
- return resumeID;
- }
-
- const boost::optional<unsigned int> getHandledStanzasCount() const {
- return handledStanzasCount;
- }
-
- void setHandledStanzasCount(unsigned int i) {
- handledStanzasCount = i;
- }
-
- private:
- std::string resumeID;
- boost::optional<unsigned int> handledStanzasCount;
- };
+ class SWIFTEN_API StreamResume : public ToplevelElement {
+ public:
+ StreamResume();
+ ~StreamResume();
+
+ void setResumeID(const std::string& id) {
+ resumeID = id;
+ }
+
+ const std::string& getResumeID() const {
+ return resumeID;
+ }
+
+ const boost::optional<unsigned int> getHandledStanzasCount() const {
+ return handledStanzasCount;
+ }
+
+ void setHandledStanzasCount(unsigned int i) {
+ handledStanzasCount = i;
+ }
+
+ private:
+ std::string resumeID;
+ boost::optional<unsigned int> handledStanzasCount;
+ };
}
diff --git a/Swiften/Elements/StreamResumed.cpp b/Swiften/Elements/StreamResumed.cpp
index 552e654..a5b7ec4 100644
--- a/Swiften/Elements/StreamResumed.cpp
+++ b/Swiften/Elements/StreamResumed.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2011 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2011 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#include <Swiften/Elements/StreamResumed.h>
diff --git a/Swiften/Elements/StreamResumed.h b/Swiften/Elements/StreamResumed.h
index cf9a755..e1c80d9 100644
--- a/Swiften/Elements/StreamResumed.h
+++ b/Swiften/Elements/StreamResumed.h
@@ -1,40 +1,42 @@
/*
- * Copyright (c) 2011 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2011-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
#include <string>
+
#include <boost/optional.hpp>
-#include <Swiften/Elements/Element.h>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/ToplevelElement.h>
namespace Swift {
- class StreamResumed : public Element {
- public:
- StreamResumed();
- ~StreamResumed();
-
- void setResumeID(const std::string& id) {
- resumeID = id;
- }
-
- const std::string& getResumeID() const {
- return resumeID;
- }
-
- const boost::optional<unsigned int> getHandledStanzasCount() const {
- return handledStanzasCount;
- }
-
- void setHandledStanzasCount(unsigned int i) {
- handledStanzasCount = i;
- }
-
- private:
- std::string resumeID;
- boost::optional<unsigned int> handledStanzasCount;
- };
+ class SWIFTEN_API StreamResumed : public ToplevelElement {
+ public:
+ StreamResumed();
+ ~StreamResumed();
+
+ void setResumeID(const std::string& id) {
+ resumeID = id;
+ }
+
+ const std::string& getResumeID() const {
+ return resumeID;
+ }
+
+ const boost::optional<unsigned int> getHandledStanzasCount() const {
+ return handledStanzasCount;
+ }
+
+ void setHandledStanzasCount(unsigned int i) {
+ handledStanzasCount = i;
+ }
+
+ private:
+ std::string resumeID;
+ boost::optional<unsigned int> handledStanzasCount;
+ };
}
diff --git a/Swiften/Elements/StreamType.h b/Swiften/Elements/StreamType.h
index 7ca9ed5..d6b820e 100644
--- a/Swiften/Elements/StreamType.h
+++ b/Swiften/Elements/StreamType.h
@@ -1,15 +1,15 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
namespace Swift {
- enum StreamType {
- ClientStreamType,
- ServerStreamType,
- ComponentStreamType
- };
+ enum StreamType {
+ ClientStreamType,
+ ServerStreamType,
+ ComponentStreamType
+ };
}
diff --git a/Swiften/Elements/Subject.h b/Swiften/Elements/Subject.h
index bc757af..4f9444a 100644
--- a/Swiften/Elements/Subject.h
+++ b/Swiften/Elements/Subject.h
@@ -1,29 +1,31 @@
/*
- * Copyright (c) 2010 Kevin Smith
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Elements/Payload.h>
#include <string>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
+
namespace Swift {
- class Subject : public Payload {
- public:
- Subject(const std::string& text = "") : text_(text) {
- }
+ class SWIFTEN_API Subject : public Payload {
+ public:
+ Subject(const std::string& text = "") : text_(text) {
+ }
- void setText(const std::string& text) {
- text_ = text;
- }
+ void setText(const std::string& text) {
+ text_ = text;
+ }
- const std::string& getText() const {
- return text_;
- }
+ const std::string& getText() const {
+ return text_;
+ }
- private:
- std::string text_;
- };
+ private:
+ std::string text_;
+ };
}
diff --git a/Swiften/Elements/TLSProceed.h b/Swiften/Elements/TLSProceed.h
index 4bd790a..3cd5360 100644
--- a/Swiften/Elements/TLSProceed.h
+++ b/Swiften/Elements/TLSProceed.h
@@ -1,16 +1,17 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Elements/Element.h>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/ToplevelElement.h>
namespace Swift {
- class TLSProceed : public Element {
- public:
- TLSProceed() {}
- };
+ class SWIFTEN_API TLSProceed : public ToplevelElement {
+ public:
+ TLSProceed() {}
+ };
}
diff --git a/Swiften/Elements/Thread.cpp b/Swiften/Elements/Thread.cpp
new file mode 100644
index 0000000..5ac371b
--- /dev/null
+++ b/Swiften/Elements/Thread.cpp
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#include <Swiften/Elements/Thread.h>
+
+namespace Swift {
+
+ Thread::Thread(const std::string& text, const std::string& parent) : text_(text), parent_(parent) {
+
+ }
+
+ Thread::~Thread() {
+
+ }
+
+ void Thread::setText(const std::string& text) {
+ text_ = text;
+ }
+
+ const std::string& Thread::getText() const {
+ return text_;
+ }
+
+ void Thread::setParent(const std::string& parent) {
+ parent_ = parent;
+ }
+
+ const std::string& Thread::getParent() const {
+ return parent_;
+ }
+}
diff --git a/Swiften/Elements/Thread.h b/Swiften/Elements/Thread.h
new file mode 100644
index 0000000..e736e7f
--- /dev/null
+++ b/Swiften/Elements/Thread.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#pragma once
+
+#include <string>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
+
+namespace Swift {
+ class SWIFTEN_API Thread : public Payload {
+ public:
+ Thread(const std::string& text = "", const std::string& parent = "");
+ virtual ~Thread();
+ void setText(const std::string& text);
+ const std::string& getText() const;
+ void setParent(const std::string& parent);
+ const std::string& getParent() const;
+
+ private:
+ std::string text_;
+ std::string parent_;
+ };
+}
diff --git a/Swiften/Elements/ToplevelElement.cpp b/Swiften/Elements/ToplevelElement.cpp
new file mode 100644
index 0000000..1a858bd
--- /dev/null
+++ b/Swiften/Elements/ToplevelElement.cpp
@@ -0,0 +1,14 @@
+/*
+ * Copyright (c) 2010-2014 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#include <Swiften/Elements/ToplevelElement.h>
+
+namespace Swift {
+
+ToplevelElement::~ToplevelElement() {
+}
+
+}
diff --git a/Swiften/Elements/ToplevelElement.h b/Swiften/Elements/ToplevelElement.h
new file mode 100644
index 0000000..55e055a
--- /dev/null
+++ b/Swiften/Elements/ToplevelElement.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright (c) 2010-2014 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#pragma once
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Element.h>
+
+namespace Swift {
+ class SWIFTEN_API ToplevelElement : public Element {
+ public:
+ ToplevelElement() {}
+ SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(ToplevelElement)
+ virtual ~ToplevelElement();
+ };
+}
diff --git a/Swiften/Elements/UnblockPayload.h b/Swiften/Elements/UnblockPayload.h
index c5e7c80..7d6574d 100644
--- a/Swiften/Elements/UnblockPayload.h
+++ b/Swiften/Elements/UnblockPayload.h
@@ -1,31 +1,32 @@
/*
- * Copyright (c) 2011 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2011-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
#include <vector>
-#include <Swiften/JID/JID.h>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
+#include <Swiften/JID/JID.h>
namespace Swift {
- class UnblockPayload : public Payload {
- public:
- UnblockPayload(const std::vector<JID>& jids = std::vector<JID>()) : items(jids) {
- }
+ class SWIFTEN_API UnblockPayload : public Payload {
+ public:
+ UnblockPayload(const std::vector<JID>& jids = std::vector<JID>()) : items(jids) {
+ }
- void addItem(const JID& item) {
- items.push_back(item);
- }
+ void addItem(const JID& item) {
+ items.push_back(item);
+ }
- const std::vector<JID>& getItems() const {
- return items;
- }
+ const std::vector<JID>& getItems() const {
+ return items;
+ }
- private:
- std::vector<JID> items;
- };
+ private:
+ std::vector<JID> items;
+ };
}
diff --git a/Swiften/Elements/UnitTest/FormTest.cpp b/Swiften/Elements/UnitTest/FormTest.cpp
index 3000c22..c728bde 100644
--- a/Swiften/Elements/UnitTest/FormTest.cpp
+++ b/Swiften/Elements/UnitTest/FormTest.cpp
@@ -1,57 +1,57 @@
/*
- * Copyright (c) 2010-2013 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
+#include <memory>
+
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <boost/shared_ptr.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Elements/Form.h>
using namespace Swift;
class FormTest : public CppUnit::TestFixture {
- CPPUNIT_TEST_SUITE(FormTest);
- CPPUNIT_TEST(testGetFormType);
- CPPUNIT_TEST(testGetFormType_InvalidFormType);
- CPPUNIT_TEST(testGetFormType_NoFormType);
- CPPUNIT_TEST_SUITE_END();
+ CPPUNIT_TEST_SUITE(FormTest);
+ CPPUNIT_TEST(testGetFormType);
+ CPPUNIT_TEST(testGetFormType_InvalidFormType);
+ CPPUNIT_TEST(testGetFormType_NoFormType);
+ CPPUNIT_TEST_SUITE_END();
- public:
- void testGetFormType() {
- Form form;
+ public:
+ void testGetFormType() {
+ Form form;
- form.addField(boost::make_shared<FormField>(FormField::FixedType, "Foo"));
+ form.addField(std::make_shared<FormField>(FormField::FixedType, "Foo"));
- FormField::ref field = boost::make_shared<FormField>(FormField::HiddenType, "jabber:bot");
- field->setName("FORM_TYPE");
- form.addField(field);
+ FormField::ref field = std::make_shared<FormField>(FormField::HiddenType, "jabber:bot");
+ field->setName("FORM_TYPE");
+ form.addField(field);
- form.addField(boost::make_shared<FormField>(FormField::FixedType, "Bar"));
+ form.addField(std::make_shared<FormField>(FormField::FixedType, "Bar"));
- CPPUNIT_ASSERT_EQUAL(std::string("jabber:bot"), form.getFormType());
- }
+ CPPUNIT_ASSERT_EQUAL(std::string("jabber:bot"), form.getFormType());
+ }
- void testGetFormType_InvalidFormType() {
- Form form;
+ void testGetFormType_InvalidFormType() {
+ Form form;
- FormField::ref field = boost::make_shared<FormField>(FormField::FixedType, "jabber:bot");
- field->setName("FORM_TYPE");
- form.addField(field);
+ FormField::ref field = std::make_shared<FormField>(FormField::FixedType, "jabber:bot");
+ field->setName("FORM_TYPE");
+ form.addField(field);
- CPPUNIT_ASSERT_EQUAL(std::string(""), form.getFormType());
- }
+ CPPUNIT_ASSERT_EQUAL(std::string(""), form.getFormType());
+ }
- void testGetFormType_NoFormType() {
- Form form;
+ void testGetFormType_NoFormType() {
+ Form form;
- form.addField(boost::make_shared<FormField>(FormField::FixedType, "Foo"));
+ form.addField(std::make_shared<FormField>(FormField::FixedType, "Foo"));
- CPPUNIT_ASSERT_EQUAL(std::string(""), form.getFormType());
- }
+ CPPUNIT_ASSERT_EQUAL(std::string(""), form.getFormType());
+ }
};
CPPUNIT_TEST_SUITE_REGISTRATION(FormTest);
diff --git a/Swiften/Elements/UnitTest/IQTest.cpp b/Swiften/Elements/UnitTest/IQTest.cpp
index 23255b8..ed98c75 100644
--- a/Swiften/Elements/UnitTest/IQTest.cpp
+++ b/Swiften/Elements/UnitTest/IQTest.cpp
@@ -1,12 +1,13 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
+#include <memory>
+
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <boost/shared_ptr.hpp>
#include <Swiften/Elements/IQ.h>
#include <Swiften/Elements/SoftwareVersion.h>
@@ -15,43 +16,43 @@ using namespace Swift;
class IQTest : public CppUnit::TestFixture
{
- CPPUNIT_TEST_SUITE(IQTest);
- CPPUNIT_TEST(testCreateResult);
- CPPUNIT_TEST(testCreateResult_WithoutPayload);
- CPPUNIT_TEST(testCreateError);
- CPPUNIT_TEST_SUITE_END();
-
- public:
- IQTest() {}
-
- void testCreateResult() {
- boost::shared_ptr<Payload> payload(new SoftwareVersion("myclient"));
- boost::shared_ptr<IQ> iq(IQ::createResult(JID("foo@bar/fum"), "myid", payload));
-
- CPPUNIT_ASSERT_EQUAL(JID("foo@bar/fum"), iq->getTo());
- CPPUNIT_ASSERT_EQUAL(std::string("myid"), iq->getID());
- CPPUNIT_ASSERT(iq->getPayload<SoftwareVersion>());
- CPPUNIT_ASSERT(payload == iq->getPayload<SoftwareVersion>());
- }
-
- void testCreateResult_WithoutPayload() {
- boost::shared_ptr<IQ> iq(IQ::createResult(JID("foo@bar/fum"), "myid"));
-
- CPPUNIT_ASSERT_EQUAL(JID("foo@bar/fum"), iq->getTo());
- CPPUNIT_ASSERT_EQUAL(std::string("myid"), iq->getID());
- CPPUNIT_ASSERT(!iq->getPayload<SoftwareVersion>());
- }
-
- void testCreateError() {
- boost::shared_ptr<IQ> iq(IQ::createError(JID("foo@bar/fum"), "myid", ErrorPayload::BadRequest, ErrorPayload::Modify));
-
- CPPUNIT_ASSERT_EQUAL(JID("foo@bar/fum"), iq->getTo());
- CPPUNIT_ASSERT_EQUAL(std::string("myid"), iq->getID());
- boost::shared_ptr<ErrorPayload> error(iq->getPayload<ErrorPayload>());
- CPPUNIT_ASSERT(error);
- CPPUNIT_ASSERT_EQUAL(ErrorPayload::BadRequest, error->getCondition());
- CPPUNIT_ASSERT_EQUAL(ErrorPayload::Modify, error->getType());
- }
+ CPPUNIT_TEST_SUITE(IQTest);
+ CPPUNIT_TEST(testCreateResult);
+ CPPUNIT_TEST(testCreateResult_WithoutPayload);
+ CPPUNIT_TEST(testCreateError);
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+ IQTest() {}
+
+ void testCreateResult() {
+ std::shared_ptr<Payload> payload(new SoftwareVersion("myclient"));
+ std::shared_ptr<IQ> iq(IQ::createResult(JID("foo@bar/fum"), "myid", payload));
+
+ CPPUNIT_ASSERT_EQUAL(JID("foo@bar/fum"), iq->getTo());
+ CPPUNIT_ASSERT_EQUAL(std::string("myid"), iq->getID());
+ CPPUNIT_ASSERT(iq->getPayload<SoftwareVersion>());
+ CPPUNIT_ASSERT(payload == iq->getPayload<SoftwareVersion>());
+ }
+
+ void testCreateResult_WithoutPayload() {
+ std::shared_ptr<IQ> iq(IQ::createResult(JID("foo@bar/fum"), "myid"));
+
+ CPPUNIT_ASSERT_EQUAL(JID("foo@bar/fum"), iq->getTo());
+ CPPUNIT_ASSERT_EQUAL(std::string("myid"), iq->getID());
+ CPPUNIT_ASSERT(!iq->getPayload<SoftwareVersion>());
+ }
+
+ void testCreateError() {
+ std::shared_ptr<IQ> iq(IQ::createError(JID("foo@bar/fum"), "myid", ErrorPayload::BadRequest, ErrorPayload::Modify));
+
+ CPPUNIT_ASSERT_EQUAL(JID("foo@bar/fum"), iq->getTo());
+ CPPUNIT_ASSERT_EQUAL(std::string("myid"), iq->getID());
+ std::shared_ptr<ErrorPayload> error(iq->getPayload<ErrorPayload>());
+ CPPUNIT_ASSERT(error);
+ CPPUNIT_ASSERT_EQUAL(ErrorPayload::BadRequest, error->getCondition());
+ CPPUNIT_ASSERT_EQUAL(ErrorPayload::Modify, error->getType());
+ }
};
diff --git a/Swiften/Elements/UnitTest/StanzaTest.cpp b/Swiften/Elements/UnitTest/StanzaTest.cpp
index 4bb59b1..6a45bd8 100644
--- a/Swiften/Elements/UnitTest/StanzaTest.cpp
+++ b/Swiften/Elements/UnitTest/StanzaTest.cpp
@@ -1,231 +1,233 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
+#include <memory>
+
+#include <boost/date_time/posix_time/posix_time.hpp>
+
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <boost/shared_ptr.hpp>
-#include <boost/date_time/posix_time/posix_time.hpp>
-#include <Swiften/Elements/Stanza.h>
-#include <Swiften/Elements/Payload.h>
-#include <Swiften/Elements/Message.h>
#include <Swiften/Elements/Delay.h>
+#include <Swiften/Elements/Message.h>
+#include <Swiften/Elements/Payload.h>
+#include <Swiften/Elements/Stanza.h>
using namespace Swift;
class StanzaTest : public CppUnit::TestFixture
{
- CPPUNIT_TEST_SUITE(StanzaTest);
- CPPUNIT_TEST(testConstructor_Copy);
- CPPUNIT_TEST(testGetPayload);
- CPPUNIT_TEST(testGetPayloads);
- CPPUNIT_TEST(testGetPayload_NoSuchPayload);
- CPPUNIT_TEST(testDestructor);
- CPPUNIT_TEST(testDestructor_Copy);
- CPPUNIT_TEST(testUpdatePayload_ExistingPayload);
- CPPUNIT_TEST(testUpdatePayload_NewPayload);
- CPPUNIT_TEST(testGetPayloadOfSameType);
- CPPUNIT_TEST(testGetPayloadOfSameType_NoSuchPayload);
- CPPUNIT_TEST(testGetTimestamp);
- CPPUNIT_TEST(testGetTimestamp_TimestampWithFrom);
- CPPUNIT_TEST(testGetTimestamp_NoDelay);
- CPPUNIT_TEST(testGetTimestampFrom);
- CPPUNIT_TEST(testGetTimestampFrom_Fallsback);
- CPPUNIT_TEST_SUITE_END();
-
- public:
- class MyPayload1 : public Payload {
- public:
- MyPayload1() {}
- };
-
- class MyPayload2 : public Payload {
- public:
- MyPayload2(const std::string& s = "") : text_(s) {}
-
- std::string text_;
- };
-
- class MyPayload3 : public Payload {
- public:
- MyPayload3() {}
- };
-
- class DestroyingPayload : public Payload {
- public:
- DestroyingPayload(bool* alive) : alive_(alive) {
- }
-
- ~DestroyingPayload() {
- (*alive_) = false;
- }
-
- private:
- bool* alive_;
- };
-
- void testConstructor_Copy() {
- Message m;
- m.addPayload(boost::make_shared<MyPayload1>());
- m.addPayload(boost::make_shared<MyPayload2>());
- Message copy(m);
-
- CPPUNIT_ASSERT(copy.getPayload<MyPayload1>());
- CPPUNIT_ASSERT(copy.getPayload<MyPayload2>());
- }
-
- void testDestructor() {
- bool payloadAlive = true;
- {
- Message m;
- m.addPayload(boost::make_shared<DestroyingPayload>(&payloadAlive));
- }
-
- CPPUNIT_ASSERT(!payloadAlive);
- }
-
- void testDestructor_Copy() {
- bool payloadAlive = true;
- Message* m1 = new Message();
- m1->addPayload(boost::make_shared<DestroyingPayload>(&payloadAlive));
- Message* m2 = new Message(*m1);
-
- delete m1;
- CPPUNIT_ASSERT(payloadAlive);
-
- delete m2;
- CPPUNIT_ASSERT(!payloadAlive);
- }
-
- void testGetPayload() {
- Message m;
- m.addPayload(boost::make_shared<MyPayload1>());
- m.addPayload(boost::make_shared<MyPayload2>());
- m.addPayload(boost::make_shared<MyPayload3>());
-
- boost::shared_ptr<MyPayload2> p(m.getPayload<MyPayload2>());
- CPPUNIT_ASSERT(p);
- }
-
- void testGetPayload_NoSuchPayload() {
- Message m;
- m.addPayload(boost::make_shared<MyPayload1>());
- m.addPayload(boost::make_shared<MyPayload3>());
-
- boost::shared_ptr<MyPayload2> p(m.getPayload<MyPayload2>());
- CPPUNIT_ASSERT(!p);
- }
-
- void testGetPayloads() {
- Message m;
- boost::shared_ptr<MyPayload2> payload1(new MyPayload2());
- boost::shared_ptr<MyPayload2> payload2(new MyPayload2());
- m.addPayload(boost::make_shared<MyPayload1>());
- m.addPayload(payload1);
- m.addPayload(boost::make_shared<MyPayload3>());
- m.addPayload(payload2);
-
- CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), m.getPayloads<MyPayload2>().size());
- CPPUNIT_ASSERT_EQUAL(payload1, m.getPayloads<MyPayload2>()[0]);
- CPPUNIT_ASSERT_EQUAL(payload2, m.getPayloads<MyPayload2>()[1]);
- }
-
-
- void testUpdatePayload_ExistingPayload() {
- Message m;
- m.addPayload(boost::make_shared<MyPayload1>());
- m.addPayload(boost::make_shared<MyPayload2>("foo"));
- m.addPayload(boost::make_shared<MyPayload3>());
-
- m.updatePayload(boost::make_shared<MyPayload2>("bar"));
-
- CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), m.getPayloads().size());
- boost::shared_ptr<MyPayload2> p(m.getPayload<MyPayload2>());
- CPPUNIT_ASSERT_EQUAL(std::string("bar"), p->text_);
- }
-
- void testUpdatePayload_NewPayload() {
- Message m;
- m.addPayload(boost::make_shared<MyPayload1>());
- m.addPayload(boost::make_shared<MyPayload3>());
-
- m.updatePayload(boost::make_shared<MyPayload2>("bar"));
-
- CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), m.getPayloads().size());
- boost::shared_ptr<MyPayload2> p(m.getPayload<MyPayload2>());
- CPPUNIT_ASSERT_EQUAL(std::string("bar"), p->text_);
- }
-
- void testGetPayloadOfSameType() {
- Message m;
- m.addPayload(boost::make_shared<MyPayload1>());
- m.addPayload(boost::make_shared<MyPayload2>("foo"));
- m.addPayload(boost::make_shared<MyPayload3>());
-
- boost::shared_ptr<MyPayload2> payload(boost::dynamic_pointer_cast<MyPayload2>(m.getPayloadOfSameType(boost::make_shared<MyPayload2>("bar"))));
- CPPUNIT_ASSERT(payload);
- CPPUNIT_ASSERT_EQUAL(std::string("foo"), payload->text_);
- }
-
- void testGetPayloadOfSameType_NoSuchPayload() {
- Message m;
- m.addPayload(boost::make_shared<MyPayload1>());
- m.addPayload(boost::make_shared<MyPayload3>());
-
- CPPUNIT_ASSERT(!m.getPayloadOfSameType(boost::make_shared<MyPayload2>("bar")));
- }
-
- void testGetTimestamp() {
- Message m;
- m.addPayload(boost::make_shared<Delay>(boost::posix_time::from_time_t(1)));
-
- boost::optional<boost::posix_time::ptime> timestamp = m.getTimestamp();
-
- CPPUNIT_ASSERT(timestamp);
- CPPUNIT_ASSERT_EQUAL(std::string("1970-Jan-01 00:00:01"), boost::posix_time::to_simple_string(*timestamp));
- }
-
- void testGetTimestamp_TimestampWithFrom() {
- Message m;
- m.addPayload(boost::make_shared<Delay>(boost::posix_time::from_time_t(1), JID("foo@bar.com")));
-
- boost::optional<boost::posix_time::ptime> timestamp = m.getTimestamp();
-
- CPPUNIT_ASSERT(timestamp);
- CPPUNIT_ASSERT_EQUAL(std::string("1970-Jan-01 00:00:01"), boost::posix_time::to_simple_string(*timestamp));
- }
-
- void testGetTimestamp_NoDelay() {
- Message m;
- CPPUNIT_ASSERT(!m.getTimestamp());
- }
-
- void testGetTimestampFrom() {
- Message m;
- m.addPayload(boost::make_shared<Delay>(boost::posix_time::from_time_t(0)));
- m.addPayload(boost::make_shared<Delay>(boost::posix_time::from_time_t(1), JID("foo1@bar.com")));
- m.addPayload(boost::make_shared<Delay>(boost::posix_time::from_time_t(2), JID("foo2@bar.com")));
- m.addPayload(boost::make_shared<Delay>(boost::posix_time::from_time_t(3), JID("foo3@bar.com")));
-
- boost::optional<boost::posix_time::ptime> timestamp = m.getTimestampFrom(JID("foo2@bar.com"));
-
- CPPUNIT_ASSERT(timestamp);
- CPPUNIT_ASSERT_EQUAL(std::string("1970-Jan-01 00:00:02"), boost::posix_time::to_simple_string(*timestamp));
- }
-
- void testGetTimestampFrom_Fallsback() {
- Message m;
- m.addPayload(boost::make_shared<Delay>(boost::posix_time::from_time_t(1), JID("foo1@bar.com")));
- m.addPayload(boost::make_shared<Delay>(boost::posix_time::from_time_t(3), JID("foo3@bar.com")));
-
- boost::optional<boost::posix_time::ptime> timestamp = m.getTimestampFrom(JID("foo2@bar.com"));
-
- CPPUNIT_ASSERT(timestamp);
- CPPUNIT_ASSERT_EQUAL(std::string("1970-Jan-01 00:00:01"), boost::posix_time::to_simple_string(*timestamp));
- }
+ CPPUNIT_TEST_SUITE(StanzaTest);
+ CPPUNIT_TEST(testConstructor_Copy);
+ CPPUNIT_TEST(testGetPayload);
+ CPPUNIT_TEST(testGetPayloads);
+ CPPUNIT_TEST(testGetPayload_NoSuchPayload);
+ CPPUNIT_TEST(testDestructor);
+ CPPUNIT_TEST(testDestructor_Copy);
+ CPPUNIT_TEST(testUpdatePayload_ExistingPayload);
+ CPPUNIT_TEST(testUpdatePayload_NewPayload);
+ CPPUNIT_TEST(testGetPayloadOfSameType);
+ CPPUNIT_TEST(testGetPayloadOfSameType_NoSuchPayload);
+ CPPUNIT_TEST(testGetTimestamp);
+ CPPUNIT_TEST(testGetTimestamp_TimestampWithFrom);
+ CPPUNIT_TEST(testGetTimestamp_NoDelay);
+ CPPUNIT_TEST(testGetTimestampFrom);
+ CPPUNIT_TEST(testGetTimestampFrom_Fallsback);
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+ class MyPayload1 : public Payload {
+ public:
+ MyPayload1() {}
+ };
+
+ class MyPayload2 : public Payload {
+ public:
+ MyPayload2(const std::string& s = "") : text_(s) {}
+
+ std::string text_;
+ };
+
+ class MyPayload3 : public Payload {
+ public:
+ MyPayload3() {}
+ };
+
+ class DestroyingPayload : public Payload {
+ public:
+ DestroyingPayload(bool* alive) : alive_(alive) {
+ }
+
+ ~DestroyingPayload() {
+ (*alive_) = false;
+ }
+
+ private:
+ bool* alive_;
+ };
+
+ void testConstructor_Copy() {
+ Message m;
+ m.addPayload(std::make_shared<MyPayload1>());
+ m.addPayload(std::make_shared<MyPayload2>());
+ Message copy(m);
+
+ CPPUNIT_ASSERT(copy.getPayload<MyPayload1>());
+ CPPUNIT_ASSERT(copy.getPayload<MyPayload2>());
+ }
+
+ void testDestructor() {
+ bool payloadAlive = true;
+ {
+ Message m;
+ m.addPayload(std::make_shared<DestroyingPayload>(&payloadAlive));
+ }
+
+ CPPUNIT_ASSERT(!payloadAlive);
+ }
+
+ void testDestructor_Copy() {
+ bool payloadAlive = true;
+ Message* m1 = new Message();
+ m1->addPayload(std::make_shared<DestroyingPayload>(&payloadAlive));
+ Message* m2 = new Message(*m1);
+
+ delete m1;
+ CPPUNIT_ASSERT(payloadAlive);
+
+ delete m2;
+ CPPUNIT_ASSERT(!payloadAlive);
+ }
+
+ void testGetPayload() {
+ Message m;
+ m.addPayload(std::make_shared<MyPayload1>());
+ m.addPayload(std::make_shared<MyPayload2>());
+ m.addPayload(std::make_shared<MyPayload3>());
+
+ std::shared_ptr<MyPayload2> p(m.getPayload<MyPayload2>());
+ CPPUNIT_ASSERT(p);
+ }
+
+ void testGetPayload_NoSuchPayload() {
+ Message m;
+ m.addPayload(std::make_shared<MyPayload1>());
+ m.addPayload(std::make_shared<MyPayload3>());
+
+ std::shared_ptr<MyPayload2> p(m.getPayload<MyPayload2>());
+ CPPUNIT_ASSERT(!p);
+ }
+
+ void testGetPayloads() {
+ Message m;
+ std::shared_ptr<MyPayload2> payload1(new MyPayload2());
+ std::shared_ptr<MyPayload2> payload2(new MyPayload2());
+ m.addPayload(std::make_shared<MyPayload1>());
+ m.addPayload(payload1);
+ m.addPayload(std::make_shared<MyPayload3>());
+ m.addPayload(payload2);
+
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), m.getPayloads<MyPayload2>().size());
+ CPPUNIT_ASSERT_EQUAL(payload1, m.getPayloads<MyPayload2>()[0]);
+ CPPUNIT_ASSERT_EQUAL(payload2, m.getPayloads<MyPayload2>()[1]);
+ }
+
+
+ void testUpdatePayload_ExistingPayload() {
+ Message m;
+ m.addPayload(std::make_shared<MyPayload1>());
+ m.addPayload(std::make_shared<MyPayload2>("foo"));
+ m.addPayload(std::make_shared<MyPayload3>());
+
+ m.updatePayload(std::make_shared<MyPayload2>("bar"));
+
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), m.getPayloads().size());
+ std::shared_ptr<MyPayload2> p(m.getPayload<MyPayload2>());
+ CPPUNIT_ASSERT_EQUAL(std::string("bar"), p->text_);
+ }
+
+ void testUpdatePayload_NewPayload() {
+ Message m;
+ m.addPayload(std::make_shared<MyPayload1>());
+ m.addPayload(std::make_shared<MyPayload3>());
+
+ m.updatePayload(std::make_shared<MyPayload2>("bar"));
+
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), m.getPayloads().size());
+ std::shared_ptr<MyPayload2> p(m.getPayload<MyPayload2>());
+ CPPUNIT_ASSERT_EQUAL(std::string("bar"), p->text_);
+ }
+
+ void testGetPayloadOfSameType() {
+ Message m;
+ m.addPayload(std::make_shared<MyPayload1>());
+ m.addPayload(std::make_shared<MyPayload2>("foo"));
+ m.addPayload(std::make_shared<MyPayload3>());
+
+ std::shared_ptr<MyPayload2> payload(std::dynamic_pointer_cast<MyPayload2>(m.getPayloadOfSameType(std::make_shared<MyPayload2>("bar"))));
+ CPPUNIT_ASSERT(payload);
+ CPPUNIT_ASSERT_EQUAL(std::string("foo"), payload->text_);
+ }
+
+ void testGetPayloadOfSameType_NoSuchPayload() {
+ Message m;
+ m.addPayload(std::make_shared<MyPayload1>());
+ m.addPayload(std::make_shared<MyPayload3>());
+
+ CPPUNIT_ASSERT(!m.getPayloadOfSameType(std::make_shared<MyPayload2>("bar")));
+ }
+
+ void testGetTimestamp() {
+ Message m;
+ m.addPayload(std::make_shared<Delay>(boost::posix_time::from_time_t(1)));
+
+ boost::optional<boost::posix_time::ptime> timestamp = m.getTimestamp();
+
+ CPPUNIT_ASSERT(timestamp);
+ CPPUNIT_ASSERT_EQUAL(std::string("1970-Jan-01 00:00:01"), boost::posix_time::to_simple_string(*timestamp));
+ }
+
+ void testGetTimestamp_TimestampWithFrom() {
+ Message m;
+ m.addPayload(std::make_shared<Delay>(boost::posix_time::from_time_t(1), JID("foo@bar.com")));
+
+ boost::optional<boost::posix_time::ptime> timestamp = m.getTimestamp();
+
+ CPPUNIT_ASSERT(timestamp);
+ CPPUNIT_ASSERT_EQUAL(std::string("1970-Jan-01 00:00:01"), boost::posix_time::to_simple_string(*timestamp));
+ }
+
+ void testGetTimestamp_NoDelay() {
+ Message m;
+ CPPUNIT_ASSERT(!m.getTimestamp());
+ }
+
+ void testGetTimestampFrom() {
+ Message m;
+ m.addPayload(std::make_shared<Delay>(boost::posix_time::from_time_t(0)));
+ m.addPayload(std::make_shared<Delay>(boost::posix_time::from_time_t(1), JID("foo1@bar.com")));
+ m.addPayload(std::make_shared<Delay>(boost::posix_time::from_time_t(2), JID("foo2@bar.com")));
+ m.addPayload(std::make_shared<Delay>(boost::posix_time::from_time_t(3), JID("foo3@bar.com")));
+
+ boost::optional<boost::posix_time::ptime> timestamp = m.getTimestampFrom(JID("foo2@bar.com"));
+
+ CPPUNIT_ASSERT(timestamp);
+ CPPUNIT_ASSERT_EQUAL(std::string("1970-Jan-01 00:00:02"), boost::posix_time::to_simple_string(*timestamp));
+ }
+
+ void testGetTimestampFrom_Fallsback() {
+ Message m;
+ m.addPayload(std::make_shared<Delay>(boost::posix_time::from_time_t(1), JID("foo1@bar.com")));
+ m.addPayload(std::make_shared<Delay>(boost::posix_time::from_time_t(3), JID("foo3@bar.com")));
+
+ boost::optional<boost::posix_time::ptime> timestamp = m.getTimestampFrom(JID("foo2@bar.com"));
+
+ CPPUNIT_ASSERT(timestamp);
+ CPPUNIT_ASSERT_EQUAL(std::string("1970-Jan-01 00:00:01"), boost::posix_time::to_simple_string(*timestamp));
+ }
};
CPPUNIT_TEST_SUITE_REGISTRATION(StanzaTest);
diff --git a/Swiften/Elements/UnknownElement.h b/Swiften/Elements/UnknownElement.h
index 100ba92..b6f8021 100644
--- a/Swiften/Elements/UnknownElement.h
+++ b/Swiften/Elements/UnknownElement.h
@@ -1,16 +1,17 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Elements/Element.h>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/ToplevelElement.h>
namespace Swift {
- class UnknownElement : public Element {
- public:
- UnknownElement() {}
- };
+ class SWIFTEN_API UnknownElement : public ToplevelElement {
+ public:
+ UnknownElement() {}
+ };
}
diff --git a/Swiften/Elements/UserLocation.cpp b/Swiften/Elements/UserLocation.cpp
index f22973e..bc8c584 100644
--- a/Swiften/Elements/UserLocation.cpp
+++ b/Swiften/Elements/UserLocation.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
diff --git a/Swiften/Elements/UserLocation.h b/Swiften/Elements/UserLocation.h
index 2355838..b59fc5c 100644
--- a/Swiften/Elements/UserLocation.h
+++ b/Swiften/Elements/UserLocation.h
@@ -1,227 +1,226 @@
/*
- * Copyright (c) 2013 Remko Tronçon
- * Licensed under the GNU General Public License.
+ * Copyright (c) 2013-2017 Isode Limited.
+ * All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-#include <Swiften/Base/API.h>
-#include <Swiften/Elements/Payload.h>
-#include <boost/optional.hpp>
#include <string>
-#include <boost/date_time/posix_time/posix_time_types.hpp>
+#include <boost/date_time/posix_time/posix_time_types.hpp>
+#include <boost/optional.hpp>
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
namespace Swift {
- class SWIFTEN_API UserLocation : public Payload {
- public:
-
- UserLocation();
-
- virtual ~UserLocation();
+ class SWIFTEN_API UserLocation : public Payload {
+ public:
+
+ UserLocation();
+
+ virtual ~UserLocation();
+
+ const boost::optional< std::string >& getArea() const {
+ return area;
+ }
+
+ void setArea(const boost::optional< std::string >& value) {
+ this->area = value ;
+ }
- const boost::optional< std::string >& getArea() const {
- return area;
- }
+ const boost::optional< double >& getAltitude() const {
+ return altitude;
+ }
- void setArea(const boost::optional< std::string >& value) {
- this->area = value ;
- }
+ void setAltitude(const boost::optional< double >& value) {
+ this->altitude = value ;
+ }
- const boost::optional< float >& getAltitude() const {
- return altitude;
- }
+ const boost::optional< std::string >& getLocality() const {
+ return locality;
+ }
- void setAltitude(const boost::optional< float >& value) {
- this->altitude = value ;
- }
+ void setLocality(const boost::optional< std::string >& value) {
+ this->locality = value ;
+ }
- const boost::optional< std::string >& getLocality() const {
- return locality;
- }
+ const boost::optional< double >& getLatitude() const {
+ return latitude;
+ }
- void setLocality(const boost::optional< std::string >& value) {
- this->locality = value ;
- }
+ void setLatitude(const boost::optional< double >& value) {
+ this->latitude = value ;
+ }
- const boost::optional< float >& getLatitude() const {
- return latitude;
- }
+ const boost::optional< double >& getAccuracy() const {
+ return accuracy;
+ }
- void setLatitude(const boost::optional< float >& value) {
- this->latitude = value ;
- }
+ void setAccuracy(const boost::optional< double >& value) {
+ this->accuracy = value ;
+ }
- const boost::optional< float >& getAccuracy() const {
- return accuracy;
- }
+ const boost::optional< std::string >& getDescription() const {
+ return description;
+ }
- void setAccuracy(const boost::optional< float >& value) {
- this->accuracy = value ;
- }
+ void setDescription(const boost::optional< std::string >& value) {
+ this->description = value ;
+ }
- const boost::optional< std::string >& getDescription() const {
- return description;
- }
+ const boost::optional< std::string >& getCountryCode() const {
+ return countryCode;
+ }
- void setDescription(const boost::optional< std::string >& value) {
- this->description = value ;
- }
+ void setCountryCode(const boost::optional< std::string >& value) {
+ this->countryCode = value ;
+ }
- const boost::optional< std::string >& getCountryCode() const {
- return countryCode;
- }
+ const boost::optional< boost::posix_time::ptime >& getTimestamp() const {
+ return timestamp;
+ }
- void setCountryCode(const boost::optional< std::string >& value) {
- this->countryCode = value ;
- }
+ void setTimestamp(const boost::optional< boost::posix_time::ptime >& value) {
+ this->timestamp = value ;
+ }
- const boost::optional< boost::posix_time::ptime >& getTimestamp() const {
- return timestamp;
- }
+ const boost::optional< std::string >& getFloor() const {
+ return floor;
+ }
- void setTimestamp(const boost::optional< boost::posix_time::ptime >& value) {
- this->timestamp = value ;
- }
+ void setFloor(const boost::optional< std::string >& value) {
+ this->floor = value ;
+ }
- const boost::optional< std::string >& getFloor() const {
- return floor;
- }
+ const boost::optional< std::string >& getBuilding() const {
+ return building;
+ }
- void setFloor(const boost::optional< std::string >& value) {
- this->floor = value ;
- }
+ void setBuilding(const boost::optional< std::string >& value) {
+ this->building = value ;
+ }
- const boost::optional< std::string >& getBuilding() const {
- return building;
- }
+ const boost::optional< std::string >& getRoom() const {
+ return room;
+ }
- void setBuilding(const boost::optional< std::string >& value) {
- this->building = value ;
- }
+ void setRoom(const boost::optional< std::string >& value) {
+ this->room = value ;
+ }
- const boost::optional< std::string >& getRoom() const {
- return room;
- }
-
- void setRoom(const boost::optional< std::string >& value) {
- this->room = value ;
- }
-
- const boost::optional< std::string >& getCountry() const {
- return country;
- }
-
- void setCountry(const boost::optional< std::string >& value) {
- this->country = value ;
- }
-
- const boost::optional< std::string >& getRegion() const {
- return region;
- }
-
- void setRegion(const boost::optional< std::string >& value) {
- this->region = value ;
- }
-
- const boost::optional< std::string >& getURI() const {
- return uri;
- }
-
- void setURI(const boost::optional< std::string >& value) {
- this->uri = value ;
- }
-
- const boost::optional< float >& getLongitude() const {
- return longitude;
- }
-
- void setLongitude(const boost::optional< float >& value) {
- this->longitude = value ;
- }
-
- const boost::optional< float >& getError() const {
- return error;
- }
-
- void setError(const boost::optional< float >& value) {
- this->error = value ;
- }
-
- const boost::optional< std::string >& getPostalCode() const {
- return postalCode;
- }
-
- void setPostalCode(const boost::optional< std::string >& value) {
- this->postalCode = value ;
- }
-
- const boost::optional< float >& getBearing() const {
- return bearing;
- }
-
- void setBearing(const boost::optional< float >& value) {
- this->bearing = value ;
- }
-
- const boost::optional< std::string >& getText() const {
- return text;
- }
-
- void setText(const boost::optional< std::string >& value) {
- this->text = value ;
- }
-
- const boost::optional< std::string >& getDatum() const {
- return datum;
- }
-
- void setDatum(const boost::optional< std::string >& value) {
- this->datum = value ;
- }
-
- const boost::optional< std::string >& getStreet() const {
- return street;
- }
-
- void setStreet(const boost::optional< std::string >& value) {
- this->street = value ;
- }
-
- const boost::optional< float >& getSpeed() const {
- return speed;
- }
-
- void setSpeed(const boost::optional< float >& value) {
- this->speed = value ;
- }
-
-
- private:
- boost::optional< std::string > area;
- boost::optional< float > altitude;
- boost::optional< std::string > locality;
- boost::optional< float > latitude;
- boost::optional< float > accuracy;
- boost::optional< std::string > description;
- boost::optional< std::string > countryCode;
- boost::optional< boost::posix_time::ptime > timestamp;
- boost::optional< std::string > floor;
- boost::optional< std::string > building;
- boost::optional< std::string > room;
- boost::optional< std::string > country;
- boost::optional< std::string > region;
- boost::optional< std::string > uri;
- boost::optional< float > longitude;
- boost::optional< float > error;
- boost::optional< std::string > postalCode;
- boost::optional< float > bearing;
- boost::optional< std::string > text;
- boost::optional< std::string > datum;
- boost::optional< std::string > street;
- boost::optional< float > speed;
- };
+ const boost::optional< std::string >& getCountry() const {
+ return country;
+ }
+
+ void setCountry(const boost::optional< std::string >& value) {
+ this->country = value ;
+ }
+
+ const boost::optional< std::string >& getRegion() const {
+ return region;
+ }
+
+ void setRegion(const boost::optional< std::string >& value) {
+ this->region = value ;
+ }
+
+ const boost::optional< std::string >& getURI() const {
+ return uri;
+ }
+
+ void setURI(const boost::optional< std::string >& value) {
+ this->uri = value ;
+ }
+
+ const boost::optional< double >& getLongitude() const {
+ return longitude;
+ }
+
+ void setLongitude(const boost::optional< double >& value) {
+ this->longitude = value ;
+ }
+
+ const boost::optional< double >& getError() const {
+ return error;
+ }
+
+ void setError(const boost::optional< double >& value) {
+ this->error = value ;
+ }
+
+ const boost::optional< std::string >& getPostalCode() const {
+ return postalCode;
+ }
+
+ void setPostalCode(const boost::optional< std::string >& value) {
+ this->postalCode = value ;
+ }
+
+ const boost::optional< double >& getBearing() const {
+ return bearing;
+ }
+
+ void setBearing(const boost::optional< double >& value) {
+ this->bearing = value ;
+ }
+
+ const boost::optional< std::string >& getText() const {
+ return text;
+ }
+
+ void setText(const boost::optional< std::string >& value) {
+ this->text = value ;
+ }
+
+ const boost::optional< std::string >& getDatum() const {
+ return datum;
+ }
+
+ void setDatum(const boost::optional< std::string >& value) {
+ this->datum = value ;
+ }
+
+ const boost::optional< std::string >& getStreet() const {
+ return street;
+ }
+
+ void setStreet(const boost::optional< std::string >& value) {
+ this->street = value ;
+ }
+
+ const boost::optional< double >& getSpeed() const {
+ return speed;
+ }
+
+ void setSpeed(const boost::optional< double >& value) {
+ this->speed = value ;
+ }
+
+
+ private:
+ boost::optional< std::string > area;
+ boost::optional< double > altitude;
+ boost::optional< std::string > locality;
+ boost::optional< double > latitude;
+ boost::optional< double > accuracy;
+ boost::optional< std::string > description;
+ boost::optional< std::string > countryCode;
+ boost::optional< boost::posix_time::ptime > timestamp;
+ boost::optional< std::string > floor;
+ boost::optional< std::string > building;
+ boost::optional< std::string > room;
+ boost::optional< std::string > country;
+ boost::optional< std::string > region;
+ boost::optional< std::string > uri;
+ boost::optional< double > longitude;
+ boost::optional< double > error;
+ boost::optional< std::string > postalCode;
+ boost::optional< double > bearing;
+ boost::optional< std::string > text;
+ boost::optional< std::string > datum;
+ boost::optional< std::string > street;
+ boost::optional< double > speed;
+ };
}
diff --git a/Swiften/Elements/UserTune.cpp b/Swiften/Elements/UserTune.cpp
new file mode 100644
index 0000000..abd97d2
--- /dev/null
+++ b/Swiften/Elements/UserTune.cpp
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2014 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#include <Swiften/Elements/UserTune.h>
+
+using namespace Swift;
+
+UserTune::UserTune() {
+}
+
+UserTune::~UserTune() {
+}
diff --git a/Swiften/Elements/UserTune.h b/Swiften/Elements/UserTune.h
new file mode 100644
index 0000000..5413085
--- /dev/null
+++ b/Swiften/Elements/UserTune.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2014-2017 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+#pragma once
+
+#include <string>
+
+#include <boost/optional.hpp>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Payload.h>
+
+namespace Swift {
+ class SWIFTEN_API UserTune : public Payload {
+ public:
+
+ UserTune();
+
+ virtual ~UserTune();
+
+ const boost::optional< unsigned int >& getRating() const {
+ return rating;
+ }
+
+ void setRating(const boost::optional< unsigned int >& value) {
+ this->rating = value ;
+ }
+
+ const boost::optional< std::string >& getTitle() const {
+ return title;
+ }
+
+ void setTitle(const boost::optional< std::string >& value) {
+ this->title = value ;
+ }
+
+ const boost::optional< std::string >& getTrack() const {
+ return track;
+ }
+
+ void setTrack(const boost::optional< std::string >& value) {
+ this->track = value ;
+ }
+
+ const boost::optional< std::string >& getArtist() const {
+ return artist;
+ }
+
+ void setArtist(const boost::optional< std::string >& value) {
+ this->artist = value ;
+ }
+
+ const boost::optional< std::string >& getURI() const {
+ return uri;
+ }
+
+ void setURI(const boost::optional< std::string >& value) {
+ this->uri = value ;
+ }
+
+ const boost::optional< std::string >& getSource() const {
+ return source;
+ }
+
+ void setSource(const boost::optional< std::string >& value) {
+ this->source = value ;
+ }
+
+ const boost::optional< unsigned int >& getLength() const {
+ return length;
+ }
+
+ void setLength(const boost::optional< unsigned int >& value) {
+ this->length = value ;
+ }
+
+
+ private:
+ boost::optional< unsigned int > rating;
+ boost::optional< std::string > title;
+ boost::optional< std::string > track;
+ boost::optional< std::string > artist;
+ boost::optional< std::string > uri;
+ boost::optional< std::string > source;
+ boost::optional< unsigned int > length;
+ };
+}
diff --git a/Swiften/Elements/VCard.cpp b/Swiften/Elements/VCard.cpp
index 8bf3eb9..571ead4 100644
--- a/Swiften/Elements/VCard.cpp
+++ b/Swiften/Elements/VCard.cpp
@@ -1,25 +1,23 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#include <Swiften/Elements/VCard.h>
-#include <Swiften/Base/foreach.h>
-
namespace Swift {
VCard::EMailAddress VCard::getPreferredEMailAddress() const {
- foreach(const EMailAddress& address, emailAddresses_) {
- if (address.isPreferred) {
- return address;
- }
- }
- if (!emailAddresses_.empty()) {
- return emailAddresses_[0];
- }
- return EMailAddress();
+ for (const auto& address : emailAddresses_) {
+ if (address.isPreferred) {
+ return address;
+ }
+ }
+ if (!emailAddresses_.empty()) {
+ return emailAddresses_[0];
+ }
+ return EMailAddress();
}
diff --git a/Swiften/Elements/VCard.h b/Swiften/Elements/VCard.h
index 84b6cfe..5a43c3c 100644
--- a/Swiften/Elements/VCard.h
+++ b/Swiften/Elements/VCard.h
@@ -1,291 +1,303 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
+#include <string>
+
#include <boost/date_time/posix_time/ptime.hpp>
-#include <string>
-#include <Swiften/JID/JID.h>
+#include <Swiften/Base/API.h>
#include <Swiften/Base/ByteArray.h>
#include <Swiften/Elements/Payload.h>
+#include <Swiften/JID/JID.h>
namespace Swift {
- class VCard : public Payload {
- public:
- typedef boost::shared_ptr<VCard> ref;
-
- struct EMailAddress {
- EMailAddress() : isHome(false), isWork(false), isInternet(false), isPreferred(false), isX400(false) {
- }
-
- bool isHome;
- bool isWork;
- bool isInternet;
- bool isPreferred;
- bool isX400;
- std::string address;
- };
-
- struct Telephone {
- Telephone() : isHome(false), isWork(false), isVoice(false), isFax(false), isPager(false), isMSG(false), isCell(false),
- isVideo(false), isBBS(false), isModem(false), isISDN(false), isPCS(false), isPreferred(false) {
- }
-
- bool isHome;
- bool isWork;
- bool isVoice;
- bool isFax;
- bool isPager;
- bool isMSG;
- bool isCell;
- bool isVideo;
- bool isBBS;
- bool isModem;
- bool isISDN;
- bool isPCS;
- bool isPreferred;
- std::string number;
- };
-
- enum DeliveryType {
- DomesticDelivery,
- InternationalDelivery,
- None
- };
-
- struct Address {
- Address() : isHome(false), isWork(false), isPostal(false), isParcel(false), deliveryType(None), isPreferred(false) {
- }
-
- bool isHome;
- bool isWork;
- bool isPostal;
- bool isParcel;
- DeliveryType deliveryType;
- bool isPreferred;
-
- std::string poBox;
- std::string addressExtension;
- std::string street;
- std::string locality;
- std::string region;
- std::string postalCode;
- std::string country;
- };
-
- struct AddressLabel {
- AddressLabel() : isHome(false), isWork(false), isPostal(false), isParcel(false), deliveryType(None), isPreferred(false) {
- }
-
- bool isHome;
- bool isWork;
- bool isPostal;
- bool isParcel;
- DeliveryType deliveryType;
- bool isPreferred;
- std::vector<std::string> lines;
- };
-
- struct Organization {
- std::string name;
- std::vector<std::string> units;
- };
-
- VCard() {}
-
- void setVersion(const std::string& version) { version_ = version; }
- const std::string& getVersion() const { return version_; }
-
- void setFullName(const std::string& fullName) { fullName_ = fullName; }
- const std::string& getFullName() const { return fullName_; }
-
- void setFamilyName(const std::string& familyName) { familyName_ = familyName; }
- const std::string& getFamilyName() const { return familyName_; }
-
- void setGivenName(const std::string& givenName) { givenName_ = givenName; }
- const std::string& getGivenName() const { return givenName_; }
-
- void setMiddleName(const std::string& middleName) { middleName_ = middleName; }
- const std::string& getMiddleName() const { return middleName_; }
-
- void setPrefix(const std::string& prefix) { prefix_ = prefix; }
- const std::string& getPrefix() const { return prefix_; }
-
- void setSuffix(const std::string& suffix) { suffix_ = suffix; }
- const std::string& getSuffix() const { return suffix_; }
-
-
- //void setEMailAddress(const std::string& email) { email_ = email; }
- //const std::string& getEMailAddress() const { return email_; }
-
- void setNickname(const std::string& nick) { nick_ = nick; }
- const std::string& getNickname() const { return nick_; }
-
- void setPhoto(const ByteArray& photo) { photo_ = photo; }
- const ByteArray& getPhoto() const { return photo_; }
-
- void setPhotoType(const std::string& photoType) { photoType_ = photoType; }
- const std::string& getPhotoType() const { return photoType_; }
-
- const std::string& getUnknownContent() const { return unknownContent_; }
- void addUnknownContent(const std::string& c) {
- unknownContent_ += c;
- }
-
- const std::vector<EMailAddress>& getEMailAddresses() const {
- return emailAddresses_;
- }
-
- void addEMailAddress(const EMailAddress& email) {
- emailAddresses_.push_back(email);
- }
-
- void clearEMailAddresses() {
- emailAddresses_.clear();
- }
+ class SWIFTEN_API VCard : public Payload {
+ public:
+ typedef std::shared_ptr<VCard> ref;
+
+ struct EMailAddress {
+ EMailAddress() : isHome(false), isWork(false), isInternet(false), isPreferred(false), isX400(false) {
+ }
+
+ bool isHome;
+ bool isWork;
+ bool isInternet;
+ bool isPreferred;
+ bool isX400;
+ std::string address;
+ };
+
+ struct Telephone {
+ Telephone() : isHome(false), isWork(false), isVoice(false), isFax(false), isPager(false), isMSG(false), isCell(false),
+ isVideo(false), isBBS(false), isModem(false), isISDN(false), isPCS(false), isPreferred(false) {
+ }
+
+ bool isHome;
+ bool isWork;
+ bool isVoice;
+ bool isFax;
+ bool isPager;
+ bool isMSG;
+ bool isCell;
+ bool isVideo;
+ bool isBBS;
+ bool isModem;
+ bool isISDN;
+ bool isPCS;
+ bool isPreferred;
+ std::string number;
+ };
+
+ enum DeliveryType {
+ DomesticDelivery,
+ InternationalDelivery,
+ None
+ };
+
+ struct Address {
+ Address() : isHome(false), isWork(false), isPostal(false), isParcel(false), deliveryType(None), isPreferred(false) {
+ }
+
+ bool isHome;
+ bool isWork;
+ bool isPostal;
+ bool isParcel;
+ DeliveryType deliveryType;
+ bool isPreferred;
+
+ std::string poBox;
+ std::string addressExtension;
+ std::string street;
+ std::string locality;
+ std::string region;
+ std::string postalCode;
+ std::string country;
+ };
+
+ struct AddressLabel {
+ AddressLabel() : isHome(false), isWork(false), isPostal(false), isParcel(false), deliveryType(None), isPreferred(false) {
+ }
+
+ bool isHome;
+ bool isWork;
+ bool isPostal;
+ bool isParcel;
+ DeliveryType deliveryType;
+ bool isPreferred;
+ std::vector<std::string> lines;
+ };
+
+ struct Organization {
+ std::string name;
+ std::vector<std::string> units;
+ };
+
+ VCard() {}
+
+ void setVersion(const std::string& version) { version_ = version; }
+ const std::string& getVersion() const { return version_; }
+
+ void setFullName(const std::string& fullName) { fullName_ = fullName; }
+ const std::string& getFullName() const { return fullName_; }
+
+ void setFamilyName(const std::string& familyName) { familyName_ = familyName; }
+ const std::string& getFamilyName() const { return familyName_; }
+
+ void setGivenName(const std::string& givenName) { givenName_ = givenName; }
+ const std::string& getGivenName() const { return givenName_; }
+
+ void setMiddleName(const std::string& middleName) { middleName_ = middleName; }
+ const std::string& getMiddleName() const { return middleName_; }
+
+ void setPrefix(const std::string& prefix) { prefix_ = prefix; }
+ const std::string& getPrefix() const { return prefix_; }
+
+ void setSuffix(const std::string& suffix) { suffix_ = suffix; }
+ const std::string& getSuffix() const { return suffix_; }
+
+
+ //void setEMailAddress(const std::string& email) { email_ = email; }
+ //const std::string& getEMailAddress() const { return email_; }
+
+ void setNickname(const std::string& nick) { nick_ = nick; }
+ const std::string& getNickname() const { return nick_; }
+
+ void setPhoto(const ByteArray& photo) { photo_ = photo; }
+ const ByteArray& getPhoto() const { return photo_; }
+
+ void setPhotoType(const std::string& photoType) { photoType_ = photoType; }
+ const std::string& getPhotoType() const { return photoType_; }
+
+ const std::string& getUnknownContent() const { return unknownContent_; }
+ void addUnknownContent(const std::string& c) {
+ unknownContent_ += c;
+ }
+
+ const std::vector<EMailAddress>& getEMailAddresses() const {
+ return emailAddresses_;
+ }
+
+ void addEMailAddress(const EMailAddress& email) {
+ emailAddresses_.push_back(email);
+ }
+
+ void clearEMailAddresses() {
+ emailAddresses_.clear();
+ }
+
+ EMailAddress getPreferredEMailAddress() const;
- EMailAddress getPreferredEMailAddress() const;
+ void setBirthday(const boost::posix_time::ptime& birthday) {
+ birthday_ = birthday;
+ }
- void setBirthday(const boost::posix_time::ptime& birthday) {
- birthday_ = birthday;
- }
+ const boost::posix_time::ptime& getBirthday() const {
+ return birthday_;
+ }
- const boost::posix_time::ptime& getBirthday() const {
- return birthday_;
- }
+ const std::vector<Telephone>& getTelephones() const {
+ return telephones_;
+ }
- const std::vector<Telephone>& getTelephones() const {
- return telephones_;
- }
+ void addTelephone(const Telephone& phone) {
+ telephones_.push_back(phone);
+ }
- void addTelephone(const Telephone& phone) {
- telephones_.push_back(phone);
- }
+ void clearTelephones() {
+ telephones_.clear();
+ }
- void clearTelephones() {
- telephones_.clear();
- }
+ const std::vector<Address>& getAddresses() const {
+ return addresses_;
+ }
- const std::vector<Address>& getAddresses() const {
- return addresses_;
- }
+ void addAddress(const Address& address) {
+ addresses_.push_back(address);
+ }
- void addAddress(const Address& address) {
- addresses_.push_back(address);
- }
-
- void clearAddresses() {
- addresses_.clear();
- }
-
- const std::vector<AddressLabel>& getAddressLabels() const {
- return addressLabels_;
- }
-
- void addAddressLabel(const AddressLabel& addressLabel) {
- addressLabels_.push_back(addressLabel);
- }
-
- void clearAddressLabels() {
- addressLabels_.clear();
- }
-
- const std::vector<JID>& getJIDs() const {
- return jids_;
- }
-
- void addJID(const JID& jid) {
- jids_.push_back(jid);
- }
-
- void clearJIDs() {
- jids_.clear();
- }
-
- const std::string& getDescription() const {
- return description_;
- }
-
- void setDescription(const std::string& description) {
- this->description_ = description;
- }
-
- const std::vector<Organization>& getOrganizations() const {
- return organizations_;
- }
-
- void addOrganization(const Organization& organization) {
- organizations_.push_back(organization);
- }
-
- void clearOrganizations() {
- organizations_.clear();
- }
-
- const std::vector<std::string>& getTitles() const {
- return titles_;
- }
-
- void addTitle(const std::string& title) {
- titles_.push_back(title);
- }
-
- void clearTitles() {
- titles_.clear();
- }
-
- const std::vector<std::string>& getRoles() const {
- return roles_;
- }
-
- void addRole(const std::string& role) {
- roles_.push_back(role);
- }
-
- void clearRoles() {
- roles_.clear();
- }
-
- const std::vector<std::string>& getURLs() const {
- return urls_;
- }
-
- void addURL(const std::string& url) {
- urls_.push_back(url);
- }
-
- void clearURLs() {
- urls_.clear();
- }
-
- private:
- std::string version_;
- std::string fullName_;
- std::string familyName_;
- std::string givenName_;
- std::string middleName_;
- std::string prefix_;
- std::string suffix_;
- //std::string email_;
- ByteArray photo_;
- std::string photoType_;
- std::string nick_;
- boost::posix_time::ptime birthday_;
- std::string unknownContent_;
- std::vector<EMailAddress> emailAddresses_;
- std::vector<Telephone> telephones_;
- std::vector<Address> addresses_;
- std::vector<AddressLabel> addressLabels_;
- std::vector<JID> jids_;
- std::string description_;
- std::vector<Organization> organizations_;
- std::vector<std::string> titles_;
- std::vector<std::string> roles_;
- std::vector<std::string> urls_;
- };
+ void clearAddresses() {
+ addresses_.clear();
+ }
+
+ const std::vector<AddressLabel>& getAddressLabels() const {
+ return addressLabels_;
+ }
+
+ void addAddressLabel(const AddressLabel& addressLabel) {
+ addressLabels_.push_back(addressLabel);
+ }
+
+ void clearAddressLabels() {
+ addressLabels_.clear();
+ }
+
+ const std::vector<JID>& getJIDs() const {
+ return jids_;
+ }
+
+ void addJID(const JID& jid) {
+ jids_.push_back(jid);
+ }
+
+ void clearJIDs() {
+ jids_.clear();
+ }
+
+ const std::string& getDescription() const {
+ return description_;
+ }
+
+ void setDescription(const std::string& description) {
+ this->description_ = description;
+ }
+
+ const std::vector<Organization>& getOrganizations() const {
+ return organizations_;
+ }
+
+ void addOrganization(const Organization& organization) {
+ organizations_.push_back(organization);
+ }
+
+ void clearOrganizations() {
+ organizations_.clear();
+ }
+
+ const std::vector<std::string>& getTitles() const {
+ return titles_;
+ }
+
+ void addTitle(const std::string& title) {
+ titles_.push_back(title);
+ }
+
+ void clearTitles() {
+ titles_.clear();
+ }
+
+ const std::vector<std::string>& getRoles() const {
+ return roles_;
+ }
+
+ void addRole(const std::string& role) {
+ roles_.push_back(role);
+ }
+
+ void clearRoles() {
+ roles_.clear();
+ }
+
+ const std::vector<std::string>& getURLs() const {
+ return urls_;
+ }
+
+ void addURL(const std::string& url) {
+ urls_.push_back(url);
+ }
+
+ void clearURLs() {
+ urls_.clear();
+ }
+
+ bool isEmpty() const {
+ bool empty = version_.empty() && fullName_.empty() && familyName_.empty() && givenName_.empty() && middleName_.empty() && prefix_.empty() && suffix_.empty();
+ empty &= photo_.empty() && photoType_.empty() && nick_.empty();
+ empty &= birthday_.is_not_a_date_time();
+ empty &= unknownContent_.empty();
+ empty &= emailAddresses_.empty() && telephones_.empty() && addresses_.empty() && addressLabels_.empty() && jids_.empty();
+ empty &= description_.empty() && organizations_.empty() && titles_.empty() && roles_.empty() && urls_.empty();
+ return empty;
+ }
+
+ private:
+ std::string version_;
+ std::string fullName_;
+ std::string familyName_;
+ std::string givenName_;
+ std::string middleName_;
+ std::string prefix_;
+ std::string suffix_;
+ //std::string email_;
+ ByteArray photo_;
+ std::string photoType_;
+ std::string nick_;
+ boost::posix_time::ptime birthday_;
+ std::string unknownContent_;
+ std::vector<EMailAddress> emailAddresses_;
+ std::vector<Telephone> telephones_;
+ std::vector<Address> addresses_;
+ std::vector<AddressLabel> addressLabels_;
+ std::vector<JID> jids_;
+ std::string description_;
+ std::vector<Organization> organizations_;
+ std::vector<std::string> titles_;
+ std::vector<std::string> roles_;
+ std::vector<std::string> urls_;
+ };
}
diff --git a/Swiften/Elements/VCardUpdate.h b/Swiften/Elements/VCardUpdate.h
index 782106c..e3b5377 100644
--- a/Swiften/Elements/VCardUpdate.h
+++ b/Swiften/Elements/VCardUpdate.h
@@ -1,23 +1,25 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
#include <string>
+
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
- class VCardUpdate : public Payload {
- public:
- VCardUpdate(const std::string& photoHash = "") : photoHash_(photoHash) {}
+ class SWIFTEN_API VCardUpdate : public Payload {
+ public:
+ VCardUpdate(const std::string& photoHash = "") : photoHash_(photoHash) {}
- void setPhotoHash(const std::string& photoHash) { photoHash_ = photoHash; }
- const std::string& getPhotoHash() const { return photoHash_; }
+ void setPhotoHash(const std::string& photoHash) { photoHash_ = photoHash; }
+ const std::string& getPhotoHash() const { return photoHash_; }
- private:
- std::string photoHash_;
- };
+ private:
+ std::string photoHash_;
+ };
}
diff --git a/Swiften/Elements/Version.h b/Swiften/Elements/Version.h
index 350fd91..1d734be 100644
--- a/Swiften/Elements/Version.h
+++ b/Swiften/Elements/Version.h
@@ -1,26 +1,28 @@
/*
- * Copyright (c) 2010 Remko Tronçon
- * Licensed under the GNU General Public License v3.
- * See Documentation/Licenses/GPLv3.txt for more information.
+ * Copyright (c) 2010-2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
*/
#pragma once
#include <string>
+
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
namespace Swift {
- class Version : public Payload {
- public:
- Version(const std::string& name = "", const std::string& version = "", const std::string& os = "") : name_(name), version_(version), os_(os) { }
+ class SWIFTEN_API Version : public Payload {
+ public:
+ Version(const std::string& name = "", const std::string& version = "", const std::string& os = "") : name_(name), version_(version), os_(os) { }
- const std::string& getName() const { return name_; }
- const std::string& getVersion() const { return version_; }
- const std::string& getOS() const { return os_; }
+ const std::string& getName() const { return name_; }
+ const std::string& getVersion() const { return version_; }
+ const std::string& getOS() const { return os_; }
- private:
- std::string name_;
- std::string version_;
- std::string os_;
- };
+ private:
+ std::string name_;
+ std::string version_;
+ std::string os_;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardColor.cpp b/Swiften/Elements/Whiteboard/WhiteboardColor.cpp
index f4ff01a..037fde4 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardColor.cpp
+++ b/Swiften/Elements/Whiteboard/WhiteboardColor.cpp
@@ -4,52 +4,59 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#include <Swiften/Elements/Whiteboard/WhiteboardColor.h>
-#include <Swiften/Base/String.h>
+
#include <cstdio>
#include <iomanip>
#include <sstream>
-#include <iostream>
+
+#include <Swiften/Base/String.h>
namespace Swift {
- WhiteboardColor::WhiteboardColor() : red_(0), green_(0), blue_(0), alpha_(255) {
- }
-
- WhiteboardColor::WhiteboardColor(int red, int green, int blue, int alpha) : red_(red), green_(green), blue_(blue), alpha_(alpha) {
- }
-
- WhiteboardColor::WhiteboardColor(const std::string& hex) : alpha_(255) {
- int value = String::convertHexStringToInt(hex.substr(1));
- red_ = (value >> 16)&0xFF;
- green_ = (value >> 8)&0xFF;
- blue_ = value&0xFF;
- }
-
- std::string WhiteboardColor::toHex() const {
- std::string value = String::convertIntToHexString((red_ << 16) + (green_ << 8) + blue_);
- while (value.size() < 6) {
- value.insert(0, "0");
- }
- return "#"+value;
- }
-
- int WhiteboardColor::getRed() const {
- return red_;
- }
-
- int WhiteboardColor::getGreen() const {
- return green_;
- }
-
- int WhiteboardColor::getBlue() const {
- return blue_;
- }
-
- int WhiteboardColor::getAlpha() const {
- return alpha_;
- }
-
- void WhiteboardColor::setAlpha(int alpha) {
- alpha_ = alpha;
- }
+ WhiteboardColor::WhiteboardColor() : red_(0), green_(0), blue_(0), alpha_(255) {
+ }
+
+ WhiteboardColor::WhiteboardColor(int red, int green, int blue, int alpha) : red_(red), green_(green), blue_(blue), alpha_(alpha) {
+ }
+
+ WhiteboardColor::WhiteboardColor(const std::string& hex) : alpha_(255) {
+ int value = String::convertHexStringToInt(hex.substr(1));
+ red_ = (value >> 16)&0xFF;
+ green_ = (value >> 8)&0xFF;
+ blue_ = value&0xFF;
+ }
+
+ std::string WhiteboardColor::toHex() const {
+ std::string value = String::convertIntToHexString((red_ << 16) + (green_ << 8) + blue_);
+ while (value.size() < 6) {
+ value.insert(0, "0");
+ }
+ return "#"+value;
+ }
+
+ int WhiteboardColor::getRed() const {
+ return red_;
+ }
+
+ int WhiteboardColor::getGreen() const {
+ return green_;
+ }
+
+ int WhiteboardColor::getBlue() const {
+ return blue_;
+ }
+
+ int WhiteboardColor::getAlpha() const {
+ return alpha_;
+ }
+
+ void WhiteboardColor::setAlpha(int alpha) {
+ alpha_ = alpha;
+ }
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardColor.h b/Swiften/Elements/Whiteboard/WhiteboardColor.h
index 3b3d93c..6402efd 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardColor.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardColor.h
@@ -11,20 +11,20 @@
#include <Swiften/Base/API.h>
namespace Swift {
- class SWIFTEN_API WhiteboardColor {
- public:
- WhiteboardColor();
- WhiteboardColor(int red, int green, int blue, int alpha = 255);
- WhiteboardColor(const std::string& hex);
- std::string toHex() const;
- int getRed() const;
- int getGreen() const;
- int getBlue() const;
- int getAlpha() const;
- void setAlpha(int alpha);
+ class SWIFTEN_API WhiteboardColor {
+ public:
+ WhiteboardColor();
+ WhiteboardColor(int red, int green, int blue, int alpha = 255);
+ WhiteboardColor(const std::string& hex);
+ std::string toHex() const;
+ int getRed() const;
+ int getGreen() const;
+ int getBlue() const;
+ int getAlpha() const;
+ void setAlpha(int alpha);
- private:
- int red_, green_, blue_;
- int alpha_;
- };
+ private:
+ int red_, green_, blue_;
+ int alpha_;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h b/Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h
index 091ee30..ae0fe17 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardDeleteOperation.h
@@ -4,29 +4,32 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
-#pragma once
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
-#include <Swiften/Elements/Whiteboard/WhiteboardOperation.h>
+#pragma once
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
+#include <Swiften/Elements/Whiteboard/WhiteboardOperation.h>
namespace Swift {
- class WhiteboardDeleteOperation : public WhiteboardOperation {
- public:
- typedef boost::shared_ptr<WhiteboardDeleteOperation> ref;
- public:
- ~WhiteboardDeleteOperation() {
- }
-
- std::string getElementID() const {
- return elementID_;
- }
+ class SWIFTEN_API WhiteboardDeleteOperation : public WhiteboardOperation {
+ public:
+ typedef std::shared_ptr<WhiteboardDeleteOperation> ref;
+ public:
+ std::string getElementID() const {
+ return elementID_;
+ }
- void setElementID(const std::string& elementID) {
- elementID_ = elementID;
- }
+ void setElementID(const std::string& elementID) {
+ elementID_ = elementID;
+ }
- private:
- std::string elementID_;
- };
+ private:
+ std::string elementID_;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardElement.h b/Swiften/Elements/Whiteboard/WhiteboardElement.h
index df774d9..6f6ff4f 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardElement.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardElement.h
@@ -4,29 +4,37 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#pragma once
-#include <boost/shared_ptr.hpp>
+#include <memory>
+#include <string>
+
#include <Swiften/Elements/Whiteboard/WhiteboardElementVisitor.h>
namespace Swift {
- class WhiteboardElement {
- public:
- typedef boost::shared_ptr<WhiteboardElement> ref;
+ class WhiteboardElement {
+ public:
+ typedef std::shared_ptr<WhiteboardElement> ref;
- public:
- virtual ~WhiteboardElement() {}
- virtual void accept(WhiteboardElementVisitor& visitor) = 0;
+ public:
+ virtual ~WhiteboardElement() {}
+ virtual void accept(WhiteboardElementVisitor& visitor) = 0;
- const std::string& getID() const {
- return id_;
- }
+ const std::string& getID() const {
+ return id_;
+ }
- void setID(const std::string& id) {
- id_ = id;
- }
+ void setID(const std::string& id) {
+ id_ = id;
+ }
- private:
- std::string id_;
- };
+ private:
+ std::string id_;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardElementVisitor.h b/Swiften/Elements/Whiteboard/WhiteboardElementVisitor.h
index 413d6cf..090af56 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardElementVisitor.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardElementVisitor.h
@@ -7,21 +7,21 @@
#pragma once
namespace Swift {
- class WhiteboardLineElement;
- class WhiteboardFreehandPathElement;
- class WhiteboardRectElement;
- class WhiteboardPolygonElement;
- class WhiteboardTextElement;
- class WhiteboardEllipseElement;
+ class WhiteboardLineElement;
+ class WhiteboardFreehandPathElement;
+ class WhiteboardRectElement;
+ class WhiteboardPolygonElement;
+ class WhiteboardTextElement;
+ class WhiteboardEllipseElement;
- class WhiteboardElementVisitor {
- public:
- virtual ~WhiteboardElementVisitor() {}
- virtual void visit(WhiteboardLineElement& /*element*/) = 0;
- virtual void visit(WhiteboardFreehandPathElement& /*element*/) = 0;
- virtual void visit(WhiteboardRectElement& /*element*/) = 0;
- virtual void visit(WhiteboardPolygonElement& /*element*/) = 0;
- virtual void visit(WhiteboardTextElement& /*element*/) = 0;
- virtual void visit(WhiteboardEllipseElement& /*element*/) = 0;
- };
+ class WhiteboardElementVisitor {
+ public:
+ virtual ~WhiteboardElementVisitor() {}
+ virtual void visit(WhiteboardLineElement& /*element*/) = 0;
+ virtual void visit(WhiteboardFreehandPathElement& /*element*/) = 0;
+ virtual void visit(WhiteboardRectElement& /*element*/) = 0;
+ virtual void visit(WhiteboardPolygonElement& /*element*/) = 0;
+ virtual void visit(WhiteboardTextElement& /*element*/) = 0;
+ virtual void visit(WhiteboardEllipseElement& /*element*/) = 0;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardEllipseElement.h b/Swiften/Elements/Whiteboard/WhiteboardEllipseElement.h
index 0078479..8086aed 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardEllipseElement.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardEllipseElement.h
@@ -4,71 +4,78 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#pragma once
-#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Whiteboard/WhiteboardColor.h>
+#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
namespace Swift {
- class WhiteboardEllipseElement : public WhiteboardElement {
- public:
- typedef boost::shared_ptr<WhiteboardEllipseElement> ref;
- public:
- WhiteboardEllipseElement(int cx, int cy, int rx, int ry) {
- cx_ = cx;
- cy_ = cy;
- rx_ = rx;
- ry_ = ry;
- }
-
- int getCX() const {
- return cx_;
- }
-
- int getCY() const {
- return cy_;
- }
-
- int getRX() const {
- return rx_;
- }
-
- int getRY() const {
- return ry_;
- }
-
- const WhiteboardColor& getPenColor() const {
- return penColor_;
- }
-
- void setPenColor(const WhiteboardColor& color) {
- penColor_ = color;
- }
-
- const WhiteboardColor& getBrushColor() const {
- return brushColor_;
- }
-
- void setBrushColor(const WhiteboardColor& color) {
- brushColor_ = color;
- }
-
- int getPenWidth() const {
- return penWidth_;
- }
-
- void setPenWidth(const int penWidth) {
- penWidth_ = penWidth;
- }
-
- void accept(WhiteboardElementVisitor& visitor) {
- visitor.visit(*this);
- }
-
- private:
- int cx_, cy_, rx_, ry_;
- WhiteboardColor penColor_;
- WhiteboardColor brushColor_;
- int penWidth_;
- };
+ class SWIFTEN_API WhiteboardEllipseElement : public WhiteboardElement {
+ public:
+ typedef std::shared_ptr<WhiteboardEllipseElement> ref;
+ public:
+ WhiteboardEllipseElement(int cx, int cy, int rx, int ry) {
+ cx_ = cx;
+ cy_ = cy;
+ rx_ = rx;
+ ry_ = ry;
+ }
+
+ int getCX() const {
+ return cx_;
+ }
+
+ int getCY() const {
+ return cy_;
+ }
+
+ int getRX() const {
+ return rx_;
+ }
+
+ int getRY() const {
+ return ry_;
+ }
+
+ const WhiteboardColor& getPenColor() const {
+ return penColor_;
+ }
+
+ void setPenColor(const WhiteboardColor& color) {
+ penColor_ = color;
+ }
+
+ const WhiteboardColor& getBrushColor() const {
+ return brushColor_;
+ }
+
+ void setBrushColor(const WhiteboardColor& color) {
+ brushColor_ = color;
+ }
+
+ int getPenWidth() const {
+ return penWidth_;
+ }
+
+ void setPenWidth(const int penWidth) {
+ penWidth_ = penWidth;
+ }
+
+ void accept(WhiteboardElementVisitor& visitor) {
+ visitor.visit(*this);
+ }
+
+ private:
+ int cx_, cy_, rx_, ry_;
+ WhiteboardColor penColor_;
+ WhiteboardColor brushColor_;
+ int penWidth_ = 0;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardFreehandPathElement.h b/Swiften/Elements/Whiteboard/WhiteboardFreehandPathElement.h
index bcf3bf9..bc6c846 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardFreehandPathElement.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardFreehandPathElement.h
@@ -4,54 +4,61 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
-#pragma once
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
-#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
-#include <Swiften/Elements/Whiteboard/WhiteboardColor.h>
+#pragma once
-#include <vector>
#include <utility>
+#include <vector>
+
+#include <Swiften/Base/API.h>
+#include <Swiften/Elements/Whiteboard/WhiteboardColor.h>
+#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
namespace Swift {
- class WhiteboardFreehandPathElement : public WhiteboardElement {
- typedef std::pair<int, int> Point;
- public:
- typedef boost::shared_ptr<WhiteboardFreehandPathElement> ref;
- public:
- WhiteboardFreehandPathElement() {
- }
-
- void setPoints(const std::vector<Point>& points) {
- points_ = points;
- }
-
- const std::vector<Point>& getPoints() const {
- return points_;
- }
-
- const WhiteboardColor& getColor() const {
- return color_;
- }
-
- void setColor(const WhiteboardColor& color) {
- color_ = color;
- }
-
- int getPenWidth() const {
- return penWidth_;
- }
-
- void setPenWidth(const int penWidth) {
- penWidth_ = penWidth;
- }
-
- void accept(WhiteboardElementVisitor& visitor) {
- visitor.visit(*this);
- }
-
- private:
- std::vector<Point> points_;
- WhiteboardColor color_;
- int penWidth_;
- };
+ class SWIFTEN_API WhiteboardFreehandPathElement : public WhiteboardElement {
+ typedef std::pair<int, int> Point;
+ public:
+ typedef std::shared_ptr<WhiteboardFreehandPathElement> ref;
+ public:
+ WhiteboardFreehandPathElement() {
+ }
+
+ void setPoints(const std::vector<Point>& points) {
+ points_ = points;
+ }
+
+ const std::vector<Point>& getPoints() const {
+ return points_;
+ }
+
+ const WhiteboardColor& getColor() const {
+ return color_;
+ }
+
+ void setColor(const WhiteboardColor& color) {
+ color_ = color;
+ }
+
+ int getPenWidth() const {
+ return penWidth_;
+ }
+
+ void setPenWidth(const int penWidth) {
+ penWidth_ = penWidth;
+ }
+
+ void accept(WhiteboardElementVisitor& visitor) {
+ visitor.visit(*this);
+ }
+
+ private:
+ std::vector<Point> points_;
+ WhiteboardColor color_;
+ int penWidth_ = 0;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h b/Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h
index 8c20044..256c17e 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardInsertOperation.h
@@ -4,29 +4,32 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
-#pragma once
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
-#include <Swiften/Elements/Whiteboard/WhiteboardOperation.h>
+#pragma once
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
+#include <Swiften/Elements/Whiteboard/WhiteboardOperation.h>
namespace Swift {
- class WhiteboardInsertOperation : public WhiteboardOperation {
- public:
- typedef boost::shared_ptr<WhiteboardInsertOperation> ref;
- public:
- ~WhiteboardInsertOperation() {
- }
-
- WhiteboardElement::ref getElement() const {
- return element_;
- }
+ class SWIFTEN_API WhiteboardInsertOperation : public WhiteboardOperation {
+ public:
+ typedef std::shared_ptr<WhiteboardInsertOperation> ref;
+ public:
+ WhiteboardElement::ref getElement() const {
+ return element_;
+ }
- void setElement(WhiteboardElement::ref element) {
- element_ = element;
- }
+ void setElement(WhiteboardElement::ref element) {
+ element_ = element;
+ }
- private:
- WhiteboardElement::ref element_;
- };
+ private:
+ WhiteboardElement::ref element_;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardLineElement.h b/Swiften/Elements/Whiteboard/WhiteboardLineElement.h
index 3c63afc..9c64977 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardLineElement.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardLineElement.h
@@ -4,62 +4,70 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2014-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
+
#pragma once
-#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Whiteboard/WhiteboardColor.h>
+#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
namespace Swift {
- class WhiteboardLineElement : public WhiteboardElement {
- public:
- typedef boost::shared_ptr<WhiteboardLineElement> ref;
- public:
- WhiteboardLineElement(int x1, int y1, int x2, int y2) {
- x1_ = x1;
- y1_ = y1;
- x2_ = x2;
- y2_ = y2;
- }
+ class SWIFTEN_API WhiteboardLineElement : public WhiteboardElement {
+ public:
+ typedef std::shared_ptr<WhiteboardLineElement> ref;
+ public:
+ WhiteboardLineElement(int x1, int y1, int x2, int y2) : penWidth_(1) {
+ x1_ = x1;
+ y1_ = y1;
+ x2_ = x2;
+ y2_ = y2;
+ }
- int x1() const {
- return x1_;
- }
+ int x1() const {
+ return x1_;
+ }
- int y1() const {
- return y1_;
- }
+ int y1() const {
+ return y1_;
+ }
- int x2() const {
- return x2_;
- }
+ int x2() const {
+ return x2_;
+ }
- int y2() const {
- return y2_;
- }
+ int y2() const {
+ return y2_;
+ }
- const WhiteboardColor& getColor() const {
- return color_;
- }
+ const WhiteboardColor& getColor() const {
+ return color_;
+ }
- void setColor(const WhiteboardColor& color) {
- color_ = color;
- }
+ void setColor(const WhiteboardColor& color) {
+ color_ = color;
+ }
- int getPenWidth() const {
- return penWidth_;
- }
+ int getPenWidth() const {
+ return penWidth_;
+ }
- void setPenWidth(const int penWidth) {
- penWidth_ = penWidth;
- }
+ void setPenWidth(const int penWidth) {
+ penWidth_ = penWidth;
+ }
- void accept(WhiteboardElementVisitor& visitor) {
- visitor.visit(*this);
- }
+ void accept(WhiteboardElementVisitor& visitor) {
+ visitor.visit(*this);
+ }
- private:
- int x1_, y1_, x2_, y2_;
- WhiteboardColor color_;
- int penWidth_;
- };
+ private:
+ int x1_, y1_, x2_, y2_;
+ WhiteboardColor color_;
+ int penWidth_;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardOperation.h b/Swiften/Elements/Whiteboard/WhiteboardOperation.h
index 75f6e6a..2e90c69 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardOperation.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardOperation.h
@@ -4,45 +4,56 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#pragma once
-#include <boost/smart_ptr/shared_ptr.hpp>
#include <string>
+#include <boost/smart_ptr/shared_ptr.hpp>
+
+#include <Swiften/Base/API.h>
+
namespace Swift {
- class WhiteboardOperation {
- public:
- typedef boost::shared_ptr<WhiteboardOperation> ref;
- public:
- virtual ~WhiteboardOperation(){}
-
- std::string getID() const {
- return id_;
- }
-
- void setID(const std::string& id) {
- id_ = id;
- }
-
- std::string getParentID() const {
- return parentID_;
- }
-
- void setParentID(const std::string& parentID) {
- parentID_ = parentID;
- }
-
- int getPos() const {
- return pos_;
- }
-
- void setPos(int pos) {
- pos_ = pos;
- }
-
- private:
- std::string id_;
- std::string parentID_;
- int pos_;
- };
+ class WhiteboardOperation {
+ public:
+ typedef std::shared_ptr<WhiteboardOperation> ref;
+ public:
+ WhiteboardOperation() {}
+ SWIFTEN_DEFAULT_COPY_CONSTRUCTOR(WhiteboardOperation)
+ virtual ~WhiteboardOperation(){}
+
+ std::string getID() const {
+ return id_;
+ }
+
+ void setID(const std::string& id) {
+ id_ = id;
+ }
+
+ std::string getParentID() const {
+ return parentID_;
+ }
+
+ void setParentID(const std::string& parentID) {
+ parentID_ = parentID;
+ }
+
+ int getPos() const {
+ return pos_;
+ }
+
+ void setPos(int pos) {
+ pos_ = pos;
+ }
+
+ private:
+ std::string id_;
+ std::string parentID_;
+ int pos_ = 0;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardPolygonElement.h b/Swiften/Elements/Whiteboard/WhiteboardPolygonElement.h
index 679ac01..6ad5dc7 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardPolygonElement.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardPolygonElement.h
@@ -4,60 +4,69 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#pragma once
-#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
+#include <vector>
+
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Whiteboard/WhiteboardColor.h>
+#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
namespace Swift {
- class WhiteboardPolygonElement : public WhiteboardElement {
- typedef std::pair<int, int> Point;
- public:
- typedef boost::shared_ptr<WhiteboardPolygonElement> ref;
- public:
- WhiteboardPolygonElement() {
- }
-
- const std::vector<Point>& getPoints() const {
- return points_;
- }
-
- void setPoints(const std::vector<Point>& points) {
- points_ = points;
- }
-
- const WhiteboardColor& getPenColor() const {
- return penColor_;
- }
-
- void setPenColor(const WhiteboardColor& color) {
- penColor_ = color;
- }
-
- const WhiteboardColor& getBrushColor() const {
- return brushColor_;
- }
-
- void setBrushColor(const WhiteboardColor& color) {
- brushColor_ = color;
- }
-
- int getPenWidth() const {
- return penWidth_;
- }
-
- void setPenWidth(const int penWidth) {
- penWidth_ = penWidth;
- }
-
- void accept(WhiteboardElementVisitor& visitor) {
- visitor.visit(*this);
- }
-
- private:
- std::vector<Point> points_;
- WhiteboardColor penColor_;
- WhiteboardColor brushColor_;
- int penWidth_;
- };
+ class SWIFTEN_API WhiteboardPolygonElement : public WhiteboardElement {
+ typedef std::pair<int, int> Point;
+ public:
+ typedef std::shared_ptr<WhiteboardPolygonElement> ref;
+ public:
+ WhiteboardPolygonElement() {
+ }
+
+ const std::vector<Point>& getPoints() const {
+ return points_;
+ }
+
+ void setPoints(const std::vector<Point>& points) {
+ points_ = points;
+ }
+
+ const WhiteboardColor& getPenColor() const {
+ return penColor_;
+ }
+
+ void setPenColor(const WhiteboardColor& color) {
+ penColor_ = color;
+ }
+
+ const WhiteboardColor& getBrushColor() const {
+ return brushColor_;
+ }
+
+ void setBrushColor(const WhiteboardColor& color) {
+ brushColor_ = color;
+ }
+
+ int getPenWidth() const {
+ return penWidth_;
+ }
+
+ void setPenWidth(const int penWidth) {
+ penWidth_ = penWidth;
+ }
+
+ void accept(WhiteboardElementVisitor& visitor) {
+ visitor.visit(*this);
+ }
+
+ private:
+ std::vector<Point> points_;
+ WhiteboardColor penColor_;
+ WhiteboardColor brushColor_;
+ int penWidth_ = 0;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardRectElement.h b/Swiften/Elements/Whiteboard/WhiteboardRectElement.h
index 233b3fa..4dcdc8a 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardRectElement.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardRectElement.h
@@ -4,71 +4,78 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2014-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#pragma once
-#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Whiteboard/WhiteboardColor.h>
+#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
namespace Swift {
- class WhiteboardRectElement : public WhiteboardElement {
- public:
- typedef boost::shared_ptr<WhiteboardRectElement> ref;
- public:
- WhiteboardRectElement(int x, int y, int width, int height) {
- x_ = x;
- y_ = y;
- width_ = width;
- height_ = height;
- }
-
- int getX() const {
- return x_;
- }
-
- int getY() const {
- return y_;
- }
-
- int getWidth() const {
- return width_;
- }
-
- int getHeight() const {
- return height_;
- }
-
- const WhiteboardColor& getPenColor() const {
- return penColor_;
- }
-
- void setPenColor(const WhiteboardColor& color) {
- penColor_ = color;
- }
-
- const WhiteboardColor& getBrushColor() const {
- return brushColor_;
- }
-
- void setBrushColor(const WhiteboardColor& color) {
- brushColor_ = color;
- }
-
- int getPenWidth() const {
- return penWidth_;
- }
-
- void setPenWidth(const int penWidth) {
- penWidth_ = penWidth;
- }
-
- void accept(WhiteboardElementVisitor& visitor) {
- visitor.visit(*this);
- }
-
- private:
- int x_, y_, width_, height_;
- WhiteboardColor penColor_;
- WhiteboardColor brushColor_;
- int penWidth_;
- };
+ class SWIFTEN_API WhiteboardRectElement : public WhiteboardElement {
+ public:
+ typedef std::shared_ptr<WhiteboardRectElement> ref;
+ public:
+ WhiteboardRectElement(int x, int y, int width, int height) : penWidth_(1) {
+ x_ = x;
+ y_ = y;
+ width_ = width;
+ height_ = height;
+ }
+
+ int getX() const {
+ return x_;
+ }
+
+ int getY() const {
+ return y_;
+ }
+
+ int getWidth() const {
+ return width_;
+ }
+
+ int getHeight() const {
+ return height_;
+ }
+
+ const WhiteboardColor& getPenColor() const {
+ return penColor_;
+ }
+
+ void setPenColor(const WhiteboardColor& color) {
+ penColor_ = color;
+ }
+
+ const WhiteboardColor& getBrushColor() const {
+ return brushColor_;
+ }
+
+ void setBrushColor(const WhiteboardColor& color) {
+ brushColor_ = color;
+ }
+
+ int getPenWidth() const {
+ return penWidth_;
+ }
+
+ void setPenWidth(const int penWidth) {
+ penWidth_ = penWidth;
+ }
+
+ void accept(WhiteboardElementVisitor& visitor) {
+ visitor.visit(*this);
+ }
+
+ private:
+ int x_, y_, width_, height_;
+ WhiteboardColor penColor_;
+ WhiteboardColor brushColor_;
+ int penWidth_;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardTextElement.h b/Swiften/Elements/Whiteboard/WhiteboardTextElement.h
index 7118ac9..2e1c145 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardTextElement.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardTextElement.h
@@ -4,61 +4,68 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#pragma once
-#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Whiteboard/WhiteboardColor.h>
+#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
namespace Swift {
- class WhiteboardTextElement : public WhiteboardElement {
- public:
- typedef boost::shared_ptr<WhiteboardTextElement> ref;
- public:
- WhiteboardTextElement(int x, int y) {
- x_ = x;
- y_ = y;
- }
+ class SWIFTEN_API WhiteboardTextElement : public WhiteboardElement {
+ public:
+ typedef std::shared_ptr<WhiteboardTextElement> ref;
+ public:
+ WhiteboardTextElement(int x, int y) {
+ x_ = x;
+ y_ = y;
+ }
- void setText(const std::string text) {
- text_ = text;
- }
+ void setText(const std::string text) {
+ text_ = text;
+ }
- const std::string& getText() const {
- return text_;
- }
+ const std::string& getText() const {
+ return text_;
+ }
- int getX() const {
- return x_;
- }
+ int getX() const {
+ return x_;
+ }
- int getY() const {
- return y_;
- }
+ int getY() const {
+ return y_;
+ }
- const WhiteboardColor& getColor() const {
- return color_;
- }
+ const WhiteboardColor& getColor() const {
+ return color_;
+ }
- void setColor(const WhiteboardColor& color) {
- color_ = color;
- }
+ void setColor(const WhiteboardColor& color) {
+ color_ = color;
+ }
- int getSize() const {
- return size_;
- }
+ int getSize() const {
+ return size_;
+ }
- void setSize(const int size) {
- size_ = size;
- }
+ void setSize(const int size) {
+ size_ = size;
+ }
- void accept(WhiteboardElementVisitor& visitor) {
- visitor.visit(*this);
- }
+ void accept(WhiteboardElementVisitor& visitor) {
+ visitor.visit(*this);
+ }
- private:
- int x_, y_;
- int size_;
- std::string text_;
- WhiteboardColor color_;
- };
+ private:
+ int x_, y_;
+ int size_ = 0;
+ std::string text_;
+ WhiteboardColor color_;
+ };
}
diff --git a/Swiften/Elements/Whiteboard/WhiteboardUpdateOperation.h b/Swiften/Elements/Whiteboard/WhiteboardUpdateOperation.h
index a52a341..36cbc6d 100644
--- a/Swiften/Elements/Whiteboard/WhiteboardUpdateOperation.h
+++ b/Swiften/Elements/Whiteboard/WhiteboardUpdateOperation.h
@@ -4,38 +4,41 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
-#pragma once
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
-#include <Swiften/Elements/Whiteboard/WhiteboardOperation.h>
+#pragma once
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
+#include <Swiften/Elements/Whiteboard/WhiteboardOperation.h>
namespace Swift {
- class WhiteboardUpdateOperation : public WhiteboardOperation {
- public:
- typedef boost::shared_ptr<WhiteboardUpdateOperation> ref;
- public:
- ~WhiteboardUpdateOperation() {
- }
-
- WhiteboardElement::ref getElement() const {
- return element_;
- }
-
- void setElement(WhiteboardElement::ref element) {
- element_ = element;
- }
-
- int getNewPos() const {
- return newPos_;
- }
-
- void setNewPos(int newPos) {
- newPos_ = newPos;
- }
-
- private:
- WhiteboardElement::ref element_;
- int newPos_;
- };
+ class SWIFTEN_API WhiteboardUpdateOperation : public WhiteboardOperation {
+ public:
+ typedef std::shared_ptr<WhiteboardUpdateOperation> ref;
+ public:
+ WhiteboardElement::ref getElement() const {
+ return element_;
+ }
+
+ void setElement(WhiteboardElement::ref element) {
+ element_ = element;
+ }
+
+ int getNewPos() const {
+ return newPos_;
+ }
+
+ void setNewPos(int newPos) {
+ newPos_ = newPos;
+ }
+
+ private:
+ WhiteboardElement::ref element_;
+ int newPos_ = 0;
+ };
}
diff --git a/Swiften/Elements/WhiteboardPayload.h b/Swiften/Elements/WhiteboardPayload.h
index ceb2b27..41c0acd 100644
--- a/Swiften/Elements/WhiteboardPayload.h
+++ b/Swiften/Elements/WhiteboardPayload.h
@@ -4,61 +4,68 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2015-2016 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#pragma once
#include <string>
+#include <Swiften/Base/API.h>
#include <Swiften/Elements/Payload.h>
#include <Swiften/Elements/Whiteboard/WhiteboardElement.h>
#include <Swiften/Elements/Whiteboard/WhiteboardOperation.h>
namespace Swift {
- class WhiteboardPayload : public Payload {
- public:
- typedef boost::shared_ptr<WhiteboardPayload> ref;
-
- public:
- enum Type {UnknownType, Data, SessionRequest, SessionAccept, SessionTerminate};
-
- WhiteboardPayload(Type type = WhiteboardPayload::Data) : type_(type) {
- }
-
- void setData(const std::string &data) {
- data_ = data;
- }
-
- std::string getData() const {
- return data_;
- }
-
- Type getType() const {
- return type_;
- }
-
- void setType(Type type) {
- type_ = type;
- }
-
- WhiteboardElement::ref getElement() const {
- return element_;
- }
-
- void setElement(WhiteboardElement::ref element) {
- element_ = element;
- }
-
- WhiteboardOperation::ref getOperation() const {
- return operation_;
- }
-
- void setOperation(WhiteboardOperation::ref operation) {
- operation_ = operation;
- }
-
- private:
- std::string data_;
- Type type_;
- WhiteboardElement::ref element_;
- WhiteboardOperation::ref operation_;
- };
+ class SWIFTEN_API WhiteboardPayload : public Payload {
+ public:
+ typedef std::shared_ptr<WhiteboardPayload> ref;
+
+ public:
+ enum Type {UnknownType, Data, SessionRequest, SessionAccept, SessionTerminate};
+
+ WhiteboardPayload(Type type = WhiteboardPayload::Data) : type_(type) {
+ }
+
+ void setData(const std::string &data) {
+ data_ = data;
+ }
+
+ std::string getData() const {
+ return data_;
+ }
+
+ Type getType() const {
+ return type_;
+ }
+
+ void setType(Type type) {
+ type_ = type;
+ }
+
+ WhiteboardElement::ref getElement() const {
+ return element_;
+ }
+
+ void setElement(WhiteboardElement::ref element) {
+ element_ = element;
+ }
+
+ WhiteboardOperation::ref getOperation() const {
+ return operation_;
+ }
+
+ void setOperation(WhiteboardOperation::ref operation) {
+ operation_ = operation;
+ }
+
+ private:
+ std::string data_;
+ Type type_;
+ WhiteboardElement::ref element_;
+ WhiteboardOperation::ref operation_;
+ };
}