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
49 /** Container of all dialogs and signals a LyXView needs or uses to access them
50 The list of dialog signals isn't comprehensive but should be a good guide
51 for any future additions. Remember don't go overboard -- think minimal.
53 class Dialogs : boost::noncopyable
57 typedef boost::shared_ptr<DialogBase> db_ptr;
58 /**@name Constructor */
64 /** Redraw all visible dialogs because, for example, the GUI colours
65 have been re-mapped. */
66 static SigC::Signal0<void> redrawGUI;
68 /**@name Global Hide and Update Signals */
70 /// Hide all visible dialogs
71 SigC::Signal0<void> hideAll;
73 /// Hide any dialogs that require a buffer for them to operate
74 SigC::Signal0<void> hideBufferDependent;
76 /** Update visible, buffer-dependent dialogs
77 If the bool is true then a buffer change has occurred
78 else its still the same buffer.
80 SigC::Signal1<void, bool> updateBufferDependent;
83 /**@name Dialog Access Signals.
84 Put into some sort of alphabetical order */
86 /// Do we really have to push this?
87 SigC::Signal1<void, std::vector<string> const &> SetDocumentClassChoice;
89 SigC::Signal0<void> showAboutlyx;
90 /// show the key and label of a bibliography entry
91 SigC::Signal1<void, InsetCommand *> showBibitem;
92 /// show the bibtex dialog
93 SigC::Signal1<void, InsetCommand *> showBibtex;
95 SigC::Signal0<void> showCharacter;
96 /// connected to the character dialog also
97 SigC::Signal0<void> setUserFreeFont;
99 SigC::Signal1<void, InsetCommand *> showCitation;
101 SigC::Signal1<void, string const &> createCitation;
103 SigC::Signal0<void> showDocument;
105 SigC::Signal1<void, InsetError *> showError;
106 /// show the external inset dialog
107 SigC::Signal1<void, InsetExternal *> showExternal;
109 SigC::Signal1<void, InsetGraphics *> showGraphics;
110 /// show the details of a LyX file include inset
111 SigC::Signal1<void, InsetInclude *> showInclude;
113 SigC::Signal1<void, InsetCommand *> showIndex;
115 SigC::Signal1<void, string const &> createIndex;
117 SigC::Signal1<void, InsetInfo *> showInfo;
118 /// show the LaTeX log or build file
119 SigC::Signal0<void> showLogFile;
120 /// display the top-level maths panel
121 SigC::Signal0<void> showMathPanel;
123 SigC::Signal1<void, InsetMinipage *> showMinipage;
125 SigC::Signal1<void, InsetMinipage *> updateMinipage;
127 SigC::Signal0<void> showParagraph;
129 SigC::Signal0<void> updateParagraph;
131 SigC::Signal0<void> showPreamble;
133 SigC::Signal0<void> showPreferences;
135 SigC::Signal0<void> showPrint;
137 SigC::Signal1<void, InsetCommand *> showRef;
139 SigC::Signal1<void, string const &> createRef;
141 SigC::Signal0<void> showSearch;
142 /// bring up the spellchecker
143 SigC::Signal0<void> showSpellchecker;
144 /// bring up the spellchecker tab in preferences
145 SigC::Signal0<void> showSpellcheckerPreferences;
146 /// pop up the splash
147 SigC::Signal0<void> showSplash;
148 /// destroy the splash dialog
149 void destroySplash();
151 SigC::Signal1<void, InsetTabular *> showTabular;
153 SigC::Signal1<void, InsetTabular *> updateTabular;
155 SigC::Signal0<void> showTabularCreate;
157 SigC::Signal1<void, InsetCommand *> showTOC;
159 SigC::Signal1<void, string const &> createTOC;
161 SigC::Signal1<void, InsetCommand *> showUrl;
163 SigC::Signal1<void, string const &> createUrl;
164 /// show the version control log
165 SigC::Signal0<void> showVCLogFile;
168 /// Add a dialog to the vector of dialogs.
169 void add(DialogBase *);
170 /// the dialogs being managed
171 std::vector<db_ptr> dialogs_;
172 /// the splash dialog
173 boost::scoped_ptr<DialogBase> splash_;