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 "GuiDialog.h"
18 #include "ControlViewSource.h"
19 #include "Application.h"
20 #include "ui_ViewSourceUi.h"
23 #include <QSyntaxHighlighter>
24 #include <QTextCharFormat>
31 // used already twice...
32 class LaTeXHighlighter : public QSyntaxHighlighter
35 LaTeXHighlighter(QTextDocument * parent);
38 void highlightBlock(QString const & text);
41 QTextCharFormat commentFormat;
42 QTextCharFormat keywordFormat;
43 QTextCharFormat mathFormat;
47 class GuiViewSourceDialog : public GuiDialog, public Ui::ViewSourceUi
52 GuiViewSourceDialog(LyXView & lv);
58 QTextDocument * document() { return document_; }
60 void update(bool full_source);
64 ControlViewSource & controller() const;
66 QTextDocument * document_;
67 /// LaTeX syntax highlighter
68 LaTeXHighlighter * highlighter_;
72 } // namespace frontend
75 #endif // GUIVIEWSOURCE_H