00001 #ifndef LOCATIONCACHE_H_
00002 #define LOCATIONCACHE_H_
00003
00004 #include <qgeocoordinate.h>
00005
00006 #include <QString>
00007 #include <QHash>
00008 #include <QList>
00009
00010 #include "Wigle.h"
00011
00012 QTM_USE_NAMESPACE
00013
00014
00018 class LocationCache : public QObject
00019 {
00020 Q_OBJECT
00021
00022 public:
00023 LocationCache(QObject *parent =0);
00024 virtual ~LocationCache();
00025
00026 void add(QString mac, QGeoCoordinate pos);
00027 QGeoCoordinate getCacheCenter();
00028
00029 void updateCache();
00030 void reset();
00031 void init();
00032
00033 QGeoCoordinate getPos(QString mac);
00034 QGeoCoordinate getPos(QList<QString> macs);
00035
00036
00037 public slots:
00038 void addCache(QHash<QString, QGeoCoordinate>);
00039 void setCacheRegion(QGeoCoordinate center);
00040
00041 signals:
00042 void cacheDone(QString src);
00043
00044 private:
00045
00046
00047 void readFromFile();
00048 void writeToFile();
00049 Wigle* wigle;
00050
00051 double homeLat1,homeLat2, homeLng1, homeLng2;
00052 QHash<QString, QGeoCoordinate> cache;
00053
00054 };
00055
00056 #endif