]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/Dialogs2.C
Now that fewer dialogs use the old scheme, can merge three files into one.
[lyx.git] / src / frontends / xforms / Dialogs2.C
1 /**
2  * \file xforms/Dialogs2.C
3  * Copyright 1995 Matthias Ettrich
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Allan Rae
8  * \author Angus Leeming
9  *
10  * Full author contact details are available in file CREDITS
11  */
12
13 #include <config.h>
14
15 #include "Dialogs.h"
16 #include "controllers/GUI.h"
17 #include "ButtonController.h"
18
19 #include "Tooltips.h"
20 #include "xformsBC.h"
21 #include "combox.h"
22
23 #include "ControlDocument.h"
24 #include "FormDocument.h"
25 #include "forms/form_document.h"
26
27 #include "ControlForks.h"
28 #include "FormForks.h"
29 #include "forms/form_forks.h"
30
31 #include "ControlMath.h"
32 #include "FormMathsPanel.h"
33 #include "forms/form_maths_panel.h"
34
35 #include "ControlPreamble.h"
36 #include "FormPreamble.h"
37 #include "forms/form_preamble.h"
38
39 #include "ControlPrefs.h"
40 #include "FormPreferences.h"
41 #include "forms/form_preferences.h"
42
43 #include "ControlPrint.h"
44 #include "FormPrint.h"
45 #include "forms/form_print.h"
46
47 #include "ControlSearch.h"
48 #include "FormSearch.h"
49 #include "forms/form_search.h"
50
51 #include "ControlSendto.h"
52 #include "FormSendto.h"
53 #include "forms/form_sendto.h"
54
55 #include "ControlSpellchecker.h"
56 #include "FormSpellchecker.h"
57 #include "forms/form_spellchecker.h"
58
59 #include "ControlTexinfo.h"
60 #include "FormTexinfo.h"
61 #include "forms/form_texinfo.h"
62
63 typedef GUI<ControlDocument, FormDocument, NoRepeatedApplyReadOnlyPolicy, xformsBC>
64 DocumentDialog;
65
66 typedef GUI<ControlForks, FormForks, OkApplyCancelPolicy, xformsBC>
67 ForksDialog;
68
69 typedef GUI<ControlMath, FormMathsPanel, OkCancelReadOnlyPolicy, xformsBC>
70 MathPanelDialog;
71
72 typedef GUI<ControlPreamble, FormPreamble, NoRepeatedApplyReadOnlyPolicy, xformsBC>
73 PreambleDialog;
74
75 typedef GUI<ControlPrefs, FormPreferences, OkApplyCancelPolicy, xformsBC>
76 PreferencesDialog;
77
78 typedef GUI<ControlPrint, FormPrint, OkApplyCancelPolicy, xformsBC>
79 PrintDialog;
80
81 typedef GUI<ControlSearch, FormSearch, NoRepeatedApplyReadOnlyPolicy, xformsBC>
82 SearchDialog;
83
84 typedef GUI<ControlSendto, FormSendto, OkApplyCancelPolicy, xformsBC>
85 SendtoDialog;
86
87 typedef GUI<ControlSpellchecker, FormSpellchecker, NoRepeatedApplyReadOnlyPolicy, xformsBC>
88 SpellcheckerDialog;
89
90 typedef GUI<ControlTexinfo, FormTexinfo, OkCancelPolicy, xformsBC>
91 TexinfoDialog;
92
93 struct Dialogs::Impl {
94         Impl(LyXView & lv, Dialogs & d);
95
96         DocumentDialog      document;
97         ForksDialog         forks;
98         MathPanelDialog     mathpanel;
99         PreambleDialog      preamble;
100         PreferencesDialog   preferences;
101         PrintDialog         print;
102         SearchDialog        search;
103         SendtoDialog        sendto;
104         SpellcheckerDialog  spellchecker;
105         TexinfoDialog       texinfo;
106 };
107
108
109 Dialogs::Impl::Impl(LyXView & lv, Dialogs & d)
110         : document(lv, d),
111           forks(lv, d),
112           mathpanel(lv, d),
113           preamble(lv, d),
114           preferences(lv, d),
115           print(lv, d),
116           search(lv, d),
117           sendto(lv, d),
118           spellchecker(lv, d),
119           texinfo(lv, d)
120 {}
121
122
123 void Dialogs::init_pimpl()
124 {
125         pimpl_ = new Impl(lyxview_, *this);
126 }
127
128
129 Dialogs::~Dialogs()
130 {
131         delete pimpl_;
132 }
133
134
135 void Dialogs::showDocument()
136 {
137         pimpl_->document.controller().show();
138 }
139
140
141 void Dialogs::showForks()
142 {
143         pimpl_->forks.controller().show();
144 }
145
146
147 void Dialogs::showMathPanel()
148 {
149         pimpl_->mathpanel.controller().show();
150 }
151
152
153 void Dialogs::showPreamble()
154 {
155         pimpl_->preamble.controller().show();
156 }
157
158
159 void Dialogs::showPreferences()
160 {
161         pimpl_->preferences.controller().show();
162 }
163
164
165 void Dialogs::showPrint()
166 {
167         pimpl_->print.controller().show();
168 }
169
170
171 void Dialogs::showSearch()
172 {
173         pimpl_->search.controller().show();
174 }
175
176
177 void Dialogs::showSendto()
178 {
179         pimpl_->sendto.controller().show();
180 }
181
182
183 void Dialogs::showSpellchecker()
184 {
185         pimpl_->spellchecker.controller().show();
186 }
187
188
189 void Dialogs::showTexinfo()
190 {
191         pimpl_->texinfo.controller().show();
192 }