OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
PropertyStringList.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
9#include "OTGui/Property.h"
10
11// std header
12#include <list>
13#include <string>
14#include <vector>
15
16namespace ot {
17
20 public:
22 PropertyStringList(const PropertyBase& _base);
24 PropertyStringList(const std::string& _current, PropertyFlags _flags = PropertyFlags(NoFlags)) ;
25 PropertyStringList(const std::string& _current, const std::list<std::string>& _list, PropertyFlags _flags = PropertyFlags(NoFlags));
26 PropertyStringList(const std::string& _current, const std::vector<std::string>& _list, PropertyFlags _flags = PropertyFlags(NoFlags));
27 PropertyStringList(const std::string& _name, const std::string& _current, const std::list<std::string>& _list, PropertyFlags _flags = PropertyFlags(NoFlags));
28 PropertyStringList(const std::string& _name, const std::string& _current, const std::vector<std::string>& _list, PropertyFlags _flags = PropertyFlags(NoFlags));
29 virtual ~PropertyStringList() {};
30
31 static std::string propertyTypeString(void) { return "StringList"; };
32 virtual std::string getPropertyType(void) const override { return PropertyStringList::propertyTypeString(); };
33
34 virtual Property* createCopy(void) const override;
35
36 void setList(const std::list<std::string>& _values) { m_list = _values; };
37 std::list<std::string>& getList(void) { return m_list; };
38 const std::list<std::string>& getList(void) const { return m_list; };
39
40 void setCurrent(const std::string& _current) { m_current = _current; };
41 const std::string& getCurrent(void) const { return m_current; };
42
43 protected:
48 virtual void getPropertyData(ot::JsonValue& _object, ot::JsonAllocator& _allocator) const override;
49
53 virtual void setPropertyData(const ot::ConstJsonObject& _object) override;
54
55 private:
56 std::string m_current;
57 std::list<std::string> m_list;
58 };
59
60}
#define OT_DECL_NOCOPY(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:14
#define OT_GUI_API_EXPORT
Definition OTGuiAPIExport.h:9
The PropertyBase class is used to hold general Property information.
Definition PropertyBase.h:25
The Property class is used as a base class for all Properties that can be displayed and modified in t...
Definition Property.h:21
Definition PropertyStringList.h:18
std::list< std::string > & getList(void)
Definition PropertyStringList.h:37
virtual std::string getPropertyType(void) const override
Definition PropertyStringList.h:32
const std::string & getCurrent(void) const
Definition PropertyStringList.h:41
virtual ~PropertyStringList()
Definition PropertyStringList.h:29
void setList(const std::list< std::string > &_values)
Definition PropertyStringList.h:36
const std::list< std::string > & getList(void) const
Definition PropertyStringList.h:38
void setCurrent(const std::string &_current)
Definition PropertyStringList.h:40
static std::string propertyTypeString(void)
Definition PropertyStringList.h:31
Definition Connector.h:8
rapidjson::Value JsonValue
Writable JSON value.
Definition JSON.h:27
rapidjson::GenericObject< true, rapidjson::GenericValue< rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator< rapidjson::CrtAllocator > > > ConstJsonObject
Read only JSON Object.
Definition JSON.h:35
rapidjson::MemoryPoolAllocator< rapidjson::CrtAllocator > JsonAllocator
Allocator used for writing to JSON values.
Definition JSON.h:30