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