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>
21 #include <boost/signals/signal2.hpp>
29 /** Container of all dialogs and signals a LyXView needs or uses to access them
30 The list of dialog signals isn't comprehensive but should be a good guide
31 for any future additions. Remember don't go overboard -- think minimal.
33 class Dialogs : boost::noncopyable
38 /// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy.
41 /** Redraw all visible dialogs because, for example, the GUI colours
42 * have been re-mapped.
44 * Note that static boost signals break some compilers, so we return a
45 * reference to some hidden magic ;-)
47 static boost::signal0<void> & redrawGUI();
49 /// Toggle tooltips on/off in all dialogs.
50 static void toggleTooltips();
52 /// Are the tooltips on or off?
53 static bool tooltipsEnabled();
55 /// Signals slated to go
57 boost::signal0<void> hideAllSignal;
58 boost::signal0<void> hideBufferDependentSignal;
59 boost::signal1<void, bool> updateBufferDependentSignal;
62 /// Hide all visible dialogs
64 /// Hide any dialogs that require a buffer for them to operate
65 void hideBufferDependent() const;
66 /** Update visible, buffer-dependent dialogs
67 If the bool is true then a buffer change has occurred
68 else its still the same buffer.
70 void updateBufferDependent(bool) const ;
72 /**@name Dialog Access Signals.
73 Put into some sort of alphabetical order */
77 /// connected to the character dialog also
78 void setUserFreeFont();
81 /// show the contents of a file.
82 void showFile(string const &);
83 /// show all forked child processes
85 /// show the LaTeX log or build file
87 /// display the top-level maths panel
92 void updateParagraph();
96 void showPreferences();
103 /// bring up the spellchecker
104 void showSpellchecker();
107 /// show the thesaurus dialog
108 void showThesaurus(string const &);
109 /// show the version control log
110 void showVCLogFile();
113 ///name == "about" etc
114 void show(string const & name);
115 /** name == "bibtex", "citation" etc
116 data is generated by the Inset::write method, to be read by the
117 Inset::read method in the frontends.
118 inset is stored. On a subsequent Apply from the frontends, the
119 stored inset will be modified. If no inset is stored, then a
120 new one will be created at the current cursor position.
122 void show(string const & name, string const & data, InsetBase * inset);
123 /** name == "citation", "bibtex" etc.
124 Update the contents of the dialog.
126 void update(string const & name, string const & data);
127 /** All Dialogs of the given 'name' will be closed if they are
128 connected to the given 'inset'.
130 static boost::signal2<void, string const &, InsetBase*> & hide();
132 void disconnect(string const & name);
134 InsetBase * getOpenInset(string const & name) const;
137 void hideSlot(string const & name, InsetBase * inset);
141 bool isValidName(string const & name) const;
143 Dialog * find(string const & name);
145 Dialog * build(string const & name);
150 std::map<string, InsetBase *> open_insets_;
153 typedef boost::shared_ptr<Dialog> DialogPtr;
155 std::map<string, DialogPtr> dialogs_;
157 /// the stuff below is slated to go...