Conflict fixed: mainwindow.cpp and httpclient.cpp
[speedfreak] / Client / maemo5locationprivate.h
1 /*
2  * Maemo5LocationPrivate
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 #ifndef MAEMO5LOCATIONPRIVATE_H
10 #define MAEMO5LOCATIONPRIVATE_H
11
12 //We have to declare these header file inside extern, since these modules are actually c modules not c++
13 extern "C"
14 {
15 #include <location/location-gps-device.h>
16 #include <location/location-gpsd-control.h>
17 #include <location/location-distance-utils.h>
18 }
19
20 #include <QObject>
21 #include "maemo5location.h"
22
23 class Maemo5LocationPrivate : public QObject
24 {
25     Q_OBJECT
26
27 public:
28     Maemo5LocationPrivate(Maemo5Location* location);
29     ~Maemo5LocationPrivate();
30
31     void get_acwp();
32     void get_agnss();
33
34     friend void gps_data_changed(LocationGPSDevice *device, Maemo5LocationPrivate *gps);
35     friend void gps_connected_func(LocationGPSDevice *device, Maemo5LocationPrivate *gps);
36     friend void gps_disconnected_func(LocationGPSDevice *device, Maemo5LocationPrivate *gps);
37     friend void gps_error_func(LocationGPSDControl *control, gint error, Maemo5LocationPrivate *gps);
38     friend void gpsd_running_func(LocationGPSDControl *control, Maemo5LocationPrivate *gps);
39     friend void gpsd_stopped_func(LocationGPSDControl *control, Maemo5LocationPrivate *gps);
40
41     static void handleStatus( LocationGPSDeviceStatus status );
42
43     int get_satellites_in_view() { return satellites_in_view; }
44     int get_satellites_in_use() { return satellites_in_use; }
45     int get_signal_strength() { return signal_strength; }
46     gboolean get_gps_online() { return gps_online; }
47     double get_lat() { return latitude; }
48     double get_lon() { return longitude; }
49     double get_time() { return time; }
50     double get_ept() { return ept; }
51     double get_eph() { return eph; }
52     double get_altitude() { return altitude; }
53     double get_epv() { return epv; }
54     double get_track() { return track; }
55     double get_epd() { return epd; }
56     double get_speed() { return speed; }
57     double get_eps() { return eps; }
58     double get_climb() { return climb; }
59     double get_epc() { return epc; }
60     double distance_between_two_points(double latitude_s, double longitude_s, double latitude_f, double longitude_f);
61     void stop();
62
63 signals:
64     void awcp();
65     void agnss();
66     void locationUpdated();
67     void gps_connected();
68     void gps_disconnected();
69     void gps_error(int);
70     void gpsd_running();
71     void gpsd_stopped();
72
73 private:
74     void resetAll();
75     //void stop();
76     void restart();
77
78     int satellites_in_view;
79     int satellites_in_use;
80     int signal_strength;
81     gboolean gps_online;
82     double latitude;
83     double longitude;
84     double time;
85     double ept;
86     double eph;
87     double altitude;
88     double epv;
89     double track;
90     double epd;
91     double speed;
92     double eps;
93     double climb;
94     double epc;
95
96     Maemo5Location* d_ptr;
97     int usegps;
98     LocationGPSDControl *control;
99     LocationGPSDevice *device;
100 };
101
102 void gps_data_changed(LocationGPSDevice *device, Maemo5LocationPrivate *gps);
103 void gps_connected_func(LocationGPSDevice *device, Maemo5LocationPrivate *gps);
104 void gps_disconnected_func(LocationGPSDevice *device, Maemo5LocationPrivate *gps);
105 void gps_error_func(LocationGPSDControl *control, gint error, Maemo5LocationPrivate *gps);
106 void gpsd_running_func(LocationGPSDControl *control, Maemo5LocationPrivate *gps);
107 void gpsd_stopped_func(LocationGPSDControl *control, Maemo5LocationPrivate *gps);
108
109 #endif // MAEMO5LOCATIONPRIVATE_H