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>
32 /** Container of all dialogs and signals a LyXView needs or uses to access them
33 The list of dialog signals isn't comprehensive but should be a good guide
34 for any future additions. Remember don't go overboard -- think minimal.
36 class Dialogs : boost::noncopyable
41 /// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy.
44 /** Redraw all visible dialogs because, for example, the GUI colours
45 * have been re-mapped.
47 * Note that static boost signals break some compilers, so we return a
48 * reference to some hidden magic ;-)
50 static boost::signal0<void> & redrawGUI();
52 /// Toggle tooltips on/off in all dialogs.
53 static void toggleTooltips();
55 /// Are the tooltips on or off?
56 static bool tooltipsEnabled();
58 /// Signals slated to go
60 boost::signal0<void> hideAllSignal;
61 boost::signal0<void> hideBufferDependentSignal;
62 boost::signal1<void, bool> updateBufferDependentSignal;
65 /// Hide all visible dialogs
67 /// Hide any dialogs that require a buffer for them to operate
68 void hideBufferDependent() const;
69 /** Update visible, buffer-dependent dialogs
70 If the bool is true then a buffer change has occurred
71 else its still the same buffer.
73 void updateBufferDependent(bool) const ;
75 /**@name Dialog Access Signals.
76 Put into some sort of alphabetical order */
82 /// connected to the character dialog also
83 void setUserFreeFont();
86 /// show the contents of a file.
87 void showFile(string const &);
88 /// show all forked child processes
91 void showGraphics(InsetGraphics *);
92 /// show the LaTeX log or build file
94 /// display the top-level maths panel
96 /// show the merge changes dialog
97 void showMergeChanges();
99 void showMinipage(InsetMinipage *);
101 void updateMinipage(InsetMinipage *);
103 void showParagraph();
105 void updateParagraph();
109 void showPreferences();
116 /// bring up the spellchecker
117 void showSpellchecker();
119 void showTabular(InsetTabular *);
121 void updateTabular(InsetTabular *);
123 void showTabularCreate();
126 /// show the thesaurus dialog
127 void showThesaurus(string const &);
128 /// show the version control log
129 void showVCLogFile();
132 /** name == "bibtex", "citation" etc
133 data is generated by the Inset::write method, to be read by the
134 Inset::read method in the frontends.
135 inset is stored. On a subsequent Apply from the frontends, the
136 stored inset will be modified. If no inset is stored, then a
137 new one will be created at the current cursor position.
139 void show(string const & name, string const & data, InsetBase * inset);
140 /** name == "citation", "bibtex" etc.
141 Update the contents of the dialog.
143 void update(string const & name, string const & data);
145 void Dialogs::hide(string const & name);
147 void disconnect(string const & name);
149 InsetBase * getOpenInset(string const & name) const;
154 bool isValidName(string const & name) const;
156 Dialog * find(string const & name);
158 Dialog * build(string const & name);
163 std::map<string, InsetBase *> open_insets_;
166 typedef boost::shared_ptr<Dialog> DialogPtr;
168 std::map<string, DialogPtr> dialogs_;
170 /// the stuff below is slated to go...