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
|
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
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef WORKAREA_H
|
|
|
|
#define WORKAREA_H
|
|
|
|
|
|
|
|
#include "frontends/key_state.h"
|
2006-04-13 12:18:42 +00:00
|
|
|
#include "frontends/LyXKeySym.h"
|
2002-06-18 15:44:30 +00:00
|
|
|
|
2004-09-26 14:19:47 +00:00
|
|
|
#include <boost/signal.hpp>
|
2002-06-18 15:44:30 +00:00
|
|
|
|
|
|
|
|
2002-06-19 23:55:55 +00:00
|
|
|
class Painter;
|
2003-09-04 03:54:04 +00:00
|
|
|
class FuncRequest;
|
2002-06-24 20:28:12 +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.
|
|
|
|
* It works in concert with the LyXScreen class to update the
|
|
|
|
* widget view of a document.
|
|
|
|
*/
|
2002-06-18 15:44:30 +00:00
|
|
|
class WorkArea {
|
|
|
|
public:
|
|
|
|
WorkArea() {}
|
2002-06-19 23:55:55 +00:00
|
|
|
|
2002-06-18 15:44:30 +00:00
|
|
|
virtual ~WorkArea() {}
|
2002-06-24 20:28:12 +00:00
|
|
|
|
2002-06-19 23:55:55 +00:00
|
|
|
/// return the painter object for this work area
|
2002-06-18 15:44:30 +00:00
|
|
|
virtual Painter & getPainter() = 0;
|
2002-06-24 20:28:12 +00:00
|
|
|
|
2002-06-19 23:55:55 +00:00
|
|
|
/// return the width of the work area in pixels
|
2002-06-18 15:44:30 +00:00
|
|
|
virtual int workWidth() const = 0;
|
2002-06-19 23:55:55 +00:00
|
|
|
/// return the height of the work area in pixels
|
2002-06-18 15:44:30 +00:00
|
|
|
virtual int workHeight() const = 0;
|
2002-06-24 20:28:12 +00:00
|
|
|
|
2002-06-19 23:55:55 +00:00
|
|
|
/**
|
|
|
|
* Update the scrollbar.
|
|
|
|
* @param height the total document height in pixels
|
|
|
|
* @param pos the current position in the document, in pixels
|
|
|
|
* @param line_height the line-scroll amount, in pixels
|
|
|
|
*/
|
|
|
|
virtual void setScrollbarParams(int height, int pos, int line_height) = 0;
|
2002-06-24 20:28:12 +00:00
|
|
|
|
2002-06-19 23:55:55 +00:00
|
|
|
// FIXME: this is an odd place to have it, but xforms needs it here ...
|
2002-06-18 15:44:30 +00:00
|
|
|
/// a selection exists
|
|
|
|
virtual void haveSelection(bool) const = 0;
|
2002-06-19 23:55:55 +00:00
|
|
|
/// get the X clipboard contents
|
2003-10-06 15:43:21 +00:00
|
|
|
virtual std::string const getClipboard() const = 0;
|
2002-06-19 23:55:55 +00:00
|
|
|
/// fill the clipboard
|
2003-10-06 15:43:21 +00:00
|
|
|
virtual void putClipboard(std::string const &) const = 0;
|
2002-06-18 15:44:30 +00:00
|
|
|
};
|
2002-06-24 20:28:12 +00:00
|
|
|
|
2002-06-18 15:44:30 +00:00
|
|
|
#endif // WORKAREA_H
|