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,
25 #include <QGeoPositionInfo>
26 #include <QGeoPositionInfoSource>
27 #include <QNmeaPositionInfoSource>
30 #include "gpspositioninterface.h"
35 * @brief GPSPosition class use GPS to receive location information.
37 * @class GPSPosition gpsposition.h "gps/gpsposition.h"
39 class GPSPosition : public GPSPositionInterface
45 * @brief Constructor creates GPS source.
47 * @param parent QObject
49 GPSPosition(QObject *parent = 0);
52 * @brief Destructor stops GPS.
56 /******************************************************************************
57 * MEMBER FUNCTIONS AND SLOTS
58 ******************************************************************************/
61 * @brief Checks if GPS is running.
63 * @return true if GPS running, false otherwise
68 * @brief Informs gps to emit last known position.
73 * @brief Set GPS mode.
75 * Modes: default and simulation.
76 * @param mode GPS mode
77 * @param filePath file path to NMEA file if simulation mode is used
79 void setMode(Mode mode, const QString &filePath = 0);
82 * @brief Set GPS update interval
84 * @return interval interval in milliseconds
86 void setUpdateInterval(int interval);
100 * @brief Return bigger accuracy value from latitude and longitude values.
102 * @param positionInfo geo position info
103 * @return bigger accuracy value, -1 if undefined
105 qreal biggerAccuracy(QGeoPositionInfo positionInfo);
110 * @brief Slot for received position update.
112 * @param positionInfo Geo position info.
114 void positionUpdated(QGeoPositionInfo positionInfo);
117 * @brief Slot for GPS update request.
122 * @brief Slot for update timeout.
124 * Called when request timeout occurs.
126 void updateTimeout();
129 QGeoPositionInfoSource *m_gpsSource; ///< GPS position info source
130 bool m_running; ///< GPS is running
131 int m_updateInterval; ///< GPS update interval
134 const int DEFAULT_UPDATE_INTERVAL = 5000; ///< Default update interval
136 #endif // GPSPOSITION_H