2001-03-15 13:37:04 +00:00
|
|
|
// -*- C++ -*-
|
2002-09-05 14:10:50 +00:00
|
|
|
/**
|
|
|
|
* \file ViewBase.h
|
2002-09-05 15:14:23 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2001-03-15 13:37:04 +00:00
|
|
|
*
|
2002-09-05 14:10:50 +00:00
|
|
|
* \author Angus Leeming
|
2001-03-15 13:37:04 +00:00
|
|
|
*
|
2002-09-05 14:10:50 +00:00
|
|
|
* Full author contact details are available in file CREDITS
|
2001-03-15 13:37:04 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef VIEWBASE_H
|
|
|
|
#define VIEWBASE_H
|
|
|
|
|
2002-08-12 14:28:43 +00:00
|
|
|
class ControlButtons;
|
2003-03-10 03:13:28 +00:00
|
|
|
class ButtonController;
|
2002-08-12 14:28:43 +00:00
|
|
|
|
2003-03-10 03:13:28 +00:00
|
|
|
#include <boost/utility.hpp>
|
2001-03-15 13:37:04 +00:00
|
|
|
|
2002-08-14 19:19:47 +00:00
|
|
|
class ViewBase : boost::noncopyable {
|
2001-03-15 13:37:04 +00:00
|
|
|
public:
|
2002-03-21 21:21:28 +00:00
|
|
|
///
|
2003-03-10 03:13:28 +00:00
|
|
|
ViewBase();
|
2002-03-21 21:21:28 +00:00
|
|
|
///
|
2001-03-15 13:37:04 +00:00
|
|
|
virtual ~ViewBase() {}
|
|
|
|
|
|
|
|
/// Apply changes to LyX data from dialog.
|
|
|
|
virtual void apply() = 0;
|
2002-08-12 14:28:43 +00:00
|
|
|
/// build the dialog
|
|
|
|
virtual void build() = 0;
|
2001-03-15 13:37:04 +00:00
|
|
|
/// Hide the dialog.
|
|
|
|
virtual void hide() = 0;
|
|
|
|
/// Redraw the dialog (e.g. if the colors have been remapped).
|
|
|
|
virtual void redraw() {}
|
|
|
|
/// Create the dialog if necessary, update it and display it.
|
|
|
|
virtual void show() = 0;
|
|
|
|
/// Update dialog before/whilst showing it.
|
|
|
|
virtual void update() = 0;
|
2003-02-02 00:48:38 +00:00
|
|
|
///
|
|
|
|
virtual bool isVisible() const = 0;
|
2001-03-15 13:37:04 +00:00
|
|
|
|
2002-08-12 14:28:43 +00:00
|
|
|
/** 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.
|
|
|
|
*/
|
2001-07-13 14:03:48 +00:00
|
|
|
virtual void partialUpdate(int) {}
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-08-12 14:28:43 +00:00
|
|
|
/** This should be set by the GUI class that owns both the controller
|
|
|
|
* and the view
|
|
|
|
*/
|
2003-03-10 03:13:28 +00:00
|
|
|
void setController(ControlButtons &);
|
2002-10-21 17:38:09 +00:00
|
|
|
|
2001-03-15 13:37:04 +00:00
|
|
|
///
|
2003-03-10 03:13:28 +00:00
|
|
|
ControlButtons & getController();
|
|
|
|
///
|
|
|
|
ControlButtons const & getController() const;
|
2001-03-15 13:37:04 +00:00
|
|
|
///
|
2003-03-10 03:13:28 +00:00
|
|
|
ButtonController & bc();
|
2002-08-12 14:28:43 +00:00
|
|
|
protected:
|
|
|
|
/// We don't own this.
|
|
|
|
ControlButtons * controller_ptr_;
|
2001-03-15 13:37:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VIEWBASE_H
|