OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
LineEditCfg.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
10
11namespace ot {
12
14 public:
16 LineEditCfg(const std::string& _name, const std::string& _text);
17 LineEditCfg(const LineEditCfg&) = default;
19 virtual ~LineEditCfg();
20
21 LineEditCfg& operator = (const LineEditCfg&) = default;
22 LineEditCfg& operator = (LineEditCfg&&) = default;
23
24 static std::string getLineEditCfgTypeString(void) { return "LineEditCfg"; };
25 virtual std::string getWidgetBaseTypeString(void) const override { return LineEditCfg::getLineEditCfgTypeString(); };
26
27 virtual void addToJsonObject(ot::JsonValue& _object, ot::JsonAllocator& _allocator) const override;
28 virtual void setFromJsonObject(const ot::ConstJsonObject& _object) override;
29
30 void setReadOnly(bool _isReadOnly) { m_readOnly = _isReadOnly; };
31 bool getReadOnly(void) const { return m_readOnly; };
32
33 void setText(const std::string& _text) { m_text = _text; };
34 const std::string& getText(void) const { return m_text; };
35
36 void setPlaceholderText(const std::string& _text) { m_text = _text; };
37 const std::string& getPlaceholderText(void) const { return m_text; };
38
39 private:
40 bool m_readOnly;
41 std::string m_text;
42 std::string m_placeholderText;
43 };
44
45}
#define OT_GUI_API_EXPORT
Definition OTGuiAPIExport.h:9
Definition LineEditCfg.h:13
LineEditCfg(LineEditCfg &&)=default
static std::string getLineEditCfgTypeString(void)
Definition LineEditCfg.h:24
LineEditCfg(const LineEditCfg &)=default
virtual std::string getWidgetBaseTypeString(void) const override
Definition LineEditCfg.h:25
const std::string & getText(void) const
Definition LineEditCfg.h:34
const std::string & getPlaceholderText(void) const
Definition LineEditCfg.h:37
void setPlaceholderText(const std::string &_text)
Definition LineEditCfg.h:36
void setText(const std::string &_text)
Definition LineEditCfg.h:33
void setReadOnly(bool _isReadOnly)
Definition LineEditCfg.h:30
bool getReadOnly(void) const
Definition LineEditCfg.h:31
Definition WidgetBaseCfg.h:19
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