]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QWorkArea.h
dont use pragma impementation and interface anymore
[lyx.git] / src / frontends / qt2 / QWorkArea.h
1 // -*- C++ -*-
2 /**
3  * \file QWorkArea.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 QWORKAREA_H
14 #define QWORKAREA_H
15
16
17 #include "WorkArea.h"
18 #include "QLPainter.h"
19 #include "QContentPane.h"
20
21 #include <qwidget.h>
22 #include <qscrollbar.h>
23 #include <qpixmap.h>
24
25
26 /**
27  * Qt-specific implementation of the work area
28  * (buffer view GUI)
29  *
30  * It consists of a content pane widget, and a scrollbar.
31  * Hopefully soon we can just use QScrollView ...
32  */
33 class QWorkArea : public WorkArea, public QWidget {
34 public:
35         friend class QContentPane;
36
37         QWorkArea(int x, int y, int w, int h);
38
39         virtual ~QWorkArea();
40         /// return this widget's painter
41         virtual Painter & getPainter() { return painter_; }
42         /// return the width of the content pane
43         virtual int workWidth() const { return content_->width(); }
44         /// return the height of the content pane
45         virtual int workHeight() const { return content_->height(); }
46         ///
47         virtual void setScrollbarParams(int height, int pos, int line_height);
48
49         /// a selection exists
50         virtual void haveSelection(bool) const;
51         ///
52         virtual string const getClipboard() const;
53         ///
54         virtual void putClipboard(string const &) const;
55
56         /// get the pixmap we paint on to
57         QPixmap * getPixmap() const { return content_->pixmap(); }
58
59         /// get the content pane widget
60         QWidget * getContent() const { return content_; }
61 private:
62         /// scroll bar
63         QScrollBar * scrollbar_;
64         /// content
65         QContentPane * content_;
66
67         /// our painter
68         QLPainter painter_;
69 };
70
71 #endif // QWORKAREA_H