19 #ifndef QGSMAPCANVAS_H
20 #define QGSMAPCANVAS_H
30 #include <QDomDocument>
31 #include <QGraphicsView>
68 : mLayer( layer ), mVisible( visible ), mInOverview( isInOverview ) {}
103 QgsMapCanvas( QWidget * parent = 0,
const char *name = 0 );
108 void setLayerSet( QList<QgsMapCanvasLayer>& layers );
112 void updateOverview();
122 Q_DECL_DEPRECATED QPixmap& canvasPixmap();
125 QPaintDevice &canvasPaintDevice();
134 double mapUnitsPerPixel()
const;
145 void zoomToFullExtent();
148 void zoomToPreviousExtent();
151 void zoomToNextExtent();
154 void clearExtentHistory();
175 virtual void setCanvasColor(
const QColor & _newVal );
177 virtual QColor canvasColor()
const;
183 void updateFullExtent();
189 int layerCount()
const;
192 QList<QgsMapLayer*> layers()
const;
199 void freeze(
bool frz =
true );
205 void setDirty(
bool _dirty );
208 bool isDirty()
const;
226 void setWheelAction( WheelAction action,
double factor = 2 );
236 void zoomScale(
double scale );
239 void zoomByFactor(
double scaleFactor );
242 void zoomWithCenter(
int x,
int y,
bool zoomIn );
245 void enableAntiAliasing(
bool theFlag );
251 void useImageToRender(
bool theFlag );
256 void panActionEnd( QPoint releasePoint );
259 void panAction( QMouseEvent * event );
262 QPoint mouseLastXY();
270 void selectionChangedSlot();
273 void saveAsImage( QString theFileName, QPixmap * QPixmap = 0, QString =
"PNG" );
276 void layerStateChange();
279 void setRenderFlag(
bool theFlag );
284 bool hasCrsTransformEnabled();
287 void mapUnitsChanged();
296 void readProject(
const QDomDocument & );
299 void writeProject( QDomDocument & );
303 void setProgress(
int,
int );
307 void xyCoordinates(
const QgsPoint & p );
310 void scaleChanged(
double );
313 void extentsChanged();
323 void renderComplete( QPainter * );
327 void renderStarting();
330 void layersChanged();
333 void keyPressed( QKeyEvent * e );
336 void keyReleased( QKeyEvent * e );
346 void zoomLastStatusChanged(
bool );
350 void zoomNextStatusChanged(
bool );
354 void keyPressEvent( QKeyEvent * e );
357 void keyReleaseEvent( QKeyEvent * e );
360 void mouseDoubleClickEvent( QMouseEvent * e );
363 void mouseMoveEvent( QMouseEvent * e );
366 void mousePressEvent( QMouseEvent * e );
369 void mouseReleaseEvent( QMouseEvent * e );
372 void wheelEvent( QWheelEvent * e );
375 void resizeEvent( QResizeEvent * e );
378 void paintEvent( QPaintEvent * e );
381 void moveCanvasContents(
bool reset =
false );
384 void updateCanvasItemPositions();
439 void connectNotify(
const char * signal );