]> git.lyx.org Git - lyx.git/blob - src/frontends/WorkArea.h
fix math fonts with LyX/Mac
[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
18 #include <boost/shared_ptr.hpp>
19 #include <boost/signal.hpp>
20
21
22 class Painter;
23 class FuncRequest;
24 class LyXKeySym;
25
26 /**
27  * The work area class represents the widget that provides the
28  * view onto a document. It is owned by the BufferView, and
29  * is responsible for handing events back to its owning BufferView.
30  * It works in concert with the LyXScreen class to update the
31  * widget view of a document.
32  */
33 class WorkArea {
34 public:
35         typedef boost::shared_ptr<LyXKeySym> LyXKeySymPtr;
36
37         WorkArea() {}
38
39         virtual ~WorkArea() {}
40
41         /// return the painter object for this work area
42         virtual Painter & getPainter() = 0;
43
44         /// return the width of the work area in pixels
45         virtual int workWidth() const = 0;
46         /// return the height of the work area in pixels
47         virtual int workHeight() const = 0;
48
49         /**
50          * Update the scrollbar.
51          * @param height the total document height in pixels
52          * @param pos the current position in the document, in pixels
53          * @param line_height the line-scroll amount, in pixels
54          */
55         virtual void setScrollbarParams(int height, int pos, int line_height) = 0;
56
57         // FIXME: this is an odd place to have it, but xforms needs it here ...
58         /// a selection exists
59         virtual void haveSelection(bool) const = 0;
60         /// get the X clipboard contents
61         virtual std::string const getClipboard() const = 0;
62         /// fill the clipboard
63         virtual void putClipboard(std::string const &) const = 0;
64
65         /// work area dimensions have changed
66         boost::signal<void()> workAreaResize;
67         /// the scrollbar has changed
68         boost::signal<void(int)> scrollDocView;
69         /// a key combination has been pressed
70         boost::signal<void(LyXKeySymPtr, key_modifier::state)> workAreaKeyPress;
71         /// some mouse event
72         boost::signal<void(FuncRequest)> dispatch;
73         /// emitted when an X client has requested our selection
74         boost::signal<void()> selectionRequested;
75         /// emitted when another X client has stolen our selection
76         boost::signal<void()> selectionLost;
77 };
78
79 #endif // WORKAREA_H