]> git.lyx.org Git - lyx.git/blob - src/frontends/qt/DockView.h
French Additional manual, translation of chapter 4 up to sec. 4.3
[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
19 namespace lyx {
20 namespace frontend {
21
22 /// Dock Widget container for LyX dialogs.
23 /**
24  * This template class that encapsulates a given Widget inside a
25  * QDockWidget and presents a Dialog interface
26  * FIXME: create a DockView.cpp file
27  **/
28 class DockView : public QDockWidget, public Dialog
29 {
30         Q_OBJECT
31
32 public:
33         DockView(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
37                                                                    /// (and also drawer)
38                  Qt::WindowFlags flags = {});
39
40         virtual ~DockView() {}
41
42         QWidget * asQWidget() override { return this; }
43         QWidget const * asQWidget() const override { return this; }
44
45         /// We don't want to restore geometry session for dock widgets.
46         void restoreSession() override {}
47
48         void keyPressEvent(QKeyEvent * ev) override;
49
50         /// Dialog inherited methods
51         //@{
52         void applyView() override {}
53         bool isClosing() const override { return false; }
54         bool needBufferOpen() const override { return false; }
55         //@}
56
57 protected Q_SLOTS:
58         void onBufferViewChanged() override {}
59         void onClosing(int) override {}
60 };
61
62 } // namespace frontend
63 } // namespace lyx
64
65 #endif // DOCK_VIEW_H