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 /** Called bu the graphics cache to connect the approriate frontend
67 * image loading routines to the LyX kernel.
69 static void initialiseGraphics();
71 /** Redraw all visible dialogs because, for example, the GUI colours
72 have been re-mapped. */
73 static SigC::Signal0<void> redrawGUI;
75 /**@name Global Hide and Update Signals */
77 /// Hide all visible dialogs
78 SigC::Signal0<void> hideAll;
80 /// Hide any dialogs that require a buffer for them to operate
81 SigC::Signal0<void> hideBufferDependent;
83 /** Update visible, buffer-dependent dialogs
84 If the bool is true then a buffer change has occurred
85 else its still the same buffer.
87 SigC::Signal1<void, bool> updateBufferDependent;
90 /**@name Dialog Access Signals.
91 Put into some sort of alphabetical order */
93 /// Do we really have to push this?
94 SigC::Signal1<void, std::vector<string> const &> SetDocumentClassChoice;
96 SigC::Signal0<void> showAboutlyx;
97 /// show the key and label of a bibliography entry
98 SigC::Signal1<void, InsetCommand *> showBibitem;
99 /// show the bibtex dialog
100 SigC::Signal1<void, InsetCommand *> showBibtex;
102 SigC::Signal0<void> showCharacter;
103 /// connected to the character dialog also
104 SigC::Signal0<void> setUserFreeFont;
106 SigC::Signal1<void, InsetCommand *> showCitation;
108 SigC::Signal1<void, string const &> createCitation;
110 SigC::Signal0<void> showDocument;
112 SigC::Signal1<void, InsetError *> showError;
113 /// show the external inset dialog
114 SigC::Signal1<void, InsetExternal *> showExternal;
115 /// show the contents of a file.
116 SigC::Signal1<void, string const &> showFile;
117 /// show all forked child processes
118 SigC::Signal0<void> showForks;
120 SigC::Signal1<void, InsetGraphics *> showGraphics;
121 /// show the details of a LyX file include inset
122 SigC::Signal1<void, InsetInclude *> showInclude;
124 SigC::Signal1<void, InsetCommand *> showIndex;
126 SigC::Signal1<void, string const &> createIndex;
128 SigC::Signal1<void, InsetInfo *> showInfo;
129 /// show the LaTeX log or build file
130 SigC::Signal0<void> showLogFile;
131 /// display the top-level maths panel
132 SigC::Signal0<void> showMathPanel;
134 SigC::Signal1<void, InsetMinipage *> showMinipage;
136 SigC::Signal1<void, InsetMinipage *> updateMinipage;
138 SigC::Signal1<void, InsetERT *> showERT;
140 SigC::Signal1<void, InsetERT *> updateERT;
142 SigC::Signal1<void, InsetFloat *> showFloat;
144 SigC::Signal0<void> showParagraph;
146 SigC::Signal0<void> updateParagraph;
148 SigC::Signal0<void> showPreamble;
150 SigC::Signal0<void> showPreferences;
152 SigC::Signal0<void> showPrint;
154 SigC::Signal1<void, InsetCommand *> showRef;
156 SigC::Signal1<void, string const &> createRef;
158 SigC::Signal0<void> showSearch;
159 /// bring up the spellchecker
160 SigC::Signal0<void> showSpellchecker;
161 /// bring up the spellchecker tab in preferences
162 SigC::Signal0<void> showSpellcheckerPreferences;
164 SigC::Signal1<void, InsetTabular *> showTabular;
166 SigC::Signal1<void, InsetTabular *> updateTabular;
168 SigC::Signal0<void> showTabularCreate;
170 SigC::Signal0<void> showTexinfo;
171 /// show the thesaurus dialog
172 SigC::Signal1<void, string const &> showThesaurus;
174 SigC::Signal1<void, InsetCommand *> showTOC;
176 SigC::Signal1<void, string const &> createTOC;
178 SigC::Signal1<void, InsetCommand *> showUrl;
180 SigC::Signal1<void, string const &> createUrl;
181 /// show the version control log
182 SigC::Signal0<void> showVCLogFile;
185 /// Add a dialog to the vector of dialogs.
186 void add(DialogBase *);
187 /// the dialogs being managed
188 std::vector<db_ptr> dialogs_;