QGIS API Documentation  3.18.1-Zürich (202f1bf7e5)
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 
51 class CORE_EXPORT QgsQtLocationConnection: public QgsGpsConnection
52 {
53  Q_OBJECT
54  public:
56 
57  protected slots:
59  void broadcastConnectionAvailable();
60 
62  void parseData() override;
63 
68  void positionUpdated( const QGeoPositionInfo &info ) SIP_SKIP;
69 
70 #ifdef SIP_RUN
71  SIP_IF_FEATURE( !ANDROID )
72 #endif
73 
78  void satellitesInViewUpdated( const QList<QGeoSatelliteInfo> &satellites );
79 
84  void satellitesInUseUpdated( const QList<QGeoSatelliteInfo> &satellites );
85 
86 #ifdef SIP_RUN
87  SIP_END
88 #endif
89 
90  private:
91  void startGPS();
92  void startSatelliteMonitor();
93  QString mDevice;
94  QGeoPositionInfo mInfo;
95  QPointer<QGeoPositionInfoSource> locationDataSource;
96  QPointer<QGeoSatelliteInfoSource> satelliteInfoSource;
97 
98 };
99 
100 SIP_END // MOBILITY_LOCATION
101 
102 #endif // QGSQTLOCATIONCONNECTION_H
Abstract base class for connection to a GPS device.
A GPS connection subclass based on the Qt Location libraries.
#define SIP_SKIP
Definition: qgis_sip.h:126
#define SIP_IF_FEATURE(feature)
Definition: qgis_sip.h:167
#define SIP_FEATURE(feature)
Definition: qgis_sip.h:162
#define SIP_END
Definition: qgis_sip.h:194