Quantum GIS API Documentation  1.8
src/gui/qgsmapoverviewcanvas.h
Go to the documentation of this file.
00001 /***************************************************************************
00002                            qgsmapoverviewcanvas.h
00003                       Map canvas subclassed for overview
00004                               -------------------
00005     begin                : 09/14/2005
00006     copyright            : (C) 2005 by Martin Dobias
00007     email                : won.der at centrum.sk
00008  ***************************************************************************/
00009 
00010 /***************************************************************************
00011  *                                                                         *
00012  *   This program is free software; you can redistribute it and/or modify  *
00013  *   it under the terms of the GNU General Public License as published by  *
00014  *   the Free Software Foundation; either version 2 of the License, or     *
00015  *   (at your option) any later version.                                   *
00016  *                                                                         *
00017  ***************************************************************************/
00018 
00019 #ifndef QGSMAPOVERVIEWCANVAS_H
00020 #define QGSMAPOVERVIEWCANVAS_H
00021 
00022 
00023 #include <QMouseEvent>
00024 #include <QWheelEvent>
00025 #include <QWidget>
00026 #include <QStringList>
00027 #include <QPixmap>
00028 
00029 class QgsMapCanvas;
00030 class QgsMapRenderer;
00031 class QgsPanningWidget; // defined in .cpp
00032 class QgsRectangle;
00033 
00037 class GUI_EXPORT QgsMapOverviewCanvas : public QWidget
00038 {
00039     Q_OBJECT
00040 
00041   public:
00042     QgsMapOverviewCanvas( QWidget * parent = 0, QgsMapCanvas* mapCanvas = NULL );
00043 
00044     ~QgsMapOverviewCanvas();
00045 
00047     void drawExtentRect();
00048 
00050     void refresh();
00051 
00053     void setBackgroundColor( const QColor& color );
00054 
00056     void setLayerSet( const QStringList& layerSet );
00057 
00058     QStringList& layerSet();
00059 
00060     void enableAntiAliasing( bool flag ) { mAntiAliasing = flag; }
00061 
00062     void updateFullExtent( const QgsRectangle& rect );
00063 
00064   public slots:
00065 
00066     void hasCrsTransformEnabled( bool flag );
00067 
00068     void destinationSrsChanged();
00069 
00070   protected:
00071 
00073     void paintEvent( QPaintEvent * pe );
00074 
00076     void resizeEvent( QResizeEvent * e );
00077 
00079     void mouseMoveEvent( QMouseEvent * e );
00080 
00082     void mousePressEvent( QMouseEvent * e );
00083 
00085     void mouseReleaseEvent( QMouseEvent * e );
00086 
00088     void updatePanningWidget( const QPoint& pos );
00089 
00091     QgsPanningWidget* mPanningWidget;
00092 
00094     QPoint mPanningCursorOffset;
00095 
00097     QgsMapCanvas* mMapCanvas;
00098 
00100     QgsMapRenderer* mMapRenderer;
00101 
00103     QPixmap mPixmap;
00104 
00106     QColor mBgColor;
00107 
00109     bool mAntiAliasing;
00110 
00112     QSize mNewSize;
00113 };
00114 
00115 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines