46 QML_NAMED_ELEMENT(Plugin)
47 QML_ADDED_IN_VERSION(5, 0)
49 Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
50 Q_PROPERTY(QStringList availableServiceProviders READ availableServiceProviders CONSTANT)
51 Q_PROPERTY(QQmlListProperty<QDeclarativePluginParameter> parameters READ parameters)
52 Q_PROPERTY(QDeclarativeGeoServiceProviderRequirements *required READ requirements WRITE setRequirements)
53 Q_PROPERTY(QStringList locales READ locales WRITE setLocales NOTIFY localesChanged)
54 Q_PROPERTY(QStringList preferred READ preferred WRITE setPreferred NOTIFY preferredChanged)
55 Q_PROPERTY(
bool allowExperimental READ allowExperimental WRITE setAllowExperimental NOTIFY allowExperimentalChanged)
56 Q_PROPERTY(
bool isAttached READ isAttached NOTIFY attached)
58 Q_CLASSINFO(
"DefaultProperty",
"parameters")
59 Q_INTERFACES(QQmlParserStatus)
62 explicit QDeclarativeGeoServiceProvider(QObject *parent =
nullptr);
63 ~QDeclarativeGeoServiceProvider();
66 NoRoutingFeatures = QGeoServiceProvider::NoRoutingFeatures,
67 OnlineRoutingFeature = QGeoServiceProvider::OnlineRoutingFeature,
68 OfflineRoutingFeature = QGeoServiceProvider::OfflineRoutingFeature,
69 LocalizedRoutingFeature = QGeoServiceProvider::LocalizedRoutingFeature,
70 RouteUpdatesFeature = QGeoServiceProvider::RouteUpdatesFeature,
71 AlternativeRoutesFeature = QGeoServiceProvider::AlternativeRoutesFeature,
72 ExcludeAreasRoutingFeature = QGeoServiceProvider::ExcludeAreasRoutingFeature,
73 AnyRoutingFeatures = QGeoServiceProvider::AnyRoutingFeatures
76 enum GeocodingFeature {
77 NoGeocodingFeatures = QGeoServiceProvider::NoGeocodingFeatures,
78 OnlineGeocodingFeature = QGeoServiceProvider::OnlineGeocodingFeature,
79 OfflineGeocodingFeature = QGeoServiceProvider::OfflineGeocodingFeature,
80 ReverseGeocodingFeature = QGeoServiceProvider::ReverseGeocodingFeature,
81 LocalizedGeocodingFeature = QGeoServiceProvider::LocalizedGeocodingFeature,
82 AnyGeocodingFeatures = QGeoServiceProvider::AnyGeocodingFeatures
86 NoMappingFeatures = QGeoServiceProvider::NoMappingFeatures,
87 OnlineMappingFeature = QGeoServiceProvider::OnlineMappingFeature,
88 OfflineMappingFeature = QGeoServiceProvider::OfflineMappingFeature,
89 LocalizedMappingFeature = QGeoServiceProvider::LocalizedMappingFeature,
90 AnyMappingFeatures = QGeoServiceProvider::AnyMappingFeatures
94 NoPlacesFeatures = QGeoServiceProvider::NoPlacesFeatures,
95 OnlinePlacesFeature = QGeoServiceProvider::OnlinePlacesFeature,
96 OfflinePlacesFeature = QGeoServiceProvider::OfflinePlacesFeature,
97 SavePlaceFeature = QGeoServiceProvider::SavePlaceFeature,
98 RemovePlaceFeature = QGeoServiceProvider::RemovePlaceFeature,
99 SaveCategoryFeature = QGeoServiceProvider::SaveCategoryFeature,
100 RemoveCategoryFeature = QGeoServiceProvider::RemoveCategoryFeature,
101 PlaceRecommendationsFeature = QGeoServiceProvider::PlaceRecommendationsFeature,
102 SearchSuggestionsFeature = QGeoServiceProvider::SearchSuggestionsFeature,
103 LocalizedPlacesFeature = QGeoServiceProvider::LocalizedPlacesFeature,
104 NotificationsFeature = QGeoServiceProvider::NotificationsFeature,
105 PlaceMatchingFeature = QGeoServiceProvider::PlaceMatchingFeature,
106 AnyPlacesFeatures = QGeoServiceProvider::AnyPlacesFeatures
109 enum NavigationFeature {
110 NoNavigationFeatures = QGeoServiceProvider::NoNavigationFeatures,
111 OnlineNavigationFeature = QGeoServiceProvider::OnlineNavigationFeature,
112 OfflineNavigationFeature = QGeoServiceProvider::OfflineNavigationFeature,
113 AnyNavigationFeatures = QGeoServiceProvider::AnyNavigationFeatures
116 Q_ENUM(RoutingFeature)
117 Q_DECLARE_FLAGS(RoutingFeatures, RoutingFeature)
118 Q_FLAG(RoutingFeatures)
120 Q_ENUM(GeocodingFeature)
121 Q_DECLARE_FLAGS(GeocodingFeatures, GeocodingFeature)
122 Q_FLAG(GeocodingFeatures)
124 Q_ENUM(MappingFeature)
125 Q_DECLARE_FLAGS(MappingFeatures, MappingFeature)
126 Q_FLAG(MappingFeatures)
128 Q_ENUM(PlacesFeature)
129 Q_DECLARE_FLAGS(PlacesFeatures, PlacesFeature)
130 Q_FLAG(PlacesFeatures)
132 Q_DECLARE_FLAGS(NavigationFeatures, NavigationFeature)
133 Q_FLAG(NavigationFeatures)
136 void classBegin() override {}
137 void componentComplete() override;
139 void setName(
const QString &name);
140 QString name()
const;
142 QQmlListProperty<QDeclarativePluginParameter> parameters();
143 QVariantMap parameterMap()
const;
145 QStringList availableServiceProviders();
147 QDeclarativeGeoServiceProviderRequirements *requirements()
const;
148 void setRequirements(QDeclarativeGeoServiceProviderRequirements *req);
150 QStringList preferred()
const;
151 void setPreferred(
const QStringList &val);
153 QGeoServiceProvider *sharedGeoServiceProvider()
const;
155 Q_INVOKABLE
bool supportsRouting(
const RoutingFeatures &feature = AnyRoutingFeatures)
const;
156 Q_INVOKABLE
bool supportsGeocoding(
const GeocodingFeatures &feature = AnyGeocodingFeatures)
const;
157 Q_INVOKABLE
bool supportsMapping(
const MappingFeatures &feature = AnyMappingFeatures)
const;
158 Q_INVOKABLE
bool supportsPlaces(
const PlacesFeatures &feature = AnyPlacesFeatures)
const;
159 Q_REVISION(5, 11) Q_INVOKABLE
bool supportsNavigation(
const NavigationFeature &feature = AnyNavigationFeatures)
const;
161 QStringList locales()
const;
162 void setLocales(
const QStringList &locales);
164 bool isAttached()
const;
166 void setAllowExperimental(
bool allow);
167 bool allowExperimental()
const;
170 void nameChanged(
const QString &name);
171 void localesChanged();
173 void preferredChanged(
const QStringList &preferences);
174 void allowExperimentalChanged(
bool allow);
177 bool parametersReady();
179 static void parameter_append(QQmlListProperty<QDeclarativePluginParameter> *prop, QDeclarativePluginParameter *mapObject);
180 static qsizetype parameter_count(QQmlListProperty<QDeclarativePluginParameter> *prop);
181 static QDeclarativePluginParameter *parameter_at(QQmlListProperty<QDeclarativePluginParameter> *prop, qsizetype index);
182 static void parameter_clear(QQmlListProperty<QDeclarativePluginParameter> *prop);
184 std::unique_ptr<QGeoServiceProvider> sharedProvider_;
186 QList<QDeclarativePluginParameter *> parameters_;
187 std::unique_ptr<QDeclarativeGeoServiceProviderRequirements> required_;
188 bool complete_ =
false;
189 bool experimental_ =
false;
190 QStringList locales_;
192 Q_DISABLE_COPY(QDeclarativeGeoServiceProvider)
198 QML_NAMED_ELEMENT(PluginRequirements)
199 QML_UNCREATABLE(
"PluginRequirements is not intended instantiable by developer.")
200 QML_ADDED_IN_VERSION(5, 0)
201 Q_PROPERTY(QDeclarativeGeoServiceProvider::MappingFeatures mapping
202 READ mappingRequirements WRITE setMappingRequirements
203 NOTIFY mappingRequirementsChanged)
204 Q_PROPERTY(QDeclarativeGeoServiceProvider::RoutingFeatures routing
205 READ routingRequirements WRITE setRoutingRequirements
206 NOTIFY routingRequirementsChanged)
207 Q_PROPERTY(QDeclarativeGeoServiceProvider::GeocodingFeatures geocoding
208 READ geocodingRequirements WRITE setGeocodingRequirements
209 NOTIFY geocodingRequirementsChanged)
210 Q_PROPERTY(QDeclarativeGeoServiceProvider::PlacesFeatures places
211 READ placesRequirements WRITE setPlacesRequirements
212 NOTIFY placesRequirementsChanged)
213 Q_PROPERTY(QDeclarativeGeoServiceProvider::NavigationFeatures navigation
214 READ navigationRequirements WRITE setNavigationRequirements
215 NOTIFY navigationRequirementsChanged)
218 explicit QDeclarativeGeoServiceProviderRequirements(QObject *parent =
nullptr);
219 ~QDeclarativeGeoServiceProviderRequirements();
221 QDeclarativeGeoServiceProvider::MappingFeatures mappingRequirements()
const;
222 void setMappingRequirements(
const QDeclarativeGeoServiceProvider::MappingFeatures &features);
224 QDeclarativeGeoServiceProvider::RoutingFeatures routingRequirements()
const;
225 void setRoutingRequirements(
const QDeclarativeGeoServiceProvider::RoutingFeatures &features);
227 QDeclarativeGeoServiceProvider::GeocodingFeatures geocodingRequirements()
const;
228 void setGeocodingRequirements(
const QDeclarativeGeoServiceProvider::GeocodingFeatures &features);
230 QDeclarativeGeoServiceProvider::PlacesFeatures placesRequirements()
const;
231 void setPlacesRequirements(
const QDeclarativeGeoServiceProvider::PlacesFeatures &features);
233 QDeclarativeGeoServiceProvider::NavigationFeatures navigationRequirements()
const;
234 void setNavigationRequirements(
const QDeclarativeGeoServiceProvider::NavigationFeatures &features);
236 Q_INVOKABLE
bool matches(
const QGeoServiceProvider *provider)
const;
238 bool operator == (
const QDeclarativeGeoServiceProviderRequirements &rhs)
const;
241 void mappingRequirementsChanged(
const QDeclarativeGeoServiceProvider::MappingFeatures &features);
242 void routingRequirementsChanged(
const QDeclarativeGeoServiceProvider::RoutingFeatures &features);
243 void geocodingRequirementsChanged(
const QDeclarativeGeoServiceProvider::GeocodingFeatures &features);
244 void placesRequirementsChanged(
const QDeclarativeGeoServiceProvider::PlacesFeatures &features);
245 void navigationRequirementsChanged(
const QDeclarativeGeoServiceProvider::NavigationFeatures &features);
247 void requirementsChanged();
250 QDeclarativeGeoServiceProvider::MappingFeatures mapping_ = QDeclarativeGeoServiceProvider::NoMappingFeatures;
251 QDeclarativeGeoServiceProvider::RoutingFeatures routing_ = QDeclarativeGeoServiceProvider::NoRoutingFeatures;
252 QDeclarativeGeoServiceProvider::GeocodingFeatures geocoding_ = QDeclarativeGeoServiceProvider::NoGeocodingFeatures;
253 QDeclarativeGeoServiceProvider::PlacesFeatures places_ = QDeclarativeGeoServiceProvider::NoPlacesFeatures;
254 QDeclarativeGeoServiceProvider::NavigationFeatures navigation_ = QDeclarativeGeoServiceProvider::NoNavigationFeatures;