]> git.lyx.org Git - features.git/blobdiff - src/frontends/controllers/ViewBase.h
Replace LString.h with support/std_string.h,
[features.git] / src / frontends / controllers / ViewBase.h
index c1d98ab83b7b003a1cc3aa9dfc39640fa0a2007a..203f88e98c0b769dd14ecf767fc42141caeb8016 100644 (file)
@@ -1,28 +1,28 @@
 // -*- C++ -*-
-/* This file is part of
- * ======================================================
+/**
+ * \file ViewBase.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- *           LyX, The Document Processor
+ * \author Angus Leeming
  *
- *           Copyright 2001 The LyX Team.
- *
- * ======================================================
- *
- * Author: Angus Leeming <a.leeming@ic.ac.uk>
+ * Full author contact details are available in file CREDITS.
  */
 
 #ifndef VIEWBASE_H
 #define VIEWBASE_H
 
-#include "support/LAssert.h"
-
 class ControlButtons;
+class ButtonController;
 
+#include "support/std_string.h"
 
-class ViewBase {
+#include <boost/utility.hpp>
+
+class ViewBase : boost::noncopyable {
 public:
        ///
-       ViewBase() : controller_ptr_(0) {}
+       ViewBase(string const &);
        ///
        virtual ~ViewBase() {}
 
@@ -38,6 +38,8 @@ public:
        virtual void show() = 0;
        /// Update dialog before/whilst showing it.
        virtual void update() = 0;
+       ///
+       virtual bool isVisible() const = 0;
 
        /** Defaults to nothing. Can be used by the controller, however, to
         *  indicate to the view that something has changed and that the
@@ -48,25 +50,26 @@ public:
        /** This should be set by the GUI class that owns both the controller
         *  and the view
         */
-       void setController(ControlButtons & c) { controller_ptr_ = &c; }
-       
+       void setController(ControlButtons &);
+
+       ///
+       ControlButtons & getController();
        ///
-       ControlButtons & getController()
-       {
-               lyx::Assert(controller_ptr_);
-               return *controller_ptr_;
-       }
+       ControlButtons const & getController() const;
        ///
-       ControlButtons const & getController() const
-       {
-               lyx::Assert(controller_ptr_);
-               return *controller_ptr_;
-       }
+       ButtonController & bc();
+       /// sets the title of the dialog (window caption)
+       void setTitle(string const &);
+       /// gets the title of the dialog
+       string const & getTitle() const;
 
 protected:
        /// We don't own this.
        ControlButtons * controller_ptr_;
-};
 
+private:
+       string title_;
+
+};
 
 #endif // VIEWBASE_H