]> git.lyx.org Git - lyx.git/blob - src/frontends/WorkArea.h
Really dull and boring header shit
[lyx.git] / src / frontends / WorkArea.h
1 // -*- C++ -*-
2 /**
3  * \file WorkArea.h
4  * Read the file COPYING
5  *
6  * \author unknown
7  * \author John Levon 
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #ifndef WORKAREA_H
13 #define WORKAREA_H
14
15 #include "frontends/key_state.h"
16 #include "frontends/LyXKeySym.h"
17 #include "funcrequest.h"
18
19 #include <boost/signals/signal0.hpp>
20 #include <boost/signals/signal1.hpp>
21 #include <boost/signals/signal2.hpp>
22 #include <boost/signals/signal3.hpp>
23
24 #include <utility>
25
26 class Painter;
27
28 /**
29  * The work area class represents the widget that provides the
30  * view onto a document. It is owned by the BufferView, and
31  * is responsible for handing events back to its owning BufferView.
32  * It works in concert with the LyXScreen class to update the
33  * widget view of a document.
34  */
35 class WorkArea {
36 public:
37
38         WorkArea() {}
39
40         virtual ~WorkArea() {}
41
42         /// return the painter object for this work area
43         virtual Painter & getPainter() = 0;
44
45         /// return the width of the work area in pixels
46         virtual int workWidth() const = 0;
47         /// return the height of the work area in pixels
48         virtual int workHeight() const = 0;
49
50         /**
51          * Update the scrollbar.
52          * @param height the total document height in pixels
53          * @param pos the current position in the document, in pixels
54          * @param line_height the line-scroll amount, in pixels
55          */
56         virtual void setScrollbarParams(int height, int pos, int line_height) = 0;
57
58         // FIXME: this is an odd place to have it, but xforms needs it here ...
59         /// a selection exists
60         virtual void haveSelection(bool) const = 0;
61         /// get the X clipboard contents
62         virtual string const getClipboard() const = 0;
63         /// fill the clipboard
64         virtual void putClipboard(string const &) const = 0;
65
66         /// work area dimensions have changed
67         boost::signal0<void> workAreaResize;
68         /// the scrollbar has changed
69         boost::signal1<void, int> scrollDocView;
70         /// a key combination has been pressed
71         boost::signal2<void, LyXKeySymPtr, key_modifier::state> workAreaKeyPress;
72         /// some mouse event
73         boost::signal1<void, FuncRequest> dispatch;
74         /// emitted when an X client has requested our selection
75         boost::signal0<void> selectionRequested;
76         /// emitted when another X client has stolen our selection
77         boost::signal0<void> selectionLost;
78 };
79
80 #endif // WORKAREA_H