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"
21 #include "qt_helpers.h"
23 #include <QDockWidget>
32 class LaTeXHighlighter;
34 class ViewSourceWidget : public QWidget, public Ui::ViewSourceUi
41 void setBufferView(BufferView const * bv);
49 void updateDefaultFormat();
51 void contentsChanged();
55 BufferView const * bv_;
57 QTextDocument * document_;
58 /// LaTeX syntax highlighter
59 LaTeXHighlighter * highlighter_;
61 bool force_getcontent_;
67 class GuiViewSource : public DockView
73 GuiView & parent, ///< the main window where to dock.
74 Qt::DockWidgetArea area = Qt::BottomDockWidgetArea, ///< Position of the dock (and also drawer)
75 Qt::WindowFlags flags = 0);
79 /// Controller inherited method.
81 bool initialiseParams(std::string const & source);
83 void dispatchParams() {}
84 bool isBufferDependent() const { return true; }
85 bool canApply() const { return true; }
86 bool canApplyToReadOnly() const { return true; }
88 void enableView(bool enable);
89 void saveSession() const;
90 void restoreSession();
91 bool wantInitialFocus() const { return false; }
94 /// The title displayed by the dialog reflects source type.
95 QString title() const;
98 /// The encapsulated widget.
99 ViewSourceWidget * widget_;
102 } // namespace frontend
105 #endif // GUIVIEWSOURCE_H