Initial version
[gpssportsniffer] / tilesMap.h
index 0858489..834581b 100755 (executable)
@@ -1,3 +1,22 @@
+/****************************************************************************
+**
+**  Copyright (C) 2011  Tito Eritja Real <jtitoo@gmail.com>
+**
+**  This program is free software: you can redistribute it and/or modify
+**  it under the terms of the GNU General Public License as published by
+**  the Free Software Foundation, either version 3 of the License, or
+**  (at your option) any later version.
+**
+**  This program is distributed in the hope that it will be useful,
+**  but WITHOUT ANY WARRANTY; without even the implied warranty of
+**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+**  GNU General Public License for more details.
+**
+**  You should have received a copy of the GNU General Public License
+**  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+**
+****************************************************************************/
+
 #ifndef TILESMAP_H
 #define TILESMAP_H
 
@@ -20,8 +39,7 @@
 // Use the QtMobility namespace
 QTM_USE_NAMESPACE
 
-// tile size in pixels
-const int tdim=256;
+
 
 class TileRequest{
 
@@ -29,14 +47,16 @@ public:
 
     QDateTime dateTime;
     bool save;
+    bool downloading;
     int zoom;
 
     TileRequest(){}
 
-    TileRequest(int z, QDateTime time, bool s){
+    TileRequest(int z, QDateTime time, bool s, bool d){
         dateTime=time;
         save=s;
         zoom=z;
+        downloading=d;
     }
 
 };
@@ -81,6 +101,9 @@ public:
     inline void setMapType(MapType m){mapType=m;}
     inline MapType getMapType(){return mapType;}
 
+    inline bool isCacheEnabled(){return cache;}
+    inline void setIsCacheEnabled(bool value){cache=value;}
+
     //inline void setLatitude(qreal lat){latitude=lat;}
     inline qreal getLatitude(){return latitude;}
 
@@ -97,6 +120,7 @@ public:
     void updateTiles();
     void updateTiles(qreal lat, qreal lng);
 
+    void cancelDownloading();
     int downloadMaps(Track* track_p);
     void downloadTiles(qreal lat, qreal lng, int zoom, int* numTiles);
     void downloadWindow(int *numTiles, int zoom);
@@ -127,6 +151,7 @@ private:
     int height;
 
     int tilesD;
+    bool cache;
 
     qreal latitude;
     qreal longitude;