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 GPSPOSITION_H 00023 #define GPSPOSITION_H 00024 00025 #include <QObject> 00026 00027 #include "coordinates/geocoordinate.h" 00028 00029 class GPSPositionPrivate; 00030 00034 class GPSPosition : public QObject 00035 { 00036 Q_OBJECT 00037 00038 public: 00042 friend class GPSPositionPrivate; 00043 00049 GPSPosition(QObject *parent = 0); 00050 00054 enum Mode {Default, Simulation}; 00055 00056 /****************************************************************************** 00057 * MEMBER FUNCTIONS AND SLOTS 00058 ******************************************************************************/ 00059 public: 00065 void enablePowerSave(bool enabled); 00066 00072 bool isInitialized() const; 00073 00079 bool isRunning() const; 00080 00084 GeoCoordinate lastPosition() const; 00085 00089 void requestLastPosition(); 00090 00096 void requestUpdate(); 00097 00105 void setMode(Mode mode, const QString &filePath = 0); 00106 00112 void setUpdateInterval(int interval); 00113 00117 void start(); 00118 00122 void stop(); 00123 00124 /****************************************************************************** 00125 * SIGNALS 00126 ******************************************************************************/ 00127 signals: 00134 void error(const int context, const int error); 00135 00142 void position(GeoCoordinate coordinate, qreal accuracy); 00143 00147 void timeout(); 00148 00149 /******************************************************************************* 00150 * DATA MEMBERS 00151 *******************************************************************************/ 00152 private: 00153 GPSPositionPrivate *m_gpsPositionPrivate; 00154 }; 00155 00156 #endif // GPSPOSITIONINTERFACE_H