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
18 #include <boost/scoped_ptr.hpp>
22 /// for emulating triple click
26 Qt::ButtonState state;
29 bool operator==(QMouseEvent const & e) {
30 return x == e.x() && y == e.y()
31 && state == e.button();
35 : x(0), y(0), state(Qt::NoButton), active(false) {}
37 double_click(QMouseEvent * e)
38 : x(e->x()), y(e->y()),
39 state(e->button()), active(true) {}
44 * Widget for actually drawing the document on
46 class QContentPane : public QWidget {
49 QContentPane(QWorkArea * parent);
51 /// return the backing pixmap
52 QPixmap * pixmap() const { return pixmap_.get(); }
54 /// repaint part of the widget
55 void paintEvent(QPaintEvent * e);
56 /// widget has been resized
57 void resizeEvent(QResizeEvent * e);
59 /// mouse button press
60 void mousePressEvent(QMouseEvent * e);
61 /// mouse button release
62 void mouseReleaseEvent(QMouseEvent * e);
63 /// mouse double click of button
64 void mouseDoubleClickEvent(QMouseEvent * e);
66 void mouseMoveEvent(QMouseEvent * e);
68 void wheelEvent(QWheelEvent * e);
70 void keyPressEvent(QKeyEvent * e);
72 void doubleClickTimeout();
74 void scrollBarChanged(int);
79 /// the double buffered pixmap
80 boost::scoped_ptr<QPixmap> pixmap_;
82 double_click dc_event_;
85 #endif // QCONTENTPANE_H