]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/GUI.h
Implemented controller-view split for minipage and preamble popups.
[lyx.git] / src / frontends / controllers / GUI.h
1 /**
2  * \file GUI.h
3  * Copyright 2001 The LyX Team.
4  * See the file COPYING.
5  *
6  * \author Angus Leeming <a.leeming@ic.ac.uk>
7  */
8
9 #ifndef GUI_H
10 #define GUI_H
11
12 /** This class instantiates and makes available the GUI-specific
13     View for the Splash screen controller.
14  */
15 template <class GUIview>
16 class GUISplash : public ControlSplash {
17 public:
18         ///
19         GUISplash(Dialogs & d) : ControlSplash(d), view_(*this) {}
20         ///
21         virtual ViewSplash & view() { return view_; }
22
23 private:
24         ///
25         GUIview view_;
26 };
27
28
29 /** This class instantiates and makes available the GUI-specific
30     ButtonController and View.
31  */
32 template <class Controller, class GUIview, class Policy, class GUIbc>
33 class GUI : public Controller {
34 public:
35         ///
36         GUI(LyXView & lv, Dialogs & d) : Controller(lv, d), view_(*this) {}
37         ///
38         virtual ButtonControllerBase & bc() { return bc_; }
39         ///
40         virtual ViewBase & view() { return view_; }
41
42 private:
43         ///
44         ButtonController<Policy, GUIbc> bc_;
45         ///
46         GUIview view_;
47 };
48
49 /// Forward declaration of ButtonPolicies
50 class OkCancelPolicy;
51 class OkCancelReadOnlyPolicy;
52 class NoRepeatedApplyReadOnlyPolicy;
53
54
55 /** Specialization for Bibitem dialog
56  */
57 class ControlBibitem;
58
59 template <class GUIview, class GUIbc>
60 class GUIBibitem :
61         public GUI<ControlBibitem, GUIview, OkCancelReadOnlyPolicy, GUIbc> {
62 public:
63         ///
64         GUIBibitem(LyXView & lv, Dialogs & d)
65                 : GUI<ControlBibitem, GUIview, OkCancelReadOnlyPolicy, GUIbc>(lv, d) {}
66 };
67
68
69 /** Specialization for Bibtex dialog
70  */
71 class ControlBibtex;
72
73 template <class GUIview, class GUIbc>
74 class GUIBibtex :
75         public GUI<ControlBibtex, GUIview, OkCancelReadOnlyPolicy, GUIbc> {
76 public:
77         ///
78         GUIBibtex(LyXView & lv, Dialogs & d)
79                 : GUI<ControlBibtex, GUIview, OkCancelReadOnlyPolicy, GUIbc>(lv, d) {}
80 };
81
82
83 /** Specialization for Character dialog
84  */
85 class ControlCharacter;
86
87 template <class GUIview, class GUIbc>
88 class GUICharacter : public GUI<ControlCharacter, GUIview,
89                                 NoRepeatedApplyReadOnlyPolicy, GUIbc>
90 {
91 public:
92         ///
93         GUICharacter(LyXView & lv, Dialogs & d)
94                 : GUI<ControlCharacter, GUIview,
95                       NoRepeatedApplyReadOnlyPolicy, GUIbc>(lv, d) {}
96 };
97
98
99 /** Specialization for Citation dialog
100  */
101 class ControlCitation;
102
103 template <class GUIview, class GUIbc>
104 class GUICitation : public GUI<ControlCitation, GUIview,
105                                NoRepeatedApplyReadOnlyPolicy, GUIbc>
106 {
107 public:
108         ///
109         GUICitation(LyXView & lv, Dialogs & d)
110                 : GUI<ControlCitation, GUIview,
111                       NoRepeatedApplyReadOnlyPolicy, GUIbc>(lv, d) {}
112 };
113
114
115 /** Specialization for Credits dialog
116  */
117 class ControlCredits;
118
119 template <class GUIview, class GUIbc>
120 class GUICredits :
121         public GUI<ControlCredits, GUIview, OkCancelPolicy, GUIbc> {
122 public:
123         ///
124         GUICredits(LyXView & lv, Dialogs & d)
125                 : GUI<ControlCredits, GUIview, OkCancelPolicy, GUIbc>(lv, d) {}
126 };
127
128
129 /** Specialization for Error dialog
130  */
131 class ControlError;
132
133 template <class GUIview, class GUIbc>
134 class GUIError :
135         public GUI<ControlError, GUIview, OkCancelPolicy, GUIbc> {
136 public:
137         ///
138         GUIError(LyXView & lv, Dialogs & d)
139                 : GUI<ControlError, GUIview, OkCancelPolicy, GUIbc>(lv, d) {}
140 };
141
142
143 /** Specialization for Include dialog
144  */
145 class ControlInclude;
146
147 template <class GUIview, class GUIbc>
148 class GUIInclude :
149         public GUI<ControlInclude, GUIview, OkCancelReadOnlyPolicy, GUIbc> {
150 public:
151         ///
152         GUIInclude(LyXView & lv, Dialogs & d)
153                 : GUI<ControlInclude, GUIview, OkCancelReadOnlyPolicy, GUIbc>(lv, d) {}
154 };
155
156
157 /** Specialization for Log dialog
158  */
159 class ControlLog;
160
161 template <class GUIview, class GUIbc>
162 class GUILog :
163         public GUI<ControlLog, GUIview, OkCancelPolicy, GUIbc> {
164 public:
165         ///
166         GUILog(LyXView & lv, Dialogs & d)
167                 : GUI<ControlLog, GUIview, OkCancelPolicy, GUIbc>(lv, d) {}
168 };
169
170
171 /** Specialization for Minipage dialog
172  */
173 class ControlMinipage;
174
175 template <class GUIview, class GUIbc>
176 class GUIMinipage :
177         public GUI<ControlMinipage, GUIview, OkApplyCancelReadOnlyPolicy, GUIbc> {
178 public:
179         ///
180         GUIMinipage(LyXView & lv, Dialogs & d)
181                 : GUI<ControlMinipage, GUIview, OkApplyCancelReadOnlyPolicy, GUIbc>(lv, d) {}
182 };
183
184
185 /** Specialization for Preamble dialog
186  */
187 class ControlPreamble;
188
189 template <class GUIview, class GUIbc>
190 class GUIPreamble :
191         public GUI<ControlPreamble, GUIview, NoRepeatedApplyReadOnlyPolicy, GUIbc> {
192 public:
193         ///
194         GUIPreamble(LyXView & lv, Dialogs & d)
195                 : GUI<ControlPreamble, GUIview, NoRepeatedApplyReadOnlyPolicy, GUIbc>(lv, d) {}
196 };
197
198
199 /** Specialization for Print dialog
200  */
201 class ControlPrint;
202
203 template <class GUIview, class GUIbc>
204 class GUIPrint :
205         public GUI<ControlPrint, GUIview, OkApplyCancelPolicy, GUIbc> {
206 public:
207         ///
208         GUIPrint(LyXView & lv, Dialogs & d)
209                 : GUI<ControlPrint, GUIview, OkApplyCancelPolicy, GUIbc>(lv, d) {}
210 };
211
212
213 /** Specialization for Ref dialog
214  */
215 class ControlRef;
216
217 template <class GUIview, class GUIbc>
218 class GUIRef :
219         public GUI<ControlRef, GUIview, NoRepeatedApplyPolicy, GUIbc> {
220 public:
221         ///
222         GUIRef(LyXView & lv, Dialogs & d)
223                 : GUI<ControlRef, GUIview, NoRepeatedApplyPolicy, GUIbc>(lv, d) {}
224 };
225
226
227 /** Specialization for Search dialog
228  */
229 class ControlSearch;
230
231 template <class GUIview, class GUIbc>
232 class GUISearch :
233         public GUI<ControlSearch, GUIview, NoRepeatedApplyReadOnlyPolicy, GUIbc> {
234 public:
235         ///
236         GUISearch(LyXView & lv, Dialogs & d)
237                 : GUI<ControlSearch, GUIview, NoRepeatedApplyReadOnlyPolicy, GUIbc>(lv, d) {}
238 };
239
240
241 /** Specialization for TabularCreate dialog
242  */
243 class ControlTabularCreate;
244
245 template <class GUIview, class GUIbc>
246 class GUITabularCreate :
247         public GUI<ControlTabularCreate, GUIview,
248                    OkApplyCancelReadOnlyPolicy, GUIbc> {
249 public:
250         ///
251         GUITabularCreate(LyXView & lv, Dialogs & d)
252                 : GUI<ControlTabularCreate, GUIview,
253                       OkApplyCancelReadOnlyPolicy, GUIbc>(lv, d) {}
254 };
255
256
257 /** Specialization for Url dialog
258  */
259 class ControlUrl;
260
261 template <class GUIview, class GUIbc>
262 class GUIUrl :
263         public GUI<ControlUrl, GUIview, NoRepeatedApplyReadOnlyPolicy, GUIbc> {
264 public:
265         ///
266         GUIUrl(LyXView & lv, Dialogs & d)
267             : GUI<ControlUrl, GUIview, NoRepeatedApplyReadOnlyPolicy, GUIbc>(lv, d) {}
268 };
269
270
271 /** Specialization for VCLog dialog
272  */
273 class ControlVCLog;
274
275 template <class GUIview, class GUIbc>
276 class GUIVCLog :
277         public GUI<ControlVCLog, GUIview, OkCancelPolicy, GUIbc> {
278 public:
279         ///
280         GUIVCLog(LyXView & lv, Dialogs & d)
281             : GUI<ControlVCLog, GUIview, OkCancelPolicy, GUIbc>(lv, d) {}
282 };
283
284
285 #endif // GUI_H