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 * ======================================================
23 #include <boost/utility.hpp>
24 #include <boost/shared_ptr.hpp>
26 #include <sigc++/signal_system.h>
34 #include "DialogBase.h"
36 // Maybe this should be a UIFunc modelled on LyXFunc
53 /** Container of all dialogs and signals a LyXView needs or uses to access them
54 The list of dialog signals isn't comprehensive but should be a good guide
55 for any future additions. Remember don't go overboard -- think minimal.
57 class Dialogs : boost::noncopyable
61 typedef boost::shared_ptr<DialogBase> db_ptr;
62 /**@name Constructor */
68 /** Redraw all visible dialogs because, for example, the GUI colours
69 have been re-mapped. */
70 static SigC::Signal0<void> redrawGUI;
72 /// Toggle tooltips on/off in all dialogs.
73 static SigC::Signal0<void> toggleTooltips;
75 /// Are the tooltips on or off?
76 static bool tooltipsEnabled();
78 /**@name Global Hide and Update Signals */
80 /// Hide all visible dialogs
81 SigC::Signal0<void> hideAll;
83 /// Hide any dialogs that require a buffer for them to operate
84 SigC::Signal0<void> hideBufferDependent;
86 /** Update visible, buffer-dependent dialogs
87 If the bool is true then a buffer change has occurred
88 else its still the same buffer.
90 SigC::Signal1<void, bool> updateBufferDependent;
93 /**@name Dialog Access Signals.
94 Put into some sort of alphabetical order */
96 /// Do we really have to push this?
97 SigC::Signal1<void, std::vector<string> const &> SetDocumentClassChoice;
99 SigC::Signal0<void> showAboutlyx;
100 /// show the key and label of a bibliography entry
101 SigC::Signal1<void, InsetCommand *> showBibitem;
102 /// show the bibtex dialog
103 SigC::Signal1<void, InsetCommand *> showBibtex;
105 SigC::Signal0<void> showCharacter;
106 /// connected to the character dialog also
107 SigC::Signal0<void> setUserFreeFont;
109 SigC::Signal1<void, InsetCommand *> showCitation;
111 SigC::Signal1<void, string const &> createCitation;
113 SigC::Signal0<void> showDocument;
115 SigC::Signal1<void, InsetError *> showError;
116 /// show the external inset dialog
117 SigC::Signal1<void, InsetExternal *> showExternal;
118 /// show the contents of a file.
119 SigC::Signal1<void, string const &> showFile;
120 /// show all forked child processes
121 SigC::Signal0<void> showForks;
123 SigC::Signal1<void, InsetGraphics *> showGraphics;
124 /// show the details of a LyX file include inset
125 SigC::Signal1<void, InsetInclude *> showInclude;
127 SigC::Signal1<void, InsetCommand *> showIndex;
129 SigC::Signal1<void, string const &> createIndex;
131 SigC::Signal1<void, InsetInfo *> showInfo;
132 /// show the LaTeX log or build file
133 SigC::Signal0<void> showLogFile;
134 /// display the top-level maths panel
135 SigC::Signal0<void> showMathPanel;
137 SigC::Signal1<void, InsetMinipage *> showMinipage;
139 SigC::Signal1<void, InsetMinipage *> updateMinipage;
141 SigC::Signal1<void, InsetERT *> showERT;
143 SigC::Signal1<void, InsetERT *> updateERT;
145 SigC::Signal1<void, InsetFloat *> showFloat;
147 SigC::Signal0<void> showParagraph;
149 SigC::Signal0<void> updateParagraph;
151 SigC::Signal0<void> showPreamble;
153 SigC::Signal0<void> showPreferences;
155 SigC::Signal0<void> showPrint;
157 SigC::Signal1<void, InsetCommand *> showRef;
159 SigC::Signal1<void, string const &> createRef;
161 SigC::Signal0<void> showSearch;
163 SigC::Signal0<void> showSendto;
164 /// bring up the spellchecker
165 SigC::Signal0<void> showSpellchecker;
166 /// bring up the spellchecker tab in preferences
167 SigC::Signal0<void> showSpellcheckerPreferences;
169 SigC::Signal1<void, InsetTabular *> showTabular;
171 SigC::Signal1<void, InsetTabular *> updateTabular;
173 SigC::Signal0<void> showTabularCreate;
175 SigC::Signal0<void> showTexinfo;
176 /// show the thesaurus dialog
177 SigC::Signal1<void, string const &> showThesaurus;
179 SigC::Signal1<void, InsetCommand *> showTOC;
181 SigC::Signal1<void, string const &> createTOC;
183 SigC::Signal1<void, InsetCommand *> showUrl;
185 SigC::Signal1<void, string const &> createUrl;
186 /// show the version control log
187 SigC::Signal0<void> showVCLogFile;
190 /// Add a dialog to the vector of dialogs.
191 void add(DialogBase *);
192 /// the dialogs being managed
193 std::vector<db_ptr> dialogs_;