4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * \author Abdelrazak Younes
11 * Full author contact details are available in file CREDITS.
17 #include "frontends/controllers/ControlViewSource.h"
20 #include <QSyntaxHighlighter>
21 #include <QTextCharFormat>
22 #include <QTextDocument>
27 /// LateX syntax highlighting.
28 /// \todo FIXME: extract the latexHighlighter class into its
30 class latexHighlighter : public QSyntaxHighlighter
34 latexHighlighter(QTextDocument * parent);
37 void highlightBlock(QString const & text);
40 QTextCharFormat commentFormat;
41 QTextCharFormat keywordFormat;
42 QTextCharFormat mathFormat;
46 class QViewSource: public QObject, public ControlViewSource
50 QViewSource(Dialog &);
51 virtual ~QViewSource() {}
53 QTextDocument * document() { return document_; }
55 void update(bool full_source);
59 QTextDocument * document_;
61 /// latex syntax highlighter
62 latexHighlighter * highlighter_;
66 } // namespace frontend
69 #endif // QVIEWSOURCE_H