4 * Copyright 1995-2002 the LyX Team
5 * Read the file COPYING
8 * \author John Levon <moz@compsoc.man.ac.uk>
21 #include "QLPainter.h"
22 #include "QContentPane.h"
25 #include <qscrollbar.h>
30 * Qt-specific implementation of the work area
33 * It consists of a content pane widget, and a scrollbar.
34 * Hopefully soon we can just use QScrollView ...
36 class QWorkArea : public WorkArea, public QWidget {
38 friend class QContentPane;
42 QWorkArea(int x, int y, int w, int h);
45 virtual int xpos() const { return 0; }
46 virtual int ypos() const { return 0; }
47 virtual bool visible() const { return true; }
48 virtual void greyOut() const { }
51 /// return this widget's painter
52 virtual Painter & getPainter() { return painter_; }
53 /// return the width of the content pane
54 virtual int workWidth() const { return content_->width(); }
55 /// return the height of the content pane
56 virtual int workHeight() const { return content_->height(); }
57 /// resize this widget
58 virtual void resize(int xpos, int ypos, int width, int height);
59 /// FIXME: makes no sense ?
60 virtual void redraw() const { }
61 /// set focus to this widget
62 virtual void setFocus() const { /* FIXME */ }
63 /// does this widget have the focus ?
64 virtual bool hasFocus() const { /* FIXME */ return true; }
66 virtual void setScrollbarParams(int height, int pos, int line_height);
68 /// a selection exists
69 virtual void haveSelection(bool) const;
71 virtual string const getClipboard() const;
73 virtual void putClipboard(string const &) const;
75 /// get the pixmap we paint on to
76 QPixmap * getPixmap() const { return content_->pixmap(); }
78 /// get the content pane widget
79 QWidget * getContent() const { return content_; }
83 QScrollBar * scrollbar_;
85 QContentPane * content_;