Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qgeopositioninfosource_cl_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QGEOPOSITIONINFOSOURCECL_H
5#define QGEOPOSITIONINFOSOURCECL_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#import <CoreLocation/CoreLocation.h>
19
22
23QT_BEGIN_NAMESPACE
24
25class QGeoPositionInfoSourceCL : public QGeoPositionInfoSource
26{
27 Q_OBJECT
28public:
29 QGeoPositionInfoSourceCL(QObject *parent = 0);
30 ~QGeoPositionInfoSourceCL();
31
32 QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const override;
33 PositioningMethods supportedPositioningMethods() const override;
34
35 void setUpdateInterval(int msec) override;
36 int minimumUpdateInterval() const override;
37 Error error() const override;
38
39 void locationDataAvailable(QGeoPositionInfo location);
40 void setError(QGeoPositionInfoSource::Error positionError);
41 void changeAuthorizationStatus(CLAuthorizationStatus status);
42
43private:
44 bool enableLocationManager();
45 void setTimeoutInterval(int msec);
46
47public Q_SLOTS:
48 void startUpdates() override;
49 void stopUpdates() override;
50
51 void requestUpdate(int timeout = 0) override;
52
53protected:
54 void timerEvent(QTimerEvent *event) override;
55
56private:
57 Q_DISABLE_COPY(QGeoPositionInfoSourceCL);
58 CLLocationManager *m_locationManager;
59 bool m_updatesWanted;
60
61 QGeoPositionInfo m_lastUpdate;
62
63 int m_updateTimer;
64 int m_updateTimeout;
65
66 QGeoPositionInfoSource::Error m_positionError;
67};
68
69QT_END_NAMESPACE
70
71#endif // QGEOPOSITIONINFOSOURCECL_H
#define MINIMUM_UPDATE_INTERVAL