]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/GUI.h
No longer pass Controller & or Dialogs & to the View c-tors.
[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 <a.leeming@ic.ac.uk>
8  */
9
10 #ifndef GUI_H
11 #define GUI_H
12
13 #include "ButtonController.h"
14
15
16 /** This class makes a whole out of the disparate parts of a dialog.
17  */
18 template <typename Controller, typename GUIview,
19           typename Policy,     typename GUIbc>
20 class GUI {
21 public:
22         ///
23         GUI(LyXView & lv, Dialogs & d);
24         ///
25         Controller & controller() { return controller_; }
26         ///
27         Controller const & controller() const { return controller_; }
28
29 private:
30         ///
31         Controller controller_;
32         ///
33         ButtonController<Policy, GUIbc> bc_;
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         controller_.setButtonController(bc_);
47         view_.setController(controller_);
48 }
49
50
51 #endif // GUI_H