OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
SyntaxHighlighter.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
12
13// Qt header
14#include <QtGui/qsyntaxhighlighter.h>
15
16// std header
17#include <list>
18
19namespace ot {
20
21 class OT_WIDGETS_API_EXPORT SyntaxHighlighter : public QSyntaxHighlighter {
24 public:
25 SyntaxHighlighter(QTextDocument* _document);
26 virtual ~SyntaxHighlighter();
27
28 void addRule(const SyntaxHighlighterRule& _rule);
29 void addRules(const std::list<SyntaxHighlighterRule>& _rules);
30 void setRules(const std::list<SyntaxHighlighterRule>& _rules) { m_rules = _rules; };
31 const std::list<SyntaxHighlighterRule>& getRules(void) const { return m_rules; };
32
33 protected:
34 virtual void highlightBlock(const QString& text) override;
35
36 private:
37 std::list<SyntaxHighlighterRule> m_rules;
38
39 };
40
41}
This file contains defines that may be used simplyfy class creation.
#define OT_DECL_NODEFAULT(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:22
#define OT_DECL_NOCOPY(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:14
#define OT_WIDGETS_API_EXPORT
Definition OTWidgetsAPIExport.h:12
Definition SyntaxHighlighter.h:21
const std::list< SyntaxHighlighterRule > & getRules(void) const
Definition SyntaxHighlighter.h:31
void setRules(const std::list< SyntaxHighlighterRule > &_rules)
Definition SyntaxHighlighter.h:30
Definition SyntaxHighlighterRule.h:20
Definition Connector.h:8