]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiImplementation.h
Make GuiRef and GuiInclude subclasses of GuiCommand.
[lyx.git] / src / frontends / qt4 / GuiImplementation.h
1 // -*- C++ -*-
2 /**
3  * \file GuiImplementation.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  * \author Abdelrazak Younes
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef GUI_H
14 #define GUI_H
15
16 #include "frontends/Gui.h"
17
18 #include <QObject>
19
20 #include <map>
21
22 namespace lyx {
23 namespace frontend {
24
25 class GuiViewBase;
26 class LyXView;
27
28 /**
29  * The GuiImplementation class is the interface to all Qt4 components.
30  */
31 class GuiImplementation : public QObject, public Gui
32 {
33         Q_OBJECT
34
35 public:
36         GuiImplementation();
37         virtual ~GuiImplementation() {}
38
39         virtual LyXView& createRegisteredView();
40         virtual bool closeAllViews();
41         virtual bool unregisterView(int id);
42
43         virtual LyXView& view(int id) const;
44
45 private:
46
47         /// Multiple views container.
48         /**
49         * Warning: This must not be a smart pointer as the destruction of the
50         * object is handled by Qt when the view is closed
51         * \sa Qt::WA_DeleteOnClose attribute.
52         */
53         std::map<int, GuiViewBase *> views_;
54 };
55
56 } // namespace frontend
57 } // namespace lyx
58
59 #endif // GUI_H