4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Abdelrazak Younes
9 * Full author contact details are available in file CREDITS.
18 #include <QDockWidget>
23 /// Dock Widget container for LyX dialogs.
25 * This template class that encapsulates a given Widget inside a
26 * QDockWidget and presents a Dialog interface
27 * FIXME: create a DockView.cpp file
29 class DockView : public QDockWidget, public Dialog
33 GuiView & parent, ///< the main window where to dock.
34 QString const & name, ///< dialog identifier.
35 QString const & title, ///< dialog title.
36 Qt::DockWidgetArea area = Qt::LeftDockWidgetArea, ///< Position of the dock (and also drawer)
37 Qt::WindowFlags flags = 0
39 : QDockWidget(&parent, flags), Dialog(parent, name, title)
42 if (flags & Qt::Drawer)
43 setFeatures(QDockWidget::NoDockWidgetFeatures);
44 parent.addDockWidget(area, this);
48 virtual ~DockView() {}
50 virtual QWidget * asQWidget() { return this; }
51 virtual QWidget const * asQWidget() const { return this; }
53 /// We don't want to restore geometry session for dock widgets.
54 void restoreSession() {}
56 /// Dialog inherited methods
59 bool isClosing() const { return false; }