]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QContentPane.h
remove focus/unfocus events - unused
[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  
46         /// mouse button press
47         void mousePressEvent(QMouseEvent * e);
48         /// mouse button release 
49         void mouseReleaseEvent(QMouseEvent * e);
50         /// mouse double click of button 
51         void mouseDoubleClickEvent(QMouseEvent * e);
52         /// mouse motion
53         void mouseMoveEvent(QMouseEvent * e);
54  
55         /// key press
56         void keyPressEvent(QKeyEvent * e);
57  
58 public slots:
59         void scrollBarChanged(int);
60  
61 private:
62         /// owning widget
63         QWorkArea * wa_;
64  
65         /// the double buffered pixmap
66         boost::scoped_ptr<QPixmap> pixmap_;
67 };
68
69 #endif // QCONTENTPANE_H