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>
24 /// Dock Widget container for LyX dialogs.
26 * This template class that encapsulates a given Widget inside a
27 * QDockWidget and presents a Dialog interface
28 * FIXME: create a DockView.cpp file
30 class DockView : public QDockWidget, public Dialog
34 GuiView & parent, ///< the main window where to dock.
35 QString const & name, ///< dialog identifier.
36 QString const & title, ///< dialog title.
37 Qt::DockWidgetArea area = Qt::LeftDockWidgetArea, ///< Position of the dock (and also drawer)
38 Qt::WindowFlags flags = 0
40 : QDockWidget(&parent, flags), Dialog(parent, name, title)
43 parent.addDockWidget(area, this);
47 virtual ~DockView() {}
49 virtual QWidget * asQWidget() { return this; }
50 virtual QWidget const * asQWidget() const { return this; }
52 /// We don't want to restore geometry session for dock widgets.
53 void restoreSession() {}
55 void keyPressEvent(QKeyEvent * ev)
57 if (ev->key() == Qt::Key_Escape) {
58 QMainWindow * mw = static_cast<QMainWindow *>(parent());
68 /// Dialog inherited methods
71 bool isClosing() const { return false; }
72 bool needBufferOpen() const { return false; }