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
4#ifndef QGEOPOSITIONDISPATCHER_WASM_H
5#define QGEOPOSITIONDISPATCHER_WASM_H
6
7#include <QObject>
8#include <QGlobalStatic>
9#include <unordered_map>
10#include <mutex>
11
12#include <emscripten/val.h>
13#include <emscripten/bind.h>
14
15
16QT_BEGIN_NAMESPACE
17
18using namespace emscripten;
19
21
23{
24 public:
27
30 void unregisterInfoSourceInstance(int instanceId);
32
34
35 void geolocationSuccess(int instanceId, val position);
36 void geolocationError(int instanceId, val error);
37 void log(val value);
38
39 private:
40 std::unordered_map<int, QGeoPositionInfoSourceWasm*> m_instanceRegistry;
41 std::mutex registryMutex;
43};
44
45QT_END_NAMESPACE
46
47#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