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
50 /** Container of all dialogs and signals a LyXView needs or uses to access them
51 The list of dialog signals isn't comprehensive but should be a good guide
52 for any future additions. Remember don't go overboard -- think minimal.
54 class Dialogs : boost::noncopyable
58 typedef boost::shared_ptr<DialogBase> db_ptr;
59 /**@name Constructor */
65 /** Redraw all visible dialogs because, for example, the GUI colours
66 have been re-mapped. */
67 static SigC::Signal0<void> redrawGUI;
69 /**@name Global Hide and Update Signals */
71 /// Hide all visible dialogs
72 SigC::Signal0<void> hideAll;
74 /// Hide any dialogs that require a buffer for them to operate
75 SigC::Signal0<void> hideBufferDependent;
77 /** Update visible, buffer-dependent dialogs
78 If the bool is true then a buffer change has occurred
79 else its still the same buffer.
81 SigC::Signal1<void, bool> updateBufferDependent;
84 /**@name Dialog Access Signals.
85 Put into some sort of alphabetical order */
87 /// Do we really have to push this?
88 SigC::Signal1<void, std::vector<string> const &> SetDocumentClassChoice;
90 SigC::Signal0<void> showAboutlyx;
91 /// show the key and label of a bibliography entry
92 SigC::Signal1<void, InsetCommand *> showBibitem;
93 /// show the bibtex dialog
94 SigC::Signal1<void, InsetCommand *> showBibtex;
96 SigC::Signal0<void> showCharacter;
97 /// connected to the character dialog also
98 SigC::Signal0<void> setUserFreeFont;
100 SigC::Signal1<void, InsetCommand *> showCitation;
102 SigC::Signal1<void, string const &> createCitation;
104 SigC::Signal0<void> showDocument;
106 SigC::Signal1<void, InsetError *> showError;
107 /// show the external inset dialog
108 SigC::Signal1<void, InsetExternal *> showExternal;
110 SigC::Signal1<void, InsetGraphics *> showGraphics;
111 /// show the details of a LyX file include inset
112 SigC::Signal1<void, InsetInclude *> showInclude;
114 SigC::Signal1<void, InsetCommand *> showIndex;
116 SigC::Signal1<void, string const &> createIndex;
118 SigC::Signal1<void, InsetInfo *> showInfo;
119 /// show the LaTeX log or build file
120 SigC::Signal0<void> showLogFile;
121 /// display the top-level maths panel
122 SigC::Signal0<void> showMathPanel;
124 SigC::Signal1<void, InsetMinipage *> showMinipage;
126 SigC::Signal1<void, InsetMinipage *> updateMinipage;
128 SigC::Signal1<void, InsetFloat *> showFloat;
130 SigC::Signal0<void> showParagraph;
132 SigC::Signal0<void> updateParagraph;
134 SigC::Signal0<void> showPreamble;
136 SigC::Signal0<void> showPreferences;
138 SigC::Signal0<void> showPrint;
140 SigC::Signal1<void, InsetCommand *> showRef;
142 SigC::Signal1<void, string const &> createRef;
144 SigC::Signal0<void> showSearch;
145 /// bring up the spellchecker
146 SigC::Signal0<void> showSpellchecker;
147 /// bring up the spellchecker tab in preferences
148 SigC::Signal0<void> showSpellcheckerPreferences;
149 /// pop up the splash
150 SigC::Signal0<void> showSplash;
151 /// destroy the splash dialog
152 void destroySplash();
154 SigC::Signal1<void, InsetTabular *> showTabular;
156 SigC::Signal1<void, InsetTabular *> updateTabular;
158 SigC::Signal0<void> showTabularCreate;
159 /// show the thesaurus dialog
160 SigC::Signal1<void, string const &> showThesaurus;
162 SigC::Signal1<void, InsetCommand *> showTOC;
164 SigC::Signal1<void, string const &> createTOC;
166 SigC::Signal1<void, InsetCommand *> showUrl;
168 SigC::Signal1<void, string const &> createUrl;
169 /// show the version control log
170 SigC::Signal0<void> showVCLogFile;
173 /// Add a dialog to the vector of dialogs.
174 void add(DialogBase *);
175 /// the dialogs being managed
176 std::vector<db_ptr> dialogs_;
177 /// the splash dialog
178 boost::scoped_ptr<DialogBase> splash_;