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_winrt_p.h
Go to the documentation of this file.
1// Copyright (C) 2015 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 QGEOPOSITIONINFOSOURCEWINRT_H
6#define QGEOPOSITIONINFOSOURCEWINRT_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
21
22#include <QtCore/qtimer.h>
23
24#include <EventToken.h>
25#include <wrl.h>
26
27#include <memory>
28
29namespace ABI {
30 namespace Windows {
31 namespace Devices {
32 namespace Geolocation{
33 struct IGeolocator;
34 struct IPositionChangedEventArgs;
35 struct IStatusChangedEventArgs;
36 }
37 }
38 }
39}
40
41QT_BEGIN_NAMESPACE
42
43class QGeoPositionInfoSourceWinRTPrivate;
44
46{
48public:
51 int init();
52
53 QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const override;
55
56 void setPreferredPositioningMethods(PositioningMethods methods) override;
57
58 void setUpdateInterval(int msec) override;
60 Error error() const override;
61
62 HRESULT onPositionChanged(ABI::Windows::Devices::Geolocation::IGeolocator *locator,
63 ABI::Windows::Devices::Geolocation::IPositionChangedEventArgs *args);
64 HRESULT onStatusChanged(ABI::Windows::Devices::Geolocation::IGeolocator *locator,
65 ABI::Windows::Devices::Geolocation::IStatusChangedEventArgs *args);
66
67 bool requestAccess() const;
70public slots:
72 void stopUpdates() override;
73
74 void requestUpdate(int timeout = 0) override;
75
76private slots:
77 void stopHandler();
78 void virtualPositionUpdate();
79 void singleUpdateTimeOut();
80 void updateSynchronized(const QGeoPositionInfo info);
81 void reactOnError(QGeoPositionInfoSource::Error positionError);
82private:
83 bool startHandler();
84
87
88 std::unique_ptr<QGeoPositionInfoSourceWinRTPrivate> d_ptr;
90};
91
92QT_END_NAMESPACE
93
94#endif // QGEOPOSITIONINFOSOURCEWINRT_H
HRESULT onStatusChanged(ABI::Windows::Devices::Geolocation::IGeolocator *locator, ABI::Windows::Devices::Geolocation::IStatusChangedEventArgs *args)
QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly=false) const override
Returns an update containing the last known position, or a null update if none is available.
Error error() const override
Returns the type of error that last occurred.
HRESULT onPositionChanged(ABI::Windows::Devices::Geolocation::IGeolocator *locator, ABI::Windows::Devices::Geolocation::IPositionChangedEventArgs *args)
void requestUpdate(int timeout=0) override
void setPreferredPositioningMethods(PositioningMethods methods) override
PositioningMethods supportedPositioningMethods() const override
Returns the positioning methods available to this source.
IAsyncOperationCompletedHandler< Geoposition * > PositionHandler
ITypedEventHandler< Geolocator *, StatusChangedEventArgs * > GeoLocatorStatusHandler
ITypedEventHandler< Geolocator *, PositionChangedEventArgs * > GeoLocatorPositionHandler
IAsyncOperationCompletedHandler< GeolocationAccessStatus > AccessHandler
static bool isDisabledStatus(PositionStatus status)