X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2FDialogs.h;h=cb8a929dd4dcfe6619add2950df8a17973a99758;hb=c5058bffd88b5eb000ffd11d5729fbec0f34fb0f;hp=a183a20657134dd8ca0131cd90866b0225c27536;hpb=8999098e942c66a013b052190617ef48de916dbe;p=lyx.git diff --git a/src/frontends/Dialogs.h b/src/frontends/Dialogs.h index a183a20657..cb8a929dd4 100644 --- a/src/frontends/Dialogs.h +++ b/src/frontends/Dialogs.h @@ -1,187 +1,182 @@ // -*- C++ -*- -/* Dialogs.h - * Container of all dialogs and signals a LyXView needs or uses to access them. - * Author: Allan Rae - * This file is part of - * ====================================================== +/** + * \file Dialogs.h + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. + * \author Allan Rae * - * LyX, The Document Processor - * - * Copyright 1995 Matthias Ettrich - * Copyright 1995-2000 The LyX Team. - * - * This file Copyright 2000 - * Allan Rae - * ====================================================== + * Full author contact details are available in file CREDITS */ #ifndef DIALOGS_H #define DIALOGS_H -#include -#include - -#include "LString.h" -#include -#include - #ifdef __GNUG__ #pragma interface #endif -#include "DialogBase.h" -#include "support/LAssert.h" +#include "LString.h" -// Maybe this should be a UIFunc modelled on LyXFunc -class LyXView; +#include +#include +#include +#include -class InsetGraphics; +class LyXView; class InsetBibKey; class InsetBibtex; +class InsetCommand; class InsetError; +class InsetERT; class InsetExternal; +class InsetFloat; +class InsetWrap; +class InsetGraphics; class InsetInclude; class InsetInfo; -class InsetTabular; -class InsetCommand; class InsetMinipage; +class Paragraph; +class InsetTabular; /** 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 : public boost::noncopyable +class Dialogs : boost::noncopyable { public: /// - typedef boost::shared_ptr db_ptr; - /**@name Constructor */ - //@{ - /// - Dialogs(LyXView *); - //@} + 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. */ - static SigC::Signal0 redrawGUI; + * 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(); /**@name Global Hide and Update Signals */ //@{ /// Hide all visible dialogs - SigC::Signal0 hideAll; - + boost::signal0 hideAll; + /// Hide any dialogs that require a buffer for them to operate - SigC::Signal0 hideBufferDependent; - + boost::signal0 hideBufferDependent; + /** Update visible, buffer-dependent dialogs If the bool is true then a buffer change has occurred else its still the same buffer. */ - SigC::Signal1 updateBufferDependent; + boost::signal1 updateBufferDependent; //@} /**@name Dialog Access Signals. Put into some sort of alphabetical order */ //@{ - /// Do we really have to push this? - SigC::Signal1 const &> SetDocumentClassChoice; + /// + void showAboutlyx(); /// show the key and label of a bibliography entry - SigC::Signal1 showBibitem; + void showBibitem(InsetCommand * ic); /// show the bibtex dialog - SigC::Signal1 showBibtex; + void showBibtex(InsetCommand * ic); /// - SigC::Signal0 showCharacter; + void showCharacter(); + /// connected to the character dialog also + void setUserFreeFont(); /// - SigC::Signal1 showCitation; + void showCitation(InsetCommand *); /// - SigC::Signal1 createCitation; + void createCitation(string const &); /// - SigC::Signal0 showCopyright; + void showDocument(); /// - SigC::Signal0 showCredits; + void showError(InsetError *); /// - SigC::Signal1 showError; - /// show the external inset dialog - SigC::Signal1 showExternal; + void showERT(InsetERT *); /// - SigC::Signal1 showGraphics; - /// show the details of a LyX file include inset - SigC::Signal1 showInclude; + void updateERT(InsetERT *); + /// show the external inset dialog + void showExternal(InsetExternal *); + /// show the contents of a file. + void showFile(string const &); /// - SigC::Signal1 showIndex; + void showFloat(InsetFloat *); /// - SigC::Signal1 createIndex; + void showWrap(InsetWrap *); + /// show all forked child processes + void showForks(); /// - SigC::Signal1 showInfo; + void showGraphics(InsetGraphics *); + /// show the details of a LyX file include inset + void showInclude(InsetInclude *); /// - SigC::Signal0 showLayoutDocument; + void showIndex(InsetCommand *); /// - SigC::Signal0 showLayoutParagraph; + void createIndex(); + /// show the LaTeX log or build file + void showLogFile(); + /// display the top-level maths panel + void showMathPanel(); /// - SigC::Signal0 showLayoutCharacter; + void showMinipage(InsetMinipage *); /// - SigC::Signal0 setUserFreeFont; - /// show the version control log - SigC::Signal0 showVCLogFile; - /// show the LaTeX log or build file - SigC::Signal0 showLogFile; - /// display the top-level maths panel - SigC::Signal0 showMathPanel; + void updateMinipage(InsetMinipage *); /// - SigC::Signal0 showPreamble; + void showParagraph(); /// - SigC::Signal0 showPreferences; + void updateParagraph(); /// - SigC::Signal0 showPrint; + void showPreamble(); /// - SigC::Signal1 showRef; + void showPreferences(); /// - SigC::Signal1 createRef; + void showPrint(); /// - SigC::Signal0 showSearch; - /// pop up the splash - SigC::Signal0 showSplash; - /// destroy the splash dialog - void destroySplash(); + void showRef(InsetCommand *); /// - SigC::Signal1 showTabular; + void createRef(string const &); /// - SigC::Signal1 updateTabular; + void showSearch(); /// - SigC::Signal0 showTabularCreate; + void showSendto(); + /// bring up the spellchecker + void showSpellchecker(); /// - SigC::Signal1 showMinipage; + void showTabular(InsetTabular *); /// - SigC::Signal1 updateMinipage; + void updateTabular(InsetTabular *); /// - SigC::Signal1 showTOC; + void showTabularCreate(); + /// show the TexInfo + void showTexinfo(); + /// show the thesaurus dialog + void showThesaurus(string const &); /// - SigC::Signal1 createTOC; + void showTOC(InsetCommand *); /// - SigC::Signal1 showUrl; + void createTOC(string const &); /// - SigC::Signal1 createUrl; + void showUrl(InsetCommand *); /// - SigC::Signal0 updateCharacter; // allow update as cursor moves + void createUrl(string const &); + /// show the version control log + void showVCLogFile(); //@} + private: - /// Add a dialog to the vector of dialogs. - void add(DialogBase *); - /// the dialogs being managed - std::vector dialogs_; - /// the splash dialog - boost::scoped_ptr splash_; + /// Use the Pimpl idiom to hide the internals. + class Impl; + /// The pointer never changes although *pimpl_'s contents may. + boost::scoped_ptr const pimpl_; }; -inline void Dialogs::add(DialogBase * ptr) -{ - Assert(ptr); - dialogs_.push_back(db_ptr(ptr)); -} - -inline void Dialogs::destroySplash() -{ - splash_.reset(); -} - #endif