// -*- 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() {}
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
/** 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