diff options
Diffstat (limited to 'Swiften/Elements')
-rw-r--r-- | Swiften/Elements/SecurityLabel.cpp | 15 | ||||
-rw-r--r-- | Swiften/Elements/SecurityLabel.h | 76 | ||||
-rw-r--r-- | Swiften/Elements/SecurityLabelsCatalog.h | 8 |
3 files changed, 65 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_; }; |