diff options
author | Tobias Markmann <tm@ayena.de> | 2015-02-20 09:06:33 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2015-02-20 16:51:51 (GMT) |
commit | 88758e2b2a24372386b8d3d5fa5390414cc8ec0f (patch) | |
tree | 8bb7183c1cc7d47715a23a9be1b414cc9c09d90f /Swiften/Elements | |
parent | 9b4314424ee2daff9031a0027f2d8de3a84ed48e (diff) | |
download | swift-88758e2b2a24372386b8d3d5fa5390414cc8ec0f.zip swift-88758e2b2a24372386b8d3d5fa5390414cc8ec0f.tar.bz2 |
Add elements/parsers/serializers/tests for Message Carbons (XEP-0280)
In addition this patch adds an element, a parser and a serializer for
the <thread/> element from XMPP IM.
Test-Information:
Implemented unit tests pass as expected.
Change-Id: I0a14c778c2c0bf65f4b405c9878c741449bfe142
Diffstat (limited to 'Swiften/Elements')
-rw-r--r-- | Swiften/Elements/CarbonsDisable.cpp | 12 | ||||
-rw-r--r-- | Swiften/Elements/CarbonsDisable.h | 22 | ||||
-rw-r--r-- | Swiften/Elements/CarbonsEnable.cpp | 12 | ||||
-rw-r--r-- | Swiften/Elements/CarbonsEnable.h | 22 | ||||
-rw-r--r-- | Swiften/Elements/CarbonsPrivate.cpp | 12 | ||||
-rw-r--r-- | Swiften/Elements/CarbonsPrivate.h | 22 | ||||
-rw-r--r-- | Swiften/Elements/CarbonsReceived.cpp | 21 | ||||
-rw-r--r-- | Swiften/Elements/CarbonsReceived.h | 28 | ||||
-rw-r--r-- | Swiften/Elements/CarbonsSent.cpp | 21 | ||||
-rw-r--r-- | Swiften/Elements/CarbonsSent.h | 28 | ||||
-rw-r--r-- | Swiften/Elements/Thread.cpp | 34 | ||||
-rw-r--r-- | Swiften/Elements/Thread.h | 28 |
12 files changed, 262 insertions, 0 deletions
diff --git a/Swiften/Elements/CarbonsDisable.cpp b/Swiften/Elements/CarbonsDisable.cpp new file mode 100644 index 0000000..b5d80ca --- /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..e31526d --- /dev/null +++ b/Swiften/Elements/CarbonsDisable.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2015 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + +#pragma once + +#include <boost/shared_ptr.hpp> + +#include <Swiften/Base/API.h> +#include <Swiften/Elements/Payload.h> + +namespace Swift { + class SWIFTEN_API CarbonsDisable : public Payload { + public: + typedef boost::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..7d38be1 --- /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..b100e8d --- /dev/null +++ b/Swiften/Elements/CarbonsEnable.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2015 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + +#pragma once + +#include <boost/shared_ptr.hpp> + +#include <Swiften/Base/API.h> +#include <Swiften/Elements/Payload.h> + +namespace Swift { + class SWIFTEN_API CarbonsEnable : public Payload { + public: + typedef boost::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..a0c6369 --- /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..e363b5c --- /dev/null +++ b/Swiften/Elements/CarbonsPrivate.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2015 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + +#pragma once + +#include <boost/shared_ptr.hpp> + +#include <Swiften/Base/API.h> +#include <Swiften/Elements/Payload.h> + +namespace Swift { + class SWIFTEN_API CarbonsPrivate : public Payload { + public: + typedef boost::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..d906f8e --- /dev/null +++ b/Swiften/Elements/CarbonsReceived.cpp @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2015 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + +#include <Swiften/Elements/CarbonsReceived.h> + +namespace Swift { + CarbonsReceived::~CarbonsReceived() { + + } + + void CarbonsReceived::setForwarded(boost::shared_ptr<Forwarded> forwarded) { + forwarded_ = forwarded; + } + + boost::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..b057893 --- /dev/null +++ b/Swiften/Elements/CarbonsReceived.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2015 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + +#pragma once + +#include <boost/shared_ptr.hpp> + +#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 boost::shared_ptr<CarbonsReceived> ref; + + public: + virtual ~CarbonsReceived(); + void setForwarded(boost::shared_ptr<Forwarded> forwarded); + boost::shared_ptr<Forwarded> getForwarded() const; + + private: + boost::shared_ptr<Forwarded> forwarded_; + }; +} diff --git a/Swiften/Elements/CarbonsSent.cpp b/Swiften/Elements/CarbonsSent.cpp new file mode 100644 index 0000000..08b2e13 --- /dev/null +++ b/Swiften/Elements/CarbonsSent.cpp @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2015 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + +#include <Swiften/Elements/CarbonsSent.h> + +namespace Swift { + CarbonsSent::~CarbonsSent() { + + } + + void CarbonsSent::setForwarded(boost::shared_ptr<Forwarded> forwarded) { + forwarded_ = forwarded; + } + + boost::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..f6b2b53 --- /dev/null +++ b/Swiften/Elements/CarbonsSent.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2015 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ + +#pragma once + +#include <boost/shared_ptr.hpp> + +#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 boost::shared_ptr<CarbonsSent> ref; + + public: + virtual ~CarbonsSent(); + void setForwarded(boost::shared_ptr<Forwarded> forwarded); + boost::shared_ptr<Forwarded> getForwarded() const; + + private: + boost::shared_ptr<Forwarded> forwarded_; + }; +} diff --git a/Swiften/Elements/Thread.cpp b/Swiften/Elements/Thread.cpp new file mode 100644 index 0000000..dfd9029 --- /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..8207851 --- /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_; + }; +} |