48dd60a62147018048645df7150d73e541a571cb
[situare] / src / gps / gpsposition.cpp
1 /*
2    Situare - A location system for Facebook
3    Copyright (C) 2010  Ixonos Plc. Authors:
4
5        Jussi Laitinen - jussi.laitinen@ixonos.com
6
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.
10
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.
15
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,
19    USA.
20 */
21
22 #include <QDebug>
23
24 #include "gpsposition.h"
25
26 #if defined(Q_WS_MAEMO_5) && !defined(Q_WS_SIMULATOR)
27 #include "gpspositionprivateliblocation.h"
28 #elif defined(Q_WS_SIMULATOR)
29 #include "gpspositionprivate.h"
30 #else
31 #include "gpspositionprivatestub.h"
32 #endif
33
34 GPSPosition::GPSPosition(QObject *parent)
35     : QObject(parent),
36       m_gpsPositionPrivate(0)
37 {
38     qDebug() << __PRETTY_FUNCTION__;
39
40     m_gpsPositionPrivate = new GPSPositionPrivate(this);
41 }
42
43 bool GPSPosition::isInitialized()
44 {
45     qDebug() << __PRETTY_FUNCTION__;
46
47     return m_gpsPositionPrivate->isInitialized();
48 }
49
50 bool GPSPosition::isRunning()
51 {
52     qDebug() << __PRETTY_FUNCTION__;
53
54     return m_gpsPositionPrivate->isRunning();
55 }
56
57 QPointF GPSPosition::lastPosition()
58 {
59     qDebug() << __PRETTY_FUNCTION__;
60
61     return m_gpsPositionPrivate->lastPosition();
62 }
63
64 void GPSPosition::requestLastPosition()
65 {
66     qDebug() << __PRETTY_FUNCTION__;
67
68     m_gpsPositionPrivate->requestLastPosition();
69 }
70
71 void GPSPosition::setMode(Mode mode, const QString &filePath)
72 {
73     qDebug() << __PRETTY_FUNCTION__;
74
75     m_gpsPositionPrivate->setMode(mode, filePath);
76 }
77
78 void GPSPosition::setUpdateInterval(int interval)
79 {
80     qDebug() << __PRETTY_FUNCTION__;
81
82     m_gpsPositionPrivate->setUpdateInterval(interval);
83 }
84
85 void GPSPosition::start()
86 {
87     qDebug() << __PRETTY_FUNCTION__;
88
89     m_gpsPositionPrivate->start();
90 }
91
92 void GPSPosition::stop()
93 {
94     qDebug() << __PRETTY_FUNCTION__;
95
96     m_gpsPositionPrivate->stop();
97 }