14#include <QNetworkProxy>
15#include <QCoreApplication>
26 if (param.length() > 512)
29 for (
const auto &c : param) {
30 if (!c.isLetterOrNumber() && c.toLatin1() !=
'%' && c.toLatin1() !=
'-' &&
31 c.toLatin1() !=
'+' && c.toLatin1() !=
'_') {
43 void checkUsageTerms(
const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString)
45 const QString apiKey = parameters.value(QStringLiteral(
"here.apiKey")).toString();
47 if (isValidParameter(apiKey))
50 qWarning() <<
"Invalid here.apiKey";
52 if (parameters.contains(QStringLiteral(
"apiKey")))
53 qWarning() << QStringLiteral(
"Please prefix 'apiKey' with prefix 'here' (e.g.: 'here.apiKey')");
55 *error = QGeoServiceProvider::MissingRequiredParameterError;
56 *errorString = QCoreApplication::translate(NOKIA_PLUGIN_CONTEXT_NAME, MISSED_CREDENTIALS);
59 template<
class TInstance>
60 TInstance *
CreateInstanceOf(
const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString)
62 checkUsageTerms(parameters, error, errorString);
64 if (*error != QGeoServiceProvider::NoError)
71 return new TInstance(networkManager, parameters, error, errorString);
80 const QVariantMap ¶meters,
81 QGeoServiceProvider::Error *error,
82 QString *errorString)
const
88 const QVariantMap ¶meters,
89 QGeoServiceProvider::Error *error,
90 QString *errorString)
const
96 const QVariantMap ¶meters,
97 QGeoServiceProvider::Error *error,
98 QString *errorString)
const
104 const QVariantMap ¶meters,
105 QGeoServiceProvider::Error *error,
106 QString *errorString)
const
QGeoMappingManagerEngine * createMappingManagerEngine(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const override
Returns a new QGeoMappingManagerEngine instance, initialized with parameters, which implements mappin...
Q_PLUGIN_METADATA(IID "org.qt-project.qt.geoservice.serviceproviderfactory/6.0" FILE "nokia_plugin.json") public QGeoCodingManagerEngine * createGeocodingManagerEngine(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const override
Returns a new QGeoCodingManagerEngine instance, initialized with parameters, which implements the loc...
QPlaceManagerEngine * createPlaceManagerEngine(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const override
Returns a new QPlaceManagerEngine instance, initialized with parameters, which implements the place s...
QGeoRoutingManagerEngine * createRoutingManagerEngine(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const override
Returns a new QGeoRoutingManagerEngine instance, initialized with parameters, which implements routin...
Combined button and popup list for selecting options.
QGeoNetworkAccessManager * tryGetNetworkAccessManager(const QVariantMap ¶meters)
bool isValidParameter(const QString ¶m)
TInstance * CreateInstanceOf(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString)
void checkUsageTerms(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString)