]> git.lyx.org Git - features.git/blob - src/frontends/WorkArea.h
remove some more unneeded focus stuff
[features.git] / src / frontends / WorkArea.h
1 // -*- C++ -*-
2 /**
3  * \file WorkArea.h
4  * Copyright 1995-2002 the LyX Team
5  * Read the file COPYING
6  *
7  * \author unknown
8  * \author John Levon <moz@compsoc.man.ac.uk>
9  */
10
11 #ifndef WORKAREA_H
12 #define WORKAREA_H
13
14 #include "frontends/mouse_state.h"
15 #include "frontends/key_state.h"
16 #include "frontends/LyXKeySym.h"
17
18 #include <boost/signals/signal0.hpp>
19 #include <boost/signals/signal1.hpp>
20 #include <boost/signals/signal2.hpp>
21 #include <boost/signals/signal3.hpp>
22
23 #include <utility>
24
25 class Painter;
26  
27 /**
28  * The work area class represents the widget that provides the
29  * view onto a document. It is owned by the BufferView, and
30  * is responsible for handing events back to its owning BufferView.
31  * It works in concert with the LyXScreen class to update the
32  * widget view of a document.
33  */
34 class WorkArea {
35 public:
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         /// FIXME: GUII
50         virtual void resize(int xpos, int ypos, int width, int height) = 0;
51         /// FIXME: GUII
52         virtual void redraw() const = 0;
53  
54         /**
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
59          */
60         virtual void setScrollbarParams(int height, int pos, int line_height) = 0;
61  
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;
69  
70         /// FIXME: GUII
71         boost::signal0<void> workAreaExpose;
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;
76         /// a mouse button has been pressed
77         boost::signal3<void, int, int, mouse_button::state> workAreaButtonPress;
78         /// a mouse button has been released
79         boost::signal3<void, int, int, mouse_button::state> workAreaButtonRelease;
80         /// the mouse has moved
81         boost::signal3<void, int, int, mouse_button::state> workAreaMotionNotify;
82         /// a mouse button has been double-clicked
83         boost::signal3<void, int, int, mouse_button::state> workAreaDoubleClick;
84         /// a mouse button has been triple-clicked
85         boost::signal3<void, int, int, mouse_button::state> workAreaTripleClick;
86         /// emitted when an X client has requested our selection
87         boost::signal0<void> selectionRequested;
88         /// emitted when another X client has stolen our selection
89         boost::signal0<void> selectionLost;
90 };
91  
92 #endif // WORKAREA_H