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
qgeopositioninfosourcedispatcher_wasm_p.h
Go to the documentation of this file.
1// Copyright (C) 2025 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 QGEOPOSITIONDISPATCHER_WASM_H
6#define QGEOPOSITIONDISPATCHER_WASM_H
7
8#include <QObject>
9#include <QGlobalStatic>
10#include <unordered_map>
11#include <mutex>
12
13#include <emscripten/val.h>
14#include <emscripten/bind.h>
15
16
17QT_BEGIN_NAMESPACE
18
19using namespace emscripten;
20
22
24{
25 public:
28
31 void unregisterInfoSourceInstance(int instanceId);
33
35
36 void geolocationSuccess(int instanceId, val position);
37 void geolocationError(int instanceId, val error);
38 void log(val value);
39
40 private:
41 std::unordered_map<int, QGeoPositionInfoSourceWasm*> m_instanceRegistry;
42 std::mutex registryMutex;
44};
45
46QT_END_NAMESPACE
47
48#endif
int registerInfoSourceInstance(QGeoPositionInfoSourceWasm *source)
QGeoPositionInfoSourceWasm * lookUpInfoSource(int instanceId)
void geolocationSuccess(int instanceId, val position)
static QGeoPositionInfoDispatcherWasm * instance()
void geolocationError(GeolocationPositionError error)
Error error() const override
Returns the type of error that last occurred.
void setPreferredPositioningMethods(PositioningMethods methods) override
void requestUpdate(int timeout=0) override
PositioningMethods supportedPositioningMethods() const override
Returns the positioning methods available to this source.
void geolocationSuccess(GeolocationPosition position)
QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly=false) const override
Returns an update containing the last known position, or a null update if none is available.
Combined button and popup list for selecting options.
QT_BEGIN_NAMESPACE typedef emscripten::val GeolocationCoordinates
emscripten::val GeolocationPositionHandlerId
emscripten::val Geolocation
emscripten::val GeolocationPositionError
emscripten::val GeolocationPosition