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
qplacemanagerenginemapbox.h
Go to the documentation of this file.
1// Copyright (C) 2017 Mapbox, Inc.
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 QPLACEMANAGERENGINEMAPBOX_H
5#define QPLACEMANAGERENGINEMAPBOX_H
6
7#include <QtLocation/QPlaceManagerEngine>
8#include <QtLocation/QGeoServiceProvider>
9
11
12class QNetworkAccessManager;
13
15{
17
18public:
22
23 QPlaceSearchReply *search(const QPlaceSearchRequest &) override;
24
25 QPlaceSearchSuggestionReply *searchSuggestions(const QPlaceSearchRequest &) override;
26
28 QString parentCategoryId(const QString &categoryId) const override;
29 QStringList childCategoryIds(const QString &categoryId) const override;
30 QPlaceCategory category(const QString &categoryId) const override;
31 QList<QPlaceCategory> childCategories(const QString &parentId) const override;
32
33 QList<QLocale> locales() const override;
34 void setLocales(const QList<QLocale> &locales) override;
35
36 // TODO: icon
37 //QPlaceIcon icon(const QString &remotePath,
38 // const QList<QPlaceCategory> &categories = QList<QPlaceCategory>()) const;
39
40 //QUrl constructIconUrl(const QPlaceIcon &icon, const QSize &size) const override;
41
42private slots:
43 void onReplyFinished();
44 void onReplyError(QPlaceReply::Error, const QString &errorString);
45
46private:
47 enum PlaceSearchType {
48 CompleteSearch = 0,
49 SuggestionSearch
50 };
51
52 QPlaceReply *doSearch(const QPlaceSearchRequest&, PlaceSearchType);
53
54 QNetworkAccessManager *m_networkManager;
55 QByteArray m_userAgent;
56 QString m_accessToken;
57 QString m_urlPrefix;
58 bool m_isEnterprise;
59
60 QList<QLocale> m_locales;
61 QHash<QString, QPlaceCategory> m_categories;
62};
63
64QT_END_NAMESPACE
65
66#endif // QPLACEMANAGERENGINEMAPBOX_H
QPlaceReply * initializeCategories() override
Initializes the categories of the manager engine.
QStringList childCategoryIds(const QString &categoryId) const override
Returns the child category identifiers of the category corresponding to categoryId.
QList< QLocale > locales() const override
Returns a list of preferred locales.
QPlaceSearchReply * search(const QPlaceSearchRequest &) override
Searches for places according to the parameters specified in request.
QList< QPlaceCategory > childCategories(const QString &parentId) const override
Returns a list of categories that are children of the category corresponding to parentId.
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.
QPlaceCategory category(const QString &categoryId) const override
Returns the category corresponding to the given categoryId.
QPlaceSearchSuggestionReply * searchSuggestions(const QPlaceSearchRequest &) override
Requests a set of search term suggestions according to the parameters specified in request.
static QT_BEGIN_NAMESPACE QString msgAccessTokenParameter()