summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2014-01-22 20:20:55 (GMT)
committerRemko Tronçon <git@el-tramo.be>2014-01-22 21:25:50 (GMT)
commitfe460ca46bff4f9e735db86ca072eafb3a5c8f2d (patch)
tree82ac0b3c1c29ec13dd66a7f328a93d0b14db895a /Swiften/Elements
parent4c83aa02da939ee3dc59b6febf70cab87e85f758 (diff)
downloadswift-fe460ca46bff4f9e735db86ca072eafb3a5c8f2d.zip
swift-fe460ca46bff4f9e735db86ca072eafb3a5c8f2d.tar.bz2
Sluift: Add SecurityLabel convertor
Change-Id: I59357bda2cbfcb044b5c27b41fe0c91c194e7381
Diffstat (limited to 'Swiften/Elements')
-rw-r--r--Swiften/Elements/SecurityLabel.cpp15
-rw-r--r--Swiften/Elements/SecurityLabel.h76
-rw-r--r--Swiften/Elements/SecurityLabelsCatalog.h8
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_;
};