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>
This commit is contained in:
jkobus
2013-08-13 12:57:31 +02:00
committed by Jarek Kobus
parent 760aa0f8bc
commit e8801167aa
69 changed files with 489 additions and 531 deletions

View File

@@ -35,17 +35,16 @@
#include <texteditor/syntaxhighlighter.h>
namespace VcsBase {
namespace Internal {
class BaseAnnotationHighlighterPrivate;
} // namespace Internal
class VCSBASE_EXPORT BaseAnnotationHighlighter : public TextEditor::SyntaxHighlighter
{
Q_OBJECT
Q_DECLARE_PRIVATE(BaseAnnotationHighlighter)
public:
typedef QSet<QString> ChangeNumbers;
explicit BaseAnnotationHighlighter(const ChangeNumbers &changeNumbers, const QColor &bg,
explicit BaseAnnotationHighlighter(const ChangeNumbers &changeNumbers,
QTextDocument *document = 0);
virtual ~BaseAnnotationHighlighter();
@@ -53,13 +52,13 @@ public:
virtual void highlightBlock(const QString &text);
void setBackgroundColor(const QColor &color);
virtual void setFontSettings(const TextEditor::FontSettings &fontSettings);
private:
// Implement this to return the change number of a line
virtual QString changeNumber(const QString &block) const = 0;
Internal::BaseAnnotationHighlighterPrivate *const d;
QScopedPointer<BaseAnnotationHighlighterPrivate> d_ptr;
};
} // namespace VcsBase