]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QContentPane.h
The initial merge of the Qt frontend, and the necessary compile fixes.
[lyx.git] / src / frontends / qt2 / QContentPane.h
1 // -*- C++ -*-
2 /**
3  * \file QContentPane.h
4  * Copyright 1995-2002 the LyX Team
5  * Read the file COPYING
6  *
7  * \author John Levon <moz@compsoc.man.ac.uk>
8  */
9
10 #ifndef QCONTENTPANE_H
11 #define QCONTENTPANE_H
12
13 #ifdef __GNUG__
14 #pragma interface
15 #endif
16
17 #include <config.h>
18 #include <utility>
19 #include <boost/smart_ptr.hpp>
20
21 #include <qwidget.h>
22 #include <qscrollbar.h>
23 #include <qpixmap.h>
24 #include <qevent.h>
25
26 class QWorkArea; 
27  
28 /**
29  * Widget for actually drawing the document on
30  */
31 class QContentPane : public QWidget {
32         Q_OBJECT
33  
34 public:
35         QContentPane(QWorkArea * parent);
36          
37         /// return the backing pixmap
38         QPixmap * pixmap() const { return pixmap_.get(); } 
39  
40 protected:
41         /// repaint part of the widget
42         void paintEvent(QPaintEvent * e);
43         /// widget has been resized
44         void resizeEvent(QResizeEvent * e);
45         /// keyboard focus in this widget
46         void focusInEvent(QFocusEvent * e);
47         /// keyboard focus lost
48         void focusOutEvent(QFocusEvent * e);
49  
50         /// mouse button press
51         void mousePressEvent(QMouseEvent * e);
52         /// mouse button release 
53         void mouseReleaseEvent(QMouseEvent * e);
54         /// mouse double click of button 
55         void mouseDoubleClickEvent(QMouseEvent * e);
56         /// mouse motion
57         void mouseMoveEvent(QMouseEvent * e);
58  
59         /// key press
60         void keyPressEvent(QKeyEvent * e);
61  
62 public slots:
63         void scrollBarChanged(int);
64  
65 private:
66         /// owning widget
67         QWorkArea * wa_;
68  
69         /// the double buffered pixmap
70         boost::scoped_ptr<QPixmap> pixmap_;
71 };
72
73 #endif // QCONTENTPANE_H