18 #ifndef QGSMAPCANVAS_H
19 #define QGSMAPCANVAS_H
21 #include "qgsconfig.h"
31 #include <QDomDocument>
32 #include <QGraphicsView>
36 #include <QGestureEvent>
73 : mLayer( layer ), mVisible( visible ), mInOverview( isInOverview ) {}
108 QgsMapCanvas( QWidget * parent = 0,
const char *name = 0 );
113 void setLayerSet( QList<QgsMapCanvasLayer>& layers );
117 void updateOverview();
126 QPaintDevice &canvasPaintDevice();
135 double mapUnitsPerPixel()
const;
146 void zoomToFullExtent();
149 void zoomToPreviousExtent();
152 void zoomToNextExtent();
155 void clearExtentHistory();
180 virtual void setCanvasColor(
const QColor & _newVal );
182 virtual QColor canvasColor()
const;
188 void updateFullExtent();
194 int layerCount()
const;
197 QList<QgsMapLayer*> layers()
const;
204 void freeze(
bool frz =
true );
210 void setDirty(
bool _dirty );
213 bool isDirty()
const;
231 void setWheelAction( WheelAction action,
double factor = 2 );
241 void zoomScale(
double scale );
244 void zoomByFactor(
double scaleFactor );
247 void zoomWithCenter(
int x,
int y,
bool zoomIn );
250 void enableAntiAliasing(
bool theFlag );
256 void useImageToRender(
bool theFlag );
261 void panActionEnd( QPoint releasePoint );
264 void panAction( QMouseEvent * event );
267 QPoint mouseLastXY();
275 void selectionChangedSlot();
278 void saveAsImage( QString theFileName, QPixmap * QPixmap = 0, QString =
"PNG" );
281 void layerStateChange();
284 void setRenderFlag(
bool theFlag );
289 bool hasCrsTransformEnabled();
292 void mapUnitsChanged();
301 void readProject(
const QDomDocument & );
304 void writeProject( QDomDocument & );
308 void mapToolDestroyed();
312 void setProgress(
int,
int );
316 void xyCoordinates(
const QgsPoint &p );
319 void scaleChanged(
double );
322 void extentsChanged();
332 void renderComplete( QPainter * );
336 void mapCanvasRefreshed();
340 void renderStarting();
343 void layersChanged();
346 void keyPressed( QKeyEvent * e );
349 void keyReleased( QKeyEvent * e );
359 void zoomLastStatusChanged(
bool );
363 void zoomNextStatusChanged(
bool );
368 bool event( QEvent * e );
372 void keyPressEvent( QKeyEvent * e );
375 void keyReleaseEvent( QKeyEvent * e );
378 void mouseDoubleClickEvent( QMouseEvent * e );
381 void mouseMoveEvent( QMouseEvent * e );
384 void mousePressEvent( QMouseEvent * e );
387 void mouseReleaseEvent( QMouseEvent * e );
390 void wheelEvent( QWheelEvent * e );
393 void resizeEvent( QResizeEvent * e );
396 void paintEvent( QPaintEvent * e );
399 void dragEnterEvent( QDragEnterEvent * e );
402 void moveCanvasContents(
bool reset =
false );
405 void updateCanvasItemPositions();
416 void connectNotify(
const char * signal );
419 void crsTransformEnabled(
bool );