]> git.lyx.org Git - lyx.git/blob - src/frontends/WorkArea.h
Fix Qt4 resize bug.
[lyx.git] / src / frontends / WorkArea.h
1 // -*- C++ -*-
2 /**
3  * \file WorkArea.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author unknown
8  * \author John Levon
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef WORKAREA_H
14 #define WORKAREA_H
15
16 #include "frontends/key_state.h"
17 #include "frontends/LyXKeySym.h"
18
19 #include <boost/signal.hpp>
20
21
22 class Painter;
23 class FuncRequest;
24
25 /**
26  * The work area class represents the widget that provides the
27  * view onto a document. It is owned by the BufferView, and
28  * is responsible for handing events back to its owning BufferView.
29  * It works in concert with the LyXScreen class to update the
30  * widget view of a document.
31  */
32 class WorkArea {
33 public:
34         WorkArea() {}
35
36         virtual ~WorkArea() {}
37
38         /// return the painter object for this work area
39         virtual Painter & getPainter() = 0;
40
41         /// return the width of the work area in pixels
42         virtual int workWidth() const = 0;
43         /// return the height of the work area in pixels
44         virtual int workHeight() const = 0;
45
46         /**
47          * Update the scrollbar.
48          * @param height the total document height in pixels
49          * @param pos the current position in the document, in pixels
50          * @param line_height the line-scroll amount, in pixels
51          */
52         virtual void setScrollbarParams(int height, int pos, int line_height) = 0;
53
54         // FIXME: this is an odd place to have it, but xforms needs it here ...
55         /// a selection exists
56         virtual void haveSelection(bool) const = 0;
57         /// get the X clipboard contents
58         virtual std::string const getClipboard() const = 0;
59         /// fill the clipboard
60         virtual void putClipboard(std::string const &) const = 0;
61 };
62
63 #endif // WORKAREA_H