- Main Page
- Related Pages
- Classes
- Files

- File List

# 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 #if QT_VERSION >= 0x040000
    00055     void setOrientations(Qt::Orientations);
    00056     Qt::Orientations orientations() const;
    00057 #else
    00058     void enableOrientation(Qt::Orientation, bool enable);
    00059 #endif
    00060
    00061     bool isOrientationEnabled(Qt::Orientation) const;
    00062
    00063     virtual bool eventFilter(QObject *, QEvent *);
    00064
    00065 signals:
    00072     void panned(int dx, int dy);
    00073
    00081     void moved(int dx, int dy);
    00082
    00083 protected:
    00084     virtual void widgetMousePressEvent(QMouseEvent *);
    00085     virtual void widgetMouseReleaseEvent(QMouseEvent *);
    00086     virtual void widgetMouseMoveEvent(QMouseEvent *);
    00087     virtual void widgetKeyPressEvent(QKeyEvent *);
    00088     virtual void widgetKeyReleaseEvent(QKeyEvent *);
    00089
    00090     virtual void paintEvent(QPaintEvent *);
    00091
    00092 private:
    00093 #ifndef QT_NO_CURSOR
    00094     void showCursor(bool);
    00095 #endif
    00096
    00097     class PrivateData;
    00098     PrivateData *d_data;
    00099 };
    00100
    00101 #endif