]> git.lyx.org Git - lyx.git/blob - src/frontends/WorkArea.h
2449b8e4a6d6dd31133cce53157cb6389a0d1f7c
[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 int xpos() const = 0;
46         ///
47         virtual int ypos() const = 0;
48         ///
49         virtual void resize(int xpos, int ypos, int width, int height) = 0;
50         ///
51         virtual void redraw() const = 0;
52         ///
53         virtual void setFocus() const = 0;
54         ///
55         virtual bool hasFocus() const = 0;
56         ///
57         virtual bool visible() const = 0;
58         ///
59         virtual void greyOut() const = 0;
60         ///
61         virtual void setScrollbarParams(int height, int pos, int line_height) = 0;
62  
63         /// a selection exists
64         virtual void haveSelection(bool) const = 0;
65         ///
66         virtual string const getClipboard() const = 0;
67         ///
68         virtual void putClipboard(string const &) const = 0;
69         // Signals
70         ///
71         boost::signal0<void> workAreaExpose;
72         ///
73         boost::signal1<void, int> scrollDocView;
74         ///
75         boost::signal2<void, LyXKeySymPtr, key_modifier::state> workAreaKeyPress;
76         ///
77         boost::signal3<void, int, int, mouse_button::state> workAreaButtonPress;
78         ///
79         boost::signal3<void, int, int, mouse_button::state> workAreaButtonRelease;
80         ///
81         boost::signal3<void, int, int, mouse_button::state> workAreaMotionNotify;
82         ///
83         boost::signal0<void> workAreaFocus;
84         ///
85         boost::signal0<void> workAreaUnfocus;
86         ///
87         boost::signal3<void, int, int, mouse_button::state> workAreaDoubleClick;
88         ///
89         boost::signal3<void, int, int, mouse_button::state> workAreaTripleClick;
90         /// emitted when an X client has requested our selection
91         boost::signal0<void> selectionRequested;
92         /// emitted when another X client has stolen our selection
93         boost::signal0<void> selectionLost;
94 };
95  
96 #endif // WORKAREA_H