Added missing files to pro file
[speedfreak] / Client / maemo5location.cpp
1 /*
2  * Maemo5Location
3  *
4  * @author     Toni Jussila <toni.jussila@fudeco.com>
5  * @copyright  (c) 2010 Speed Freak team
6  * @license    http://opensource.org/licenses/gpl-license.php GNU Public License
7  */
8
9 //#ifdef Q_WS_MAEMO_5
10 #include "maemo5locationprivate.h"
11 #include "maemo5location.h"
12
13 /**
14   *Default constructor of this class.
15   *@param QObject pointer to parent object. By default the value is NULL.
16   */
17 Maemo5Location::Maemo5Location(QObject* parent):QObject(parent)
18 {
19     ptr = new Maemo5LocationPrivate(this);
20
21     connect(ptr,SIGNAL(agnss()),this,SIGNAL(agnss()));
22     connect(ptr,SIGNAL(awcp()),this,SIGNAL(awcp()));
23     connect(ptr,SIGNAL(locationUpdated()),this,SIGNAL(locationUpdated()));
24     connect(ptr, SIGNAL(gps_connected()), this, SIGNAL(gps_connected()));
25     connect(ptr, SIGNAL(gps_disconnected()), this, SIGNAL(gps_disconnected()));
26     connect(ptr, SIGNAL(gps_err(int)), this, SIGNAL(gps_error(int)));
27     connect(ptr, SIGNAL(gpsd_running()), this, SIGNAL(gpsd_running()));
28     connect(ptr, SIGNAL(gpsd_stopped()), this, SIGNAL(gpsd_stopped()));
29
30     ptr->get_agnss();
31 }
32
33 /**
34   *Destructor of this class. Should be used to release all allocated resources.
35   */
36 Maemo5Location::~Maemo5Location()
37 {
38     delete ptr;
39 }
40
41 /**
42   *Returns latitude.
43   */
44 double Maemo5Location::getLatitude()
45 {
46     return ptr->get_lat();
47 }
48
49 /**
50   *Returns longitude.
51   */
52 double Maemo5Location::getLongitude()
53 {
54     return ptr->get_lon();
55 }
56
57 /**
58   *Returns number of satellites in use.
59   */
60 int Maemo5Location::getSatellitesInUse()
61 {
62     return ptr->get_satellites_in_use();
63 }
64
65 /**
66   *Returns number of satellites in view.
67   */
68 int Maemo5Location::getSatellitesInView()
69 {
70     return ptr->get_satellites_in_view();
71 }
72
73 /**
74   *Returns average signal strength of satellites which are in use.
75   */
76 int Maemo5Location::getSignalStrength()
77 {
78     return ptr->get_signal_strength();
79 }
80
81 /**
82   *Returns timestamp of the update in seconds.
83   */
84 double Maemo5Location::getTime()
85 {
86     return ptr->get_time();
87 }
88
89 /**
90   *Returns time accuracy in seconds.
91   */
92 double Maemo5Location::getEpt()
93 {
94     return ptr->get_ept();
95 }
96
97 /**
98   *Returns horizontal position accuracy in cm.
99   */
100 double Maemo5Location::getEph()
101 {
102     return ptr->get_eph();
103 }
104
105 /**
106   *Returns fix altitude in meters.
107   */
108 double Maemo5Location::getAltitude()
109 {
110     return ptr->get_altitude();
111 }
112
113 /**
114   *Returns altitude accuracy in meters.
115   */
116 double Maemo5Location::getEpv()
117 {
118     return ptr->get_epv();
119 }
120
121 /**
122   *Returns direction of motion in degrees(0-359).
123   */
124 double Maemo5Location::getTrack()
125 {
126     return ptr->get_track();
127 }
128
129 /**
130   *Returns track accuracy in degrees.
131   */
132 double Maemo5Location::getEpd()
133 {
134     return ptr->get_epd();
135 }
136
137 /**
138   *Returns current speed in km/h.
139   */
140 double Maemo5Location::getSpeed()
141 {
142     return ptr->get_speed();
143 }
144
145 /**
146   *Returns speed accuracy in km/h.
147   */
148 double Maemo5Location::getEps()
149 {
150     return ptr->get_eps();
151 }
152
153 /**
154   *Returns current rate of climb in m/s.
155   */
156 double Maemo5Location::getClimb()
157 {
158     return ptr->get_climb();
159 }
160
161 /**
162   *Returns climb accuracy in m/s.
163   */
164 double Maemo5Location::getEpc()
165 {
166     return ptr->get_epc();
167 }
168
169 /**
170   *Returns distance between two points in kilometers.
171   *@param latitude of first point
172   *@param longitude of first point
173   *@param latitude of second point
174   *@param longitude of second point
175   */
176 double Maemo5Location::distance_between_two_points(double latitude_s, double longitude_s, double latitude_f, double longitude_f)
177 {
178     return ptr->distance_between_two_points(latitude_s, longitude_s, latitude_f, longitude_f);
179 }