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 */
78 /// connected to the character dialog also
79 void setUserFreeFont();
82 /// show the contents of a file.
83 void showFile(string const &);
84 /// show all forked child processes
86 /// show the LaTeX log or build file
88 /// display the top-level maths panel
90 /// show the merge changes dialog
91 void showMergeChanges();
95 void updateParagraph();
99 void showPreferences();
106 /// bring up the spellchecker
107 void showSpellchecker();
109 void showTabularCreate();
112 /// show the thesaurus dialog
113 void showThesaurus(string const &);
114 /// show the version control log
115 void showVCLogFile();
118 /** name == "bibtex", "citation" etc
119 data is generated by the Inset::write method, to be read by the
120 Inset::read method in the frontends.
121 inset is stored. On a subsequent Apply from the frontends, the
122 stored inset will be modified. If no inset is stored, then a
123 new one will be created at the current cursor position.
125 void show(string const & name, string const & data, InsetBase * inset);
126 /** name == "citation", "bibtex" etc.
127 Update the contents of the dialog.
129 void update(string const & name, string const & data);
131 void hide(string const & name);
133 void disconnect(string const & name);
135 InsetBase * getOpenInset(string const & name) const;
140 bool isValidName(string const & name) const;
142 Dialog * find(string const & name);
144 Dialog * build(string const & name);
149 std::map<string, InsetBase *> open_insets_;
152 typedef boost::shared_ptr<Dialog> DialogPtr;
154 std::map<string, DialogPtr> dialogs_;
156 /// the stuff below is slated to go...