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>
31 /** Container of all dialogs and signals a LyXView needs or uses to access them
32 The list of dialog signals isn't comprehensive but should be a good guide
33 for any future additions. Remember don't go overboard -- think minimal.
35 class Dialogs : boost::noncopyable
40 /// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy.
43 /** Redraw all visible dialogs because, for example, the GUI colours
44 * have been re-mapped.
46 * Note that static boost signals break some compilers, so we return a
47 * reference to some hidden magic ;-)
49 static boost::signal0<void> & redrawGUI();
51 /// Toggle tooltips on/off in all dialogs.
52 static void toggleTooltips();
54 /// Are the tooltips on or off?
55 static bool tooltipsEnabled();
57 /// Signals slated to go
59 boost::signal0<void> hideAllSignal;
60 boost::signal0<void> hideBufferDependentSignal;
61 boost::signal1<void, bool> updateBufferDependentSignal;
64 /// Hide all visible dialogs
66 /// Hide any dialogs that require a buffer for them to operate
67 void hideBufferDependent() const;
68 /** Update visible, buffer-dependent dialogs
69 If the bool is true then a buffer change has occurred
70 else its still the same buffer.
72 void updateBufferDependent(bool) const ;
74 /**@name Dialog Access Signals.
75 Put into some sort of alphabetical order */
81 /// connected to the character dialog also
82 void setUserFreeFont();
85 /// show the contents of a file.
86 void showFile(string const &);
87 /// show all forked child processes
90 void showGraphics(InsetGraphics *);
91 /// show the LaTeX log or build file
93 /// display the top-level maths panel
95 /// show the merge changes dialog
96 void showMergeChanges();
100 void updateParagraph();
104 void showPreferences();
111 /// bring up the spellchecker
112 void showSpellchecker();
114 void showTabular(InsetTabular *);
116 void updateTabular(InsetTabular *);
118 void showTabularCreate();
121 /// show the thesaurus dialog
122 void showThesaurus(string const &);
123 /// show the version control log
124 void showVCLogFile();
127 /** name == "bibtex", "citation" etc
128 data is generated by the Inset::write method, to be read by the
129 Inset::read method in the frontends.
130 inset is stored. On a subsequent Apply from the frontends, the
131 stored inset will be modified. If no inset is stored, then a
132 new one will be created at the current cursor position.
134 void show(string const & name, string const & data, InsetBase * inset);
135 /** name == "citation", "bibtex" etc.
136 Update the contents of the dialog.
138 void update(string const & name, string const & data);
140 void Dialogs::hide(string const & name);
142 void disconnect(string const & name);
144 InsetBase * getOpenInset(string const & name) const;
149 bool isValidName(string const & name) const;
151 Dialog * find(string const & name);
153 Dialog * build(string const & name);
158 std::map<string, InsetBase *> open_insets_;
161 typedef boost::shared_ptr<Dialog> DialogPtr;
163 std::map<string, DialogPtr> dialogs_;
165 /// the stuff below is slated to go...