]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/Dialogs2.C
0dbd726562d4459bd164169cf71b6f4d46066b57
[lyx.git] / src / frontends / qt2 / Dialogs2.C
1 /**
2  * \file qt2/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 "debug.h"
16 #include "Dialogs.h"
17 #include "controllers/GUI.h"
18 #include "ButtonController.h"
19
20 #include "ControlDocument.h"
21 #include "ControlPrint.h"
22 #include "ControlSpellchecker.h"
23
24 #include "QDocument.h"
25 #include "QDocumentDialog.h"
26 // Here would be an appropriate point to lecture on the evils
27 // of the Qt headers, those most fucked up of disgusting ratholes.
28 // But I won't.
29 #undef signals
30 #include "QPrefs.h"
31 #include "QPrefsDialog.h"
32 #include "QPrint.h"
33 #include "QLPrintDialog.h"
34 #include "QSpellchecker.h"
35 #include "QSpellcheckerDialog.h"
36
37
38
39
40 typedef GUI<ControlDocument, QDocument, NoRepeatedApplyReadOnlyPolicy, Qt2BC>
41 DocumentDialog;
42
43 typedef GUI<ControlPrefs, QPrefs, OkApplyCancelPolicy, Qt2BC>
44 PrefsDialog;
45
46 typedef GUI<ControlPrint, QPrint, OkApplyCancelPolicy, Qt2BC>
47 PrintDialog;
48
49 typedef GUI<ControlSpellchecker, QSpellchecker, NoRepeatedApplyReadOnlyPolicy, Qt2BC>
50 SpellcheckerDialog;
51
52 struct Dialogs::Impl {
53         Impl(LyXView & lv, Dialogs & d);
54
55         DocumentDialog      document;
56         PrefsDialog         prefs;
57         PrintDialog         print;
58         SpellcheckerDialog  spellchecker;
59 };
60
61
62 Dialogs::Impl::Impl(LyXView & lv, Dialogs & d)
63         : document(lv, d),
64           prefs(lv, d),
65           print(lv, d),
66           spellchecker(lv, d)
67 {}
68
69
70 void Dialogs::init_pimpl()
71 {
72         pimpl_ = new Impl(lyxview_, *this);
73 }
74
75
76 Dialogs::~Dialogs()
77 {
78         delete pimpl_;
79 }
80
81
82 void Dialogs::showDocument()
83 {
84         pimpl_->document.controller().show();
85 }
86
87
88 void Dialogs::showPreamble()
89 {
90         pimpl_->document.controller().show();
91         // Oh Angus, won't you help a poor child ?
92         //pimpl_->document.view()->showPreamble();
93 }
94
95
96 void Dialogs::showPreferences()
97 {
98         pimpl_->prefs.controller().show();
99 }
100
101
102 void Dialogs::showPrint()
103 {
104         pimpl_->print.controller().show();
105 }
106
107
108 void Dialogs::showSpellchecker()
109 {
110         pimpl_->spellchecker.controller().show();
111 }