lyx_mirror/src/frontends/controllers/ViewBase.h
Lars Gullik Bjønnes 44cd0fc9a1 The std::string mammoth path.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7862 a592a061-630c-0410-9148-cb99ea01b6c8
2003-10-06 15:43:21 +00:00

76 lines
1.7 KiB
C++

// -*- C++ -*-
/**
* \file ViewBase.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Angus Leeming
*
* Full author contact details are available in file CREDITS.
*/
#ifndef VIEWBASE_H
#define VIEWBASE_H
class ControlButtons;
class ButtonController;
#include <boost/utility.hpp>
#include <string>
class ViewBase : boost::noncopyable {
public:
///
ViewBase(std::string const &);
///
virtual ~ViewBase() {}
/// Apply changes to LyX data from dialog.
virtual void apply() = 0;
/// build the dialog
virtual void build() = 0;
/// 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;
///
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
* dialog therefore needs updating.
*/
virtual void partialUpdate(int) {}
/** This should be set by the GUI class that owns both the controller
* and the view
*/
void setController(ControlButtons &);
///
ControlButtons & getController();
///
ControlButtons const & getController() const;
///
ButtonController & bc();
/// sets the title of the dialog (window caption)
void setTitle(std::string const &);
/// gets the title of the dialog
std::string const & getTitle() const;
protected:
/// We don't own this.
ControlButtons * controller_ptr_;
private:
std::string title_;
};
#endif // VIEWBASE_H