Changeset View
Changeset View
Standalone View
Standalone View
src/backends/python/pythonhighlighter.h
Show All 16 Lines | 1 | /* | |||
---|---|---|---|---|---|
17 | --- | 17 | --- | ||
18 | Copyright (C) 2013 Filipe Saraiva <filipe@kde.org> | 18 | Copyright (C) 2013 Filipe Saraiva <filipe@kde.org> | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #ifndef _PYTHONHIGHLIGHTER_H | 21 | #ifndef _PYTHONHIGHLIGHTER_H | ||
22 | #define _PYTHONHIGHLIGHTER_H | 22 | #define _PYTHONHIGHLIGHTER_H | ||
23 | 23 | | |||
24 | #include "defaulthighlighter.h" | 24 | #include "defaulthighlighter.h" | ||
25 | class PythonSession; | ||||
25 | 26 | | |||
26 | class PythonHighlighter : public Cantor::DefaultHighlighter | 27 | class PythonHighlighter : public Cantor::DefaultHighlighter | ||
27 | { | 28 | { | ||
28 | Q_OBJECT | 29 | Q_OBJECT | ||
29 | 30 | | |||
30 | public: | 31 | public: | ||
31 | explicit PythonHighlighter(QObject* parent, const int pythonVersion); | 32 | explicit PythonHighlighter(QObject* parent, PythonSession* session, const int pythonVersion); | ||
32 | ~PythonHighlighter() override = default; | 33 | ~PythonHighlighter() override = default; | ||
33 | 34 | | |||
34 | public Q_SLOTS: | | |||
35 | void updateHighlight(); | | |||
36 | void addVariable(const QString variable); | | |||
37 | void clearVariables(); | | |||
38 | | ||||
39 | protected: | 35 | protected: | ||
40 | void highlightBlock(const QString& text) override; | 36 | void highlightBlock(const QString& text) override; | ||
41 | 37 | | |||
42 | private: | 38 | private: | ||
43 | QRegExp commentStartExpression; | 39 | QRegExp commentStartExpression; | ||
44 | QRegExp commentEndExpression; | 40 | QRegExp commentEndExpression; | ||
45 | QStringList m_variables; | | |||
46 | | ||||
47 | }; | 41 | }; | ||
48 | 42 | | |||
49 | #endif /* _PYTHONHIGHLIGHTER_H */ | 43 | #endif /* _PYTHONHIGHLIGHTER_H */ |