4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS
12 #ifndef QCONTENTPANE_H
13 #define QCONTENTPANE_H
20 #include <boost/scoped_ptr.hpp>
24 /// for emulating triple click
28 Qt::ButtonState state;
31 bool operator==(QMouseEvent const & e) {
32 return x == e.x() && y == e.y()
33 && state == e.button();
37 : x(0), y(0), state(Qt::NoButton), active(false) {}
39 double_click(QMouseEvent * e)
40 : x(e->x()), y(e->y()),
41 state(e->button()), active(true) {}
46 * Widget for actually drawing the document on
48 class QContentPane : public QWidget {
51 QContentPane(QWorkArea * parent);
53 /// return the backing pixmap
54 QPixmap * pixmap() const { return pixmap_.get(); }
56 /// repaint part of the widget
57 void paintEvent(QPaintEvent * e);
58 /// widget has been resized
59 void resizeEvent(QResizeEvent * e);
61 /// mouse button press
62 void mousePressEvent(QMouseEvent * e);
63 /// mouse button release
64 void mouseReleaseEvent(QMouseEvent * e);
65 /// mouse double click of button
66 void mouseDoubleClickEvent(QMouseEvent * e);
68 void mouseMoveEvent(QMouseEvent * e);
70 void wheelEvent(QWheelEvent * e);
72 void keyPressEvent(QKeyEvent * e);
74 void doubleClickTimeout();
76 void scrollBarChanged(int);
81 /// the double buffered pixmap
82 boost::scoped_ptr<QPixmap> pixmap_;
84 double_click dc_event_;
87 #endif // QCONTENTPANE_H