QGIS API Documentation  2.99.0-Master (01468d0)
qgsqtlocationconnection.h
Go to the documentation of this file.
1 /***************************************************************************
2  QgsQtLocationConnection.h - description
3  -------------------
4  begin : December 7th, 2011
5  copyright : (C) 2011 by Marco Bernasocchi, Bernawebdesign.ch
6  email : marco at bernawebdesign dot ch
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSQTLOCATIONCONNECTION_H
19 #define QGSQTLOCATIONCONNECTION_H
20 
21 #include "qgis_core.h"
22 #include "qgis_sip.h"
23 #include "qgsgpsconnection.h"
24 
25 #include <QtCore/QPointer>
26 
27 #ifndef SIP_RUN
28 #if defined(HAVE_QT_MOBILITY_LOCATION )
29 #include <QtLocation/QGeoPositionInfoSource>
30 #include <QtLocation/QGeoSatelliteInfo>
31 #include <QtLocation/QGeoSatelliteInfoSource>
32 
33 QTM_USE_NAMESPACE
34 #else // Using QtPositioning
35 #include <QtPositioning/QGeoPositionInfoSource>
36 #include <QtPositioning/QGeoSatelliteInfo>
37 #include <QtPositioning/QGeoSatelliteInfoSource>
38 #endif
39 #endif
40 
41 SIP_FEATURE( MOBILITY_LOCATION )
42 
43 SIP_IF_FEATURE( MOBILITY_LOCATION )
44 
45 
50 class CORE_EXPORT QgsQtLocationConnection: public QgsGPSConnection
51 {
52  Q_OBJECT
53  public:
55 
56  protected slots:
58  void broadcastConnectionAvailable();
59 
61  void parseData();
62 
66  void positionUpdated( const QGeoPositionInfo &info ) SIP_SKIP;
67 
68 #ifdef SIP_RUN
69  SIP_IF_FEATURE( !ANDROID )
70 #endif
71 
75  void satellitesInViewUpdated( const QList<QGeoSatelliteInfo> &satellites );
76 
80  void satellitesInUseUpdated( const QList<QGeoSatelliteInfo> &satellites );
81 
82 #ifdef SIP_RUN
83  SIP_END
84 #endif
85 
86  private:
87  void startGPS();
88  void startSatelliteMonitor();
89  QString mDevice;
90  QGeoPositionInfo mInfo;
91  QPointer<QGeoPositionInfoSource> locationDataSource;
92  QPointer<QGeoSatelliteInfoSource> satelliteInfoSource;
93 
94 };
95 
96 SIP_END // MOBILITY_LOCATION
97 
98 #endif // QGSQTLOCATIONCONNECTION_H
#define SIP_SKIP
Definition: qgis_sip.h:119
Abstract base class for connection to a GPS device.
#define SIP_END
Definition: qgis_sip.h:175
#define SIP_IF_FEATURE(feature)
Definition: qgis_sip.h:155
#define SIP_FEATURE(feature)
Definition: qgis_sip.h:150