Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qgeopositioninfosource_android_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 QGEOPOSITIONINFOSOURCE_ANDROID_P_H
5#define QGEOPOSITIONINFOSOURCE_ANDROID_P_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#include <QGeoPositionInfoSource>
19#include <QTimer>
20
22{
24public:
27
28 // From QGeoPositionInfoSource
29 void setUpdateInterval(int msec) override;
30 QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const override;
31 PositioningMethods supportedPositioningMethods() const override;
32 void setPreferredPositioningMethods(PositioningMethods methods) override;
33 int minimumUpdateInterval() const override;
34 Error error() const override;
35
36 bool useAltitudeConverter() const;
37
38public Q_SLOTS:
39 virtual void startUpdates() override;
40 virtual void stopUpdates() override;
41
42 virtual void requestUpdate(int timeout = 0) override;
43
44 void processPositionUpdate(const QGeoPositionInfo& pInfo);
46
49private Q_SLOTS:
50 void requestTimeout();
51 void regularUpdatesTimeout();
52
53private:
54 void reconfigureRunningSystem();
55 void setError(Error error);
56 void parseParameters(const QVariantMap &parameters);
57
58 bool updatesRunning = false;
59 int androidClassKeyForUpdate;
60 int androidClassKeyForSingleRequest;
61 QList<QGeoPositionInfo> queuedSingleUpdates;
62 Error m_error = NoError;
63 QTimer m_requestTimer;
64 QTimer m_regularUpdatesTimer;
65 qint64 m_lastUpdateTime = 0;
66 bool m_regularUpdatesErrorRaised = false;
67 bool m_useAltitudeConverter = false;
68};
69
70#endif // QGEOPOSITIONINFOSOURCE_ANDROID_P_H
static JNINativeMethod methods[]
QGeoPositionInfoSourceAndroid(const QVariantMap &parameters, QObject *parent=0)
QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly=false) const override
Returns an update containing the last known position, or a null update if none is available.
void processSinglePositionUpdate(const QGeoPositionInfo &pInfo)
virtual void requestUpdate(int timeout=0) override
void processPositionUpdate(const QGeoPositionInfo &pInfo)
void setPreferredPositioningMethods(PositioningMethods methods) override
Error error() const override
Returns the type of error that last occurred.
PositioningMethods supportedPositioningMethods() const override
Returns the positioning methods available to this source.
\inmodule QtPositioning
Error
The Error enumeration represents the errors which can occur.
\inmodule QtPositioning
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
\inmodule QtCore
Definition qtimer.h:20
GLbitfield GLuint64 timeout
[4]
#define Q_OBJECT
#define Q_SLOTS
long long qint64
Definition qtypes.h:60