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 #include <QPointF> 00027 00028 class GPSPositionPrivate; 00029 00033 class GPSPosition : public QObject 00034 { 00035 Q_OBJECT 00036 00037 public: 00041 friend class GPSPositionPrivate; 00042 00048 GPSPosition(QObject *parent = 0); 00049 00053 enum Mode {Default, Simulation}; 00054 00055 /****************************************************************************** 00056 * MEMBER FUNCTIONS AND SLOTS 00057 ******************************************************************************/ 00058 public: 00064 bool isRunning(); 00065 00069 QPointF lastPosition(); 00070 00074 void requestLastPosition(); 00075 00083 void setMode(Mode mode, const QString &filePath = 0); 00084 00090 void setUpdateInterval(int interval); 00091 00095 void start(); 00096 00100 void stop(); 00101 00102 /****************************************************************************** 00103 * SIGNALS 00104 ******************************************************************************/ 00105 signals: 00111 void error(const QString &message); 00112 00119 void position(QPointF latLonCoordinate, qreal accuracy); 00120 00124 void timeout(); 00125 00126 /******************************************************************************* 00127 * DATA MEMBERS 00128 *******************************************************************************/ 00129 private: 00130 GPSPositionPrivate *m_gpsPositionPrivate; 00131 }; 00132 00133 #endif // GPSPOSITIONINTERFACE_H