Qwt User's Guide
|
00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- ***************************** 00002 * Qwt Widget Library 00003 * Copyright (C) 1997 Josef Wilgen 00004 * Copyright (C) 2002 Uwe Rathmann 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the Qwt License, Version 1.0 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( Qt::MouseButton, 00047 Qt::KeyboardModifiers = Qt::NoModifier ); 00048 void getMouseButton( Qt::MouseButton &button, 00049 Qt::KeyboardModifiers & ) const; 00050 00051 void setAbortKey( int key, Qt::KeyboardModifiers = Qt::NoModifier ); 00052 void getAbortKey( int &key, Qt::KeyboardModifiers & ) const; 00053 00054 void setCursor( const QCursor & ); 00055 const QCursor cursor() const; 00056 00057 void setOrientations( Qt::Orientations ); 00058 Qt::Orientations orientations() const; 00059 00060 bool isOrientationEnabled( Qt::Orientation ) const; 00061 00062 virtual bool eventFilter( QObject *, QEvent * ); 00063 00064 Q_SIGNALS: 00071 void panned( int dx, int dy ); 00072 00080 void moved( int dx, int dy ); 00081 00082 protected: 00083 virtual void widgetMousePressEvent( QMouseEvent * ); 00084 virtual void widgetMouseReleaseEvent( QMouseEvent * ); 00085 virtual void widgetMouseMoveEvent( QMouseEvent * ); 00086 virtual void widgetKeyPressEvent( QKeyEvent * ); 00087 virtual void widgetKeyReleaseEvent( QKeyEvent * ); 00088 00089 virtual void paintEvent( QPaintEvent * ); 00090 00091 virtual QBitmap contentsMask() const; 00092 virtual QPixmap grab() const; 00093 00094 private: 00095 #ifndef QT_NO_CURSOR 00096 void showCursor( bool ); 00097 #endif 00098 00099 class PrivateData; 00100 PrivateData *d_data; 00101 }; 00102 00103 #endif