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