comparison src/panner.h @ 370:b9c153e00e84

Move source files to src/
author Chris Cannam
date Thu, 24 Mar 2011 10:27:51 +0000
parents panner.h@8fd71f570884
children 496f2042155a
comparison
equal deleted inserted replaced
369:19cce6d2c470 370:b9c153e00e84
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 /*
4 EasyMercurial
5
6 Based on HgExplorer by Jari Korhonen
7 Copyright (c) 2010 Jari Korhonen
8 Copyright (c) 2011 Chris Cannam
9 Copyright (c) 2011 Queen Mary, University of London
10
11 This program is free software; you can redistribute it and/or
12 modify it under the terms of the GNU General Public License as
13 published by the Free Software Foundation; either version 2 of the
14 License, or (at your option) any later version. See the file
15 COPYING included with this distribution for more information.
16 */
17
18 #ifndef _PANNER_H_
19 #define _PANNER_H_
20
21 #include <QGraphicsView>
22
23 class Panned;
24
25 class Panner : public QGraphicsView
26 {
27 Q_OBJECT
28
29 public:
30 Panner();
31 virtual ~Panner() { }
32
33 virtual void setScene(QGraphicsScene *);
34
35 void connectToPanned(Panned *p);
36
37 signals:
38 void pannedRectChanged(QRectF);
39 void pannerChanged(QRectF);
40 void zoomIn();
41 void zoomOut();
42
43 public slots:
44 void slotSetPannedRect(QRectF);
45
46 protected slots:
47 void slotSceneRectChanged(const QRectF &);
48 void slotSceneChanged(const QList<QRectF> &);
49
50 protected:
51 QRectF m_pannedRect;
52
53 void moveTo(QPoint);
54
55 void fit(QRectF);
56
57 virtual void paintEvent(QPaintEvent *);
58 virtual void mousePressEvent(QMouseEvent *e);
59 virtual void mouseMoveEvent(QMouseEvent *e);
60 virtual void mouseReleaseEvent(QMouseEvent *e);
61 virtual void mouseDoubleClickEvent(QMouseEvent *e);
62 virtual void wheelEvent(QWheelEvent *e);
63
64 virtual void resizeEvent(QResizeEvent *);
65
66 virtual void updateScene(const QList<QRectF> &);
67 virtual void drawItems(QPainter *, int, QGraphicsItem *[],
68 const QStyleOptionGraphicsItem []);
69
70 bool m_clicked;
71 QRectF m_clickedRect;
72 QPoint m_clickedPoint;
73
74 QPixmap m_cache;
75 };
76
77 #endif
78