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);
45 void resizeEvent (QResizeEvent * event);
53 void updateDefaultFormat();
55 void contentsChanged();
59 BufferView const * bv_;
61 QTextDocument * document_;
62 /// LaTeX syntax highlighter
63 LaTeXHighlighter * highlighter_;
65 bool force_getcontent_;
71 class GuiViewSource : public DockView
77 GuiView & parent, ///< the main window where to dock.
78 Qt::DockWidgetArea area = Qt::BottomDockWidgetArea, ///< Position of the dock (and also drawer)
79 Qt::WindowFlags flags = 0);
83 /// Controller inherited method.
85 bool initialiseParams(std::string const & source);
87 void dispatchParams() {}
88 bool isBufferDependent() const { return true; }
89 bool canApply() const { return true; }
90 bool canApplyToReadOnly() const { return true; }
92 void enableView(bool enable);
93 void saveSession() const;
94 void restoreSession();
95 bool wantInitialFocus() const { return false; }
98 /// The title displayed by the dialog reflects source type.
99 QString title() const;
102 /// The encapsulated widget.
103 ViewSourceWidget * widget_;
106 } // namespace frontend
109 #endif // GUIVIEWSOURCE_H