• Main Page
  • Classes
  • Files
  • File List

Swiften/Elements/SecurityLabelsCatalog.h

00001 /*
00002  * Copyright (c) 2010 Remko Tronçon
00003  * Licensed under the GNU General Public License v3.
00004  * See Documentation/Licenses/GPLv3.txt for more information.
00005  */
00006 
00007 #pragma once
00008 
00009 #include <vector>
00010 #include <string>
00011 #include <boost/shared_ptr.hpp>
00012 
00013 #include <Swiften/Base/API.h>
00014 #include <Swiften/JID/JID.h>
00015 #include <Swiften/Elements/Payload.h>
00016 #include <Swiften/Elements/SecurityLabel.h>
00017 
00018 namespace Swift {
00019   class SWIFTEN_API SecurityLabelsCatalog : public Payload {
00020     public:
00021       typedef boost::shared_ptr<SecurityLabelsCatalog> ref;
00022       class Item {
00023         public:
00024           Item() : default_(false) {}
00025           SecurityLabel::ref getLabel() const {
00026             return label_;
00027           }
00028 
00029           void setLabel(SecurityLabel::ref label) {
00030             label_ = label;
00031           }
00032 
00033           const std::string& getSelector() const { return selector_; }
00034 
00035           void setSelector(const std::string& selector) {
00036             selector_ = selector;
00037           }
00038 
00039           bool getIsDefault() const { return default_; }
00040 
00041           void setIsDefault(bool isDefault) {
00042             default_ = isDefault;
00043           }
00044         private:
00045           SecurityLabel::ref label_;
00046           std::string selector_;
00047           bool default_;
00048       };
00049       SecurityLabelsCatalog(const JID& to = JID()) : to_(to) {}
00050 
00051       const std::vector<Item>& getItems() const {
00052         return items_;
00053       }
00054 
00055       void addItem(const Item& item) {
00056         items_.push_back(item);
00057       }
00058 
00059       const JID& getTo() const {
00060         return to_;
00061       }
00062 
00063       void setTo(const JID& to) {
00064         to_ = to;
00065       }
00066 
00067       const std::string& getName() const {
00068         return name_;
00069       }
00070 
00071       void setName(const std::string& name) {
00072         name_ = name;
00073       }
00074 
00075       const std::string& getDescription() const {
00076         return description_;
00077       }
00078 
00079       void setDescription(const std::string& description) {
00080         description_ = description;
00081       }
00082 
00083     private:
00084       JID to_;
00085       std::string name_;
00086       std::string description_;
00087       std::vector<Item> items_;
00088   };
00089 }

Generated on Fri Oct 12 2012 21:00:19 for Swiften by  doxygen 1.7.1