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>
25 #include <boost/signals/signal0.hpp>
26 #include <boost/signals/signal1.hpp>
27 #include <boost/function.hpp>
35 #include "DialogBase.h"
37 // Maybe this should be a UIFunc modelled on LyXFunc
54 /** Container of all dialogs and signals a LyXView needs or uses to access them
55 The list of dialog signals isn't comprehensive but should be a good guide
56 for any future additions. Remember don't go overboard -- think minimal.
58 class Dialogs : boost::noncopyable
62 typedef boost::shared_ptr<DialogBase> db_ptr;
63 /**@name Constructor */
69 /** Redraw all visible dialogs because, for example, the GUI colours
70 have been re-mapped. */
71 static boost::signal0<void> redrawGUI;
73 /// Toggle tooltips on/off in all dialogs.
74 static boost::signal0<void> toggleTooltips;
76 /// Are the tooltips on or off?
77 static bool tooltipsEnabled();
79 /**@name Global Hide and Update Signals */
81 /// Hide all visible dialogs
82 boost::signal0<void> hideAll;
84 /// Hide any dialogs that require a buffer for them to operate
85 boost::signal0<void> hideBufferDependent;
87 /** Update visible, buffer-dependent dialogs
88 If the bool is true then a buffer change has occurred
89 else its still the same buffer.
91 boost::signal1<void, bool> updateBufferDependent;
94 /**@name Dialog Access Signals.
95 Put into some sort of alphabetical order */
98 boost::function<void> showAboutlyx;
99 /// show the key and label of a bibliography entry
100 boost::function<void, InsetCommand *> showBibitem;
101 /// show the bibtex dialog
102 boost::function<void, InsetCommand *> showBibtex;
104 boost::function<void> showCharacter;
105 /// connected to the character dialog also
106 boost::function<void> setUserFreeFont;
108 boost::function<void, InsetCommand *> showCitation;
110 boost::function<void, string const &> createCitation;
112 boost::function<void> showDocument;
114 boost::function<void, InsetError *> showError;
115 /// show the external inset dialog
116 boost::function<void, InsetExternal *> showExternal;
117 /// show the contents of a file.
118 boost::function<void, string const &> showFile;
119 /// show all forked child processes
120 boost::function<void> showForks;
122 boost::function<void, InsetGraphics *> showGraphics;
123 /// show the details of a LyX file include inset
124 boost::function<void, InsetInclude *> showInclude;
126 boost::function<void, InsetCommand *> showIndex;
128 boost::function<void, string const &> createIndex;
130 boost::function<void, InsetInfo *> showInfo;
131 /// show the LaTeX log or build file
132 boost::function<void> showLogFile;
133 /// display the top-level maths panel
134 boost::function<void> showMathPanel;
136 boost::function<void, InsetMinipage *> showMinipage;
138 boost::function<void, InsetMinipage *> updateMinipage;
140 boost::function<void, InsetERT *> showERT;
142 boost::function<void, InsetERT *> updateERT;
144 boost::function<void, InsetFloat *> showFloat;
146 boost::function<void> showParagraph;
148 boost::signal0<void> updateParagraph;
150 boost::function<void> showPreamble;
152 boost::function<void> showPreferences;
154 boost::function<void> showPrint;
156 boost::function<void, InsetCommand *> showRef;
158 boost::function<void, string const &> createRef;
160 boost::function<void> showSearch;
162 boost::function<void> showSendto;
163 /// bring up the spellchecker
164 boost::function<void> showSpellchecker;
165 /// bring up the spellchecker tab in preferences
166 boost::function<void> showSpellcheckerPreferences;
168 boost::function<void, InsetTabular *> showTabular;
170 boost::function<void, InsetTabular *> updateTabular;
172 boost::function<void> showTabularCreate;
174 boost::function<void> showTexinfo;
175 /// show the thesaurus dialog
176 boost::function<void, string const &> showThesaurus;
178 boost::function<void, InsetCommand *> showTOC;
180 boost::function<void, string const &> createTOC;
182 boost::function<void, InsetCommand *> showUrl;
184 boost::function<void, string const &> createUrl;
185 /// show the version control log
186 boost::function<void> showVCLogFile;
189 /// Add a dialog to the vector of dialogs.
190 void add(DialogBase *);
191 /// the dialogs being managed
192 std::vector<db_ptr> dialogs_;