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 <QGeoPositionInfoSource>
28 #include "gpspositioninterface.h"
33 * @brief GPSPosition class use GPS to receive location information.
35 * @class GPSPosition gpsposition.h "gps/gpsposition.h"
37 class GPSPosition : public GPSPositionInterface
43 * @brief Constructor creates GPS source.
45 * @param parent QObject
47 GPSPosition(QObject *parent = 0);
50 * @brief Destructor stops GPS.
54 /******************************************************************************
55 * MEMBER FUNCTIONS AND SLOTS
56 ******************************************************************************/
59 * @brief Checks if GPS is running.
61 * @return true if GPS running, false otherwise
66 * @brief Informs gps to emit last known position.
71 * @brief Set GPS update interval
73 * @return interval interval in milliseconds
75 void setUpdateInterval(int interval);
89 * @brief Return bigger accuracy value from latitude and longitude values.
91 * @param positionInfo geo position info
92 * @return bigger accuracy value, -1 if undefined
94 qreal biggerAccuracy(QGeoPositionInfo positionInfo);
99 * @brief Slot for received position update.
101 * @param positionInfo Geo position info.
103 void positionUpdated(QGeoPositionInfo positionInfo);
106 * @brief Slot for GPS update request.
111 * @brief Slot for update timeout.
113 * Called when request timeout occurs.
115 void updateTimeout();
118 QGeoPositionInfoSource *m_gpsSource; ///< GPS position info source
119 bool m_running; ///< GPS is running
120 int m_updateInterval; ///< GPS update interval
123 const int DEFAULT_UPDATE_INTERVAL = 5000; ///< Default update interval
125 #endif // GPSPOSITION_H