]> git.lyx.org Git - lyx.git/blob - src/frontends/qt/DockView.h
Move GuiView.h from DockView.h
[lyx.git] / src / frontends / qt / DockView.h
1 // -*- C++ -*-
2 /**
3  * \file DockView.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Abdelrazak Younes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef DOCK_VIEW_H
13 #define DOCK_VIEW_H
14
15 #include "Dialog.h"
16
17 #include <QDockWidget>
18 #include <QKeyEvent>
19
20 namespace lyx {
21 namespace frontend {
22
23 /// Dock Widget container for LyX dialogs.
24 /**
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
28  **/
29 class DockView : public QDockWidget, public Dialog
30 {
31         Q_OBJECT
32
33 public:
34         DockView(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
38                                                                                                                            ///the dock (and
39                                                                                                                            ///also drawer)
40                  Qt::WindowFlags flags = 0);
41
42         virtual ~DockView() {}
43
44         QWidget * asQWidget() override { return this; }
45         QWidget const * asQWidget() const override { return this; }
46
47         /// We don't want to restore geometry session for dock widgets.
48         void restoreSession() override {}
49
50         void keyPressEvent(QKeyEvent * ev) override;
51
52         /// Dialog inherited methods
53         //@{
54         void applyView() override {}
55         bool isClosing() const override { return false; }
56         bool needBufferOpen() const override { return false; }
57         //@}
58
59 protected Q_SLOTS:
60         void onBufferViewChanged() override {}
61 };
62
63 } // namespace frontend
64 } // namespace lyx
65
66 #endif // DOCK_VIEW_H