]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/GUI.h
The dialogs/guiapi re-working.
[lyx.git] / src / frontends / controllers / GUI.h
1 // -*- C++ -*-
2 /**
3  * \file GUI.h
4  * Copyright 2001 The LyX Team.
5  * See the file COPYING.
6  *
7  * \author Angus Leeming <leeming@lyx.org>
8  */
9
10 #ifndef GUI_H
11 #define GUI_H
12
13 #include "ButtonController.h"
14
15 #include <boost/utility.hpp>
16
17 /** This class makes a whole out of the disparate parts of a dialog.
18  */
19 template <typename Controller, typename GUIview,
20           typename Policy,     typename GUIbc>
21 class GUI : boost::noncopyable {
22 public:
23         ///
24         GUI(LyXView & lv, Dialogs & d);
25         ///
26         Controller & controller() { return controller_; }
27         ///
28         Controller const & controller() const { return controller_; }
29
30 private:
31         ///
32         Controller controller_;
33         ///
34         ButtonController<Policy, GUIbc> bc_;
35         ///
36         GUIview view_;
37 };
38
39
40 template <typename Controller, typename GUIview,
41           typename Policy,     typename GUIbc>
42 GUI<Controller, GUIview, Policy, GUIbc>::GUI(LyXView & lv, Dialogs & d)
43         : controller_(lv, d),
44           view_()
45 {
46         controller_.setView(view_);
47         controller_.setButtonController(bc_);
48         view_.setController(controller_);
49 }
50
51 #endif // GUI_H