]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/GuiImplementation.h
new LFUN_WINDOW_CLOSE
[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 class LyXView;
23
24 namespace lyx {
25 namespace frontend {
26
27 class GuiWorkArea;
28 class GuiView;
29
30 /**
31  * The GuiImplementation class is the interface to all Qt4 components.
32  */
33 class GuiImplementation: public QObject, public Gui
34 {
35         Q_OBJECT
36
37 public:
38         GuiImplementation();
39         virtual ~GuiImplementation() {}
40
41         int newView();
42         LyXView& view(int id);
43         int newWorkArea(unsigned int width, unsigned int height, int view_id);
44         WorkArea& workArea(int id);
45
46 private Q_SLOTS:
47         ///
48         void cleanupViews(QObject * view);
49
50 private:
51         ///
52         void buildViewIds();
53
54         /// Multiple views container.
55         /**
56         * Warning: This must not be a smart pointer as the destruction of the
57         * object is handled by Qt when the view is closed 
58         * \sa Qt::WA_DeleteOnClose attribute.
59         */
60         std::map<int, GuiView *> views_;
61
62         /// Multiple workareas container.
63         /**
64         * Warning: This must not be a smart pointer as the destruction of the
65         * object is handled by Qt when its parent view is closed.
66         */
67         std::map<int, GuiWorkArea *> work_areas_;
68         ///
69         size_t max_view_id_;
70         ///
71         size_t max_wa_id_;
72 };
73
74 } // namespace frontend
75 } // namespace lyx
76
77 #endif // GUI_H