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// Qt-Security score:significant reason:default
4
5#ifndef QGEOPOSITIONINFOSOURCECL_H
6#define QGEOPOSITIONINFOSOURCECL_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#import <CoreLocation/CoreLocation.h>
20
23
24QT_BEGIN_NAMESPACE
25
26class QGeoPositionInfoSourceCL : public QGeoPositionInfoSource
27{
28 Q_OBJECT
29public:
30 QGeoPositionInfoSourceCL(QObject *parent = 0);
31 ~QGeoPositionInfoSourceCL();
32
33 QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const override;
34 PositioningMethods supportedPositioningMethods() const override;
35
36 void setUpdateInterval(int msec) override;
37 int minimumUpdateInterval() const override;
38 Error error() const override;
39
40 void locationDataAvailable(QGeoPositionInfo location);
41 void setError(QGeoPositionInfoSource::Error positionError);
42 void changeAuthorizationStatus(CLAuthorizationStatus status);
43
44private:
45 bool enableLocationManager();
46 void setTimeoutInterval(int msec);
47
48public Q_SLOTS:
49 void startUpdates() override;
50 void stopUpdates() override;
51
52 void requestUpdate(int timeout = 0) override;
53
54protected:
55 void timerEvent(QTimerEvent *event) override;
56
57private:
58 Q_DISABLE_COPY(QGeoPositionInfoSourceCL);
59 CLLocationManager *m_locationManager;
60 bool m_updatesWanted;
61
62 QGeoPositionInfo m_lastUpdate;
63
64 int m_updateTimer;
65 int m_updateTimeout;
66
67 QGeoPositionInfoSource::Error m_positionError;
68};
69
70QT_END_NAMESPACE
71
72#endif // QGEOPOSITIONINFOSOURCECL_H
#define MINIMUM_UPDATE_INTERVAL