3 * \file GuiViewSource.h
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.
14 #ifndef GUIVIEWSOURCE_H
15 #define GUIVIEWSOURCE_H
17 #include "ui_ViewSourceUi.h"
19 #include "ControlViewSource.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;
46 class GuiViewSourceDialog : public QWidget, public Ui::ViewSourceUi
51 GuiViewSourceDialog(ControlViewSource &);
57 QTextDocument * document() { return document_; }
59 void update(bool full_source);
63 ControlViewSource & controller_;
65 QTextDocument * document_;
66 /// LaTeX syntax highlighter
67 LaTeXHighlighter * highlighter_;
71 } // namespace frontend
74 #endif // GUIVIEWSOURCE_H