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