#include "gpsposition.h"
#include "geopositioninfo.h"
+class QTimer;
class LiblocationWrapper;
/**
******************************************************************************/
public:
/**
+ * @brief Returns is GPS initialized.
+ *
+ * @return true if initialized, false otherwise
+ */
+ bool isInitialized();
+
+ /**
* @brief Checks if GPS is running.
*
* @return true if GPS running, false otherwise
void requestLastPosition();
/**
+ * @brief Requests update from GPS.
+ *
+ * Enables GPS if it is disabled
+ */
+ void requestUpdate();
+
+ /**
* @brief Set GPS mode.
*
* Modes: default and simulation.
void setMode(GPSPosition::Mode mode, const QString &filePath = 0);
/**
+ * @brief Sets power save mode.
+ *
+ * Starts GPS for position update and then stops it.
+ */
+ void setPowerSave(bool enabled);
+
+ /**
* @brief Set GPS update interval
*
* @return interval interval in milliseconds
qreal accuracy(const GeoPositionInfo &positionInfo);
private slots:
+ /**
+ * @brief Start power save.
+ */
+ void delayedPowerSaveStart();
/**
* @brief Slot for received position update.
private:
LiblocationWrapper *m_liblocationWrapper; ///< Liblocation wrapper object
GPSPosition *m_parent; ///< Parent object
+ bool m_initialized; ///< GPS is initialized
+ bool m_powerSave; ///< Power save flag
bool m_running; ///< GPS is running
int m_updateInterval; ///< GPS update interval
+ QTimer *m_delayedPowerSaveTimer; ///< Delayed power save timer
};
const int DEFAULT_UPDATE_INTERVAL = 5000; ///< Default update interval