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
qgeoserviceprovider.h
Go to the documentation of this file.
1// Copyright (C) 2015 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// Qt-Security score:significant reason:default
4
5#ifndef QGEOSERVICEPROVIDER_H
6#define QGEOSERVICEPROVIDER_H
7
8#include <QtCore/QVariantMap>
9#include <QtCore/QString>
10#include <QtCore/QObject>
11#include <QtLocation/qlocationglobal.h>
12
13QT_BEGIN_NAMESPACE
14
15class QLocale;
16class QGeoCodingManager;
17class QGeoMappingManager;
18class QGeoRoutingManager;
19class QPlaceManager;
20class QGeoCodingManagerEngine;
21class QGeoMappingManagerEngine;
22class QGeoRoutingManagerEngine;
23class QPlaceManagerEngine;
25class QQmlEngine;
26
27class Q_LOCATION_EXPORT QGeoServiceProvider : public QObject
28{
29 Q_OBJECT
30public:
31 enum Error {
32 NoError,
33 NotSupportedError,
34 UnknownParameterError,
35 MissingRequiredParameterError,
36 ConnectionError,
37 LoaderError
38 };
39 Q_ENUM(Error)
40
41 enum RoutingFeature {
42 NoRoutingFeatures = 0,
43 OnlineRoutingFeature = (1<<0),
44 OfflineRoutingFeature = (1<<1),
45 LocalizedRoutingFeature = (1<<2),
46 RouteUpdatesFeature = (1<<3),
47 AlternativeRoutesFeature = (1<<4),
48 ExcludeAreasRoutingFeature = (1<<5),
49 AnyRoutingFeatures = ~(0)
50 };
51
52 enum GeocodingFeature {
53 NoGeocodingFeatures = 0,
54 OnlineGeocodingFeature = (1<<0),
55 OfflineGeocodingFeature = (1<<1),
56 ReverseGeocodingFeature = (1<<2),
57 LocalizedGeocodingFeature = (1<<3),
58 AnyGeocodingFeatures = ~(0)
59 };
60
61 enum MappingFeature {
62 NoMappingFeatures = 0,
63 OnlineMappingFeature = (1<<0),
64 OfflineMappingFeature = (1<<1),
65 LocalizedMappingFeature = (1<<2),
66 AnyMappingFeatures = ~(0)
67 };
68
69 enum PlacesFeature {
70 NoPlacesFeatures = 0,
71 OnlinePlacesFeature = (1<<0),
72 OfflinePlacesFeature = (1<<1),
73 SavePlaceFeature = (1<<2),
74 RemovePlaceFeature = (1<<3),
75 SaveCategoryFeature = (1<<4),
76 RemoveCategoryFeature = (1<<5),
77 PlaceRecommendationsFeature = (1<<6),
78 SearchSuggestionsFeature = (1<<7),
79 LocalizedPlacesFeature = (1<<8),
80 NotificationsFeature = (1<<9),
81 PlaceMatchingFeature = (1<<10),
82 AnyPlacesFeatures = ~(0)
83 };
84
85 enum NavigationFeature {
86 NoNavigationFeatures = 0,
87 OnlineNavigationFeature = (1<<0),
88 OfflineNavigationFeature = (1<<1),
89 AnyNavigationFeatures = ~(0)
90 };
91
92 Q_DECLARE_FLAGS(RoutingFeatures, RoutingFeature)
93 Q_FLAG(RoutingFeatures)
94
95 Q_DECLARE_FLAGS(GeocodingFeatures, GeocodingFeature)
96 Q_FLAG(GeocodingFeatures)
97
98 Q_DECLARE_FLAGS(MappingFeatures, MappingFeature)
99 Q_FLAG(MappingFeatures)
100
101 Q_DECLARE_FLAGS(PlacesFeatures, PlacesFeature)
102 Q_FLAG(PlacesFeatures)
103
104 Q_DECLARE_FLAGS(NavigationFeatures, NavigationFeature)
105 Q_FLAG(NavigationFeatures)
106
107 static QStringList availableServiceProviders();
108 QGeoServiceProvider(const QString &providerName,
109 const QVariantMap &parameters = QVariantMap(),
110 bool allowExperimental = false);
111
112 ~QGeoServiceProvider();
113
114 RoutingFeatures routingFeatures() const;
115 GeocodingFeatures geocodingFeatures() const;
116 MappingFeatures mappingFeatures() const;
117 PlacesFeatures placesFeatures() const;
118 NavigationFeatures navigationFeatures() const;
119
120 QGeoCodingManager *geocodingManager() const;
121 QGeoMappingManager *mappingManager() const;
122 QGeoRoutingManager *routingManager() const;
123 QPlaceManager *placeManager() const;
124
125 Error error() const;
126 QString errorString() const;
127
128 Error mappingError() const;
129 QString mappingErrorString() const;
130 Error geocodingError() const;
131 QString geocodingErrorString() const;
132 Error routingError() const;
133 QString routingErrorString() const;
134 Error placesError() const;
135 QString placesErrorString() const;
136 Error navigationError() const;
137 QString navigationErrorString() const;
138
139 void setParameters(const QVariantMap &parameters);
140 void setLocale(const QLocale &locale);
141 void setAllowExperimental(bool allow);
142 void setQmlEngine(QQmlEngine *engine);
143
144private:
145 QGeoServiceProviderPrivate *d_ptr;
146};
147
148Q_DECLARE_OPERATORS_FOR_FLAGS(QGeoServiceProvider::RoutingFeatures)
149Q_DECLARE_OPERATORS_FOR_FLAGS(QGeoServiceProvider::GeocodingFeatures)
150Q_DECLARE_OPERATORS_FOR_FLAGS(QGeoServiceProvider::MappingFeatures)
151Q_DECLARE_OPERATORS_FOR_FLAGS(QGeoServiceProvider::PlacesFeatures)
152Q_DECLARE_OPERATORS_FOR_FLAGS(QGeoServiceProvider::NavigationFeatures)
153
154QT_END_NAMESPACE
155
156#endif
\inmodule QtLocation
Combined button and popup list for selecting options.