46 QML_NAMED_ELEMENT(Plugin)
47 QML_ADDED_IN_VERSION(5, 0)
48 Q_ENUMS(RoutingFeature)
49 Q_ENUMS(GeocodingFeature)
50 Q_ENUMS(MappingFeature)
51 Q_ENUMS(PlacesFeature)
53 Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
54 Q_PROPERTY(QStringList availableServiceProviders READ availableServiceProviders CONSTANT)
55 Q_PROPERTY(QQmlListProperty<QDeclarativePluginParameter> parameters READ parameters)
56 Q_PROPERTY(QDeclarativeGeoServiceProviderRequirements *required READ requirements WRITE setRequirements)
57 Q_PROPERTY(QStringList locales READ locales WRITE setLocales NOTIFY localesChanged)
58 Q_PROPERTY(QStringList preferred READ preferred WRITE setPreferred NOTIFY preferredChanged)
59 Q_PROPERTY(
bool allowExperimental READ allowExperimental WRITE setAllowExperimental NOTIFY allowExperimentalChanged)
60 Q_PROPERTY(
bool isAttached READ isAttached NOTIFY attached)
62 Q_CLASSINFO(
"DefaultProperty",
"parameters")
63 Q_INTERFACES(QQmlParserStatus)
66 explicit QDeclarativeGeoServiceProvider(QObject *parent =
nullptr);
67 ~QDeclarativeGeoServiceProvider();
70 NoRoutingFeatures = QGeoServiceProvider::NoRoutingFeatures,
71 OnlineRoutingFeature = QGeoServiceProvider::OnlineRoutingFeature,
72 OfflineRoutingFeature = QGeoServiceProvider::OfflineRoutingFeature,
73 LocalizedRoutingFeature = QGeoServiceProvider::LocalizedRoutingFeature,
74 RouteUpdatesFeature = QGeoServiceProvider::RouteUpdatesFeature,
75 AlternativeRoutesFeature = QGeoServiceProvider::AlternativeRoutesFeature,
76 ExcludeAreasRoutingFeature = QGeoServiceProvider::ExcludeAreasRoutingFeature,
77 AnyRoutingFeatures = QGeoServiceProvider::AnyRoutingFeatures
80 enum GeocodingFeature {
81 NoGeocodingFeatures = QGeoServiceProvider::NoGeocodingFeatures,
82 OnlineGeocodingFeature = QGeoServiceProvider::OnlineGeocodingFeature,
83 OfflineGeocodingFeature = QGeoServiceProvider::OfflineGeocodingFeature,
84 ReverseGeocodingFeature = QGeoServiceProvider::ReverseGeocodingFeature,
85 LocalizedGeocodingFeature = QGeoServiceProvider::LocalizedGeocodingFeature,
86 AnyGeocodingFeatures = QGeoServiceProvider::AnyGeocodingFeatures
90 NoMappingFeatures = QGeoServiceProvider::NoMappingFeatures,
91 OnlineMappingFeature = QGeoServiceProvider::OnlineMappingFeature,
92 OfflineMappingFeature = QGeoServiceProvider::OfflineMappingFeature,
93 LocalizedMappingFeature = QGeoServiceProvider::LocalizedMappingFeature,
94 AnyMappingFeatures = QGeoServiceProvider::AnyMappingFeatures
98 NoPlacesFeatures = QGeoServiceProvider::NoPlacesFeatures,
99 OnlinePlacesFeature = QGeoServiceProvider::OnlinePlacesFeature,
100 OfflinePlacesFeature = QGeoServiceProvider::OfflinePlacesFeature,
101 SavePlaceFeature = QGeoServiceProvider::SavePlaceFeature,
102 RemovePlaceFeature = QGeoServiceProvider::RemovePlaceFeature,
103 SaveCategoryFeature = QGeoServiceProvider::SaveCategoryFeature,
104 RemoveCategoryFeature = QGeoServiceProvider::RemoveCategoryFeature,
105 PlaceRecommendationsFeature = QGeoServiceProvider::PlaceRecommendationsFeature,
106 SearchSuggestionsFeature = QGeoServiceProvider::SearchSuggestionsFeature,
107 LocalizedPlacesFeature = QGeoServiceProvider::LocalizedPlacesFeature,
108 NotificationsFeature = QGeoServiceProvider::NotificationsFeature,
109 PlaceMatchingFeature = QGeoServiceProvider::PlaceMatchingFeature,
110 AnyPlacesFeatures = QGeoServiceProvider::AnyPlacesFeatures
113 enum NavigationFeature {
114 NoNavigationFeatures = QGeoServiceProvider::NoNavigationFeatures,
115 OnlineNavigationFeature = QGeoServiceProvider::OnlineNavigationFeature,
116 OfflineNavigationFeature = QGeoServiceProvider::OfflineNavigationFeature,
117 AnyNavigationFeatures = QGeoServiceProvider::AnyNavigationFeatures
120 Q_DECLARE_FLAGS(RoutingFeatures, RoutingFeature)
121 Q_FLAGS(RoutingFeatures)
123 Q_DECLARE_FLAGS(GeocodingFeatures, GeocodingFeature)
124 Q_FLAGS(GeocodingFeatures)
126 Q_DECLARE_FLAGS(MappingFeatures, MappingFeature)
127 Q_FLAGS(MappingFeatures)
129 Q_DECLARE_FLAGS(PlacesFeatures, PlacesFeature)
130 Q_FLAGS(PlacesFeatures)
132 Q_DECLARE_FLAGS(NavigationFeatures, NavigationFeature)
133 Q_FLAGS(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;