[go: up one dir, main page]

Menu

[4cf102]: / highlighter.h  Maximize  Restore  History

Download this file

61 lines (47 with data), 1.2 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#ifndef HIGHLIGHTER_H
#define HIGHLIGHTER_H
#include <QSyntaxHighlighter>
#include <QSet>
#include <QTextCharFormat>
QT_BEGIN_NAMESPACE
class QTextDocument;
QT_END_NAMESPACE
class Highlighter: public QSyntaxHighlighter
{
public:
Highlighter(QTextDocument *parent = 0);
protected:
QSet<QString> keywords;
QString operators;
QTextCharFormat idFormat;
QTextCharFormat keywordFormat;
QTextCharFormat commentFormat;
QTextCharFormat stringFormat;
QTextCharFormat functionFormat;
QTextCharFormat numberFormat;
QTextCharFormat operatorFormat;
QTextCharFormat illegalFormat;
QTextCharFormat preprocessorFormat;
};
class AsmHighlighter: public Highlighter
{
public:
AsmHighlighter(QTextDocument *parent = 0);
protected:
void highlightBlock(const QString &text);
};
class CppHighlighter: public Highlighter
{
public:
CppHighlighter(QTextDocument *parent = 0);
protected:
void highlightBlock(const QString &text);
};
class FortranHighlighter: public Highlighter
{
public:
FortranHighlighter(QTextDocument *parent = 0);
protected:
void highlightBlock(const QString &text);
};
#endif