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 #include <qpixmap.h>
00016
00017 class QCursor;
00018
00035 class QWT_EXPORT QwtPanner: public QWidget
00036 {
00037 Q_OBJECT
00038
00039 public:
00040 QwtPanner( QWidget* parent );
00041 virtual ~QwtPanner();
00042
00043 void setEnabled( bool );
00044 bool isEnabled() const;
00045
00046 void setMouseButton( int button, int buttonState = Qt::NoButton );
00047 void getMouseButton( int &button, int &buttonState ) const;
00048 void setAbortKey( int key, int state = Qt::NoButton );
00049 void getAbortKey( int &key, int &state ) const;
00050
00051 void setCursor( const QCursor & );
00052 const QCursor cursor() const;
00053
00054 void setOrientations( Qt::Orientations );
00055 Qt::Orientations orientations() const;
00056
00057 bool isOrientationEnabled( Qt::Orientation ) const;
00058
00059 virtual bool eventFilter( QObject *, QEvent * );
00060
00061 Q_SIGNALS:
00068 void panned( int dx, int dy );
00069
00077 void moved( int dx, int dy );
00078
00079 protected:
00080 virtual void widgetMousePressEvent( QMouseEvent * );
00081 virtual void widgetMouseReleaseEvent( QMouseEvent * );
00082 virtual void widgetMouseMoveEvent( QMouseEvent * );
00083 virtual void widgetKeyPressEvent( QKeyEvent * );
00084 virtual void widgetKeyReleaseEvent( QKeyEvent * );
00085
00086 virtual void paintEvent( QPaintEvent * );
00087
00088 virtual QBitmap contentsMask() const;
00089 virtual QPixmap grab() const;
00090
00091 private:
00092 #ifndef QT_NO_CURSOR
00093 void showCursor( bool );
00094 #endif
00095
00096 class PrivateData;
00097 PrivateData *d_data;
00098 };
00099
00100 #endif