]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/DockView.h
We do not need to update just because the class has been changed.
[lyx.git] / src / frontends / qt4 / 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 #include "GuiView.h"
17
18 #include <QDockWidget>
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 public:
32         DockView(
33                 GuiView & parent, ///< the main window where to dock.
34                 std::string const & name, ///< dialog identifier.
35                 Qt::DockWidgetArea area = Qt::LeftDockWidgetArea, ///< Position of the dock (and also drawer)
36                 Qt::WindowFlags flags = 0
37         )
38                 : QDockWidget(&parent, flags), Dialog(parent, name)
39         {
40                 if (flags & Qt::Drawer)
41                         setFeatures(QDockWidget::NoDockWidgetFeatures);
42                 parent.addDockWidget(area, this);
43         }
44
45         virtual ~DockView() {}
46
47         virtual QWidget * asQWidget() { return this; }
48         virtual QWidget const * asQWidget() const { return this; }
49
50         /// Dialog inherited methods
51         //@{
52         void applyView() {}
53         bool isClosing() const { return false; }
54         //@}
55 };
56
57 } // frontend
58 } // lyx
59
60 #endif // DOCK_VIEW_H