qwt_panner.h

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 <qnamespace.h>
00014 #include <qwidget.h>
00015 #include "qwt_global.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     virtual bool eventFilter(QObject *, QEvent *);
00055 
00056 signals:
00063     void panned(int dx, int dy);
00064 
00072     void moved(int dx, int dy);
00073 
00074 protected:
00075     virtual void widgetMousePressEvent(QMouseEvent *);
00076     virtual void widgetMouseReleaseEvent(QMouseEvent *);
00077     virtual void widgetMouseMoveEvent(QMouseEvent *);
00078     virtual void widgetKeyPressEvent(QKeyEvent *);
00079     virtual void widgetKeyReleaseEvent(QKeyEvent *);
00080 
00081     virtual void paintEvent(QPaintEvent *);
00082 
00083 private:
00084 #ifndef QT_NO_CURSOR
00085     void showCursor(bool);
00086 #endif
00087 
00088     class PrivateData;
00089     PrivateData *d_data;
00090 };
00091 
00092 #endif

Generated on Mon Feb 26 21:22:37 2007 for Qwt User's Guide by  doxygen 1.4.6