-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsyntaxhighlighter.h
More file actions
33 lines (26 loc) · 998 Bytes
/
syntaxhighlighter.h
File metadata and controls
33 lines (26 loc) · 998 Bytes
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
#ifndef SYNTAXHIGHLIGHTER_H
#define SYNTAXHIGHLIGHTER_H
#include <QSyntaxHighlighter>
#include "assetmanager.h"
class SyntaxHighlighter: public QSyntaxHighlighter
{
public:
SyntaxHighlighter(QTextDocument* document);
~SyntaxHighlighter();
void highlightBlock(const QString &text);
void load(AssetManager *am, QString lan);
SyntaxHighlightingRuleSet * getRuleSet() const;
QStringList & getAutoCompleteRules();
void setSyntaxHighlightingRules(SyntaxHighlightingRuleSet *);
void highlightMatch(const QString &text, QRegExp &exp);
bool isLanguageSet();
SyntaxHighlightingRuleSet *ruleSet;
private:
AssetManager * assetManager;
QStringList autoCompleteSuggestions;
QRegExp searchExpression;
QStringList searchInputForAutocompleteRules(const QString &text);
void highlightSearchExpression(QRegExp expr, const QString &text);
bool languageSet;
};
#endif // SYNTAXHIGHLIGHTER_H