00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef QWT_PANNER_H
00011 #define QWT_PANNER_H 1
00012
00013 #include "qwt_global.h"
00014 #include <qwidget.h>
00015
00016 class QCursor;
00017
00034 class QWT_EXPORT QwtPanner: public QWidget
00035 {
00036 Q_OBJECT
00037
00038 public:
00039 QwtPanner( QWidget* parent );
00040 virtual ~QwtPanner();
00041
00042 void setEnabled( bool );
00043 bool isEnabled() const;
00044
00045 void setMouseButton( int button, int buttonState = Qt::NoButton );
00046 void getMouseButton( int &button, int &buttonState ) const;
00047 void setAbortKey( int key, int state = Qt::NoButton );
00048 void getAbortKey( int &key, int &state ) const;
00049
00050 void setCursor( const QCursor & );
00051 const QCursor cursor() const;
00052
00053 void setOrientations( Qt::Orientations );
00054 Qt::Orientations orientations() const;
00055
00056 bool isOrientationEnabled( Qt::Orientation ) const;
00057
00058 virtual bool eventFilter( QObject *, QEvent * );
00059
00060 Q_SIGNALS:
00067 void panned( int dx, int dy );
00068
00076 void moved( int dx, int dy );
00077
00078 protected:
00079 virtual void widgetMousePressEvent( QMouseEvent * );
00080 virtual void widgetMouseReleaseEvent( QMouseEvent * );
00081 virtual void widgetMouseMoveEvent( QMouseEvent * );
00082 virtual void widgetKeyPressEvent( QKeyEvent * );
00083 virtual void widgetKeyReleaseEvent( QKeyEvent * );
00084
00085 virtual void paintEvent( QPaintEvent * );
00086
00087 private:
00088 #ifndef QT_NO_CURSOR
00089 void showCursor( bool );
00090 #endif
00091
00092 class PrivateData;
00093 PrivateData *d_data;
00094 };
00095
00096 #endif