]> git.lyx.org Git - lyx.git/blob - src/frontends/Dialogs.h
Move init() back to LyXView
[lyx.git] / src / frontends / Dialogs.h
1 // -*- C++ -*-
2 /* Dialogs.h
3  * Container of all dialogs and signals a LyXView needs or uses to access them.
4  * Author: Allan Rae <rae@lyx.org>
5  * This file is part of
6  * ======================================================
7  *
8  *           LyX, The Document Processor
9  *
10  *           Copyright 1995 Matthias Ettrich
11  *           Copyright 1995-2001 The LyX Team.
12  *
13  *           This file Copyright 2000
14  *           Allan Rae
15  * ======================================================
16  */
17
18 #ifndef DIALOGS_H
19 #define DIALOGS_H
20
21 #include "LString.h"
22
23 #include <boost/utility.hpp>
24 #include <boost/shared_ptr.hpp>
25 #include <boost/signals/signal0.hpp>
26 #include <boost/signals/signal1.hpp>
27 #include <boost/function.hpp>
28
29 #include <vector>
30
31 #ifdef __GNUG__
32 #pragma interface
33 #endif
34
35 #include "DialogBase.h"
36
37 // Maybe this should be a UIFunc modelled on LyXFunc
38 class LyXView;
39
40 class InsetGraphics;
41 class InsetBibKey;
42 class InsetBibtex;
43 class InsetError;
44 class InsetExternal;
45 class InsetInclude;
46 class InsetInfo;
47 class InsetTabular;
48 class InsetCommand;
49 class InsetMinipage;
50 class InsetFloat;
51 class InsetERT;
52 class Paragraph;
53
54 /** Container of all dialogs and signals a LyXView needs or uses to access them
55     The list of dialog signals isn't comprehensive but should be a good guide
56     for any future additions.  Remember don't go overboard -- think minimal.
57  */
58 class Dialogs : boost::noncopyable
59 {
60 public:
61         ///
62         typedef boost::shared_ptr<DialogBase> db_ptr;
63         /**@name Constructor */
64         //@{
65         ///
66         Dialogs(LyXView *);
67         //@}
68
69         /** Redraw all visible dialogs because, for example, the GUI colours
70             have been re-mapped. */
71         static boost::signal0<void> redrawGUI;
72
73         /// Toggle tooltips on/off in all dialogs.
74         static boost::signal0<void> toggleTooltips;
75
76         /// Are the tooltips on or off?
77         static bool tooltipsEnabled();
78
79         /**@name Global Hide and Update Signals */
80         //@{
81         /// Hide all visible dialogs
82         boost::signal0<void> hideAll;
83
84         /// Hide any dialogs that require a buffer for them to operate
85         boost::signal0<void> hideBufferDependent;
86
87         /** Update visible, buffer-dependent dialogs
88             If the bool is true then a buffer change has occurred
89             else its still the same buffer.
90          */
91         boost::signal1<void, bool> updateBufferDependent;
92         //@}
93
94         /**@name Dialog Access Signals.
95            Put into some sort of alphabetical order */
96         //@{
97         ///
98         boost::function<void> showAboutlyx;
99         /// show the key and label of a bibliography entry
100         boost::function<void, InsetCommand *> showBibitem;
101         /// show the bibtex dialog
102         boost::function<void, InsetCommand *> showBibtex;
103         ///
104         boost::function<void> showCharacter;
105         /// connected to the character dialog also
106         boost::function<void> setUserFreeFont;
107         ///
108         boost::function<void, InsetCommand *> showCitation;
109         ///
110         boost::function<void, string const &> createCitation;
111         ///
112         boost::function<void> showDocument;
113         ///
114         boost::function<void, InsetError *> showError;
115         /// show the external inset dialog
116         boost::function<void, InsetExternal *> showExternal;
117         /// show the contents of a file.
118         boost::function<void, string const &> showFile;
119         /// show all forked child processes
120         boost::function<void> showForks;
121         ///
122         boost::function<void, InsetGraphics *> showGraphics;
123         /// show the details of a LyX file include inset
124         boost::function<void, InsetInclude *> showInclude;
125         ///
126         boost::function<void, InsetCommand *> showIndex;
127         ///
128         boost::function<void, string const &> createIndex;
129         ///
130         boost::function<void, InsetInfo *> showInfo;
131         /// show the LaTeX log or build file
132         boost::function<void> showLogFile;
133         /// display the top-level maths panel
134         boost::function<void> showMathPanel;
135         ///
136         boost::function<void, InsetMinipage *> showMinipage;
137         ///
138         boost::function<void, InsetMinipage *> updateMinipage;
139         ///
140         boost::function<void, InsetERT *> showERT;
141         ///
142         boost::function<void, InsetERT *> updateERT;
143         ///
144         boost::function<void, InsetFloat *> showFloat;
145         ///
146         boost::function<void> showParagraph;
147         ///
148         boost::signal0<void> updateParagraph;
149         ///
150         boost::function<void> showPreamble;
151         ///
152         boost::function<void> showPreferences;
153         ///
154         boost::function<void> showPrint;
155         ///
156         boost::function<void, InsetCommand *> showRef;
157         ///
158         boost::function<void, string const &> createRef;
159         ///
160         boost::function<void> showSearch;
161         ///
162         boost::function<void> showSendto;
163         /// bring up the spellchecker
164         boost::function<void> showSpellchecker;
165         /// bring up the spellchecker tab in preferences
166         boost::function<void> showSpellcheckerPreferences;
167         ///
168         boost::function<void, InsetTabular *> showTabular;
169         ///
170         boost::function<void, InsetTabular *> updateTabular;
171         ///
172         boost::function<void> showTabularCreate;
173         /// show the TexInfo
174         boost::function<void> showTexinfo;
175         /// show the thesaurus dialog
176         boost::function<void, string const &> showThesaurus;
177         ///
178         boost::function<void, InsetCommand *> showTOC;
179         ///
180         boost::function<void, string const &> createTOC;
181         ///
182         boost::function<void, InsetCommand *> showUrl;
183         ///
184         boost::function<void, string const &> createUrl;
185         /// show the version control log
186         boost::function<void> showVCLogFile;
187         //@}
188 private:
189         /// Add a dialog to the vector of dialogs.
190         void add(DialogBase *);
191         /// the dialogs being managed
192         std::vector<db_ptr> dialogs_;
193 };
194
195 #endif