]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/Dialogs_impl.h
The dialogs/guiapi re-working.
[lyx.git] / src / frontends / xforms / Dialogs_impl.h
1 // -*- C++ -*-
2 /**
3  * \file Dialogs_impl.h
4  * Copyright 1995-2002 The LyX Team.
5  * See the file COPYING.
6  * \author Angus Leeming <leeming@lyx.org>
7  */
8
9 #ifndef DIALOGS_IMPL_H
10 #define DIALOGS_IMP_H
11
12 #ifdef __GNUG__
13 #pragma interface
14 #endif
15
16 #include "Dialogs.h"
17 #include "GUI.h"
18
19 #include <boost/scoped_ptr.hpp>
20
21
22 class ControlAboutlyx;
23 class ControlBibitem;
24 class ControlBibtex;
25 class ControlCharacter;
26 class ControlCitation;
27 class ControlError;
28 class ControlERT;
29 class ControlExternal;
30 class ControlShowFile;
31 class ControlFloat;
32 class ControlForks;
33 class ControlGraphics;
34 class ControlInclude;
35 class ControlIndex;
36 class ControlLog;
37 class ControlMinipage;
38 class ControlParagraph;
39 class ControlPreamble;
40 class ControlPrint;
41 class ControlRef;
42 class ControlSearch;
43 class ControlSendto;
44 class ControlSpellchecker;
45 class ControlTabularCreate;
46 class ControlTexinfo;
47 class ControlToc;
48 class ControlUrl;
49 class ControlVCLog;
50
51 class FormAboutlyx;
52 class FormBibitem;
53 class FormBibtex;
54 class FormCharacter;
55 class FormCitation;
56 class FormDocument;
57 class FormError;
58 class FormERT;
59 class FormExternal;
60 class FormShowFile;
61 class FormFloat;
62 class FormForks;
63 class FormGraphics;
64 class FormInclude;
65 class FormIndex;
66 class FormLog;
67 class FormMathsPanel;
68 class FormMinipage;
69 class FormParagraph;
70 class FormPreamble;
71 class FormPreferences;
72 class FormPrint;
73 class FormRef;
74 class FormSearch;
75 class FormSendto;
76 class FormSpellchecker;
77 class FormTabular;
78 class FormTabularCreate;
79 class FormTexinfo;
80 class FormToc;
81 class FormUrl;
82 class FormVCLog;
83
84 #ifdef HAVE_LIBAIKSAURUS
85 class ControlThesaurus;
86 class FormThesaurus;
87 #endif
88
89 class OkCancelPolicy;
90 class OkApplyCancelPolicy;
91 class OkCancelReadOnlyPolicy;
92 class OkApplyCancelReadOnlyPolicy;
93 class NoRepeatedApplyReadOnlyPolicy;
94 class xformsBC;
95
96
97 typedef GUI<ControlAboutlyx, FormAboutlyx, OkCancelPolicy, xformsBC>
98 AboutlyxDialog;
99
100 typedef GUI<ControlBibitem, FormBibitem, OkCancelReadOnlyPolicy, xformsBC>
101 BibitemDialog;
102
103 typedef GUI<ControlBibtex, FormBibtex, OkCancelReadOnlyPolicy, xformsBC>
104 BibtexDialog;
105
106 typedef GUI<ControlCharacter, FormCharacter,
107         OkApplyCancelReadOnlyPolicy, xformsBC>
108 CharacterDialog;
109
110 typedef GUI<ControlCitation, FormCitation,
111         NoRepeatedApplyReadOnlyPolicy, xformsBC>
112 CitationDialog;
113
114 typedef FormDocument DocumentDialog;
115
116 typedef GUI<ControlError, FormError, OkCancelPolicy, xformsBC>
117 ErrorDialog;
118
119 typedef GUI<ControlERT, FormERT, NoRepeatedApplyReadOnlyPolicy, xformsBC>
120 ERTDialog;
121
122 typedef GUI<ControlExternal, FormExternal,
123         OkApplyCancelReadOnlyPolicy, xformsBC>
124 ExternalDialog;
125
126 typedef GUI<ControlShowFile, FormShowFile, OkCancelPolicy, xformsBC>
127 FileDialog;
128
129 typedef GUI<ControlFloat, FormFloat, NoRepeatedApplyReadOnlyPolicy, xformsBC>
130 FloatDialog;
131
132 typedef GUI<ControlForks, FormForks, OkApplyCancelPolicy, xformsBC>
133 ForksDialog;
134
135 typedef GUI<ControlGraphics, FormGraphics,
136         NoRepeatedApplyReadOnlyPolicy, xformsBC>
137 GraphicsDialog;
138
139 typedef GUI<ControlInclude, FormInclude, OkCancelReadOnlyPolicy, xformsBC>
140 IncludeDialog;
141
142 typedef GUI<ControlIndex, FormIndex, NoRepeatedApplyReadOnlyPolicy, xformsBC>
143 IndexDialog;
144
145 typedef GUI<ControlLog, FormLog, OkCancelPolicy, xformsBC>
146 LogFileDialog;
147
148 typedef FormMathsPanel MathPanelDialog;
149
150 typedef GUI<ControlMinipage, FormMinipage,
151         NoRepeatedApplyReadOnlyPolicy, xformsBC>
152 MinipageDialog;
153
154 typedef GUI<ControlParagraph, FormParagraph,
155         OkApplyCancelReadOnlyPolicy, xformsBC>
156 ParagraphDialog;
157
158 typedef GUI<ControlPreamble, FormPreamble,
159         NoRepeatedApplyReadOnlyPolicy, xformsBC>
160 PreambleDialog;
161
162 typedef FormPreferences PreferencesDialog;
163
164 typedef GUI<ControlPrint, FormPrint, OkApplyCancelPolicy, xformsBC>
165 PrintDialog;
166
167 typedef GUI<ControlRef, FormRef, NoRepeatedApplyReadOnlyPolicy, xformsBC>
168 RefDialog;
169
170 typedef GUI<ControlSearch, FormSearch, NoRepeatedApplyReadOnlyPolicy, xformsBC>
171 SearchDialog;
172
173 typedef GUI<ControlSendto, FormSendto, OkApplyCancelPolicy, xformsBC>
174 SendtoDialog;
175
176 typedef GUI<ControlSpellchecker, FormSpellchecker,
177         NoRepeatedApplyReadOnlyPolicy, xformsBC>
178 SpellcheckerDialog;
179
180 typedef FormTabular TabularDialog;
181
182 typedef GUI<ControlTabularCreate, FormTabularCreate,
183         OkApplyCancelReadOnlyPolicy, xformsBC>
184 TabularCreateDialog;
185
186 typedef GUI<ControlTexinfo, FormTexinfo, OkCancelPolicy, xformsBC>
187 TexinfoDialog;
188
189 #ifdef HAVE_LIBAIKSAURUS
190 typedef GUI<ControlThesaurus, FormThesaurus,
191         OkApplyCancelReadOnlyPolicy, xformsBC>
192 ThesaurusDialog;
193 #endif
194
195 typedef GUI<ControlToc, FormToc, OkCancelPolicy, xformsBC>
196 TocDialog;
197
198 typedef GUI<ControlUrl, FormUrl, NoRepeatedApplyReadOnlyPolicy, xformsBC>
199 UrlDialog;
200
201 typedef GUI<ControlVCLog, FormVCLog, OkCancelPolicy, xformsBC>
202 VCLogFileDialog;
203
204 struct Dialogs::Impl {
205         Impl(LyXView & lv, Dialogs & d) : lv_(lv), d_(d) {}
206
207         template <typename T>
208         T & dialog(boost::scoped_ptr<T> & var)
209         {
210                 if (!var.get())
211                         var.reset(new T(lv_, d_));
212                 return *var;
213         }
214         
215         boost::scoped_ptr<AboutlyxDialog>      aboutlyx;
216         boost::scoped_ptr<BibitemDialog>       bibitem;
217         boost::scoped_ptr<BibtexDialog>        bibtex;
218         boost::scoped_ptr<CharacterDialog>     character;
219         boost::scoped_ptr<CitationDialog>      citation;
220         boost::scoped_ptr<DocumentDialog>      document;
221         boost::scoped_ptr<ErrorDialog>         error;
222         boost::scoped_ptr<ERTDialog>           ert;
223         boost::scoped_ptr<ExternalDialog>      external;
224         boost::scoped_ptr<FileDialog>          file;
225         boost::scoped_ptr<FloatDialog>         floats;
226         boost::scoped_ptr<ForksDialog>         forks;
227         boost::scoped_ptr<GraphicsDialog>      graphics;
228         boost::scoped_ptr<IncludeDialog>       include;
229         boost::scoped_ptr<IndexDialog>         index;
230         boost::scoped_ptr<LogFileDialog>       logfile;
231         boost::scoped_ptr<MathPanelDialog>     mathpanel;
232         boost::scoped_ptr<MinipageDialog>      minipage;
233         boost::scoped_ptr<ParagraphDialog>     paragraph;
234         boost::scoped_ptr<PreambleDialog>      preamble;
235         boost::scoped_ptr<PreferencesDialog>   preferences;
236         boost::scoped_ptr<PrintDialog>         print;
237         boost::scoped_ptr<RefDialog>           ref;
238         boost::scoped_ptr<SearchDialog>        search;
239         boost::scoped_ptr<SendtoDialog>        sendto;
240         boost::scoped_ptr<SpellcheckerDialog>  spellchecker;
241         boost::scoped_ptr<TabularDialog>       tabular;
242         boost::scoped_ptr<TabularCreateDialog> tabularcreate;
243         boost::scoped_ptr<TexinfoDialog>       texinfo;
244
245 #ifdef HAVE_LIBAIKSAURUS
246         boost::scoped_ptr<ThesaurusDialog>     thesaurus;
247 #endif
248
249         boost::scoped_ptr<TocDialog>           toc;
250         boost::scoped_ptr<UrlDialog>           url;
251         boost::scoped_ptr<VCLogFileDialog>     vclogfile;
252
253 private:
254         LyXView & lv_;
255         Dialogs & d_;
256 };
257
258 #endif // DIALOGS_IMPL_H