QGIS API Documentation  2.15.0-Master (af20121)
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 
41 class CORE_EXPORT QgsQtLocationConnection: public QgsGPSConnection
42 {
43  Q_OBJECT
44  public:
47 
48  protected slots:
50  void broadcastConnectionAvailable();
51 
53  void parseData();
54 
58  void positionUpdated( const QGeoPositionInfo &info );
59 
63  void satellitesInViewUpdated( const QList<QGeoSatelliteInfo>& satellites );
64 
68  void satellitesInUseUpdated( const QList<QGeoSatelliteInfo>& satellites );
69 
70  private:
71  void startGPS();
72  void startSatelliteMonitor();
73  QString mDevice;
74  QGeoPositionInfo mInfo;
75  QPointer<QGeoPositionInfoSource> locationDataSource;
76  QPointer<QGeoSatelliteInfoSource> satelliteInfoSource;
77 
78 };
79 
80 #endif // QGSQTLOCATIONCONNECTION_H
virtual void parseData()=0
Parse available data source content.
Abstract base class for connection to a GPS device.