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>
30 /** Container of all dialogs and signals a LyXView needs or uses to access them
31 The list of dialog signals isn't comprehensive but should be a good guide
32 for any future additions. Remember don't go overboard -- think minimal.
34 class Dialogs : boost::noncopyable
39 /// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy.
42 /** Redraw all visible dialogs because, for example, the GUI colours
43 * have been re-mapped.
45 * Note that static boost signals break some compilers, so we return a
46 * reference to some hidden magic ;-)
48 static boost::signal0<void> & redrawGUI();
50 /// Toggle tooltips on/off in all dialogs.
51 static void toggleTooltips();
53 /// Are the tooltips on or off?
54 static bool tooltipsEnabled();
56 /// Signals slated to go
58 boost::signal0<void> hideAllSignal;
59 boost::signal0<void> hideBufferDependentSignal;
60 boost::signal1<void, bool> updateBufferDependentSignal;
63 /// Hide all visible dialogs
65 /// Hide any dialogs that require a buffer for them to operate
66 void hideBufferDependent() const;
67 /** Update visible, buffer-dependent dialogs
68 If the bool is true then a buffer change has occurred
69 else its still the same buffer.
71 void updateBufferDependent(bool) const ;
73 /**@name Dialog Access Signals.
74 Put into some sort of alphabetical order */
80 /// connected to the character dialog also
81 void setUserFreeFont();
84 /// show the contents of a file.
85 void showFile(string const &);
86 /// show all forked child processes
88 /// show the LaTeX log or build file
90 /// display the top-level maths panel
92 /// show the merge changes dialog
93 void showMergeChanges();
97 void updateParagraph();
101 void showPreferences();
108 /// bring up the spellchecker
109 void showSpellchecker();
111 void showTabular(InsetTabular *);
113 void updateTabular(InsetTabular *);
115 void showTabularCreate();
118 /// show the thesaurus dialog
119 void showThesaurus(string const &);
120 /// show the version control log
121 void showVCLogFile();
124 /** name == "bibtex", "citation" etc
125 data is generated by the Inset::write method, to be read by the
126 Inset::read method in the frontends.
127 inset is stored. On a subsequent Apply from the frontends, the
128 stored inset will be modified. If no inset is stored, then a
129 new one will be created at the current cursor position.
131 void show(string const & name, string const & data, InsetBase * inset);
132 /** name == "citation", "bibtex" etc.
133 Update the contents of the dialog.
135 void update(string const & name, string const & data);
137 void Dialogs::hide(string const & name);
139 void disconnect(string const & name);
141 InsetBase * getOpenInset(string const & name) const;
146 bool isValidName(string const & name) const;
148 Dialog * find(string const & name);
150 Dialog * build(string const & name);
155 std::map<string, InsetBase *> open_insets_;
158 typedef boost::shared_ptr<Dialog> DialogPtr;
160 std::map<string, DialogPtr> dialogs_;
162 /// the stuff below is slated to go...