]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/qscreen.h
dont use pragma impementation and interface anymore
[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         /**
41          * showManualCursor - display the caret on the work area
42          * @param text the lyx text containing the cursor
43          * @param x the x position of the cursor
44          * @param y the y position of the row's baseline
45          * @param asc ascent of the row
46          * @param desc descent of the row
47          * @param shape the current shape
48          */
49         virtual void showManualCursor(LyXText const *, int x, int y,
50                               int asc, int desc,
51                               Cursor_Shape shape);
52
53         /// unpaint the cursor painted by showManualCursor()
54         virtual void hideCursor();
55
56 protected:
57         /// get the work area
58         virtual WorkArea & workarea() const { return owner_; }
59
60         /// repaint the whole content immediately
61         void repaint();
62
63         /// copies specified area of pixmap to screen
64         virtual void expose(int x, int y, int exp_width, int exp_height);
65
66 private:
67         /// our owning widget
68         QWorkArea & owner_;
69
70         /// the mini-pixmap used for backing store for the blinking cursor
71         boost::scoped_ptr<QPixmap> nocursor_pixmap_;
72
73         //{@ the cursor pixmap position/size
74         int cursor_x_;
75         int cursor_y_;
76         int cursor_w_;
77         int cursor_h_;
78         //@}
79 };
80
81 #endif // QSCREEN_H