]> git.lyx.org Git - features.git/blob - src/frontends/gtk/Dialogs.C
Remove all xforms code from gtk frontends
[features.git] / src / frontends / gtk / Dialogs.C
1 /**
2 // * \file xforms/Dialogs.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Angus Leeming
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 // Too hard to make concept checks work with this file
14 #ifdef _GLIBCXX_CONCEPT_CHECKS
15 #undef _GLIBCXX_CONCEPT_CHECKS
16 #endif
17 #ifdef _GLIBCPP_CONCEPT_CHECKS
18 #undef _GLIBCPP_CONCEPT_CHECKS
19 #endif
20
21 #include "Dialogs.h"
22 #include "Dialog.h"
23
24 #include "ControlAboutlyx.h"
25 #include "ControlBibtex.h"
26 #include "ControlBox.h"
27 #include "ControlBranch.h"
28 #include "ControlChanges.h"
29 #include "ControlCharacter.h"
30 #include "ControlCitation.h"
31 #include "ControlCommand.h"
32 #include "ControlDocument.h"
33 #include "ControlErrorList.h"
34 #include "ControlERT.h"
35 #include "ControlExternal.h"
36 #include "ControlFloat.h"
37 #include "ControlGraphics.h"
38 #include "ControlInclude.h"
39 #include "ControlLog.h"
40 #include "ControlMath.h"
41 #include "ControlNote.h"
42 #include "ControlParagraph.h"
43 #include "ControlPreamble.h"
44 #include "ControlPrefs.h"
45 #include "ControlPrint.h"
46 #include "ControlRef.h"
47 #include "ControlSearch.h"
48 #include "ControlSendto.h"
49 #include "ControlShowFile.h"
50 #include "ControlSpellchecker.h"
51 #include "ControlTabular.h"
52 #include "ControlTabularCreate.h"
53 #include "ControlTexinfo.h"
54 #include "ControlToc.h"
55 #include "ControlVSpace.h"
56 #include "ControlWrap.h"
57
58 #include "GAboutlyx.h"
59 #include "GText.h"
60 #include "GMathDelim.h"
61 #include "GBibItem.h"
62 //#include "FormBibtex.h"
63 #include "GBox.h"
64 //#include "FormBranch.h"
65 #include "GChanges.h"
66 #include "GCharacter.h"
67 #include "GCitation.h"
68 #include "GDocument.h"
69 #include "GErrorList.h"
70 #include "GERT.h"
71 //#include "FormExternal.h"
72 #include "GFloat.h"
73 #include "GGraphics.h"
74 #include "GInclude.h"
75 #include "GLog.h"
76 #include "GMathPanel.h"
77 //#include "FormMathsBitmap.h"
78 #include "GMathsMatrix.h"
79 //#include "FormMathsSpace.h"
80 //#include "FormMathsStyle.h"
81 #include "GNote.h"
82 #include "GParagraph.h"
83 //#include "FormPreamble.h"
84 //#include "FormPreferences.h"
85 #include "GPrint.h"
86 #include "GRef.h"
87 #include "GSearch.h"
88 #include "GSendto.h"
89 #include "GTabular.h"
90 #include "GTexinfo.h"
91 #include "GShowFile.h"
92 #include "GSpellchecker.h"
93 #include "GTableCreate.h"
94 #include "GToc.h"
95 #include "GUrl.h"
96 #include "GVSpace.h"
97 //#include "FormWrap.h"
98
99 #ifdef HAVE_LIBAIKSAURUS
100 #include "ControlThesaurus.h"
101 #include "GThesaurus.h"
102 #endif
103
104 //#include "xformsBC.h"
105 #include "ButtonController.h"
106
107 #include "arrows.xbm"
108 #include "bop.xbm"
109 #include "brel.xbm"
110 #include "deco.xbm"
111 #include "dots.xbm"
112 #include "greek.xbm"
113 #include "misc.xbm"
114 #include "varsz.xbm"
115
116 #include "ams_misc.xbm"
117 #include "ams_arrows.xbm"
118 #include "ams_rel.xbm"
119 #include "ams_nrel.xbm"
120 #include "ams_ops.xbm"
121
122 #include <boost/assert.hpp>
123 #include <vector>
124
125 using std::string;
126
127 using namespace lyx::frontend;
128
129 namespace {
130
131 //FormMathsBitmap * createFormBitmap(Dialog & parent, string const & title,
132 //                                 char const * const * data, int size)
133 //{
134 //      char const * const * const end = data + size;
135 //      return new FormMathsBitmap(parent, title, std::vector<string>(data, end));
136 //}
137
138
139 char const * const dialognames[] = {
140 "aboutlyx", "bibitem", "bibtex", "box", "branch", "changes", "character",
141 "citation", "document", "errorlist" , "ert", "external", "file",
142 "findreplace", "float", "graphics", "include", "index", "label", "log",
143 "mathpanel", "mathaccents", "matharrows", "mathoperators", "mathrelations",
144 "mathgreek", "mathmisc", "mathdots", "mathbigoperators", "mathamsmisc",
145 "mathamsarrows", "mathamsrelations", "mathamsnegatedrelations",
146 "mathamsoperators", "mathdelimiter", "mathmatrix", "mathspace", "mathstyle",
147 "note", "paragraph", "preamble", "prefs", "print", "ref", "sendto",
148 "spellchecker", "tabular", "tabularcreate", "texinfo",
149
150 #ifdef HAVE_LIBAIKSAURUS
151 "thesaurus",
152 #endif
153
154 "toc", "url", "vspace", "wrap" };
155
156 char const * const * const end_dialognames =
157         dialognames + (sizeof(dialognames) / sizeof(char *));
158
159 struct cmpCStr {
160         cmpCStr(char const * name) : name_(name) {}
161         bool operator()(char const * other) {
162                 return strcmp(other, name_) == 0;
163         }
164 private:
165         char const * name_;
166 };
167
168 } // namespace anon
169
170
171 bool Dialogs::isValidName(string const & name) const
172 {
173         return std::find_if(dialognames, end_dialognames,
174                             cmpCStr(name.c_str())) != end_dialognames;
175 }
176
177
178 Dialogs::DialogPtr Dialogs::build(string const & name)
179 {
180         BOOST_ASSERT(isValidName(name));
181
182         DialogPtr dialog(new Dialog(lyxview_, name));
183
184         if (name == "aboutlyx") {
185                 dialog->bc().view(new GBC(dialog->bc()));
186                 dialog->setController(new ControlAboutlyx(*dialog));
187                 dialog->setView(new GAboutlyx(*dialog));
188                 dialog->bc().bp(new OkCancelPolicy);
189         } else if (name == "bibitem") {
190                 dialog->bc().view(new GBC(dialog->bc()));
191                 dialog->setController(new ControlCommand(*dialog, name));
192                 dialog->setView(new GBibItem(*dialog));
193                 dialog->bc().bp(new OkCancelReadOnlyPolicy);
194         } else if (name == "bibtex") {
195 //              dialog->bc().view(new xformsBC(dialog->bc()));
196                 dialog->setController(new ControlBibtex(*dialog));
197 //              dialog->setView(new FormBibtex(*dialog));
198                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
199         } else if (name == "box") {
200                 dialog->bc().view(new GBC(dialog->bc()));
201                 dialog->setController(new ControlBox(*dialog));
202                 dialog->setView(new GBox(*dialog));
203                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
204         } else if (name == "changes") {
205                 dialog->bc().view(new GBC(dialog->bc()));
206                 dialog->setController(new ControlChanges(*dialog));
207                 dialog->setView(new GChanges(*dialog));
208                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
209         } else if (name == "character") {
210                 dialog->bc().view(new GBC(dialog->bc()));
211                 dialog->setController(new ControlCharacter(*dialog));
212                 dialog->setView(new GCharacter(*dialog));
213                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
214         } else if (name == "citation") {
215                 dialog->bc().view(new GBC(dialog->bc()));
216                 dialog->setController(new ControlCitation(*dialog));
217                 dialog->setView(new GCitation(*dialog));
218                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
219         } else if (name == "document") {
220                 dialog->bc().view(new GBC(dialog->bc()));
221                 dialog->setController(new ControlDocument(*dialog));
222                 dialog->setView(new GDocument(*dialog));
223                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
224         } else if (name == "errorlist") {
225                 dialog->bc().view(new GBC(dialog->bc()));
226                 dialog->setController(new ControlErrorList(*dialog));
227                 dialog->setView(new GErrorList(*dialog));
228                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
229         } else if (name == "ert") {
230                 dialog->bc().view(new GBC(dialog->bc()));
231                 dialog->setController(new ControlERT(*dialog));
232                 dialog->setView(new GERT(*dialog));
233                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
234         } else if (name == "external") {
235 //              dialog->bc().view(new xformsBC(dialog->bc()));
236                 dialog->setController(new ControlExternal(*dialog));
237 //              dialog->setView(new FormExternal(*dialog));
238                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
239         } else if (name == "file") {
240                 dialog->bc().view(new GBC(dialog->bc()));
241                 dialog->setController(new ControlShowFile(*dialog));
242                 dialog->setView(new GShowFile(*dialog));
243                 dialog->bc().bp(new OkCancelPolicy);
244         } else if (name == "findreplace") {
245                 dialog->bc().view(new GBC(dialog->bc()));
246                 dialog->setController(new ControlSearch(*dialog));
247                 dialog->setView(new GSearch(*dialog));
248                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
249         } else if (name == "float") {
250                 dialog->bc().view(new GBC(dialog->bc()));
251                 dialog->setController(new ControlFloat(*dialog));
252                 dialog->setView(new GFloat(*dialog));
253                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
254         } else if (name == "graphics") {
255                 dialog->bc().view(new GBC(dialog->bc()));
256                 dialog->setController(new ControlGraphics(*dialog));
257                 dialog->setView(new GGraphics(*dialog));
258                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
259         } else if (name == "include") {
260                 dialog->bc().view(new GBC(dialog->bc()));
261                 dialog->setController(new ControlInclude(*dialog));
262                 dialog->setView(new GInclude(*dialog));
263                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
264         } else if (name == "index") {
265                 dialog->bc().view(new GBC(dialog->bc()));
266                 dialog->setController(new ControlCommand(*dialog, name));
267                 dialog->setView(new GText(*dialog,
268                                           _("Index Entry"), _("Keyword:|#K")));
269                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
270         } else if (name == "label") {
271                 dialog->bc().view(new GBC(dialog->bc()));
272                 dialog->setController(new ControlCommand(*dialog, name));
273                 dialog->setView(new GText(*dialog,
274                                           _("Label"), _("Label:|#L")));
275                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
276         } else if (name == "log") {
277                 dialog->bc().view(new GBC(dialog->bc()));
278                 dialog->setController(new ControlLog(*dialog));
279                 dialog->setView(new GLog(*dialog));
280                 dialog->bc().bp(new OkCancelPolicy);
281
282         } else if (name == "mathpanel") {
283                 dialog->bc().view(new GBC(dialog->bc()));
284                 dialog->setController(new ControlMath(*dialog));
285                 dialog->setView(new GMathPanel(*dialog));
286                 dialog->bc().bp(new IgnorantPolicy);
287
288         } else if (name == "mathaccents") {
289 //              FormMathsBitmap * bitmap =
290 //                      createFormBitmap(*dialog, _("Maths Decorations & Accents"),
291 //                                       latex_deco, nr_latex_deco);
292 //              bitmap->addBitmap(
293 //                      BitmapStore(12, 3, 4, deco1_width, deco1_height, deco1_bits, true));
294 //              bitmap->addBitmap(
295 //                      BitmapStore(10, 4, 3, deco2_width, deco2_height, deco2_bits, true));
296
297 //              dialog->bc().view(new xformsBC(dialog->bc()));
298                 dialog->setController(new ControlMath(*dialog));
299 //              dialog->setView(bitmap);
300                 dialog->bc().bp(new IgnorantPolicy);
301
302         } else if (name == "matharrows") {
303 //              FormMathsBitmap * bitmap =
304 //                      createFormBitmap(*dialog, _("Arrows"), latex_arrow, nr_latex_arrow);
305 //              bitmap->addBitmap(
306 //                      BitmapStore(20, 5, 4, arrow_width,  arrow_height,  arrow_bits, true));
307 //              bitmap->addBitmap(
308 //                      BitmapStore(7,  2, 4, larrow_width, larrow_height, larrow_bits, false));
309 //              bitmap->addBitmap(
310 //                      BitmapStore(4,  2, 2, darrow_width,  darrow_height, darrow_bits, true));
311
312 //              dialog->bc().view(new xformsBC(dialog->bc()));
313                 dialog->setController(new ControlMath(*dialog));
314 //              dialog->setView(bitmap);
315                 dialog->bc().bp(new IgnorantPolicy);
316
317         } else if (name == "mathoperators") {
318 //              FormMathsBitmap * bitmap =
319 //                      createFormBitmap(*dialog, _("Binary Ops"),
320 //                                       latex_bop, nr_latex_bop);
321 //              bitmap->addBitmap(
322 //                      BitmapStore(31, 4, 8, bop_width, bop_height, bop_bits, true));
323
324 //              dialog->bc().view(new xformsBC(dialog->bc()));
325                 dialog->setController(new ControlMath(*dialog));
326 //              dialog->setView(bitmap);
327                 dialog->bc().bp(new IgnorantPolicy);
328
329         } else if (name == "mathrelations") {
330 //              FormMathsBitmap * bitmap =
331 //                      createFormBitmap(*dialog, _("Binary Relations"),
332 //                                       latex_brel, nr_latex_brel);
333 //              bitmap->addBitmap(
334 //                      BitmapStore(35, 4, 9, brel_width, brel_height, brel_bits, true));
335
336 //              dialog->bc().view(new xformsBC(dialog->bc()));
337                 dialog->setController(new ControlMath(*dialog));
338 //              dialog->setView(bitmap);
339                 dialog->bc().bp(new IgnorantPolicy);
340
341         } else if (name == "mathgreek") {
342 //              FormMathsBitmap * bitmap =
343 //                      createFormBitmap(*dialog, _("Greek"),
344 //                                       latex_greek, nr_latex_greek);
345 //              bitmap->addBitmap(
346 //                      BitmapStore(11, 6, 2, Greek_width, Greek_height, Greek_bits, true));
347 //              bitmap->addBitmap(
348 //                      BitmapStore(28, 7, 4, greek_width, greek_height, greek_bits, true));
349
350 //              dialog->bc().view(new xformsBC(dialog->bc()));
351                 dialog->setController(new ControlMath(*dialog));
352 //              dialog->setView(bitmap);
353                 dialog->bc().bp(new IgnorantPolicy);
354
355         } else if (name == "mathmisc") {
356 //              FormMathsBitmap * bitmap =
357 //                      createFormBitmap(*dialog, _("Misc"),
358 //                                       latex_misc, nr_latex_misc);
359 //              bitmap->addBitmap(
360 //                      BitmapStore(29, 5, 6, misc_width, misc_height, misc_bits, true));
361 //              bitmap->addBitmap(
362 //                      BitmapStore(5, 5, 1, misc4_width, misc4_height, misc4_bits, true));
363 //              bitmap->addBitmap(
364 //                      BitmapStore(6, 3, 2, misc2_width, misc2_height, misc2_bits, false));
365 //              bitmap->addBitmap(
366 //                      BitmapStore(4, 2, 2, misc3_width, misc3_height, misc3_bits, true));
367
368 //              dialog->bc().view(new xformsBC(dialog->bc()));
369                 dialog->setController(new ControlMath(*dialog));
370 //              dialog->setView(bitmap);
371                 dialog->bc().bp(new IgnorantPolicy);
372
373         } else if (name == "mathdots") {
374 //              FormMathsBitmap * bitmap =
375 //                      createFormBitmap(*dialog, _("Dots"),
376 //                                       latex_dots, nr_latex_dots);
377 //              bitmap->addBitmap(
378 //                      BitmapStore(4, 4, 1, dots_width, dots_height, dots_bits, true));
379
380 //              dialog->bc().view(new xformsBC(dialog->bc()));
381                 dialog->setController(new ControlMath(*dialog));
382 //              dialog->setView(bitmap);
383                 dialog->bc().bp(new IgnorantPolicy);
384
385         } else if (name == "mathbigoperators") {
386 //              FormMathsBitmap * bitmap =
387 //                      createFormBitmap(*dialog, _("Big Operators"),
388 //                                       latex_varsz, nr_latex_varsz);
389 //              bitmap->addBitmap(
390 //                      BitmapStore(14, 3, 5, varsz_width, varsz_height, varsz_bits, true));
391
392 //              dialog->bc().view(new xformsBC(dialog->bc()));
393                 dialog->setController(new ControlMath(*dialog));
394 //              dialog->setView(bitmap);
395                 dialog->bc().bp(new IgnorantPolicy);
396
397         } else if (name == "mathamsmisc") {
398 //              FormMathsBitmap * bitmap =
399 //                      createFormBitmap(*dialog, _("AMS Misc"),
400 //                                       latex_ams_misc, nr_latex_ams_misc);
401 //              bitmap->addBitmap(
402 //                      BitmapStore(9, 5, 2, ams1_width, ams1_height, ams1_bits, true));
403 //              bitmap->addBitmap(
404 //                      BitmapStore(26, 3, 9, ams7_width, ams7_height, ams7_bits, true));
405
406 //              dialog->bc().view(new xformsBC(dialog->bc()));
407                 dialog->setController(new ControlMath(*dialog));
408 //              dialog->setView(bitmap);
409                 dialog->bc().bp(new IgnorantPolicy);
410
411         } else if (name == "mathamsarrows") {
412 //              FormMathsBitmap * bitmap =
413 //                      createFormBitmap(*dialog, _("AMS Arrows"),
414 //                                       latex_ams_arrows, nr_latex_ams_arrows);
415 //              bitmap->addBitmap(
416 //                      BitmapStore(32, 3, 11, ams2_width, ams2_height, ams2_bits, true));
417 //              bitmap->addBitmap(
418 //                      BitmapStore(6, 3, 2, ams3_width, ams3_height, ams3_bits, true));
419
420 //              dialog->bc().view(new xformsBC(dialog->bc()));
421                 dialog->setController(new ControlMath(*dialog));
422 //              dialog->setView(bitmap);
423                 dialog->bc().bp(new IgnorantPolicy);
424
425         } else if (name == "mathamsrelations") {
426 //              FormMathsBitmap * bitmap =
427 //                      createFormBitmap(*dialog, _("AMS Relations"),
428 //                                       latex_ams_rel, nr_latex_ams_rel);
429 //              bitmap->addBitmap(
430 //                      BitmapStore(66, 6, 11, ams_rel_width, ams_rel_height, ams_rel_bits, true));
431
432 //              dialog->bc().view(new xformsBC(dialog->bc()));
433                 dialog->setController(new ControlMath(*dialog));
434 //              dialog->setView(bitmap);
435                 dialog->bc().bp(new IgnorantPolicy);
436
437         } else if (name == "mathamsnegatedrelations") {
438 //              FormMathsBitmap * bitmap =
439 //                      createFormBitmap(*dialog, _("AMS Negated Rel"),
440 //                                       latex_ams_nrel, nr_latex_ams_nrel);
441 //              bitmap->addBitmap(
442 //                      BitmapStore(51, 6, 9, ams_nrel_width, ams_nrel_height, ams_nrel_bits, true));
443
444 //              dialog->bc().view(new xformsBC(dialog->bc()));
445                 dialog->setController(new ControlMath(*dialog));
446 //              dialog->setView(bitmap);
447                 dialog->bc().bp(new IgnorantPolicy);
448
449         } else if (name == "mathamsoperators") {
450 //              FormMathsBitmap * bitmap =
451 //                      createFormBitmap(*dialog, _("AMS Operators"),
452 //                                       latex_ams_ops, nr_latex_ams_ops);
453 //              bitmap->addBitmap(
454 //                      BitmapStore(23, 3, 8, ams_ops_width, ams_ops_height, ams_ops_bits, true));
455
456 //              dialog->bc().view(new xformsBC(dialog->bc()));
457                 dialog->setController(new ControlMath(*dialog));
458 //              dialog->setView(bitmap);
459                 dialog->bc().bp(new IgnorantPolicy);
460
461         } else if (name == "mathdelimiter") {
462                 dialog->bc().view(new GBC(dialog->bc()));
463                 dialog->setController(new ControlMath(*dialog));
464                 dialog->setView(new GMathDelim(*dialog));
465                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
466         } else if (name == "mathmatrix") {
467                 dialog->bc().view(new GBC(dialog->bc()));
468                 dialog->setController(new ControlMath(*dialog));
469                 dialog->setView(new GMathsMatrix(*dialog));
470                 dialog->bc().bp(new OkCancelReadOnlyPolicy);
471         } else if (name == "mathspace") {
472 //              dialog->bc().view(new xformsBC(dialog->bc()));
473                 dialog->setController(new ControlMath(*dialog));
474 //              dialog->setView(new FormMathsSpace(*dialog));
475                 dialog->bc().bp(new IgnorantPolicy);
476         } else if (name == "mathstyle") {
477 //              dialog->bc().view(new xformsBC(dialog->bc()));
478                 dialog->setController(new ControlMath(*dialog));
479 //              dialog->setView(new FormMathsStyle(*dialog));
480                 dialog->bc().bp(new IgnorantPolicy);
481         } else if (name == "note") {
482                 dialog->bc().view(new GBC(dialog->bc()));
483                 dialog->setController(new ControlNote(*dialog));
484                 dialog->setView(new GNote(*dialog));
485                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
486         } else if (name == "branch") {
487 //              dialog->bc().view(new xformsBC(dialog->bc()));
488                 dialog->setController(new ControlBranch(*dialog));
489 //              dialog->setView(new FormBranch(*dialog));
490                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
491         } else if (name == "paragraph") {
492                 dialog->bc().view(new GBC(dialog->bc()));
493                 dialog->setController(new ControlParagraph(*dialog));
494                 dialog->setView(new GParagraph(*dialog));
495                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
496         } else if (name == "preamble") {
497 //              dialog->bc().view(new xformsBC(dialog->bc()));
498                 dialog->setController(new ControlPreamble(*dialog));
499 //              dialog->setView(new FormPreamble(*dialog));
500                 dialog->bc().bp(new OkApplyCancelPolicy);
501         } else if (name == "prefs") {
502 //              dialog->bc().view(new xformsBC(dialog->bc()));
503                 dialog->setController(new ControlPrefs(*dialog));
504 //              dialog->setView(new FormPreferences(*dialog));
505                 dialog->bc().bp(new PreferencesPolicy);
506         } else if (name == "print") {
507                 dialog->bc().view(new GBC(dialog->bc()));
508                 dialog->setController(new ControlPrint(*dialog));
509                 dialog->setView(new GPrint(*dialog));
510                 dialog->bc().bp(new OkCancelPolicy);
511         } else if (name == "ref") {
512                 dialog->bc().view(new GBC(dialog->bc()));
513                 dialog->setController(new ControlRef(*dialog));
514                 dialog->setView(new GRef(*dialog));
515                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
516         } else if (name == "sendto") {
517                 dialog->bc().view(new GBC(dialog->bc()));
518                 dialog->setController(new ControlSendto(*dialog));
519                 dialog->setView(new GSendto(*dialog));
520                 dialog->bc().bp(new OkApplyCancelPolicy);
521         } else if (name == "spellchecker") {
522                 dialog->bc().view(new GBC(dialog->bc()));
523                 dialog->setController(new ControlSpellchecker(*dialog));
524                 dialog->setView(new GSpellchecker(*dialog));
525                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
526         } else if (name == "tabular") {
527                 dialog->bc().view(new GBC(dialog->bc()));
528                 dialog->setController(new ControlTabular(*dialog));
529                 dialog->setView(new GTabular(*dialog));
530                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
531         } else if (name == "tabularcreate") {
532                 dialog->bc().view(new GBC(dialog->bc()));
533                 dialog->setController(new ControlTabularCreate(*dialog));
534                 dialog->setView(new GTableCreate(*dialog));
535                 dialog->bc().bp(new IgnorantPolicy);
536         } else if (name == "texinfo") {
537                 dialog->bc().view(new GBC(dialog->bc()));
538                 dialog->setController(new ControlTexinfo(*dialog));
539                 dialog->setView(new GTexinfo(*dialog));
540                 dialog->bc().bp(new OkCancelPolicy);
541 #ifdef HAVE_LIBAIKSAURUS
542         } else if (name == "thesaurus") {
543                 dialog->bc().view(new GBC(dialog->bc()));
544                 dialog->setController(new ControlThesaurus(*dialog));
545                 dialog->setView(new GThesaurus(*dialog));
546                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
547 #endif
548         } else if (name == "toc") {
549                 dialog->bc().view(new GBC(dialog->bc()));
550                 dialog->setController(new ControlToc(*dialog));
551                 dialog->setView(new GToc(*dialog));
552                 dialog->bc().bp(new OkCancelPolicy);
553         } else if (name == "url") {
554                 dialog->bc().view(new GBC(dialog->bc()));
555                 dialog->setController(new ControlCommand(*dialog, name));
556                 dialog->setView(new GUrl(*dialog));
557                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
558         } else if (name == "vspace") {
559                 dialog->bc().view(new GBC(dialog->bc()));
560                 dialog->setController(new ControlVSpace(*dialog));
561                 dialog->setView(new GVSpace(*dialog));
562                 dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
563         } else if (name == "wrap") {
564 //              dialog->bc().view(new xformsBC(dialog->bc()));
565                 dialog->setController(new ControlWrap(*dialog));
566 //              dialog->setView(new FormWrap(*dialog));
567                 dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
568         }
569
570         return dialog;
571 }
572
573
574 void Dialogs::toggleTooltips()
575 {
576         // Turning off tooltips is not necessary and will
577         // not be implemented by me - jcs
578 //      Tooltips::toggleEnabled();
579 }
580
581
582 /// Are the tooltips on or off?
583 bool Dialogs::tooltipsEnabled()
584 {
585 //      return Tooltips::enabled();
586 }