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>
34 /** Container of all dialogs and signals a LyXView needs or uses to access them
35 The list of dialog signals isn't comprehensive but should be a good guide
36 for any future additions. Remember don't go overboard -- think minimal.
38 class Dialogs : boost::noncopyable
43 /// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy.
46 /** Redraw all visible dialogs because, for example, the GUI colours
47 * have been re-mapped.
49 * Note that static boost signals break some compilers, so we return a
50 * reference to some hidden magic ;-)
52 static boost::signal0<void> & redrawGUI();
54 /// Toggle tooltips on/off in all dialogs.
55 static void toggleTooltips();
57 /// Are the tooltips on or off?
58 static bool tooltipsEnabled();
60 /// Signals slated to go
62 boost::signal0<void> hideAllSignal;
63 boost::signal0<void> hideBufferDependentSignal;
64 boost::signal1<void, bool> updateBufferDependentSignal;
67 /// Hide all visible dialogs
69 /// Hide any dialogs that require a buffer for them to operate
70 void hideBufferDependent() const;
71 /** Update visible, buffer-dependent dialogs
72 If the bool is true then a buffer change has occurred
73 else its still the same buffer.
75 void updateBufferDependent(bool) const ;
77 /**@name Dialog Access Signals.
78 Put into some sort of alphabetical order */
84 /// connected to the character dialog also
85 void setUserFreeFont();
88 /// show the contents of a file.
89 void showFile(string const &);
91 void showFloat(InsetFloat *);
93 void showWrap(InsetWrap *);
94 /// show all forked child processes
97 void showGraphics(InsetGraphics *);
98 /// show the LaTeX log or build file
100 /// display the top-level maths panel
101 void showMathPanel();
102 /// show the merge changes dialog
103 void showMergeChanges();
105 void showMinipage(InsetMinipage *);
107 void updateMinipage(InsetMinipage *);
109 void showParagraph();
111 void updateParagraph();
115 void showPreferences();
122 /// bring up the spellchecker
123 void showSpellchecker();
125 void showTabular(InsetTabular *);
127 void updateTabular(InsetTabular *);
129 void showTabularCreate();
132 /// show the thesaurus dialog
133 void showThesaurus(string const &);
134 /// show the version control log
135 void showVCLogFile();
138 /** name == "bibtex", "citation" etc
139 data is generated by the Inset::write method, to be read by the
140 Inset::read method in the frontends.
141 inset is stored. On a subsequent Apply from the frontends, the
142 stored inset will be modified. If no inset is stored, then a
143 new one will be created at the current cursor position.
145 void show(string const & name, string const & data, InsetBase * inset);
146 /** name == "citation", "bibtex" etc.
147 Update the contents of the dialog.
149 void update(string const & name, string const & data);
151 void Dialogs::hide(string const & name);
153 void disconnect(string const & name);
155 InsetBase * getOpenInset(string const & name) const;
160 bool isValidName(string const & name) const;
162 Dialog * find(string const & name);
164 Dialog * build(string const & name);
169 std::map<string, InsetBase *> open_insets_;
172 typedef boost::shared_ptr<Dialog> DialogPtr;
174 std::map<string, DialogPtr> dialogs_;
176 /// the stuff below is slated to go...