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
4#ifndef QGEOPOSITIONINFOSOURCEWINRT_H
5#define QGEOPOSITIONINFOSOURCEWINRT_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
20
21#include <QtCore/qtimer.h>
22
23#include <EventToken.h>
24#include <wrl.h>
25
26namespace ABI {
27 namespace Windows {
28 namespace Devices {
29 namespace Geolocation{
30 struct IGeolocator;
31 struct IPositionChangedEventArgs;
32 struct IStatusChangedEventArgs;
33 }
34 }
35 }
36}
37
38QT_BEGIN_NAMESPACE
39
40class QGeoPositionInfoSourceWinRTPrivate;
41
43{
45public:
48 int init();
49
50 QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const override;
52
53 void setPreferredPositioningMethods(PositioningMethods methods) override;
54
55 void setUpdateInterval(int msec) override;
57 Error error() const override;
58
59 HRESULT onPositionChanged(ABI::Windows::Devices::Geolocation::IGeolocator *locator,
60 ABI::Windows::Devices::Geolocation::IPositionChangedEventArgs *args);
61 HRESULT onStatusChanged(ABI::Windows::Devices::Geolocation::IGeolocator *locator,
62 ABI::Windows::Devices::Geolocation::IStatusChangedEventArgs *args);
63
64 bool requestAccess() const;
67public slots:
69 void stopUpdates() override;
70
71 void requestUpdate(int timeout = 0) override;
72
73private slots:
74 void stopHandler();
75 void virtualPositionUpdate();
76 void singleUpdateTimeOut();
77 void updateSynchronized(const QGeoPositionInfo info);
78 void reactOnError(QGeoPositionInfoSource::Error positionError);
79private:
80 bool startHandler();
81
84
85 QScopedPointer<QGeoPositionInfoSourceWinRTPrivate> d_ptr;
87};
88
89QT_END_NAMESPACE
90
91#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)