~ubuntu-branches/ubuntu/wily/qgis/wily

« back to all changes in this revision

Viewing changes to src/gui/qgsmapoverviewcanvas.h

  • Committer: Bazaar Package Importer
  • Author(s): Johan Van de Wauw
  • Date: 2010-07-11 20:23:24 UTC
  • mfrom: (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100711202324-5ktghxa7hracohmr
Tags: 1.4.0+12730-3ubuntu1
* Merge from Debian unstable (LP: #540941).
* Fix compilation issues with QT 4.7
* Add build-depends on libqt4-webkit-dev 

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 *   (at your option) any later version.                                   *
16
16
 *                                                                         *
17
17
 ***************************************************************************/
18
 
/* $Id: qgsmapoverviewcanvas.h 4949 2006-03-03 01:47:39Z wonder $ */
 
18
/* $Id$ */
19
19
 
20
20
#ifndef QGSMAPOVERVIEWCANVAS_H
21
21
#define QGSMAPOVERVIEWCANVAS_H
24
24
#include <QMouseEvent>
25
25
#include <QWheelEvent>
26
26
#include <QWidget>
27
 
#include <deque>
 
27
#include <QStringList>
28
28
#include <QPixmap>
29
29
 
30
30
class QgsMapCanvas;
31
 
class QgsMapRender;
 
31
class QgsMapRenderer;
32
32
class QgsPanningWidget; // defined in .cpp
 
33
class QgsRectangle;
33
34
 
34
 
class QgsMapOverviewCanvas : public QWidget
 
35
/** \ingroup gui
 
36
 * A widget that displays an overview map.
 
37
 */
 
38
class GUI_EXPORT QgsMapOverviewCanvas : public QWidget
35
39
{
36
 
  Q_OBJECT;
37
 
  
 
40
    Q_OBJECT
 
41
 
38
42
  public:
39
 
    QgsMapOverviewCanvas(QWidget * parent = 0, QgsMapCanvas* mapCanvas = NULL);
40
 
    
 
43
    QgsMapOverviewCanvas( QWidget * parent = 0, QgsMapCanvas* mapCanvas = NULL );
 
44
 
41
45
    ~QgsMapOverviewCanvas();
42
 
  
 
46
 
43
47
    //! used for overview canvas to reflect changed extent in main map canvas
44
 
    void reflectChangedExtent();
 
48
    void drawExtentRect();
45
49
 
46
50
    //! renders overview and updates panning widget
47
51
    void refresh();
48
 
  
 
52
 
49
53
    //! changes background color
50
 
    void setbgColor(const QColor& color);
51
 
        
 
54
    void setBackgroundColor( const QColor& color );
 
55
 
52
56
    //! updates layer set for overview
53
 
    void setLayerSet(std::deque<QString>& layerSet);
54
 
    
55
 
    void enableAntiAliasing(bool flag) { mAntiAliasing = flag; }
56
 
    
57
 
    void updateFullExtent();
58
 
    
 
57
    void setLayerSet( const QStringList& layerSet );
 
58
 
 
59
    QStringList& layerSet();
 
60
 
 
61
    void enableAntiAliasing( bool flag ) { mAntiAliasing = flag; }
 
62
 
 
63
    void updateFullExtent( const QgsRectangle& rect );
 
64
 
 
65
  public slots:
 
66
 
 
67
    void hasCrsTransformEnabled( bool flag );
 
68
 
 
69
    void destinationSrsChanged();
 
70
 
59
71
  protected:
60
 
  
 
72
 
61
73
    //! Overridden paint event
62
 
    void paintEvent(QPaintEvent * pe);
 
74
    void paintEvent( QPaintEvent * pe );
63
75
 
64
76
    //! Overridden resize event
65
 
    void resizeEvent(QResizeEvent * e);
 
77
    void resizeEvent( QResizeEvent * e );
66
78
 
67
79
    //! Overridden mouse move event
68
 
    void mouseMoveEvent(QMouseEvent * e);
 
80
    void mouseMoveEvent( QMouseEvent * e );
69
81
 
70
82
    //! Overridden mouse press event
71
 
    void mousePressEvent(QMouseEvent * e);
 
83
    void mousePressEvent( QMouseEvent * e );
72
84
 
73
85
    //! Overridden mouse release event
74
 
    void mouseReleaseEvent(QMouseEvent * e);
75
 
    
 
86
    void mouseReleaseEvent( QMouseEvent * e );
 
87
 
76
88
    //! called when panning to reflect mouse movement
77
 
    void updatePanningWidget(const QPoint& pos);
78
 
    
 
89
    void updatePanningWidget( const QPoint& pos );
 
90
 
79
91
    //! widget for panning map in overview
80
92
    QgsPanningWidget* mPanningWidget;
81
 
    
 
93
 
82
94
    //! position of cursor inside panning widget
83
95
    QPoint mPanningCursorOffset;
84
 
  
 
96
 
85
97
    //! main map canvas - used to get/set extent
86
98
    QgsMapCanvas* mMapCanvas;
87
 
    
 
99
 
88
100
    //! for rendering overview
89
 
    QgsMapRender* mMapRender;
90
 
    
 
101
    QgsMapRenderer* mMapRenderer;
 
102
 
91
103
    //! pixmap where the map is stored
92
104
    QPixmap mPixmap;
93
 
    
 
105
 
94
106
    //! background color
95
107
    QColor mBgColor;
96
108