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 & );
307 void getDatumTransformInfo(
const QgsMapLayer* ml,
const QString& srcAuthId,
const QString& destAuthId );
311 void mapToolDestroyed();
315 void setProgress(
int,
int );
319 void xyCoordinates(
const QgsPoint &p );
322 void scaleChanged(
double );
325 void extentsChanged();
335 void renderComplete( QPainter * );
339 void mapCanvasRefreshed();
343 void renderStarting();
346 void layersChanged();
349 void keyPressed( QKeyEvent * e );
352 void keyReleased( QKeyEvent * e );
362 void zoomLastStatusChanged(
bool );
366 void zoomNextStatusChanged(
bool );
371 bool event( QEvent * e );
375 void keyPressEvent( QKeyEvent * e );
378 void keyReleaseEvent( QKeyEvent * e );
381 void mouseDoubleClickEvent( QMouseEvent * e );
384 void mouseMoveEvent( QMouseEvent * e );
387 void mousePressEvent( QMouseEvent * e );
390 void mouseReleaseEvent( QMouseEvent * e );
393 void wheelEvent( QWheelEvent * e );
396 void resizeEvent( QResizeEvent * e );
399 void paintEvent( QPaintEvent * e );
402 void dragEnterEvent( QDragEnterEvent * e );
405 void moveCanvasContents(
bool reset =
false );
408 void updateCanvasItemPositions();
419 void connectNotify(
const char * signal );
422 void crsTransformEnabled(
bool );