5 #include <QtCore/QDebug>
6 #include <QtCore/QSettings>
7 #include <QtCore/QTimer>
8 #include <QtLocation/QGeoPositionInfo>
9 #include <QtLocation/QGeoPositionInfoSource>
11 using namespace QtMobility;
13 class GpsControl : public QObject {
16 GpsControl(QObject *parent = 0);
23 void setTimeOut(int sec);
25 void setInterval(int sec);
27 void setPositioningMethod(QString method);
28 QString getPositioningMethod() {return GpsSettings.value("gps_method").toString();}
30 void stopUpdates(bool force = false);
31 double getCurrentLatitude();
32 double getCurrentLongitude();
33 double getCurrentAccuracy();
34 unsigned int getCurrentTimestamp();
37 void setCurrentLocation(QGeoPositionInfo pos);
38 void onGotUpdate() { qDebug() << "* GpsControl::ongotUpdate"; }
39 void onGotFix() { qDebug() << "* GpsControl::ongotFix"; }
42 QSettings GpsSettings;
43 QGeoPositionInfoSource *GpsSource;
44 QGeoPositionInfo GpsPosition;
49 #endif // GPSCONTROL_H