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
22 #include <boost/scoped_ptr.hpp>
26 /// for emulating triple click
30 Qt::ButtonState state;
33 bool operator==(QMouseEvent const & e) {
34 return x == e.x() && y == e.y()
35 && state == e.button();
39 : x(0), y(0), state(Qt::NoButton), active(false) {}
41 double_click(QMouseEvent * e)
42 : x(e->x()), y(e->y()),
43 state(e->button()), active(true) {}
47 * Widget for actually drawing the document on
49 class QContentPane : public QWidget {
53 QContentPane(QWorkArea * parent);
55 /// return the backing pixmap
56 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);
74 void keyPressEvent(QKeyEvent * e);
77 void doubleClickTimeout();
79 void scrollBarChanged(int);
85 /// the double buffered pixmap
86 boost::scoped_ptr<QPixmap> pixmap_;
88 double_click dc_event_;
91 #endif // QCONTENTPANE_H