// -*- 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
{
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();
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();
///
///
void showIndex(InsetCommand *);
///
- void createIndex(string const &);
- ///
- void showInfo(InsetInfo *);
+ void createIndex();
/// show the LaTeX log or build file
void showLogFile();
/// display the top-level maths panel
///
void updateMinipage(InsetMinipage *);
///
- void showERT(InsetERT *);
- ///
- void updateERT(InsetERT *);
- ///
- void showFloat(InsetFloat *);
- ///
void showParagraph();
///
void updateParagraph();
void showSendto();
/// bring up the spellchecker
void showSpellchecker();
- /// bring up the spellchecker tab in preferences
- void showSpellcheckerPreferences();
///
void showTabular(InsetTabular *);
///
/// 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