4 * Read the file COPYING
9 * Full author contact details are available in file CREDITS
15 #include "frontends/key_state.h"
16 #include "frontends/LyXKeySym.h"
17 #include "funcrequest.h"
19 #include <boost/signals/signal0.hpp>
20 #include <boost/signals/signal1.hpp>
21 #include <boost/signals/signal2.hpp>
22 #include <boost/signals/signal3.hpp>
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.
40 virtual ~WorkArea() {}
42 /// return the painter object for this work area
43 virtual Painter & getPainter() = 0;
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;
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
56 virtual void setScrollbarParams(int height, int pos, int line_height) = 0;
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;
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;
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;