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