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 <QDockWidget>
30 class LaTeXHighlighter;
32 class ViewSourceWidget : public QWidget, public Ui::ViewSourceUi
39 void setBufferView(BufferView const * bv);
43 void resizeEvent (QResizeEvent * event);
51 void updateDefaultFormat();
53 void contentsChanged();
57 BufferView const * bv_;
59 QTextDocument * document_;
60 /// LaTeX syntax highlighter
61 LaTeXHighlighter * highlighter_;
63 bool force_getcontent_;
69 class GuiViewSource : public DockView
75 GuiView & parent, ///< the main window where to dock.
76 Qt::DockWidgetArea area = Qt::BottomDockWidgetArea, ///< Position of the dock (and also drawer)
77 Qt::WindowFlags flags = 0);
81 /// Controller inherited method.
83 bool initialiseParams(std::string const & source);
85 void dispatchParams() {}
86 bool isBufferDependent() const { return true; }
87 bool canApply() const { return true; }
88 bool canApplyToReadOnly() const { return true; }
90 void enableView(bool enable);
91 void saveSession() const;
92 void restoreSession();
93 bool wantInitialFocus() const { return false; }
96 /// The title displayed by the dialog reflects source type.
97 QString title() const;
100 /// The encapsulated widget.
101 ViewSourceWidget * widget_;
104 } // namespace frontend
107 #endif // GUIVIEWSOURCE_H