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>
28 /** Container of all dialogs and signals a LyXView needs or uses to access them
29 The list of dialog signals isn't comprehensive but should be a good guide
30 for any future additions. Remember don't go overboard -- think minimal.
32 class Dialogs : boost::noncopyable
37 /// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy.
40 /** Redraw all visible dialogs because, for example, the GUI colours
41 * have been re-mapped.
43 * Note that static boost signals break some compilers, so we return a
44 * reference to some hidden magic ;-)
46 static boost::signal0<void> & redrawGUI();
48 /// Toggle tooltips on/off in all dialogs.
49 static void toggleTooltips();
51 /// Are the tooltips on or off?
52 static bool tooltipsEnabled();
54 /// Signals slated to go
56 boost::signal0<void> hideAllSignal;
57 boost::signal0<void> hideBufferDependentSignal;
58 boost::signal1<void, bool> updateBufferDependentSignal;
61 /// Hide all visible dialogs
63 /// Hide any dialogs that require a buffer for them to operate
64 void hideBufferDependent() const;
65 /** Update visible, buffer-dependent dialogs
66 If the bool is true then a buffer change has occurred
67 else its still the same buffer.
69 void updateBufferDependent(bool) const ;
71 /**@name Dialog Access Signals.
72 Put into some sort of alphabetical order */
76 /// connected to the character dialog also
77 void setUserFreeFont();
80 /// show the contents of a file.
81 void showFile(string const &);
82 /// show all forked child processes
84 /// show the LaTeX log or build file
86 /// display the top-level maths panel
91 void updateParagraph();
95 void showPreferences();
102 /// bring up the spellchecker
103 void showSpellchecker();
106 /// show the thesaurus dialog
107 void showThesaurus(string const &);
108 /// show the version control log
109 void showVCLogFile();
112 ///name == "about" etc
113 void show(string const & name);
114 /** name == "bibtex", "citation" etc
115 data is generated by the Inset::write method, to be read by the
116 Inset::read method in the frontends.
117 inset is stored. On a subsequent Apply from the frontends, the
118 stored inset will be modified. If no inset is stored, then a
119 new one will be created at the current cursor position.
121 void show(string const & name, string const & data, InsetBase * inset);
122 /** name == "citation", "bibtex" etc.
123 Update the contents of the dialog.
125 void update(string const & name, string const & data);
127 void hide(string const & name);
129 void disconnect(string const & name);
131 InsetBase * getOpenInset(string const & name) const;
136 bool isValidName(string const & name) const;
138 Dialog * find(string const & name);
140 Dialog * build(string const & name);
145 std::map<string, InsetBase *> open_insets_;
148 typedef boost::shared_ptr<Dialog> DialogPtr;
150 std::map<string, DialogPtr> dialogs_;
152 /// the stuff below is slated to go...