// -*- C++ -*- /** * \file Dialogs.h * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * \author Allan Rae * * Full author contact details are available in file CREDITS */ #ifndef DIALOGS_H #define DIALOGS_H #include "LString.h" #include #include #include #include class Dialog; class InsetBase; class LyXView; class Paragraph; /** Container of all dialogs and signals a LyXView needs or uses to access them The list of dialog signals isn't comprehensive but should be a good guide for any future additions. Remember don't go overboard -- think minimal. */ class Dialogs : boost::noncopyable { public: /// Dialogs(LyXView &); /// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy. ~Dialogs(); /** Redraw all visible dialogs because, for example, the GUI colours * have been re-mapped. * * Note that static boost signals break some compilers, so we return a * reference to some hidden magic ;-) */ static boost::signal0 & redrawGUI(); /// Toggle tooltips on/off in all dialogs. static void toggleTooltips(); /// Are the tooltips on or off? static bool tooltipsEnabled(); /// Signals slated to go //@{ boost::signal0 hideAllSignal; boost::signal0 hideBufferDependentSignal; boost::signal1 updateBufferDependentSignal; //@} /// Hide all visible dialogs void hideAll() const; /// Hide any dialogs that require a buffer for them to operate void hideBufferDependent() const; /** Update visible, buffer-dependent dialogs If the bool is true then a buffer change has occurred else its still the same buffer. */ void updateBufferDependent(bool) const ; /**@name Dialog Access Signals. Put into some sort of alphabetical order */ //@{ /// void showCharacter(); /// connected to the character dialog also void setUserFreeFont(); /// void showDocument(); /// show the contents of a file. void showFile(string const &); /// show all forked child processes void showForks(); /// show the LaTeX log or build file void showLogFile(); /// display the top-level maths panel void showMathPanel(); /// void showParagraph(); /// void updateParagraph(); /// void showPreamble(); /// void showPreferences(); /// void showPrint(); /// void showSearch(); /// void showSendto(); /// bring up the spellchecker void showSpellchecker(); /// show the TexInfo void showTexinfo(); /// show the thesaurus dialog void showThesaurus(string const &); /// show the version control log void showVCLogFile(); //@} ///name == "about" etc void show(string const & name); /** name == "bibtex", "citation" etc data is generated by the Inset::write method, to be read by the Inset::read method in the frontends. inset is stored. On a subsequent Apply from the frontends, the stored inset will be modified. If no inset is stored, then a new one will be created at the current cursor position. */ void show(string const & name, string const & data, InsetBase * inset); /** name == "citation", "bibtex" etc. Update the contents of the dialog. */ void update(string const & name, string const & data); /// void hide(string const & name); /// void disconnect(string const & name); /// InsetBase * getOpenInset(string const & name) const; private: /// void redraw() const; /// bool isValidName(string const & name) const; /// Dialog * find(string const & name); /// Dialog * build(string const & name); /// LyXView & lyxview_; /// std::map open_insets_; /// typedef boost::shared_ptr DialogPtr; /// std::map dialogs_; /// the stuff below is slated to go... void init_pimpl(); /// class Impl; /// Impl * pimpl_; }; #endif