# qwt_plot_magnifier.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_PLOT_MAGNIFIER_H
    00011 #define QWT_PLOT_MAGNIFIER_H 1
    00012
    00013 #include "qwt_global.h"
    00014 #include <qobject.h>
    00015
    00016 class QwtPlotCanvas;
    00017 class QwtPlot;
    00018 class QMouseEvent;
    00019 class QWheelEvent;
    00020 class QKeyEvent;
    00021
    00030 class QWT_EXPORT QwtPlotMagnifier: public QObject
    00031 {
    00032     Q_OBJECT
    00033
    00034 public:
    00035     explicit QwtPlotMagnifier(QwtPlotCanvas *);
    00036     virtual ~QwtPlotMagnifier();
    00037
    00038     void setEnabled(bool);
    00039     bool isEnabled() const;
    00040
    00041     void setAxisEnabled(int axis, bool on);
    00042     bool isAxisEnabled(int axis) const;
    00043
    00044     // mouse
    00045     void setMouseFactor(double);
    00046     double mouseFactor() const;
    00047
    00048     void setMouseButton(int button, int buttonState = Qt::NoButton);
    00049     void getMouseButton(int &button, int &buttonState) const;
    00050
    00051     // mouse wheel
    00052     void setWheelFactor(double);
    00053     double wheelFactor() const;
    00054
    00055     void setWheelButtonState(int buttonState);
    00056     int wheelButtonState() const;
    00057
    00058     // keyboard
    00059     void setKeyFactor(double);
    00060     double keyFactor() const;
    00061
    00062     void setZoomInKey(int key, int buttonState);
    00063     void getZoomInKey(int &key, int &buttonState);
    00064
    00065     void setZoomOutKey(int key, int buttonState);
    00066     void getZoomOutKey(int &key, int &buttonState);
    00067
    00068     QwtPlotCanvas *canvas();
    00069     const QwtPlotCanvas *canvas() const;
    00070
    00071     QwtPlot *plot();
    00072     const QwtPlot *plot() const;
    00073
    00074     virtual bool eventFilter(QObject *, QEvent *);
    00075
    00076 protected:
    00077     virtual void rescale(double factor);
    00078
    00079     virtual void widgetMousePressEvent(QMouseEvent *);
    00080     virtual void widgetMouseReleaseEvent(QMouseEvent *);
    00081     virtual void widgetMouseMoveEvent(QMouseEvent *);
    00082     virtual void widgetWheelEvent(QWheelEvent *);
    00083     virtual void widgetKeyPressEvent(QKeyEvent *);
    00084     virtual void widgetKeyReleaseEvent(QKeyEvent *);
    00085
    00086 private:
    00087     class PrivateData;
    00088     PrivateData *d_data;
    00089 };
    00090
    00091 #endif