QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
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 "qgsgpsconnection.h"
22 
23 #include <QtCore/QPointer>
24 
25 #if defined(HAVE_QT_MOBILITY_LOCATION )
26 #include <QtLocation/QGeoPositionInfoSource>
27 #include <QtLocation/QGeoSatelliteInfo>
28 #include <QtLocation/QGeoSatelliteInfoSource>
29 
30 QTM_USE_NAMESPACE
31 #else // Using QtPositioning
32 #include <QtPositioning/QGeoPositionInfoSource>
33 #include <QtPositioning/QGeoSatelliteInfo>
34 #include <QtPositioning/QGeoSatelliteInfoSource>
35 #endif
36 
42 class CORE_EXPORT QgsQtLocationConnection: public QgsGPSConnection
43 {
44  Q_OBJECT
45  public:
48 
49  protected slots:
51  void broadcastConnectionAvailable();
52 
54  void parseData();
55 
59  void positionUpdated( const QGeoPositionInfo &info );
60 
64  void satellitesInViewUpdated( const QList<QGeoSatelliteInfo>& satellites );
65 
69  void satellitesInUseUpdated( const QList<QGeoSatelliteInfo>& satellites );
70 
71  private:
72  void startGPS();
73  void startSatelliteMonitor();
74  QString mDevice;
75  QGeoPositionInfo mInfo;
76  QPointer<QGeoPositionInfoSource> locationDataSource;
77  QPointer<QGeoSatelliteInfoSource> satelliteInfoSource;
78 
79 };
80 
81 #endif // QGSQTLOCATIONCONNECTION_H
virtual void parseData()=0
Parse available data source content.
Abstract base class for connection to a GPS device.