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 "ControlViewSource.h"
18 #include "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;
48 class GuiViewSourceDialog : public QWidget, public Ui::ViewSourceUi {
51 GuiViewSourceDialog(GuiViewSource * form);
58 GuiViewSource * form_;
63 class GuiViewSource : public QObject, public ControlViewSource {
66 GuiViewSource(Dialog &);
68 QTextDocument * document() { return document_; }
70 void update(bool full_source);
74 QTextDocument * document_;
75 /// LaTeX syntax highlighter
76 LaTeXHighlighter * highlighter_;
80 } // namespace frontend
83 #endif // GUIVIEWSOURCE_H