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
qgeoserviceproviderpluginohosmapkit.cpp
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#include <qgeocodingmanagerengineohosmapkit.h>
5#include <qgeoroutingmanagerengineohosmapkit.h>
6#include <qgeoserviceproviderpluginohosmapkit.h>
7#include <qgeotiledmappingmanagerengineohosmapkit.h>
8#include <qohosmapkitcommon.h>
9#include <qplacemanagerengineohosmapkit.h>
10
12
13namespace {
14
16 const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString)
17{
18 if (OhosMapKit::getAuthenticationKeyParameterOrEmpty(parameters).isEmpty()) {
19 if (error != nullptr)
20 *error = QGeoServiceProvider::MissingRequiredParameterError;
21
22 if (errorString != nullptr) {
23 *errorString = QGeoServiceProviderFactoryOhosMapKit::tr(
24 "OHOS MapKit plugin requires a '%1' parameter. "
25 "Visit Huawei AppGallery Connect service to generate it.")
26 .arg(OhosMapKit::authenticationKeyParameterName);
27 }
28 return false;
29 }
30 return true;
31}
32
33}
34
35QGeoCodingManagerEngine *QGeoServiceProviderFactoryOhosMapKit::createGeocodingManagerEngine(
36 const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString) const
37{
38 return isAuthenticationKeySet(parameters, error, errorString)
39 ? makeQGeoCodingManagerEngineOhosMapKit(parameters, error, errorString)
40 : nullptr;
41}
42
44 const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString) const
45{
46 return isAuthenticationKeySet(parameters, error, errorString)
47 ? makeQGeoTiledMappingManagerEngineOhosMapKit(parameters, error, errorString)
48 : nullptr;
49}
50
52 const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString) const
53{
54 return isAuthenticationKeySet(parameters, error, errorString)
55 ? makeQGeoRoutingManagerEngineOhosMapKit(parameters, error, errorString)
56 : nullptr;
57}
58
60 const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString) const
61{
62 return isAuthenticationKeySet(parameters, error, errorString)
63 ? makeQPlaceManagerEngineOhosMapKit(parameters, error, errorString)
64 : nullptr;
65}
66
67QT_END_NAMESPACE
QGeoMappingManagerEngine * createMappingManagerEngine(const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString) const
Returns a new QGeoMappingManagerEngine instance, initialized with parameters, which implements mappin...
QGeoRoutingManagerEngine * createRoutingManagerEngine(const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString) const
Returns a new QGeoRoutingManagerEngine instance, initialized with parameters, which implements routin...
QPlaceManagerEngine * createPlaceManagerEngine(const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString) const
Returns a new QPlaceManagerEngine instance, initialized with parameters, which implements the place s...
QString getAuthenticationKeyParameterOrEmpty(const QVariantMap &parameters)
Combined button and popup list for selecting options.
bool isAuthenticationKeySet(const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString)