OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
SyntaxHighlighterRule.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
10#include "OTGui/Font.h"
12
13// std header
14#include <string>
15
16namespace ot {
17
18 class Painter2D;
19
21 public:
23
26 SyntaxHighlighterRule(const std::string& _regularExpression, Painter2D* _painter);
27
29
30 virtual ~SyntaxHighlighterRule();
31
32 SyntaxHighlighterRule& operator = (const SyntaxHighlighterRule& _other);
33
37 virtual void addToJsonObject(ot::JsonValue& _object, ot::JsonAllocator& _allocator) const override;
38
42 virtual void setFromJsonObject(const ot::ConstJsonObject& _object) override;
43
47 void setPainter(Painter2D* _painter);
48
51 Painter2D* getPainter(void) { return m_painter; };
52
55 const Painter2D* getPainter(void) const { return m_painter; };
56
57 void setRegularExpression(const std::string& _regularExpression) { m_regex = _regularExpression; };
58 const std::string& getRegularExpression(void) const { return m_regex; };
59
60 void setFont(const Font& _f) { m_font = _f; };
61 const Font& getFont(void) const { return m_font; };
62
63 private:
64 Painter2D* m_painter;
65 std::string m_regex;
66 Font m_font;
67 };
68
69}
#define OT_GUI_API_EXPORT
Definition OTGuiAPIExport.h:9
Definition Font.h:20
Definition Painter2D.h:17
The Serializable class is the default interface of serializable objects.
Definition Serializable.h:17
Definition SyntaxHighlighterRule.h:20
Painter2D * getPainter(void)
Returns the current painter. The SyntaxHighlighterRule keeps ownership of the painter.
Definition SyntaxHighlighterRule.h:51
const Painter2D * getPainter(void) const
Returns the current painter. The SyntaxHighlighterRule keeps ownership of the painter.
Definition SyntaxHighlighterRule.h:55
void setFont(const Font &_f)
Definition SyntaxHighlighterRule.h:60
void setRegularExpression(const std::string &_regularExpression)
Definition SyntaxHighlighterRule.h:57
const std::string & getRegularExpression(void) const
Definition SyntaxHighlighterRule.h:58
const Font & getFont(void) const
Definition SyntaxHighlighterRule.h:61
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