2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Jussi Laitinen - jussi.laitinen@ixonos.com
7 Situare is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 version 2 as published by the Free Software Foundation.
11 Situare is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Situare; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
22 #ifndef GPSPOSITIONPRIVATE_H
23 #define GPSPOSITIONPRIVATE_H
27 #include <QGeoPositionInfo>
28 #include <QGeoPositionInfoSource>
29 #include <QNmeaPositionInfoSource>
31 #include "gpsposition.h"
36 * @brief GPSPositionPrivate class use GPS to receive location information.
38 class GPSPositionPrivate : public QObject
44 * @brief Constructor creates GPS source.
46 * @param parent QObject
48 GPSPositionPrivate(QObject *parent);
50 /******************************************************************************
51 * MEMBER FUNCTIONS AND SLOTS
52 ******************************************************************************/
55 * @brief Checks if GPS is running.
57 * @return true if GPS running, false otherwise
62 * @brief Return last known position.
64 QPointF lastPosition();
67 * @brief Informs gps to emit last known position.
69 void requestLastPosition();
72 * @brief Set GPS mode.
74 * Modes: default and simulation.
75 * @param mode GPS mode
76 * @param filePath file path to NMEA file if simulation mode is used
78 void setMode(GPSPosition::Mode mode, const QString &filePath = 0);
81 * @brief Set GPS update interval
83 * @return interval interval in milliseconds
85 void setUpdateInterval(int interval);
99 * @brief Return horizontal accuracy
101 * @param positionInfo geo position info
102 * @return accuracy value, -1 if undefined. Returns -1 also is timestamp is not valid
103 * (when using network positioning)
105 qreal accuracy(const QGeoPositionInfo &positionInfo);
110 * @brief Slot for received position update.
112 * @param positionInfo Geo position info.
114 void positionUpdated(const QGeoPositionInfo &positionInfo);
117 * @brief Slot for update timeout.
119 * Called when request timeout occurs.
121 void updateTimeout();
123 /*******************************************************************************
125 ******************************************************************************/
127 QGeoPositionInfoSource *m_gpsSource; ///< GPS position info source
128 GPSPosition *m_parent; ///< Parent object
129 bool m_running; ///< GPS is running
130 int m_updateInterval; ///< GPS update interval
133 const int DEFAULT_UPDATE_INTERVAL = 5000; ///< Default update interval
135 #endif // GPSPOSITIONPRIVATE_H