]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/qscreen.h
Some string(widget->text()) fixes. Weirdness
[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 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "screen.h"
20 #include <qrect.h>
21 #include <boost/scoped_ptr.hpp>
22
23 class WorkArea;
24
25
26 /**
27  * Qt implementation of toolkit-specific parts of LyXScreen.
28  */
29 class QScreen : public LyXScreen {
30 public:
31         QScreen(QWorkArea &);
32
33         virtual ~QScreen();
34
35         /**
36          * draw the screen from a given position
37          * @param y the text position to draw from
38          *
39          * Uses as much of the already printed pixmap as possible
40          */
41         virtual void draw(LyXText *, BufferView *, unsigned int y);
42
43         /**
44          * showManualCursor - display the caret on the work area
45          * @param text the lyx text containing the cursor
46          * @param x the x position of the cursor
47          * @param y the y position of the row's baseline
48          * @param asc ascent of the row
49          * @param desc descent of the row
50          * @param shape the current shape
51          */
52         virtual void showManualCursor(LyXText const *, int x, int y,
53                               int asc, int desc,
54                               Cursor_Shape shape);
55
56         /// unpaint the cursor painted by showManualCursor()
57         virtual void hideCursor();
58
59 protected:
60         /// get the work area
61         virtual WorkArea & workarea() const { return owner_; }
62
63         /// repaint the whole content immediately
64         void repaint();
65
66         /// copies specified area of pixmap to screen
67         virtual void expose(int x, int y, int exp_width, int exp_height);
68
69 private:
70         /// our owning widget
71         QWorkArea & owner_;
72
73         /// the mini-pixmap used for backing store for the blinking cursor
74         boost::scoped_ptr<QPixmap> nocursor_pixmap_;
75
76         //{@ the cursor pixmap position/size
77         int cursor_x_;
78         int cursor_y_;
79         int cursor_w_;
80         int cursor_h_;
81         //@}
82 };
83
84 #endif // QSCREEN_H