]> git.lyx.org Git - lyx.git/blob - src/frontends/WorkArea.h
21b8e8425284b9fd8385e50bde54262e4c9232a0
[lyx.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 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #include "frontends/Painter.h"
19 #include "frontends/mouse_state.h"
20 #include "frontends/key_state.h"
21 #include "frontends/LyXKeySym.h"
22
23 #include <boost/signals/signal0.hpp>
24 #include <boost/signals/signal1.hpp>
25 #include <boost/signals/signal2.hpp>
26 #include <boost/signals/signal3.hpp>
27
28 #include <utility>
29
30 ///
31 class WorkArea {
32 public:
33         ///
34         WorkArea() {}
35         ///
36         virtual ~WorkArea() {}
37         ///
38         virtual Painter & getPainter() = 0;
39         ///
40         virtual int workWidth() const = 0;
41         ///
42         virtual int workHeight() const = 0;
43   
44         ///
45         virtual void resize(int xpos, int ypos, int width, int height) = 0;
46         ///
47         virtual void redraw() const = 0;
48         ///
49         virtual void setFocus() const = 0;
50         ///
51         virtual bool hasFocus() const = 0;
52         ///
53         virtual void greyOut() const = 0;
54         ///
55         virtual void setScrollbarParams(int height, int pos, int line_height) = 0;
56  
57         /// a selection exists
58         virtual void haveSelection(bool) const = 0;
59         ///
60         virtual string const getClipboard() const = 0;
61         ///
62         virtual void putClipboard(string const &) const = 0;
63         // Signals
64         ///
65         boost::signal0<void> workAreaExpose;
66         ///
67         boost::signal1<void, int> scrollDocView;
68         ///
69         boost::signal2<void, LyXKeySymPtr, key_modifier::state> workAreaKeyPress;
70         ///
71         boost::signal3<void, int, int, mouse_button::state> workAreaButtonPress;
72         ///
73         boost::signal3<void, int, int, mouse_button::state> workAreaButtonRelease;
74         ///
75         boost::signal3<void, int, int, mouse_button::state> workAreaMotionNotify;
76         ///
77         boost::signal3<void, int, int, mouse_button::state> workAreaDoubleClick;
78         ///
79         boost::signal3<void, int, int, mouse_button::state> workAreaTripleClick;
80         /// emitted when an X client has requested our selection
81         boost::signal0<void> selectionRequested;
82         /// emitted when another X client has stolen our selection
83         boost::signal0<void> selectionLost;
84 };
85  
86 #endif // WORKAREA_H