00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef QGSMAPOVERVIEWCANVAS_H
00021 #define QGSMAPOVERVIEWCANVAS_H
00022
00023
00024 #include <QMouseEvent>
00025 #include <QWheelEvent>
00026 #include <QWidget>
00027 #include <QStringList>
00028 #include <QPixmap>
00029
00030 class QgsMapCanvas;
00031 class QgsMapRenderer;
00032 class QgsPanningWidget;
00033 class QgsRectangle;
00034
00038 class GUI_EXPORT QgsMapOverviewCanvas : public QWidget
00039 {
00040 Q_OBJECT
00041
00042 public:
00043 QgsMapOverviewCanvas( QWidget * parent = 0, QgsMapCanvas* mapCanvas = NULL );
00044
00045 ~QgsMapOverviewCanvas();
00046
00048 void drawExtentRect();
00049
00051 void refresh();
00052
00054 void setBackgroundColor( const QColor& color );
00055
00057 void setLayerSet( const QStringList& layerSet );
00058
00059 QStringList& layerSet();
00060
00061 void enableAntiAliasing( bool flag ) { mAntiAliasing = flag; }
00062
00063 void updateFullExtent( const QgsRectangle& rect );
00064
00065 public slots:
00066
00067 void hasCrsTransformEnabled( bool flag );
00068
00069 void destinationSrsChanged();
00070
00071 protected:
00072
00074 void paintEvent( QPaintEvent * pe );
00075
00077 void resizeEvent( QResizeEvent * e );
00078
00080 void mouseMoveEvent( QMouseEvent * e );
00081
00083 void mousePressEvent( QMouseEvent * e );
00084
00086 void mouseReleaseEvent( QMouseEvent * e );
00087
00089 void updatePanningWidget( const QPoint& pos );
00090
00092 QgsPanningWidget* mPanningWidget;
00093
00095 QPoint mPanningCursorOffset;
00096
00098 QgsMapCanvas* mMapCanvas;
00099
00101 QgsMapRenderer* mMapRenderer;
00102
00104 QPixmap mPixmap;
00105
00107 QColor mBgColor;
00108
00110 bool mAntiAliasing;
00111 };
00112
00113 #endif