00001 /* 00002 Situare - A location system for Facebook 00003 Copyright (C) 2010 Ixonos Plc. Authors: 00004 00005 Jussi Laitinen - jussi.laitinen@ixonos.com 00006 00007 Situare is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU General Public License 00009 version 2 as published by the Free Software Foundation. 00010 00011 Situare is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with Situare; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00019 USA. 00020 */ 00021 00022 #ifndef GPSPOSITIONPRIVATELIBLOCATION_H 00023 #define GPSPOSITIONPRIVATELIBLOCATION_H 00024 00025 #include <QPointF> 00026 00027 #include "gpsposition.h" 00028 #include "geopositioninfo.h" 00029 00030 class LiblocationWrapper; 00031 00035 class GPSPositionPrivate : public QObject 00036 { 00037 Q_OBJECT 00038 00039 public: 00045 GPSPositionPrivate(QObject *parent); 00046 00047 /****************************************************************************** 00048 * MEMBER FUNCTIONS AND SLOTS 00049 ******************************************************************************/ 00050 public: 00056 bool isRunning(); 00057 00061 QPointF lastPosition(); 00062 00066 void requestLastPosition(); 00067 00075 void setMode(GPSPosition::Mode mode, const QString &filePath = 0); 00076 00082 void setUpdateInterval(int interval); 00083 00087 void start(); 00088 00092 void stop(); 00093 00094 private: 00102 qreal accuracy(const GeoPositionInfo &positionInfo); 00103 00104 private slots: 00105 00111 void positionUpdated(const GeoPositionInfo &positionInfo); 00112 00118 void locationError(const QString &errorMessage); 00119 00120 /******************************************************************************* 00121 * DATA MEMBERS 00122 ******************************************************************************/ 00123 private: 00124 LiblocationWrapper *m_liblocationWrapper; 00125 GPSPosition *m_parent; 00126 bool m_running; 00127 int m_updateInterval; 00128 }; 00129 00130 const int DEFAULT_UPDATE_INTERVAL = 5000; 00131 00132 #endif // GPSPOSITIONPRIVATELIBLOCATION_H