QGIS API Documentation  3.8.0-Zanzibar (11aff65)
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() override;
62 
67  void positionUpdated( const QGeoPositionInfo &info ) SIP_SKIP;
68 
69 #ifdef SIP_RUN
70  SIP_IF_FEATURE( !ANDROID )
71 #endif
72 
77  void satellitesInViewUpdated( const QList<QGeoSatelliteInfo> &satellites );
78 
83  void satellitesInUseUpdated( const QList<QGeoSatelliteInfo> &satellites );
84 
85 #ifdef SIP_RUN
86  SIP_END
87 #endif
88 
89  private:
90  void startGPS();
91  void startSatelliteMonitor();
92  QString mDevice;
93  QGeoPositionInfo mInfo;
94  QPointer<QGeoPositionInfoSource> locationDataSource;
95  QPointer<QGeoSatelliteInfoSource> satelliteInfoSource;
96 
97 };
98 
99 SIP_END // MOBILITY_LOCATION
100 
101 #endif // QGSQTLOCATIONCONNECTION_H
#define SIP_SKIP
Definition: qgis_sip.h:119
#define SIP_END
Definition: qgis_sip.h:182
#define SIP_IF_FEATURE(feature)
Definition: qgis_sip.h:155
#define SIP_FEATURE(feature)
Definition: qgis_sip.h:150
Abstract base class for connection to a GPS device.