OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
StyleValue.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
11#include "OTCore/Color.h"
12
13// std header
14#include <string>
15
16#pragma warning(disable:4251)
17
18namespace ot {
19
21 public:
22 StyleValue();
23 StyleValue(const StyleValue& _other);
24 virtual ~StyleValue();
25
26 StyleValue& operator = (const StyleValue& _other);
27
31 virtual void addToJsonObject(JsonValue& _object, JsonAllocator& _allocator) const override;
32
36 virtual void setFromJsonObject(const ConstJsonObject& _object) override;
37
38 void setKey(const std::string& _key) { m_key = _key; };
39 const std::string& key(void) const { return m_key; };
40
41 void setQss(const std::string& _qss) { m_qss = _qss; };
42 const std::string& qss(void) const { return m_qss; };
43
44 void setColor(const ot::Color& _color) { m_color = _color; };
45 const ot::Color& color(void) const { return m_color; };
46
47 private:
48 std::string m_key;
49 std::string m_qss;
50 ot::Color m_color;
51 };
52
53}
#define OT_GUI_API_EXPORT
Definition OTGuiAPIExport.h:9
The Color class is used to represent RGBA colors with integer values.
Definition Color.h:72
The Serializable class is the default interface of serializable objects.
Definition Serializable.h:17
Definition StyleValue.h:20
void setQss(const std::string &_qss)
Definition StyleValue.h:41
void setKey(const std::string &_key)
Definition StyleValue.h:38
const std::string & qss(void) const
Definition StyleValue.h:42
const ot::Color & color(void) const
Definition StyleValue.h:45
const std::string & key(void) const
Definition StyleValue.h:39
void setColor(const ot::Color &_color)
Definition StyleValue.h:44
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