QGIS API Documentation  2.11.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 
37 class CORE_EXPORT QgsQtLocationConnection: public QgsGPSConnection
38 {
39  Q_OBJECT
40  public:
43 
44  protected slots:
46  void broadcastConnectionAvailable();
47 
49  void parseData();
50 
54  void positionUpdated( const QGeoPositionInfo &info );
55 
59  void satellitesInViewUpdated( const QList<QGeoSatelliteInfo>& satellites );
60 
64  void satellitesInUseUpdated( const QList<QGeoSatelliteInfo>& satellites );
65 
66  private:
67  void startGPS();
68  void startSatelliteMonitor();
69  QString mDevice;
70  QGeoPositionInfo mInfo;
71  QPointer<QGeoPositionInfoSource> locationDataSource;
72  QPointer<QGeoSatelliteInfoSource> satelliteInfoSource;
73 
74 };
75 
76 #endif // QGSQTLOCATIONCONNECTION_H
virtual void parseData()=0
Parse available data source content.
Abstract base class for connection to a GPS device.