]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ViewBase.h
John's character.C patch (bug fix).
[lyx.git] / src / frontends / controllers / ViewBase.h
index bbd6a52cd1c11511a943e669b35c52a10cf397a5..f84cf426f02fa65634fd2fad666ed85de71549a3 100644 (file)
@@ -4,7 +4,7 @@
  *
  *           LyX, The Document Processor
  *
- *           Copyright 2000 The LyX Team.
+ *           Copyright 2001 The LyX Team.
  *
  * ======================================================
  *
 #define VIEWBASE_H
 
 #include <boost/utility.hpp>
-#include "ControlBase.h"
+#include "ControlButtons.h"
+#include "ControlSplash.h"
 
 class ViewBase {
 public:
        /// 
-       ViewBase(ControlBase & c) : controller_(c) {}
+       ViewBase(ControlButtons & c) : controller_(c) {}
        /// 
        virtual ~ViewBase() {}
 
@@ -34,6 +35,8 @@ public:
        virtual void show() = 0;
        /// Update dialog before/whilst showing it.
        virtual void update() = 0;
+       /// build the dialog
+       virtual void build() = 0;
 
        /** These shortcuts allow (e.g. xform's) global callback functions
            access to the buttons without making the whole controller_ public.
@@ -46,10 +49,39 @@ public:
         void CancelButton() { controller_.CancelButton(); }
         ///
         void RestoreButton() { controller_.RestoreButton(); }
+       
+       /** Defaults to nothing. Can be used by the Controller, however, to
+           indicate to the View that something has changed and that the
+           dialog therefore needs updating. */
+       virtual void partialUpdate(int) {}
+   
+protected:
+       /// The view is, after all, controlled!
+       ControlButtons & controller_;
+};
+
+
+class ViewSplash {
+public:
+       /// 
+       ViewSplash(ControlSplash & c) : controller_(c) {}
+       /// 
+       virtual ~ViewSplash() {}
+
+       /// Hide the dialog.
+       virtual void hide() = 0;
+       /// Create the dialog and show it.
+       virtual void show() = 0;
+
+       /** The shortcut allows (e.g. xform's) global callback functions
+           access without making the whole controller_ public.
+       */
+        ///
+        void Hide() { controller_.hide(); }
 
 protected:
        /// The view is, after all, controlled!
-       ControlBase & controller_;
+       ControlSplash & controller_;
 };
 
 
@@ -59,7 +91,9 @@ template <class GUIbc>
 class ViewBC : public ViewBase {
 public:
        ///
-       ViewBC(ControlBase & c) : ViewBase(c) {}
+       ViewBC(ControlButtons & c) : ViewBase(c) {}
+
+protected:
        ///
        GUIbc & bc() const
        {