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