3 * Container of all dialogs and signals a LyXView needs or uses to access them.
4 * Author: Allan Rae <rae@lyx.org>
6 * ======================================================
8 * LyX, The Document Processor
10 * Copyright 1995 Matthias Ettrich
11 * Copyright 1995-2001 The LyX Team.
13 * This file Copyright 2000
15 * ======================================================
22 #include <sigc++/signal_system.h>
25 #include <boost/utility.hpp>
26 #include <boost/smart_ptr.hpp>
32 #include "DialogBase.h"
34 // Maybe this should be a UIFunc modelled on LyXFunc
51 /** Container of all dialogs and signals a LyXView needs or uses to access them
52 The list of dialog signals isn't comprehensive but should be a good guide
53 for any future additions. Remember don't go overboard -- think minimal.
55 class Dialogs : boost::noncopyable
59 typedef boost::shared_ptr<DialogBase> db_ptr;
60 /**@name Constructor */
66 /** Redraw all visible dialogs because, for example, the GUI colours
67 have been re-mapped. */
68 static SigC::Signal0<void> redrawGUI;
70 /// Toggle tooltips on/off in all dialogs.
71 static SigC::Signal0<void> toggleTooltips;
73 /// Are the tooltips on or off?
74 static bool tooltipsEnabled();
76 /**@name Global Hide and Update Signals */
78 /// Hide all visible dialogs
79 SigC::Signal0<void> hideAll;
81 /// Hide any dialogs that require a buffer for them to operate
82 SigC::Signal0<void> hideBufferDependent;
84 /** Update visible, buffer-dependent dialogs
85 If the bool is true then a buffer change has occurred
86 else its still the same buffer.
88 SigC::Signal1<void, bool> updateBufferDependent;
91 /**@name Dialog Access Signals.
92 Put into some sort of alphabetical order */
94 /// Do we really have to push this?
95 SigC::Signal1<void, std::vector<string> const &> SetDocumentClassChoice;
97 SigC::Signal0<void> showAboutlyx;
98 /// show the key and label of a bibliography entry
99 SigC::Signal1<void, InsetCommand *> showBibitem;
100 /// show the bibtex dialog
101 SigC::Signal1<void, InsetCommand *> showBibtex;
103 SigC::Signal0<void> showCharacter;
104 /// connected to the character dialog also
105 SigC::Signal0<void> setUserFreeFont;
107 SigC::Signal1<void, InsetCommand *> showCitation;
109 SigC::Signal1<void, string const &> createCitation;
111 SigC::Signal0<void> showDocument;
113 SigC::Signal1<void, InsetError *> showError;
114 /// show the external inset dialog
115 SigC::Signal1<void, InsetExternal *> showExternal;
116 /// show the contents of a file.
117 SigC::Signal1<void, string const &> showFile;
118 /// show all forked child processes
119 SigC::Signal0<void> showForks;
121 SigC::Signal1<void, InsetGraphics *> showGraphics;
122 /// show the details of a LyX file include inset
123 SigC::Signal1<void, InsetInclude *> showInclude;
125 SigC::Signal1<void, InsetCommand *> showIndex;
127 SigC::Signal1<void, string const &> createIndex;
129 SigC::Signal1<void, InsetInfo *> showInfo;
130 /// show the LaTeX log or build file
131 SigC::Signal0<void> showLogFile;
132 /// display the top-level maths panel
133 SigC::Signal0<void> showMathPanel;
135 SigC::Signal1<void, InsetMinipage *> showMinipage;
137 SigC::Signal1<void, InsetMinipage *> updateMinipage;
139 SigC::Signal1<void, InsetERT *> showERT;
141 SigC::Signal1<void, InsetERT *> updateERT;
143 SigC::Signal1<void, InsetFloat *> showFloat;
145 SigC::Signal0<void> showParagraph;
147 SigC::Signal0<void> updateParagraph;
149 SigC::Signal0<void> showPreamble;
151 SigC::Signal0<void> showPreferences;
153 SigC::Signal0<void> showPrint;
155 SigC::Signal1<void, InsetCommand *> showRef;
157 SigC::Signal1<void, string const &> createRef;
159 SigC::Signal0<void> showSearch;
161 SigC::Signal0<void> showSendto;
162 /// bring up the spellchecker
163 SigC::Signal0<void> showSpellchecker;
164 /// bring up the spellchecker tab in preferences
165 SigC::Signal0<void> showSpellcheckerPreferences;
167 SigC::Signal1<void, InsetTabular *> showTabular;
169 SigC::Signal1<void, InsetTabular *> updateTabular;
171 SigC::Signal0<void> showTabularCreate;
173 SigC::Signal0<void> showTexinfo;
174 /// show the thesaurus dialog
175 SigC::Signal1<void, string const &> showThesaurus;
177 SigC::Signal1<void, InsetCommand *> showTOC;
179 SigC::Signal1<void, string const &> createTOC;
181 SigC::Signal1<void, InsetCommand *> showUrl;
183 SigC::Signal1<void, string const &> createUrl;
184 /// show the version control log
185 SigC::Signal0<void> showVCLogFile;
188 /// Add a dialog to the vector of dialogs.
189 void add(DialogBase *);
190 /// the dialogs being managed
191 std::vector<db_ptr> dialogs_;