4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS
17 #include <boost/utility.hpp>
18 #include <boost/scoped_ptr.hpp>
19 #include <boost/signals/signal0.hpp>
20 #include <boost/signals/signal1.hpp>
38 /** Container of all dialogs and signals a LyXView needs or uses to access them
39 The list of dialog signals isn't comprehensive but should be a good guide
40 for any future additions. Remember don't go overboard -- think minimal.
42 class Dialogs : boost::noncopyable
47 /// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy.
50 /** Redraw all visible dialogs because, for example, the GUI colours
51 * have been re-mapped.
53 * Note that static boost signals break some compilers, so we return a
54 * reference to some hidden magic ;-)
56 static boost::signal0<void> & redrawGUI();
58 /// Toggle tooltips on/off in all dialogs.
59 static void toggleTooltips();
61 /// Are the tooltips on or off?
62 static bool tooltipsEnabled();
64 /// Signals slated to go
66 boost::signal0<void> hideAllSignal;
67 boost::signal0<void> hideBufferDependentSignal;
68 boost::signal1<void, bool> updateBufferDependentSignal;
71 /// Hide all visible dialogs
73 /// Hide any dialogs that require a buffer for them to operate
74 void hideBufferDependent() const;
75 /** Update visible, buffer-dependent dialogs
76 If the bool is true then a buffer change has occurred
77 else its still the same buffer.
79 void updateBufferDependent(bool) const ;
81 /**@name Dialog Access Signals.
82 Put into some sort of alphabetical order */
88 /// connected to the character dialog also
89 void setUserFreeFont();
92 /// show the external inset dialog
93 void showExternal(InsetExternal *);
94 /// show the contents of a file.
95 void showFile(string const &);
97 void showFloat(InsetFloat *);
99 void showWrap(InsetWrap *);
100 /// show all forked child processes
103 void showGraphics(InsetGraphics *);
104 /// show the details of a LyX file include inset
105 void showInclude(InsetInclude *);
106 /// show the LaTeX log or build file
108 /// display the top-level maths panel
109 void showMathPanel();
110 /// show the merge changes dialog
111 void showMergeChanges();
113 void showMinipage(InsetMinipage *);
115 void updateMinipage(InsetMinipage *);
117 void showParagraph();
119 void updateParagraph();
123 void showPreferences();
130 /// bring up the spellchecker
131 void showSpellchecker();
133 void showTabular(InsetTabular *);
135 void updateTabular(InsetTabular *);
137 void showTabularCreate();
140 /// show the thesaurus dialog
141 void showThesaurus(string const &);
142 /// show the version control log
143 void showVCLogFile();
146 /** name == "bibtex", "citation" etc
147 data is generated by the Inset::write method, to be read by the
148 Inset::read method in the frontends.
149 inset is stored. On a subsequent Apply from the frontends, the
150 stored inset will be modified. If no inset is stored, then a
151 new one will be created at the current cursor position.
153 void show(string const & name, string const & data, InsetBase * inset);
154 /** name == "citation", "bibtex" etc.
155 Update the contents of the dialog.
157 void update(string const & name, string const & data);
159 void Dialogs::hide(string const & name);
161 void disconnect(string const & name);
163 InsetBase * getOpenInset(string const & name) const;
168 bool isValidName(string const & name) const;
170 Dialog * find(string const & name);
172 Dialog * build(string const & name);
177 std::map<string, InsetBase *> open_insets_;
180 typedef boost::shared_ptr<Dialog> DialogPtr;
182 std::map<string, DialogPtr> dialogs_;
184 /// the stuff below is slated to go...