]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/Dialogs.h
better selection and scrolling behaviour
[lyx.git] / src / frontends / Dialogs.h
index b031c0940877926fdc974a46abf2fd4a2256c66a..cb8a929dd4dcfe6619add2950df8a17973a99758 100644 (file)
@@ -1,53 +1,42 @@
 // -*- 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-2001 The LyX Team.
- *
- *           This file Copyright 2000
- *           Allan Rae
- * ======================================================
+ * Full author contact details are available in file CREDITS
  */
 
 #ifndef DIALOGS_H
 #define DIALOGS_H
 
+#ifdef __GNUG__
+#pragma interface
+#endif
+
 #include "LString.h"
 
 #include <boost/utility.hpp>
-#include <boost/shared_ptr.hpp>
+#include <boost/scoped_ptr.hpp>
 #include <boost/signals/signal0.hpp>
 #include <boost/signals/signal1.hpp>
-#include <vector>
-
-#ifdef __GNUG__
-#pragma interface
-#endif
-
-#include "DialogBase.h"
 
-// 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 InsetTabular;
-class InsetCommand;
 class InsetMinipage;
-class InsetFloat;
-class InsetERT;
 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
@@ -57,19 +46,20 @@ class Dialogs : boost::noncopyable
 {
 public:
        ///
-       typedef boost::shared_ptr<DialogBase> 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 boost::signal0<void> 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<void> & redrawGUI();
 
        /// Toggle tooltips on/off in all dialogs.
-       static boost::signal0<void> toggleTooltips;
+       static void toggleTooltips();
 
        /// Are the tooltips on or off?
        static bool tooltipsEnabled();
@@ -110,10 +100,18 @@ public:
        void showDocument();
        ///
        void showError(InsetError *);
+       ///
+       void showERT(InsetERT *);
+       ///
+       void updateERT(InsetERT *);
        /// show the external inset dialog
        void showExternal(InsetExternal *);
        /// show the contents of a file.
        void showFile(string const &);
+       ///
+       void showFloat(InsetFloat *);
+       ///
+       void showWrap(InsetWrap *);
        /// show all forked child processes
        void showForks();
        ///
@@ -124,8 +122,6 @@ public:
        void showIndex(InsetCommand *);
        ///
        void createIndex();
-       ///
-       void showInfo(InsetInfo *);
        /// show the LaTeX log or build file
        void showLogFile();
        /// display the top-level maths panel
@@ -135,12 +131,6 @@ public:
        ///
        void updateMinipage(InsetMinipage *);
        ///
-       void showERT(InsetERT *);
-       ///
-       void updateERT(InsetERT *);
-       ///
-       void showFloat(InsetFloat *);
-       ///
        void showParagraph();
        ///
        void updateParagraph();
@@ -160,8 +150,6 @@ public:
        void showSendto();
        /// bring up the spellchecker
        void showSpellchecker();
-       /// bring up the spellchecker tab in preferences
-       void showSpellcheckerPreferences();
        ///
        void showTabular(InsetTabular *);
        ///
@@ -183,11 +171,12 @@ public:
        /// 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<db_ptr> 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