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>
33 /** Container of all dialogs and signals a LyXView needs or uses to access them
34 The list of dialog signals isn't comprehensive but should be a good guide
35 for any future additions. Remember don't go overboard -- think minimal.
37 class Dialogs : boost::noncopyable
42 /// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy.
45 /** Redraw all visible dialogs because, for example, the GUI colours
46 * have been re-mapped.
48 * Note that static boost signals break some compilers, so we return a
49 * reference to some hidden magic ;-)
51 static boost::signal0<void> & redrawGUI();
53 /// Toggle tooltips on/off in all dialogs.
54 static void toggleTooltips();
56 /// Are the tooltips on or off?
57 static bool tooltipsEnabled();
59 /// Signals slated to go
61 boost::signal0<void> hideAllSignal;
62 boost::signal0<void> hideBufferDependentSignal;
63 boost::signal1<void, bool> updateBufferDependentSignal;
66 /// Hide all visible dialogs
68 /// Hide any dialogs that require a buffer for them to operate
69 void hideBufferDependent() const;
70 /** Update visible, buffer-dependent dialogs
71 If the bool is true then a buffer change has occurred
72 else its still the same buffer.
74 void updateBufferDependent(bool) const ;
76 /**@name Dialog Access Signals.
77 Put into some sort of alphabetical order */
83 /// connected to the character dialog also
84 void setUserFreeFont();
87 /// show the contents of a file.
88 void showFile(string const &);
90 void showWrap(InsetWrap *);
91 /// show all forked child processes
94 void showGraphics(InsetGraphics *);
95 /// show the LaTeX log or build file
97 /// display the top-level maths panel
99 /// show the merge changes dialog
100 void showMergeChanges();
102 void showMinipage(InsetMinipage *);
104 void updateMinipage(InsetMinipage *);
106 void showParagraph();
108 void updateParagraph();
112 void showPreferences();
119 /// bring up the spellchecker
120 void showSpellchecker();
122 void showTabular(InsetTabular *);
124 void updateTabular(InsetTabular *);
126 void showTabularCreate();
129 /// show the thesaurus dialog
130 void showThesaurus(string const &);
131 /// show the version control log
132 void showVCLogFile();
135 /** name == "bibtex", "citation" etc
136 data is generated by the Inset::write method, to be read by the
137 Inset::read method in the frontends.
138 inset is stored. On a subsequent Apply from the frontends, the
139 stored inset will be modified. If no inset is stored, then a
140 new one will be created at the current cursor position.
142 void show(string const & name, string const & data, InsetBase * inset);
143 /** name == "citation", "bibtex" etc.
144 Update the contents of the dialog.
146 void update(string const & name, string const & data);
148 void Dialogs::hide(string const & name);
150 void disconnect(string const & name);
152 InsetBase * getOpenInset(string const & name) const;
157 bool isValidName(string const & name) const;
159 Dialog * find(string const & name);
161 Dialog * build(string const & name);
166 std::map<string, InsetBase *> open_insets_;
169 typedef boost::shared_ptr<Dialog> DialogPtr;
171 std::map<string, DialogPtr> dialogs_;
173 /// the stuff below is slated to go...