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"
18 #include "frontends/Application.h"
19 #include "ui_ViewSourceUi.h"
22 #include <QSyntaxHighlighter>
23 #include <QTextCharFormat>
30 // used already twice...
31 class LaTeXHighlighter : public QSyntaxHighlighter
34 LaTeXHighlighter(QTextDocument * parent);
37 void highlightBlock(QString const & text);
40 QTextCharFormat commentFormat;
41 QTextCharFormat keywordFormat;
42 QTextCharFormat mathFormat;
49 class QViewSourceDialog : public QWidget, public Ui::QViewSourceUi {
52 QViewSourceDialog(QViewSource * form);
64 class QViewSource : public QObject, public ControlViewSource {
67 QViewSource(Dialog &);
69 QTextDocument * document() { return document_; }
71 void update(bool full_source);
75 QTextDocument * document_;
76 /// LaTeX syntax highlighter
77 LaTeXHighlighter * highlighter_;
81 } // namespace frontend
84 #endif // QVIEWSOURCE_H