]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/GUI.h
Finish the task of removing all cruft from the header files.
[lyx.git] / src / frontends / controllers / GUI.h
index 49f62ea290673a673ef653d3a1191585d4150879..ab4cfcd60c8ba4bc247139fa31b42ff819ac421d 100644 (file)
@@ -1,75 +1,52 @@
 // -*- C++ -*-
 /**
  * \file GUI.h
- * Copyright 2001 The LyX Team.
- * See the file COPYING.
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author Angus Leeming <a.leeming@ic.ac.uk>
+ * \author Angus Leeming
+ *
+ * Full author contact details are available in file CREDITS.
  */
 
 #ifndef GUI_H
 #define GUI_H
 
-#include "ButtonController.h"
-#include "ViewBase.h"
+#include <boost/utility.hpp>
+
+class LyXView;
+class Dialogs;
 
-/** This class instantiates and makes available the GUI-specific
-    ButtonController and View.
+/** This class makes a whole out of the disparate parts of a dialog.
  */
-template <class Controller, class GUIview, class Policy, class GUIbc>
-class GUI : public Controller {
+template <typename Controller, typename GUIview,
+         typename Policy,     typename GUIbc>
+class GUI : boost::noncopyable {
 public:
        ///
-       GUI(LyXView & lv, Dialogs & d) : Controller(lv, d), view_(*this) {}
+       GUI(LyXView & lv, Dialogs & d);
        ///
-       virtual ButtonControllerBase & bc() { return bc_; }
+       Controller & controller() { return controller_; }
        ///
-       virtual ViewBase & view() { return view_; }
-
-       friend void gui_ShowAboutlyx(LyXView &, Dialogs &);
-       friend void gui_ShowBibitem(InsetCommand *, LyXView &, Dialogs &);
-       friend void gui_ShowBibtex(InsetCommand *, LyXView &, Dialogs &);
-       friend void gui_ShowCharacter(LyXView &, Dialogs &);
-       friend void gui_SetUserFreeFont(LyXView &, Dialogs &);
-       friend void gui_ShowCitation(InsetCommand *, LyXView &, Dialogs &);
-       friend void gui_CreateCitation(string const &, LyXView &, Dialogs &);
-       friend void gui_ShowDocument(LyXView &, Dialogs &);
-       friend void gui_ShowError(InsetError *, LyXView &, Dialogs &);
-       friend void gui_ShowERT(InsetERT *, LyXView &, Dialogs &);
-       friend void gui_UpdateERT(InsetERT *, LyXView &, Dialogs &);
-       friend void gui_ShowExternal(InsetExternal *, LyXView &, Dialogs &);
-       friend void gui_ShowFloat(InsetFloat *, LyXView &, Dialogs &);
-       friend void gui_ShowForks(LyXView &, Dialogs &);
-       friend void gui_ShowGraphics(InsetGraphics *, LyXView &, Dialogs &);
-       friend void gui_ShowInclude(InsetInclude *, LyXView &, Dialogs &);
-       friend void gui_ShowIndex(InsetCommand *, LyXView &, Dialogs &);
-       friend void gui_CreateIndex(string const &, LyXView &, Dialogs &);
-       friend void gui_ShowLogFile(LyXView &, Dialogs &);
-       friend void gui_ShowMathPanel(LyXView &, Dialogs &);
-       friend void gui_ShowMinipage(InsetMinipage *, LyXView &, Dialogs &);
-       friend void gui_UpdateMinipage(InsetMinipage *, LyXView &, Dialogs &);
-       friend void gui_ShowParagraph(LyXView &, Dialogs &);
-       friend void gui_ShowPreamble(LyXView &, Dialogs &);
-       friend void gui_ShowPreferences(LyXView &, Dialogs &);
-       friend void gui_ShowPrint(LyXView &, Dialogs &);
-       friend void gui_ShowRef(InsetCommand *, LyXView &, Dialogs &);
-       friend void gui_CreateRef(string const &, LyXView &, Dialogs &);
-       friend void gui_ShowSearch(LyXView &, Dialogs &);
-       friend void gui_ShowSendto(LyXView &, Dialogs &);
-       friend void gui_ShowSpellchecker(LyXView &, Dialogs &);
-       friend void gui_ShowTabularCreate(LyXView &, Dialogs &);
-       friend void gui_ShowTexinfo(LyXView &, Dialogs &);
-       friend void gui_ShowTOC(InsetCommand *, LyXView &, Dialogs &);
-       friend void gui_CreateTOC(string const &, LyXView &, Dialogs &);
-       friend void gui_ShowUrl(InsetCommand *, LyXView &, Dialogs &);
-       friend void gui_CreateUrl(string const &, LyXView &, Dialogs &);
-       friend void gui_ShowVCLogFile(LyXView &, Dialogs &);
-
+       Controller const & controller() const { return controller_; }
 private:
        ///
-       ButtonController<Policy, GUIbc> bc_;
+       Controller controller_;
        ///
        GUIview view_;
 };
 
+
+template <typename Controller, typename GUIview,
+         typename Policy,     typename GUIbc>
+GUI<Controller, GUIview, Policy, GUIbc>::GUI(LyXView & lv, Dialogs & d)
+       : controller_(lv, d),
+         view_()
+{
+       controller_.setView(view_);
+       view_.setController(controller_);
+       controller_.bc().view(new GUIbc(controller_.bc()));
+       controller_.bc().bp(new Policy);
+}
+
 #endif // GUI_H