OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
StyledTextEntry.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
10
11namespace ot {
12
14 public:
15 StyledTextEntry() = default;
16 StyledTextEntry(const StyledTextStyle& _style);
17 StyledTextEntry(const ConstJsonObject& _jsonObject);
19 virtual ~StyledTextEntry() = default;
20 StyledTextEntry& operator = (const StyledTextEntry&) = default;
21
25 virtual void addToJsonObject(ot::JsonValue& _object, ot::JsonAllocator& _allocator) const override;
26
30 virtual void setFromJsonObject(const ot::ConstJsonObject& _object) override;
31
32 void setStyle(const StyledTextStyle& _style) { m_style = _style; };
33 StyledTextStyle& getStyle(void) { return m_style; };
34 const StyledTextStyle& getStyle(void) const { return m_style; };
35
36 void setText(const std::string& _text) { m_text = _text; };
37 std::string& getText(void) { return m_text; };
38 const std::string& getText(void) const { return m_text; };
39
40 private:
41 StyledTextStyle m_style;
42 std::string m_text;
43 };
44
45}
#define OT_GUI_API_EXPORT
Definition OTGuiAPIExport.h:9
The Serializable class is the default interface of serializable objects.
Definition Serializable.h:17
Definition StyledTextEntry.h:13
StyledTextStyle & getStyle(void)
Definition StyledTextEntry.h:33
StyledTextEntry()=default
virtual ~StyledTextEntry()=default
void setText(const std::string &_text)
Definition StyledTextEntry.h:36
void setStyle(const StyledTextStyle &_style)
Definition StyledTextEntry.h:32
std::string & getText(void)
Definition StyledTextEntry.h:37
const std::string & getText(void) const
Definition StyledTextEntry.h:38
const StyledTextStyle & getStyle(void) const
Definition StyledTextEntry.h:34
StyledTextEntry(const StyledTextEntry &)=default
Definition StyledTextStyle.h:15
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