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>
35 /** Container of all dialogs and signals a LyXView needs or uses to access them
36 The list of dialog signals isn't comprehensive but should be a good guide
37 for any future additions. Remember don't go overboard -- think minimal.
39 class Dialogs : boost::noncopyable
44 /// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy.
47 /** Redraw all visible dialogs because, for example, the GUI colours
48 * have been re-mapped.
50 * Note that static boost signals break some compilers, so we return a
51 * reference to some hidden magic ;-)
53 static boost::signal0<void> & redrawGUI();
55 /// Toggle tooltips on/off in all dialogs.
56 static void toggleTooltips();
58 /// Are the tooltips on or off?
59 static bool tooltipsEnabled();
61 /// Signals slated to go
63 boost::signal0<void> hideAllSignal;
64 boost::signal0<void> hideBufferDependentSignal;
65 boost::signal1<void, bool> updateBufferDependentSignal;
68 /// Hide all visible dialogs
70 /// Hide any dialogs that require a buffer for them to operate
71 void hideBufferDependent() const;
72 /** Update visible, buffer-dependent dialogs
73 If the bool is true then a buffer change has occurred
74 else its still the same buffer.
76 void updateBufferDependent(bool) const ;
78 /**@name Dialog Access Signals.
79 Put into some sort of alphabetical order */
85 /// connected to the character dialog also
86 void setUserFreeFont();
89 /// show the contents of a file.
90 void showFile(string const &);
92 void showFloat(InsetFloat *);
94 void showWrap(InsetWrap *);
95 /// show all forked child processes
98 void showGraphics(InsetGraphics *);
99 /// show the details of a LyX file include inset
100 void showInclude(InsetInclude *);
101 /// show the LaTeX log or build file
103 /// display the top-level maths panel
104 void showMathPanel();
105 /// show the merge changes dialog
106 void showMergeChanges();
108 void showMinipage(InsetMinipage *);
110 void updateMinipage(InsetMinipage *);
112 void showParagraph();
114 void updateParagraph();
118 void showPreferences();
125 /// bring up the spellchecker
126 void showSpellchecker();
128 void showTabular(InsetTabular *);
130 void updateTabular(InsetTabular *);
132 void showTabularCreate();
135 /// show the thesaurus dialog
136 void showThesaurus(string const &);
137 /// show the version control log
138 void showVCLogFile();
141 /** name == "bibtex", "citation" etc
142 data is generated by the Inset::write method, to be read by the
143 Inset::read method in the frontends.
144 inset is stored. On a subsequent Apply from the frontends, the
145 stored inset will be modified. If no inset is stored, then a
146 new one will be created at the current cursor position.
148 void show(string const & name, string const & data, InsetBase * inset);
149 /** name == "citation", "bibtex" etc.
150 Update the contents of the dialog.
152 void update(string const & name, string const & data);
154 void Dialogs::hide(string const & name);
156 void disconnect(string const & name);
158 InsetBase * getOpenInset(string const & name) const;
163 bool isValidName(string const & name) const;
165 Dialog * find(string const & name);
167 Dialog * build(string const & name);
172 std::map<string, InsetBase *> open_insets_;
175 typedef boost::shared_ptr<Dialog> DialogPtr;
177 std::map<string, DialogPtr> dialogs_;
179 /// the stuff below is slated to go...