]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/GUI.h
Ensure that the header file can be compiled stand-alone.
[lyx.git] / src / frontends / controllers / GUI.h
1 // -*- C++ -*-
2 /**
3  * \file GUI.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Angus Leeming
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef GUI_H
13 #define GUI_H
14
15 #include "BCView.h"
16
17 #include <boost/utility.hpp>
18
19 class LyXView;
20 class Dialogs;
21
22 /** This class makes a whole out of the disparate parts of a dialog.
23  */
24 template <typename Controller, typename GUIview,
25           typename Policy,     typename GUIbc>
26 class GUI : boost::noncopyable {
27 public:
28         ///
29         GUI(LyXView & lv, Dialogs & d);
30         ///
31         Controller & controller() { return controller_; }
32         ///
33         Controller const & controller() const { return controller_; }
34 private:
35         ///
36         Controller controller_;
37         ///
38         GUIview view_;
39 };
40
41
42 template <typename Controller, typename GUIview,
43           typename Policy,     typename GUIbc>
44 GUI<Controller, GUIview, Policy, GUIbc>::GUI(LyXView & lv, Dialogs & d)
45         : controller_(lv, d),
46           view_()
47 {
48         controller_.setView(view_);
49         view_.setController(controller_);
50         controller_.bc().view(new GUIbc(controller_.bc()));
51         controller_.bc().bp(new Policy);
52 }
53
54 #endif // GUI_H