Changeset View
Changeset View
Standalone View
Standalone View
src/backends/R/rhighlighter.h
Show All 17 Lines | 1 | /* | |||
---|---|---|---|---|---|
18 | Copyright (C) 2010 Oleksiy Protas <elfy.ua@gmail.com> | 18 | Copyright (C) 2010 Oleksiy Protas <elfy.ua@gmail.com> | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #ifndef _RHIGHLIGHTER_H | 21 | #ifndef _RHIGHLIGHTER_H | ||
22 | #define _RHIGHLIGHTER_H | 22 | #define _RHIGHLIGHTER_H | ||
23 | 23 | | |||
24 | #include "defaulthighlighter.h" | 24 | #include "defaulthighlighter.h" | ||
25 | 25 | | |||
26 | class RSession; | ||||
27 | | ||||
26 | class RHighlighter : public Cantor::DefaultHighlighter | 28 | class RHighlighter : public Cantor::DefaultHighlighter | ||
27 | { | 29 | { | ||
28 | Q_OBJECT | 30 | Q_OBJECT | ||
29 | 31 | | |||
30 | public: | 32 | public: | ||
31 | explicit RHighlighter( QObject* parent); | 33 | explicit RHighlighter( QObject* parent, RSession* session); | ||
32 | ~RHighlighter() override = default; | 34 | ~RHighlighter() override = default; | ||
33 | 35 | | |||
34 | protected: | 36 | protected: | ||
35 | void highlightBlock(const QString &text) override; | 37 | void highlightBlock(const QString &text) override; | ||
36 | 38 | | |||
37 | public Q_SLOTS: | | |||
38 | void refreshSyntaxRegExps(); | | |||
39 | void updateHighlighting(); | | |||
40 | | ||||
41 | Q_SIGNALS: | | |||
42 | void syntaxRegExps(QVector<QRegExp>&,QVector<QRegExp>&); | | |||
43 | | ||||
44 | private: | 39 | private: | ||
asemke: let's move the declaration of these functions to Cantor::DefaultHighlighter and make them… | |||||
In this moment, not all highlighter supports this variable model, so I think it's no need sirgienko: In this moment, not all highlighter supports this variable model, so I think it's no need | |||||
45 | inline void formatRule(const QRegExp &p, const QTextCharFormat &fmt, const QString& text,bool shift=false); | 40 | inline void formatRule(const QRegExp &p, const QTextCharFormat &fmt, const QString& text,bool shift=false); | ||
46 | inline void massFormat(const QVector<QRegExp>& rules, const QTextCharFormat &fmt, const QString& text,bool shift=false); | 41 | inline void massFormat(const QVector<QRegExp>& rules, const QTextCharFormat &fmt, const QString& text,bool shift=false); | ||
47 | 42 | | |||
48 | static const QStringList operators_list; | 43 | static const QStringList operators_list; | ||
asemke: let's use "Definition" instead of "Stuff". Sounds better. | |||||
49 | static const QStringList specials_list; | 44 | static const QStringList specials_list; | ||
50 | QVector<QRegExp> operators; | 45 | QVector<QRegExp> operators; | ||
51 | QVector<QRegExp> specials; | 46 | QVector<QRegExp> specials; | ||
52 | QVector<QRegExp> functions; | 47 | QVector<QRegExp> functions; | ||
53 | QVector<QRegExp> variables; | 48 | QVector<QRegExp> variables; | ||
54 | }; | 49 | }; | ||
55 | 50 | | |||
56 | #endif /* _RHIGHLIGHTER_H */ | 51 | #endif /* _RHIGHLIGHTER_H */ |
let's move the declaration of these functions to Cantor::DefaultHighlighter and make them abstract. All deriving classes should provide an implementation for them.