OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
WidgetBaseCfg.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
11
12// std header
13#include <string>
14
15#pragma warning(disable:4251)
16
17namespace ot {
18
20 public:
21 static std::string typeStringJsonKey(void) { return "Type"; };
22
24 WidgetBaseCfg(const std::string& _name);
25 WidgetBaseCfg(const WidgetBaseCfg&) = default;
27 virtual ~WidgetBaseCfg();
28
29 WidgetBaseCfg& operator = (const WidgetBaseCfg&) = default;
30 WidgetBaseCfg& operator = (WidgetBaseCfg&&) = default;
31
32 virtual std::string getWidgetBaseTypeString(void) const = 0;
33
34 virtual void addToJsonObject(ot::JsonValue& _object, ot::JsonAllocator& _allocator) const override;
35 virtual void setFromJsonObject(const ot::ConstJsonObject& _object) override;
36
37 void setName(const std::string& _name) { m_name = _name; };
38 const std::string& getName(void) const { return m_name; };
39
40 void setToolTip(const std::string& _toolTip) { m_toolTip = _toolTip; };
41 const std::string& getToolTip(void) const { return m_toolTip; };
42
43 private:
44 std::string m_name;
45 std::string m_toolTip;
46 };
47
48}
#define OT_GUI_API_EXPORT
Definition OTGuiAPIExport.h:9
The Serializable class is the default interface of serializable objects.
Definition Serializable.h:17
Definition WidgetBaseCfg.h:19
const std::string & getName(void) const
Definition WidgetBaseCfg.h:38
const std::string & getToolTip(void) const
Definition WidgetBaseCfg.h:41
WidgetBaseCfg(const WidgetBaseCfg &)=default
static std::string typeStringJsonKey(void)
Definition WidgetBaseCfg.h:21
void setName(const std::string &_name)
Definition WidgetBaseCfg.h:37
WidgetBaseCfg(WidgetBaseCfg &&)=default
virtual std::string getWidgetBaseTypeString(void) const =0
void setToolTip(const std::string &_toolTip)
Definition WidgetBaseCfg.h:40
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