4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Angus Leeming
9 * Full author contact details are available in file CREDITS.
16 class ButtonController;
18 #include "support/std_string.h"
20 #include <boost/utility.hpp>
22 class ViewBase : boost::noncopyable {
25 ViewBase(string const &);
27 virtual ~ViewBase() {}
29 /// Apply changes to LyX data from dialog.
30 virtual void apply() = 0;
32 virtual void build() = 0;
34 virtual void hide() = 0;
35 /// Redraw the dialog (e.g. if the colors have been remapped).
36 virtual void redraw() {}
37 /// Create the dialog if necessary, update it and display it.
38 virtual void show() = 0;
39 /// Update dialog before/whilst showing it.
40 virtual void update() = 0;
42 virtual bool isVisible() const = 0;
44 /** Defaults to nothing. Can be used by the controller, however, to
45 * indicate to the view that something has changed and that the
46 * dialog therefore needs updating.
48 virtual void partialUpdate(int) {}
50 /** This should be set by the GUI class that owns both the controller
53 void setController(ControlButtons &);
56 ControlButtons & getController();
58 ControlButtons const & getController() const;
60 ButtonController & bc();
61 /// sets the title of the dialog (window caption)
62 void setTitle(string const &);
63 /// gets the title of the dialog
64 string const & getTitle() const;
67 /// We don't own this.
68 ControlButtons * controller_ptr_;