Qwt User's Guide  6.0.2
qwt_panner.h
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_PANNER_H
11 #define QWT_PANNER_H 1
12 
13 #include "qwt_global.h"
14 #include <qwidget.h>
15 #include <qpixmap.h>
16 
17 class QCursor;
18 
35 class QWT_EXPORT QwtPanner: public QWidget
36 {
37  Q_OBJECT
38 
39 public:
40  QwtPanner( QWidget* parent );
41  virtual ~QwtPanner();
42 
43  void setEnabled( bool );
44  bool isEnabled() const;
45 
46  void setMouseButton( int button, int buttonState = Qt::NoButton );
47  void getMouseButton( int &button, int &buttonState ) const;
48  void setAbortKey( int key, int state = Qt::NoButton );
49  void getAbortKey( int &key, int &state ) const;
50 
51  void setCursor( const QCursor & );
52  const QCursor cursor() const;
53 
54  void setOrientations( Qt::Orientations );
55  Qt::Orientations orientations() const;
56 
57  bool isOrientationEnabled( Qt::Orientation ) const;
58 
59  virtual bool eventFilter( QObject *, QEvent * );
60 
61 Q_SIGNALS:
68  void panned( int dx, int dy );
69 
77  void moved( int dx, int dy );
78 
79 protected:
80  virtual void widgetMousePressEvent( QMouseEvent * );
81  virtual void widgetMouseReleaseEvent( QMouseEvent * );
82  virtual void widgetMouseMoveEvent( QMouseEvent * );
83  virtual void widgetKeyPressEvent( QKeyEvent * );
84  virtual void widgetKeyReleaseEvent( QKeyEvent * );
85 
86  virtual void paintEvent( QPaintEvent * );
87 
88  virtual QBitmap contentsMask() const;
89  virtual QPixmap grab() const;
90 
91 private:
92 #ifndef QT_NO_CURSOR
93  void showCursor( bool );
94 #endif
95 
96  class PrivateData;
97  PrivateData *d_data;
98 };
99 
100 #endif