Quantum GIS API Documentation
1.7.4
|
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 /* $Id$ */ 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; // defined in .cpp 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 00113 QSize mNewSize; 00114 }; 00115 00116 #endif