Quantum GIS API Documentation  1.8
src/gui/qgsmaptooltouch.h
Go to the documentation of this file.
00001 /***************************************************************************
00002     qgsmaptooltouch.h  -  map tool for zooming and panning using qgestures
00003     ----------------------
00004     begin                : February 2012
00005     copyright            : (C) 2012 by Marco Bernasocchi
00006     email                : marco at bernawebdesign.ch
00007  ***************************************************************************
00008  *                                                                         *
00009  *   This program is free software; you can redistribute it and/or modify  *
00010  *   it under the terms of the GNU General Public License as published by  *
00011  *   the Free Software Foundation; either version 2 of the License, or     *
00012  *   (at your option) any later version.                                   *
00013  *                                                                         *
00014  ***************************************************************************/
00015 
00016 #ifndef QGSMAPTOOLTOUCH_H
00017 #define QGSMAPTOOLTOUCH_H
00018 
00019 #include "qgsmaptool.h"
00020 #include <QGestureEvent>
00021 #include <QPinchGesture>
00022 
00023 class QgsMapCanvas;
00024 
00025 
00030 class GUI_EXPORT QgsMapToolTouch : public QgsMapTool
00031 {
00032   public:
00034     QgsMapToolTouch( QgsMapCanvas* canvas );
00035 
00036     ~QgsMapToolTouch();
00037 
00038     void activate();
00039     void deactivate();
00040 
00042     virtual void canvasMoveEvent( QMouseEvent * e );
00043 
00045     virtual void canvasReleaseEvent( QMouseEvent * e );
00046 
00048     virtual void canvasDoubleClickEvent( QMouseEvent * e );
00049 
00050     virtual bool isTransient() { return true; }
00051 
00052   private:
00053 
00055     bool mDragging;
00057     bool mPinching;
00058     bool gestureEvent( QGestureEvent *event );
00059     void pinchTriggered( QPinchGesture *gesture );
00060 };
00061 
00062 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines