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
26#include <memory>
27
28namespace ABI {
29 namespace Windows {
30 namespace Devices {
31 namespace Geolocation{
32 struct IGeolocator;
33 struct IPositionChangedEventArgs;
34 struct IStatusChangedEventArgs;
35 }
36 }
37 }
38}
39
40QT_BEGIN_NAMESPACE
41
42class QGeoPositionInfoSourceWinRTPrivate;
43
45{
47public:
50 int init();
51
52 QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const override;
54
55 void setPreferredPositioningMethods(PositioningMethods methods) override;
56
57 void setUpdateInterval(int msec) override;
59 Error error() const override;
60
61 HRESULT onPositionChanged(ABI::Windows::Devices::Geolocation::IGeolocator *locator,
62 ABI::Windows::Devices::Geolocation::IPositionChangedEventArgs *args);
63 HRESULT onStatusChanged(ABI::Windows::Devices::Geolocation::IGeolocator *locator,
64 ABI::Windows::Devices::Geolocation::IStatusChangedEventArgs *args);
65
66 bool requestAccess() const;
69public slots:
71 void stopUpdates() override;
72
73 void requestUpdate(int timeout = 0) override;
74
75private slots:
76 void stopHandler();
77 void virtualPositionUpdate();
78 void singleUpdateTimeOut();
79 void updateSynchronized(const QGeoPositionInfo info);
80 void reactOnError(QGeoPositionInfoSource::Error positionError);
81private:
82 bool startHandler();
83
86
87 std::unique_ptr<QGeoPositionInfoSourceWinRTPrivate> d_ptr;
89};
90
91QT_END_NAMESPACE
92
93#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)