diff options
author | Remko Tronçon <git@el-tramo.be> | 2014-01-22 20:20:55 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2014-01-22 21:25:50 (GMT) |
commit | fe460ca46bff4f9e735db86ca072eafb3a5c8f2d (patch) | |
tree | 82ac0b3c1c29ec13dd66a7f328a93d0b14db895a /Swiften | |
parent | 4c83aa02da939ee3dc59b6febf70cab87e85f758 (diff) | |
download | swift-fe460ca46bff4f9e735db86ca072eafb3a5c8f2d.zip swift-fe460ca46bff4f9e735db86ca072eafb3a5c8f2d.tar.bz2 |
Sluift: Add SecurityLabel convertor
Change-Id: I59357bda2cbfcb044b5c27b41fe0c91c194e7381
Diffstat (limited to 'Swiften')
-rw-r--r-- | Swiften/Elements/SecurityLabel.cpp | 15 | ||||
-rw-r--r-- | Swiften/Elements/SecurityLabel.h | 76 | ||||
-rw-r--r-- | Swiften/Elements/SecurityLabelsCatalog.h | 8 | ||||
-rw-r--r-- | Swiften/SConscript | 1 |
4 files changed, 66 insertions, 34 deletions
diff --git a/Swiften/Elements/SecurityLabel.cpp b/Swiften/Elements/SecurityLabel.cpp new file mode 100644 index 0000000..2e315c5 --- /dev/null +++ b/Swiften/Elements/SecurityLabel.cpp @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2010-2014 Remko Tronçon + * Licensed under the GNU General Public License. + * 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..24f891d 100644 --- a/Swiften/Elements/SecurityLabel.h +++ b/Swiften/Elements/SecurityLabel.h @@ -1,61 +1,77 @@ /* - * 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 Remko Tronçon + * Licensed under the GNU General Public License. + * 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 <vector> - #include <string> -#include <Swiften/Elements/Payload.h> + + namespace Swift { - class SecurityLabel : public Payload { + class SWIFTEN_API SecurityLabel : public Payload { public: - typedef boost::shared_ptr<SecurityLabel> ref; - SecurityLabel() {} + + SecurityLabel(); + + virtual ~SecurityLabel(); - const std::string& getDisplayMarking() const { return displayMarking_; } + const std::vector< std::string >& getEquivalentLabels() const { + return equivalentLabels; + } - void setDisplayMarking(const std::string& displayMarking) { - displayMarking_ = displayMarking; + void setEquivalentLabels(const std::vector< std::string >& value) { + this->equivalentLabels = value ; } - const std::string& getForegroundColor() const { - return foregroundColor_; + void addEquivalentLabel(const std::string& value) { + this->equivalentLabels.push_back(value); } - void setForegroundColor(const std::string& foregroundColor) { - foregroundColor_ = foregroundColor; + const std::string& getForegroundColor() const { + return foregroundColor; } - const std::string& getBackgroundColor() const { - return backgroundColor_; + void setForegroundColor(const std::string& value) { + this->foregroundColor = value ; } - void setBackgroundColor(const std::string& backgroundColor) { - backgroundColor_ = backgroundColor; + const std::string& getDisplayMarking() const { + return displayMarking; } - const std::string& getLabel() const { return label_; } + void setDisplayMarking(const std::string& value) { + this->displayMarking = value ; + } - void setLabel(const std::string& label) { - label_ = label; + const std::string& getBackgroundColor() const { + return backgroundColor; } - const std::vector<std::string>& getEquivalentLabels() const { return equivalentLabels_; } + void setBackgroundColor(const std::string& value) { + this->backgroundColor = value ; + } - void addEquivalentLabel(const std::string& label) { - equivalentLabels_.push_back(label); + const std::string& getLabel() const { + return label; } + void setLabel(const std::string& value) { + this->label = value ; + } + + private: - std::string displayMarking_; - std::string foregroundColor_; - std::string backgroundColor_; - std::string label_; - std::vector<std::string> equivalentLabels_; + 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..000240e 100644 --- a/Swiften/Elements/SecurityLabelsCatalog.h +++ b/Swiften/Elements/SecurityLabelsCatalog.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010 Remko Tronçon + * Copyright (c) 2010-2014 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -22,11 +22,11 @@ namespace Swift { class Item { public: Item() : default_(false) {} - SecurityLabel::ref getLabel() const { + boost::shared_ptr<SecurityLabel> getLabel() const { return label_; } - void setLabel(SecurityLabel::ref label) { + void setLabel(boost::shared_ptr<SecurityLabel> label) { label_ = label; } @@ -42,7 +42,7 @@ namespace Swift { default_ = isDefault; } private: - SecurityLabel::ref label_; + boost::shared_ptr<SecurityLabel> label_; std::string selector_; bool default_; }; diff --git a/Swiften/SConscript b/Swiften/SConscript index b5e13a9..80db7da 100644 --- a/Swiften/SConscript +++ b/Swiften/SConscript @@ -130,6 +130,7 @@ if env["SCONS_STAGE"] == "build" : "Elements/PubSubEventPayload.cpp", "Elements/RosterItemExchangePayload.cpp", "Elements/RosterPayload.cpp", + "Elements/SecurityLabel.cpp", "Elements/Stanza.cpp", "Elements/StanzaAck.cpp", "Elements/StatusShow.cpp", |