4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
10 * Full author contact details are available in file CREDITS.
16 #include "frontends/key_state.h"
18 #include <boost/shared_ptr.hpp>
19 #include <boost/signals/signal0.hpp>
20 #include <boost/signals/signal1.hpp>
21 #include <boost/signals/signal2.hpp>
22 #include <boost/signals/signal3.hpp>
24 #include "support/std_string.h"
32 * The work area class represents the widget that provides the
33 * view onto a document. It is owned by the BufferView, and
34 * is responsible for handing events back to its owning BufferView.
35 * It works in concert with the LyXScreen class to update the
36 * widget view of a document.
40 typedef boost::shared_ptr<LyXKeySym> LyXKeySymPtr;
44 virtual ~WorkArea() {}
46 /// return the painter object for this work area
47 virtual Painter & getPainter() = 0;
49 /// return the width of the work area in pixels
50 virtual int workWidth() const = 0;
51 /// return the height of the work area in pixels
52 virtual int workHeight() const = 0;
55 * Update the scrollbar.
56 * @param height the total document height in pixels
57 * @param pos the current position in the document, in pixels
58 * @param line_height the line-scroll amount, in pixels
60 virtual void setScrollbarParams(int height, int pos, int line_height) = 0;
62 // FIXME: this is an odd place to have it, but xforms needs it here ...
63 /// a selection exists
64 virtual void haveSelection(bool) const = 0;
65 /// get the X clipboard contents
66 virtual string const getClipboard() const = 0;
67 /// fill the clipboard
68 virtual void putClipboard(string const &) const = 0;
70 /// work area dimensions have changed
71 boost::signal0<void> workAreaResize;
72 /// the scrollbar has changed
73 boost::signal1<void, int> scrollDocView;
74 /// a key combination has been pressed
75 boost::signal2<void, LyXKeySymPtr, key_modifier::state> workAreaKeyPress;
77 boost::signal1<void, FuncRequest> dispatch;
78 /// emitted when an X client has requested our selection
79 boost::signal0<void> selectionRequested;
80 /// emitted when another X client has stolen our selection
81 boost::signal0<void> selectionLost;