2002-06-18 15:44:30 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file WorkArea.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.
|
2002-06-18 15:44:30 +00:00
|
|
|
*
|
|
|
|
* \author unknown
|
2002-10-21 17:38:09 +00:00
|
|
|
* \author John Levon
|
2006-06-20 08:39:16 +00:00
|
|
|
* \author Abdelrazak Younes
|
2002-09-05 14:10:50 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-06-18 15:44:30 +00:00
|
|
|
*/
|
|
|
|
|
2006-06-20 08:39:16 +00:00
|
|
|
#ifndef BASE_WORKAREA_H
|
|
|
|
#define BASE_WORKAREA_H
|
|
|
|
|
2007-10-02 21:51:54 +00:00
|
|
|
#include "frontends/KeyModifier.h"
|
2008-11-16 01:20:34 +00:00
|
|
|
#include "frontends/LyXView.h"
|
2006-09-17 10:00:15 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
2007-09-17 18:41:03 +00:00
|
|
|
|
2006-06-20 08:39:16 +00:00
|
|
|
class BufferView;
|
2007-09-17 18:41:03 +00:00
|
|
|
class KeySymbol;
|
2002-06-18 15:44:30 +00:00
|
|
|
|
2006-06-20 08:39:16 +00:00
|
|
|
namespace frontend {
|
2002-06-18 15:44:30 +00:00
|
|
|
|
2002-06-19 23:55:55 +00:00
|
|
|
/**
|
|
|
|
* The work area class represents the widget that provides the
|
|
|
|
* view onto a document. It is owned by the BufferView, and
|
|
|
|
* is responsible for handing events back to its owning BufferView.
|
2006-06-20 08:39:16 +00:00
|
|
|
* It works in concert with the BaseScreen class to update the
|
2002-06-19 23:55:55 +00:00
|
|
|
* widget view of a document.
|
|
|
|
*/
|
2007-10-02 09:00:08 +00:00
|
|
|
class WorkArea
|
|
|
|
{
|
2002-06-18 15:44:30 +00:00
|
|
|
public:
|
2007-08-21 07:33:46 +00:00
|
|
|
///
|
2008-11-16 01:20:34 +00:00
|
|
|
WorkArea() : lyx_view_(0) {}
|
2007-08-21 07:33:46 +00:00
|
|
|
///
|
2007-11-13 09:52:28 +00:00
|
|
|
virtual ~WorkArea() {}
|
2007-01-16 15:16:09 +00:00
|
|
|
|
2006-06-20 08:39:16 +00:00
|
|
|
/// redraw the screen, without using existing pixmap
|
2007-11-12 22:15:51 +00:00
|
|
|
virtual void redraw() = 0;
|
2006-06-20 08:39:16 +00:00
|
|
|
|
2006-12-20 21:28:05 +00:00
|
|
|
/// Process Key pressed event.
|
|
|
|
/// This needs to be public because it is accessed externally by GuiView.
|
2007-11-12 22:15:51 +00:00
|
|
|
virtual void processKeySym(KeySymbol const & key, KeyModifier mod) = 0;
|
2007-08-21 07:33:46 +00:00
|
|
|
|
2008-11-16 01:20:34 +00:00
|
|
|
/// Return the LyXView this workArea belongs to
|
|
|
|
LyXView const & view() const { return *lyx_view_; }
|
|
|
|
LyXView & view() { return *lyx_view_; }
|
|
|
|
|
2007-10-02 09:00:08 +00:00
|
|
|
/// close this work area.
|
|
|
|
/// Slot for Buffer::closing signal.
|
2007-11-12 22:15:51 +00:00
|
|
|
virtual void close() = 0;
|
2007-11-11 22:30:21 +00:00
|
|
|
/// This function is called when the buffer readonly status change.
|
2007-11-12 22:15:51 +00:00
|
|
|
virtual void setReadOnly(bool) = 0;
|
2007-11-11 22:30:21 +00:00
|
|
|
|
|
|
|
/// Update window titles of all users.
|
2007-11-12 22:15:51 +00:00
|
|
|
virtual void updateWindowTitle() = 0;
|
2008-11-16 01:20:34 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
LyXView * lyx_view_;
|
2002-06-18 15:44:30 +00:00
|
|
|
};
|
2002-06-24 20:28:12 +00:00
|
|
|
|
2006-06-20 08:39:16 +00:00
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif // BASE_WORKAREA_H
|