diff options
author | jkobus <jaroslaw.kobus@digia.com> | 2013-08-13 12:57:31 +0200 |
---|---|---|
committer | Jarek Kobus <jaroslaw.kobus@digia.com> | 2013-08-26 13:39:40 +0200 |
commit | e8801167aa7a0047c9c9be0942ed0b368e5b5aa4 (patch) | |
tree | eb1dcf7998b0457518681126ddf9b49f198dd2d4 /src/plugins/texteditor/syntaxhighlighter.h | |
parent | 760aa0f8bce34e094abecdd99c77c359fb96bb67 (diff) | |
download | qt-creator-e8801167aa7a0047c9c9be0942ed0b368e5b5aa4.tar.gz |
Add common interface for text formats inside syntax highlighter
Change-Id: I87f64446161a57aea0896f68e4eafacef791969b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'src/plugins/texteditor/syntaxhighlighter.h')
-rw-r--r-- | src/plugins/texteditor/syntaxhighlighter.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/texteditor/syntaxhighlighter.h b/src/plugins/texteditor/syntaxhighlighter.h index 8cee09a209..e66fa86f72 100644 --- a/src/plugins/texteditor/syntaxhighlighter.h +++ b/src/plugins/texteditor/syntaxhighlighter.h @@ -31,7 +31,7 @@ #define TEXTEDITOR_SYNTAXHIGHLIGHTER_H #include "texteditor_global.h" - +#include <texteditor/texteditorconstants.h> #include <QObject> #include <QTextLayout> @@ -48,6 +48,7 @@ QT_END_NAMESPACE namespace TextEditor { class BaseTextDocument; +class FontSettings; class SyntaxHighlighterPrivate; class TEXTEDITOR_EXPORT SyntaxHighlighter : public QObject @@ -68,11 +69,15 @@ public: static QList<QColor> generateColors(int n, const QColor &background); + // Don't call in constructors of derived classes + virtual void setFontSettings(const TextEditor::FontSettings &fontSettings); public Q_SLOTS: void rehighlight(); void rehighlightBlock(const QTextBlock &block); protected: + void setTextFormatCategories(const QVector<TextEditor::TextStyle> &categories); + QTextCharFormat formatForCategory(int categoryIndex) const; virtual void highlightBlock(const QString &text) = 0; void setFormat(int start, int count, const QTextCharFormat &format); |