cannam@45
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
cannam@45
|
2
|
cannam@45
|
3 /*
|
cannam@45
|
4 Rosegarden
|
cannam@45
|
5 A MIDI and audio sequencer and musical notation editor.
|
cannam@45
|
6 Copyright 2000-2010 the Rosegarden development team.
|
cannam@45
|
7
|
cannam@45
|
8 Other copyrights also apply to some parts of this work. Please
|
cannam@45
|
9 see the AUTHORS file and individual file headers for details.
|
cannam@45
|
10
|
cannam@45
|
11 This program is free software; you can redistribute it and/or
|
cannam@45
|
12 modify it under the terms of the GNU General Public License as
|
cannam@45
|
13 published by the Free Software Foundation; either version 2 of the
|
cannam@45
|
14 License, or (at your option) any later version. See the file
|
cannam@45
|
15 COPYING included with this distribution for more information.
|
cannam@45
|
16 */
|
cannam@45
|
17
|
cannam@45
|
18 #ifndef _RG_PANNER_H_
|
cannam@45
|
19 #define _RG_PANNER_H_
|
cannam@45
|
20
|
cannam@45
|
21 #include <QGraphicsView>
|
cannam@45
|
22
|
cannam@45
|
23 class Panned;
|
cannam@45
|
24
|
cannam@45
|
25 class Panner : public QGraphicsView
|
cannam@45
|
26 {
|
cannam@45
|
27 Q_OBJECT
|
cannam@45
|
28
|
cannam@45
|
29 public:
|
cannam@45
|
30 Panner();
|
cannam@45
|
31 virtual ~Panner() { }
|
cannam@45
|
32
|
cannam@45
|
33 virtual void setScene(QGraphicsScene *);
|
cannam@45
|
34
|
cannam@45
|
35 void connectToPanned(Panned *p);
|
cannam@45
|
36
|
cannam@45
|
37 signals:
|
cannam@45
|
38 void pannedRectChanged(QRectF);
|
cannam@45
|
39 void pannerChanged(QRectF);
|
cannam@45
|
40 void zoomIn();
|
cannam@45
|
41 void zoomOut();
|
cannam@45
|
42
|
cannam@45
|
43 public slots:
|
cannam@45
|
44 void slotSetPannedRect(QRectF);
|
cannam@45
|
45
|
cannam@45
|
46 protected slots:
|
cannam@45
|
47 void slotSceneRectChanged(const QRectF &);
|
cannam@45
|
48
|
cannam@45
|
49 protected:
|
cannam@45
|
50 QRectF m_pannedRect;
|
cannam@45
|
51
|
cannam@45
|
52 void moveTo(QPoint);
|
cannam@45
|
53
|
cannam@45
|
54 virtual void paintEvent(QPaintEvent *);
|
cannam@45
|
55 virtual void mousePressEvent(QMouseEvent *e);
|
cannam@45
|
56 virtual void mouseMoveEvent(QMouseEvent *e);
|
cannam@45
|
57 virtual void mouseReleaseEvent(QMouseEvent *e);
|
cannam@45
|
58 virtual void mouseDoubleClickEvent(QMouseEvent *e);
|
cannam@45
|
59 virtual void wheelEvent(QWheelEvent *e);
|
cannam@45
|
60
|
cannam@45
|
61 virtual void resizeEvent(QResizeEvent *);
|
cannam@45
|
62
|
cannam@45
|
63 virtual void updateScene(const QList<QRectF> &);
|
cannam@45
|
64 virtual void drawItems(QPainter *, int, QGraphicsItem *[],
|
cannam@45
|
65 const QStyleOptionGraphicsItem []);
|
cannam@45
|
66
|
cannam@45
|
67 bool m_clicked;
|
cannam@45
|
68 QRectF m_clickedRect;
|
cannam@45
|
69 QPoint m_clickedPoint;
|
cannam@45
|
70
|
cannam@45
|
71 QPixmap m_cache;
|
cannam@45
|
72 };
|
cannam@45
|
73
|
cannam@45
|
74 #endif
|
cannam@45
|
75
|