4 * See the file COPYING.
6 * \author Angus Leeming
8 * Full author contact details are available in file CREDITS
14 #include "support/LAssert.h"
16 #include <boost/utility.hpp>
21 class ViewBase : boost::noncopyable {
24 ViewBase() : controller_ptr_(0) {}
26 virtual ~ViewBase() {}
28 /// Apply changes to LyX data from dialog.
29 virtual void apply() = 0;
31 virtual void build() = 0;
33 virtual void hide() = 0;
34 /// Redraw the dialog (e.g. if the colors have been remapped).
35 virtual void redraw() {}
36 /// Create the dialog if necessary, update it and display it.
37 virtual void show() = 0;
38 /// Update dialog before/whilst showing it.
39 virtual void update() = 0;
41 /** Defaults to nothing. Can be used by the controller, however, to
42 * indicate to the view that something has changed and that the
43 * dialog therefore needs updating.
45 virtual void partialUpdate(int) {}
47 /** This should be set by the GUI class that owns both the controller
50 void setController(ControlButtons & c) { controller_ptr_ = &c; }
53 ControlButtons & getController()
55 lyx::Assert(controller_ptr_);
56 return *controller_ptr_;
59 ControlButtons const & getController() const
61 lyx::Assert(controller_ptr_);
62 return *controller_ptr_;
66 /// We don't own this.
67 ControlButtons * controller_ptr_;