source: ntrip/trunk/BNC/qwt/qwt_magnifier.h@ 5328

Last change on this file since 5328 was 4271, checked in by mervart, 12 years ago
File size: 2.3 KB
Line 
1/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the Qwt License, Version 1.0
8 *****************************************************************************/
9
10#ifndef QWT_MAGNIFIER_H
11#define QWT_MAGNIFIER_H 1
12
13#include "qwt_global.h"
14#include <qobject.h>
15
16class QWidget;
17class QMouseEvent;
18class QWheelEvent;
19class QKeyEvent;
20
21/*!
22 \brief QwtMagnifier provides zooming, by magnifying in steps.
23
24 Using QwtMagnifier a plot can be zoomed in/out in steps using
25 keys, the mouse wheel or moving a mouse button in vertical direction.
26*/
27class QWT_EXPORT QwtMagnifier: public QObject
28{
29 Q_OBJECT
30
31public:
32 explicit QwtMagnifier( QWidget * );
33 virtual ~QwtMagnifier();
34
35 QWidget *parentWidget();
36 const QWidget *parentWidget() const;
37
38 void setEnabled( bool );
39 bool isEnabled() const;
40
41 // mouse
42 void setMouseFactor( double );
43 double mouseFactor() const;
44
45 void setMouseButton( int button, int buttonState = Qt::NoButton );
46 void getMouseButton( int &button, int &buttonState ) const;
47
48 // mouse wheel
49 void setWheelFactor( double );
50 double wheelFactor() const;
51
52 void setWheelButtonState( int buttonState );
53 int wheelButtonState() const;
54
55 // keyboard
56 void setKeyFactor( double );
57 double keyFactor() const;
58
59 void setZoomInKey( int key, int modifiers );
60 void getZoomInKey( int &key, int &modifiers ) const;
61
62 void setZoomOutKey( int key, int modifiers );
63 void getZoomOutKey( int &key, int &modifiers ) const;
64
65 virtual bool eventFilter( QObject *, QEvent * );
66
67protected:
68 /*!
69 Rescale the parent widget
70 \param factor Scale factor
71 */
72 virtual void rescale( double factor ) = 0;
73
74 virtual void widgetMousePressEvent( QMouseEvent * );
75 virtual void widgetMouseReleaseEvent( QMouseEvent * );
76 virtual void widgetMouseMoveEvent( QMouseEvent * );
77 virtual void widgetWheelEvent( QWheelEvent * );
78 virtual void widgetKeyPressEvent( QKeyEvent * );
79 virtual void widgetKeyReleaseEvent( QKeyEvent * );
80
81private:
82 class PrivateData;
83 PrivateData *d_data;
84};
85
86#endif
Note: See TracBrowser for help on using the repository browser.