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
qplacemanagerengineosm.h
Go to the documentation of this file.
1// Copyright (C) 2016 Aaron McCarthy <mccarthy.aaron@gmail.com>
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 QPLACEMANAGERENGINEOSM_H
6#define QPLACEMANAGERENGINEOSM_H
7
8#include <QtLocation/QPlaceManagerEngine>
9#include <QtLocation/QGeoServiceProvider>
10
12
13class QNetworkAccessManager;
14class QNetworkReply;
15class QPlaceCategoriesReplyOsm;
16
18{
20
21public:
25
26 QPlaceSearchReply *search(const QPlaceSearchRequest &request) override;
27
29 QString parentCategoryId(const QString &categoryId) const override;
30 QStringList childCategoryIds(const QString &categoryId) const override;
31 QPlaceCategory category(const QString &categoryId) const override;
32
33 QList<QPlaceCategory> childCategories(const QString &parentId) const override;
34
35 QList<QLocale> locales() const override;
36 void setLocales(const QList<QLocale> &locales) override;
37
38private slots:
40 void categoryReplyError();
41 void replyFinished();
42 void replyError(QPlaceReply::Error errorCode, const QString &errorString);
43
44private:
45 void fetchNextCategoryLocale();
46
47 QNetworkAccessManager *m_networkManager;
48 QByteArray m_userAgent;
49 QString m_urlPrefix;
50 QList<QLocale> m_locales;
51 bool m_debugQuery = false;
52 int m_pageSize = 50; // the default page size of the public nominatim server
53
54 QNetworkReply *m_categoriesReply;
55 QList<QPlaceCategoriesReplyOsm *> m_pendingCategoriesReply;
56 QHash<QString, QPlaceCategory> m_categories;
57 QHash<QString, QStringList> m_subcategories;
58
59 QList<QLocale> m_categoryLocales;
60};
61
62QT_END_NAMESPACE
63
64#endif // QPLACEMANAGERENGINEOSM_H
QGeoTiledMappingManagerEngineOsm(const QVariantMap &parameters, QGeoServiceProvider::Error *error, QString *errorString)
const QList< QGeoTileProviderOsm * > & providers()
void onProviderResolutionError(const QGeoTileProviderOsm *provider)
QStringList childCategoryIds(const QString &categoryId) const override
Returns the child category identifiers of the category corresponding to categoryId.
QPlaceReply * initializeCategories() override
Initializes the categories of the manager engine.
QList< QPlaceCategory > childCategories(const QString &parentId) const override
Returns a list of categories that are children of the category corresponding to parentId.
QList< QLocale > locales() const override
Returns a list of preferred locales.
QPlaceCategory category(const QString &categoryId) const override
Returns the category corresponding to the given categoryId.
QPlaceSearchReply * search(const QPlaceSearchRequest &request) override
Searches for places according to the parameters specified in request.
QString parentCategoryId(const QString &categoryId) const override
Returns the parent category identifier of the category corresponding to categoryId.
void setLocales(const QList< QLocale > &locales) override
Set the list of preferred locales.
Combined button and popup list for selecting options.