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 "GuiDialog.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;
49 class GuiViewSourceDialog : public QWidget, public Ui::ViewSourceUi {
52 GuiViewSourceDialog(GuiViewSource * form);
59 GuiViewSource * form_;
64 class GuiViewSource : public QObject, public ControlViewSource {
67 GuiViewSource(GuiDialog &);
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 // GUIVIEWSOURCE_H