]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/Dialogs.h
better selection and scrolling behaviour
[lyx.git] / src / frontends / Dialogs.h
index 94fc47990484b6e287502e271e8fef1a85f432b8..cb8a929dd4dcfe6619add2950df8a17973a99758 100644 (file)
 // -*- C++ -*-
-/* Dialogs.h
- * Container of all dialogs and signals a LyXView needs or uses to access them.
- * Author: Allan Rae <rae@lyx.org>
- * 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 <vector>
-#include <sigc++/signal_system.h>
+#ifdef __GNUG__
+#pragma interface
+#endif
 
 #include "LString.h"
-#include <boost/utility.hpp>
 
-class DialogBase;
+#include <boost/utility.hpp>
+#include <boost/scoped_ptr.hpp>
+#include <boost/signals/signal0.hpp>
+#include <boost/signals/signal1.hpp>
 
-// Maybe this should be a UIFunc modelled on LyXFunc
 class LyXView;
-
-class InsetGraphics;
 class InsetBibKey;
 class InsetBibtex;
+class InsetCommand;
 class InsetError;
+class InsetERT;
+class InsetExternal;
+class InsetFloat;
+class InsetWrap;
+class InsetGraphics;
 class InsetInclude;
 class InsetInfo;
+class InsetMinipage;
+class Paragraph;
 class InsetTabular;
-class InsetCommand;
-
-using std::vector;
-
-#ifdef SIGC_CXX_NAMESPACES
-using SigC::Signal0;
-using SigC::Signal1;
-#endif
 
 /** 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 noncopyable
+class Dialogs : boost::noncopyable
 {
 public:
-       /**@name Constructors and Deconstructors */
-       //@{
-       ///
-       Dialogs(LyXView *);
        ///
+       Dialogs(LyXView &);
+       /// Define an empty d-tor out-of-line to keep boost::scoped_ptr happy.
        ~Dialogs();
-       //@}
-       
-       /** Redraw all visible popups because, for example, the GUI colours
-           have been re-mapped. */
-       static Signal0<void> redrawGUI;
+
+       /** 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<void> & 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 popups
-       Signal0<void> hideAll;
-       
+       /// Hide all visible dialogs
+       boost::signal0<void> hideAll;
+
        /// Hide any dialogs that require a buffer for them to operate
-       Signal0<void> hideBufferDependent;
-       
+       boost::signal0<void> hideBufferDependent;
+
        /** Update visible, buffer-dependent dialogs
            If the bool is true then a buffer change has occurred
            else its still the same buffer.
         */
-       Signal1<void, bool> updateBufferDependent;
+       boost::signal1<void, bool> updateBufferDependent;
        //@}
 
        /**@name Dialog Access Signals.
           Put into some sort of alphabetical order */
        //@{
-       /// Do we really have to push this?
-       Signal1<void, vector<string> const &> SetDocumentClassChoice;
+       ///
+       void showAboutlyx();
        /// show the key and label of a bibliography entry
-       Signal1<void, InsetCommand *> showBibitem;
+       void showBibitem(InsetCommand * ic);
        /// show the bibtex dialog
-       Signal1<void, InsetCommand *> showBibtex;
+       void showBibtex(InsetCommand * ic);
        ///
-       Signal0<void> showCharacter;
+       void showCharacter();
+       /// connected to the character dialog also
+       void setUserFreeFont();
        ///
-       Signal1<void, InsetCommand *> showCitation;
+       void showCitation(InsetCommand *);
        ///
-       Signal1<void, string const &> createCitation;
+       void createCitation(string const &);
        ///
-       Signal0<void> showCopyright;
+       void showDocument();
        ///
-       Signal0<void> showCredits;
+       void showError(InsetError *);
        ///
-       Signal1<void, InsetError *> showError;
+       void showERT(InsetERT *);
        ///
-       Signal1<void, InsetGraphics *> showGraphics;
-       /// show the details of a LyX file include inset
-       Signal1<void, InsetCommand *> showInclude;
-       /// create a LyX file include inset
-       Signal1<void, string const &> createInclude;
+       void updateERT(InsetERT *);
+       /// show the external inset dialog
+       void showExternal(InsetExternal *);
+       /// show the contents of a file.
+       void showFile(string const &);
        ///
-       Signal1<void, InsetCommand *> showIndex;
+       void showFloat(InsetFloat *);
        ///
-       Signal1<void, string const &> createIndex;
+       void showWrap(InsetWrap *);
+       /// show all forked child processes
+       void showForks();
        ///
-       Signal1<void, InsetInfo *> showInfo;
+       void showGraphics(InsetGraphics *);
+       /// show the details of a LyX file include inset
+       void showInclude(InsetInclude *);
        ///
-       Signal0<void> showLayoutDocument;
+       void showIndex(InsetCommand *);
        ///
-       Signal0<void> showLayoutParagraph;
-       /// show the version control log
-       Signal0<void> showVCLogFile;
+       void createIndex();
        /// show the LaTeX log or build file
-       Signal0<void> showLogFile;
+       void showLogFile();
+       /// display the top-level maths panel
+       void showMathPanel();
        ///
-       Signal0<void> showPreamble;
+       void showMinipage(InsetMinipage *);
        ///
-       Signal0<void> showPreferences;
+       void updateMinipage(InsetMinipage *);
        ///
-       Signal0<void> showPrint;
+       void showParagraph();
        ///
-       Signal1<void, InsetCommand *> showRef;
+       void updateParagraph();
        ///
-       Signal1<void, string const &> createRef;
-       /// pop up the splash
-       Signal0<void> showSplash;
-       /// hide the splash immediately
-       Signal0<void> hideSplash;
+       void showPreamble();
        ///
-       Signal1<void, InsetTabular *> showTabular;
+       void showPreferences();
        ///
-       Signal1<void, InsetTabular *> updateTabular;
+       void showPrint();
        ///
-       Signal0<void> showTabularCreate;
+       void showRef(InsetCommand *);
        ///
-       Signal1<void, InsetCommand *> showTOC;
+       void createRef(string const &);
        ///
-       Signal1<void, string const &> createTOC;
+       void showSearch();
        ///
-       Signal1<void, InsetCommand *> showUrl;
+       void showSendto();
+       /// bring up the spellchecker
+       void showSpellchecker();
        ///
-       Signal1<void, string const &> createUrl;
+       void showTabular(InsetTabular *);
        ///
-       Signal0<void> updateCharacter;  // allow update as cursor moves
+       void updateTabular(InsetTabular *);
+       ///
+       void showTabularCreate();
+       /// show the TexInfo
+       void showTexinfo();
+       /// show the thesaurus dialog
+       void showThesaurus(string const &);
+       ///
+       void showTOC(InsetCommand *);
+       ///
+       void createTOC(string const &);
+       ///
+       void showUrl(InsetCommand *);
+       ///
+       void createUrl(string const &);
+       /// show the version control log
+       void showVCLogFile();
        //@}
+
 private:
-       ///
-       vector<DialogBase *> dialogs_;
+       /// Use the Pimpl idiom to hide the internals.
+       class Impl;
+       /// The pointer never changes although *pimpl_'s contents may.
+       boost::scoped_ptr<Impl> const pimpl_;
 };
 
 #endif