]> 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 10ef6529bf62ad96e879ec5ef7e6c571ad826de4..ab4cfcd60c8ba4bc247139fa31b42ff819ac421d 100644 (file)
+// -*- 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
 
-/** This class instantiates and makes available the GUI-specific
-    ButtonController and View.
+#include <boost/utility.hpp>
+
+class LyXView;
+class Dialogs;
+
+/** 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_; }
-
+       Controller const & controller() const { return controller_; }
 private:
        ///
-       ButtonController<Policy, GUIbc> bc_;
+       Controller controller_;
        ///
        GUIview view_;
 };
 
-/// Forward declaration of ButtonPolicies
-class OkCancelPolicy;
-class OkCancelReadOnlyPolicy;
-class NoRepeatedApplyReadOnlyPolicy;
-
-
-/** Specialization for Bibitem dialog
- */
-class ControlBibitem;
-
-template <class GUIview, class GUIbc>
-class GUIBibitem :
-       public GUI<ControlBibitem, GUIview, OkCancelReadOnlyPolicy, GUIbc> {
-public:
-       ///
-       GUIBibitem(LyXView & lv, Dialogs & d)
-               : GUI<ControlBibitem, GUIview, OkCancelReadOnlyPolicy, GUIbc>(lv, d) {}
-};
-
-
-/** Specialization for Bibtex dialog
- */
-class ControlBibtex;
-
-template <class GUIview, class GUIbc>
-class GUIBibtex :
-       public GUI<ControlBibtex, GUIview, OkCancelReadOnlyPolicy, GUIbc> {
-public:
-       ///
-       GUIBibtex(LyXView & lv, Dialogs & d)
-               : GUI<ControlBibtex, GUIview, OkCancelReadOnlyPolicy, GUIbc>(lv, d) {}
-};
-
-
-/** Specialization for Character dialog
- */
-class ControlCharacter;
 
-template <class GUIview, class GUIbc>
-class GUICharacter : public GUI<ControlCharacter, GUIview,
-                               NoRepeatedApplyReadOnlyPolicy, GUIbc>
+template <typename Controller, typename GUIview,
+         typename Policy,     typename GUIbc>
+GUI<Controller, GUIview, Policy, GUIbc>::GUI(LyXView & lv, Dialogs & d)
+       : controller_(lv, d),
+         view_()
 {
-public:
-       ///
-       GUICharacter(LyXView & lv, Dialogs & d)
-               : GUI<ControlCharacter, GUIview,
-                     NoRepeatedApplyReadOnlyPolicy, GUIbc>(lv, d) {}
-};
-
-
-/** Specialization for Citation dialog
- */
-class ControlCitation;
-
-template <class GUIview, class GUIbc>
-class GUICitation : public GUI<ControlCitation, GUIview,
-                              NoRepeatedApplyReadOnlyPolicy, GUIbc>
-{
-public:
-       ///
-       GUICitation(LyXView & lv, Dialogs & d)
-               : GUI<ControlCitation, GUIview,
-                     NoRepeatedApplyReadOnlyPolicy, GUIbc>(lv, d) {}
-};
-
-
-/** Specialization for Credits dialog
- */
-class ControlCredits;
-
-template <class GUIview, class GUIbc>
-class GUICredits :
-       public GUI<ControlCredits, GUIview, OkCancelPolicy, GUIbc> {
-public:
-       ///
-       GUICredits(LyXView & lv, Dialogs & d)
-               : GUI<ControlCredits, GUIview, OkCancelPolicy, GUIbc>(lv, d) {}
-};
-
-
-/** Specialization for Error dialog
- */
-class ControlError;
-
-template <class GUIview, class GUIbc>
-class GUIError :
-       public GUI<ControlError, GUIview, OkCancelPolicy, GUIbc> {
-public:
-       ///
-       GUIError(LyXView & lv, Dialogs & d)
-               : GUI<ControlError, GUIview, OkCancelPolicy, GUIbc>(lv, d) {}
-};
-
-
-/** Specialization for Include dialog
- */
-class ControlInclude;
-
-template <class GUIview, class GUIbc>
-class GUIInclude :
-       public GUI<ControlInclude, GUIview, OkCancelReadOnlyPolicy, GUIbc> {
-public:
-       ///
-       GUIInclude(LyXView & lv, Dialogs & d)
-               : GUI<ControlInclude, GUIview, OkCancelReadOnlyPolicy, GUIbc>(lv, d) {}
-};
-
-
-/** Specialization for Log dialog
- */
-class ControlLog;
-
-template <class GUIview, class GUIbc>
-class GUILog :
-       public GUI<ControlLog, GUIview, OkCancelPolicy, GUIbc> {
-public:
-       ///
-       GUILog(LyXView & lv, Dialogs & d)
-               : GUI<ControlLog, GUIview, OkCancelPolicy, GUIbc>(lv, d) {}
-};
-
-
-/** Specialization for Ref dialog
- */
-class ControlRef;
-
-template <class GUIview, class GUIbc>
-class GUIRef :
-       public GUI<ControlRef, GUIview, NoRepeatedApplyPolicy, GUIbc> {
-public:
-       ///
-       GUIRef(LyXView & lv, Dialogs & d)
-               : GUI<ControlRef, GUIview, NoRepeatedApplyPolicy, GUIbc>(lv, d) {}
-};
-
-
-/** Specialization for Url dialog
- */
-class ControlUrl;
-
-template <class GUIview, class GUIbc>
-class GUIUrl :
-       public GUI<ControlUrl, GUIview, NoRepeatedApplyReadOnlyPolicy, GUIbc> {
-public:
-       ///
-       GUIUrl(LyXView & lv, Dialogs & d)
-           : GUI<ControlUrl, GUIview, NoRepeatedApplyReadOnlyPolicy, GUIbc>(lv, d) {}
-};
-
-
-/** Specialization for VCLog dialog
- */
-class ControlVCLog;
-
-template <class GUIview, class GUIbc>
-class GUIVCLog :
-       public GUI<ControlVCLog, GUIview, OkCancelPolicy, GUIbc> {
-public:
-       ///
-       GUIVCLog(LyXView & lv, Dialogs & d)
-           : GUI<ControlVCLog, GUIview, OkCancelPolicy, GUIbc>(lv, d) {}
-};
+       controller_.setView(view_);
+       view_.setController(controller_);
+       controller_.bc().view(new GUIbc(controller_.bc()));
+       controller_.bc().bp(new Policy);
+}
 
 #endif // GUI_H