]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/qscreen.h
Martin's changes to the Note inset.
[lyx.git] / src / frontends / qt2 / qscreen.h
1 // -*- C++ -*-
2 /**
3  * \file qscreen.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #ifndef QSCREEN_H
13 #define QSCREEN_H
14
15
16 #include "screen.h"
17 #include <qrect.h>
18 #include <boost/scoped_ptr.hpp>
19
20 class WorkArea;
21
22
23 /**
24  * Qt implementation of toolkit-specific parts of LyXScreen.
25  */
26 class QScreen : public LyXScreen {
27 public:
28         QScreen(QWorkArea &);
29
30         virtual ~QScreen();
31
32         /**
33          * draw the screen from a given position
34          * @param y the text position to draw from
35          *
36          * Uses as much of the already printed pixmap as possible
37          */
38         virtual void draw(LyXText *, BufferView *, unsigned int y);
39
40 protected:
41         /// get the work area
42         virtual WorkArea & workarea() const { return owner_; }
43
44         /// repaint the whole content immediately
45         void repaint();
46
47         /// copies specified area of pixmap to screen
48         virtual void expose(int x, int y, int exp_width, int exp_height);
49
50         /// paint the cursor and store the background
51         virtual void showCursor(int x, int y, int h, Cursor_Shape shape);
52
53         /// hide the cursor
54         virtual void removeCursor();
55
56 private:
57         /// our owning widget
58         QWorkArea & owner_;
59
60         boost::scoped_ptr<QPixmap> nocursor_pixmap_;
61
62         //@{ the cursor pixmap position/size
63         int cursor_x_;
64         int cursor_y_;
65         int cursor_w_;
66         int cursor_h_;
67         //@}
68 };
69
70 #endif // QSCREEN_H