]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/GUI.h
If I ever see another licence blurb again, it'll be too soon...
[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 /** This class makes a whole out of the disparate parts of a dialog.
20  */
21 template <typename Controller, typename GUIview,
22           typename Policy,     typename GUIbc>
23 class GUI : boost::noncopyable {
24 public:
25         ///
26         GUI(LyXView & lv, Dialogs & d);
27         ///
28         Controller & controller() { return controller_; }
29         ///
30         Controller const & controller() const { return controller_; }
31 private:
32         ///
33         Controller controller_;
34         ///
35         GUIview view_;
36 };
37
38
39 template <typename Controller, typename GUIview,
40           typename Policy,     typename GUIbc>
41 GUI<Controller, GUIview, Policy, GUIbc>::GUI(LyXView & lv, Dialogs & d)
42         : controller_(lv, d),
43           view_()
44 {
45         controller_.setView(view_);
46         view_.setController(controller_);
47         controller_.bc().view(new GUIbc(controller_.bc()));
48         controller_.bc().bp(new Policy);
49 }
50
51 #endif // GUI_H