OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
Border.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
10#include "OTGui/Outline.h"
12
13namespace ot {
14
20 public:
21 Border() {};
22 Border(const ot::Color& _color, int _width);
23 Border(const ot::Color& _color, int _leftWidth, int _topWidth, int _rightWidth, int _bottomWidth);
24 Border(const Outline& _left, const Outline& _top, const Outline& _right, const Outline& _bottom);
25 Border(const Border& _other);
26 virtual ~Border();
27
28 Border& operator = (const Border& _other);
29
33 virtual void addToJsonObject(JsonValue& _object, JsonAllocator& _allocator) const override;
34
38 virtual void setFromJsonObject(const ConstJsonObject& _object) override;
39
42 void setColor(const ot::Color& _color);
43
46 void setWidth(int _width);
47
49 inline void setTop(const Outline& _s) { m_top = _s; };
50 inline const Outline& top(void) const { return m_top; };
51
52 inline void setLeft(const Outline& _s) { m_left = _s; };
53 inline const Outline& left(void) const { return m_left; };
54
55 inline void setRight(const Outline& _s) { m_right = _s; };
56 inline const Outline& right(void) const { return m_right; };
57
58 inline void setBottom(const Outline& _s) { m_bottom = _s; };
59 inline const Outline& bottom(void) const { return m_bottom; };
60
61 private:
62 Outline m_top;
63 Outline m_left;
64 Outline m_right;
65 Outline m_bottom;
66 };
67
68 // ###########################################################################################################################################################################################################################################################################################################################
69
70 // ###########################################################################################################################################################################################################################################################################################################################
71
72 // ###########################################################################################################################################################################################################################################################################################################################
73
79 public:
80 BorderF() {};
81 BorderF(const ot::Color& _color, double _width);
82 BorderF(const ot::Color& _color, double _leftWidth, double _topWidth, double _rightWidth, double _bottomWidth);
83 BorderF(const OutlineF& _left, const OutlineF& _top, const OutlineF& _right, const OutlineF& _bottom);
84 BorderF(const BorderF& _other);
85 virtual ~BorderF();
86
87 BorderF& operator = (const BorderF& _other);
88
92 virtual void addToJsonObject(JsonValue& _object, JsonAllocator& _allocator) const override;
93
97 virtual void setFromJsonObject(const ConstJsonObject& _object) override;
98
101 void setColor(const ot::Color& _color);
102
105 void setWidth(double _width);
106
108 inline void setTop(const OutlineF& _s) { m_top = _s; };
109 inline const OutlineF& top(void) const { return m_top; };
110
111 inline void setLeft(const OutlineF& _s) { m_left = _s; };
112 inline const OutlineF& left(void) const { return m_left; };
113
114 inline void setRight(const OutlineF& _s) { m_right = _s; };
115 inline const OutlineF& right(void) const { return m_right; };
116
117 inline void setBottom(const OutlineF& _s) { m_bottom = _s; };
118 inline const OutlineF& bottom(void) const { return m_bottom; };
119
120 private:
121 OutlineF m_top;
122 OutlineF m_left;
123 OutlineF m_right;
124 OutlineF m_bottom;
125 };
126
127}
#define OT_GUI_API_EXPORT
Definition OTGuiAPIExport.h:9
The BorderF class is used to describe a border with four sides. The BorderF uses floating point value...
Definition Border.h:78
BorderF()
Definition Border.h:80
const OutlineF & left(void) const
Definition Border.h:112
void setBottom(const OutlineF &_s)
Definition Border.h:117
void setTop(const OutlineF &_s)
Set the top border.
Definition Border.h:108
void setRight(const OutlineF &_s)
Definition Border.h:114
void setLeft(const OutlineF &_s)
Definition Border.h:111
const OutlineF & right(void) const
Definition Border.h:115
const OutlineF & bottom(void) const
Definition Border.h:118
const OutlineF & top(void) const
Definition Border.h:109
The Border class is used to describe a border with four sides. The Border uses integer values.
Definition Border.h:19
const Outline & right(void) const
Definition Border.h:56
void setTop(const Outline &_s)
Set the top border.
Definition Border.h:49
const Outline & top(void) const
Definition Border.h:50
void setRight(const Outline &_s)
Definition Border.h:55
const Outline & left(void) const
Definition Border.h:53
Border()
Definition Border.h:21
void setLeft(const Outline &_s)
Definition Border.h:52
const Outline & bottom(void) const
Definition Border.h:59
void setBottom(const Outline &_s)
Definition Border.h:58
The Color class is used to represent RGBA colors with integer values.
Definition Color.h:72
The OutlineF class is used to describe how a outline should look like.
Definition Outline.h:161
The Outline class is used to describe how a outline should look like.
Definition Outline.h:54
The Serializable class is the default interface of serializable objects.
Definition Serializable.h:17
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