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,
27 #include "coordinates/geocoordinate.h"
29 class GPSPositionPrivate;
32 * @brief GPSPosition class is an interface for GPS.
34 class GPSPosition : public QObject
40 * @brief Friend class for GPSPosition.
42 friend class GPSPositionPrivate;
47 * @param parent QObject
49 GPSPosition(QObject *parent = 0);
52 * @brief GPS position mode.
54 enum Mode {Default, Simulation};
56 /******************************************************************************
57 * MEMBER FUNCTIONS AND SLOTS
58 ******************************************************************************/
61 * @brief Enables power save mode.
63 * Starts GPS for position update and then stops it.
65 void enablePowerSave(bool enabled);
68 * @brief Returns is GPS initialized.
70 * @return true if initialized, false otherwise
72 bool isInitialized() const;
75 * @brief Checks if GPS is running.
77 * @return true if GPS running, false otherwise
79 bool isRunning() const;
82 * @brief Return last known position.
84 GeoCoordinate lastPosition() const;
87 * @brief Informs gps to emit last known position.
89 void requestLastPosition();
92 * @brief Requests update from GPS.
94 * Enables GPS if it is disabled
99 * @brief Set GPS mode.
101 * Modes: default and simulation.
102 * @param mode GPS mode
103 * @param filePath file path to NMEA file if simulation mode is used
105 void setMode(Mode mode, const QString &filePath = 0);
108 * @brief Set GPS update interval
110 * @return interval interval in milliseconds
112 void setUpdateInterval(int interval);
124 /******************************************************************************
126 ******************************************************************************/
129 * @brief Signals error
131 * @param context error context
132 * @param error error code
134 void error(const int context, const int error);
137 * @brief Signal for position information.
139 * @param coordinate latitude and longitude values
140 * @param accuracy accuracy in metres
142 void position(GeoCoordinate coordinate, qreal accuracy);
145 * @brief Signal for timeout.
149 /*******************************************************************************
151 *******************************************************************************/
153 GPSPositionPrivate *m_gpsPositionPrivate; ///< GPSPositionPrivate object
156 #endif // GPSPOSITIONINTERFACE_H