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
23 #include <boost/scoped_ptr.hpp>
27 /// for emulating triple click
31 Qt::ButtonState state;
34 bool operator==(QMouseEvent const & e) {
35 return x == e.x() && y == e.y()
36 && state == e.button();
40 : x(0), y(0), state(Qt::NoButton), active(false) {}
42 double_click(QMouseEvent * e)
43 : x(e->x()), y(e->y()),
44 state(e->button()), active(true) {}
49 * Widget for actually drawing the document on
51 class QContentPane : public QWidget {
54 QContentPane(QWorkArea * parent);
56 /// return the backing pixmap
57 QPixmap * pixmap() const { return pixmap_.get(); }
59 /// repaint part of the widget
60 void paintEvent(QPaintEvent * e);
61 /// widget has been resized
62 void resizeEvent(QResizeEvent * e);
64 /// mouse button press
65 void mousePressEvent(QMouseEvent * e);
66 /// mouse button release
67 void mouseReleaseEvent(QMouseEvent * e);
68 /// mouse double click of button
69 void mouseDoubleClickEvent(QMouseEvent * e);
71 void mouseMoveEvent(QMouseEvent * e);
73 void wheelEvent(QWheelEvent * e);
75 void keyPressEvent(QKeyEvent * e);
77 void doubleClickTimeout();
79 void scrollBarChanged(int);
84 /// the double buffered pixmap
85 boost::scoped_ptr<QPixmap> pixmap_;
87 double_click dc_event_;
90 #endif // QCONTENTPANE_H