47 QML_NAMED_ELEMENT(Plugin)
48 QML_ADDED_IN_VERSION(5, 0)
50 Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
51 Q_PROPERTY(QStringList availableServiceProviders READ availableServiceProviders CONSTANT)
52 Q_PROPERTY(QQmlListProperty<QDeclarativePluginParameter> parameters READ parameters)
53 Q_PROPERTY(QDeclarativeGeoServiceProviderRequirements *required READ requirements WRITE setRequirements)
54 Q_PROPERTY(QStringList locales READ locales WRITE setLocales NOTIFY localesChanged)
55 Q_PROPERTY(QStringList preferred READ preferred WRITE setPreferred NOTIFY preferredChanged)
56 Q_PROPERTY(
bool allowExperimental READ allowExperimental WRITE setAllowExperimental NOTIFY allowExperimentalChanged)
57 Q_PROPERTY(
bool isAttached READ isAttached NOTIFY attached)
59 Q_CLASSINFO(
"DefaultProperty",
"parameters")
60 Q_INTERFACES(QQmlParserStatus)
63 explicit QDeclarativeGeoServiceProvider(QObject *parent =
nullptr);
64 ~QDeclarativeGeoServiceProvider();
67 NoRoutingFeatures = QGeoServiceProvider::NoRoutingFeatures,
68 OnlineRoutingFeature = QGeoServiceProvider::OnlineRoutingFeature,
69 OfflineRoutingFeature = QGeoServiceProvider::OfflineRoutingFeature,
70 LocalizedRoutingFeature = QGeoServiceProvider::LocalizedRoutingFeature,
71 RouteUpdatesFeature = QGeoServiceProvider::RouteUpdatesFeature,
72 AlternativeRoutesFeature = QGeoServiceProvider::AlternativeRoutesFeature,
73 ExcludeAreasRoutingFeature = QGeoServiceProvider::ExcludeAreasRoutingFeature,
74 AnyRoutingFeatures = QGeoServiceProvider::AnyRoutingFeatures
77 enum GeocodingFeature {
78 NoGeocodingFeatures = QGeoServiceProvider::NoGeocodingFeatures,
79 OnlineGeocodingFeature = QGeoServiceProvider::OnlineGeocodingFeature,
80 OfflineGeocodingFeature = QGeoServiceProvider::OfflineGeocodingFeature,
81 ReverseGeocodingFeature = QGeoServiceProvider::ReverseGeocodingFeature,
82 LocalizedGeocodingFeature = QGeoServiceProvider::LocalizedGeocodingFeature,
83 AnyGeocodingFeatures = QGeoServiceProvider::AnyGeocodingFeatures
87 NoMappingFeatures = QGeoServiceProvider::NoMappingFeatures,
88 OnlineMappingFeature = QGeoServiceProvider::OnlineMappingFeature,
89 OfflineMappingFeature = QGeoServiceProvider::OfflineMappingFeature,
90 LocalizedMappingFeature = QGeoServiceProvider::LocalizedMappingFeature,
91 AnyMappingFeatures = QGeoServiceProvider::AnyMappingFeatures
95 NoPlacesFeatures = QGeoServiceProvider::NoPlacesFeatures,
96 OnlinePlacesFeature = QGeoServiceProvider::OnlinePlacesFeature,
97 OfflinePlacesFeature = QGeoServiceProvider::OfflinePlacesFeature,
98 SavePlaceFeature = QGeoServiceProvider::SavePlaceFeature,
99 RemovePlaceFeature = QGeoServiceProvider::RemovePlaceFeature,
100 SaveCategoryFeature = QGeoServiceProvider::SaveCategoryFeature,
101 RemoveCategoryFeature = QGeoServiceProvider::RemoveCategoryFeature,
102 PlaceRecommendationsFeature = QGeoServiceProvider::PlaceRecommendationsFeature,
103 SearchSuggestionsFeature = QGeoServiceProvider::SearchSuggestionsFeature,
104 LocalizedPlacesFeature = QGeoServiceProvider::LocalizedPlacesFeature,
105 NotificationsFeature = QGeoServiceProvider::NotificationsFeature,
106 PlaceMatchingFeature = QGeoServiceProvider::PlaceMatchingFeature,
107 AnyPlacesFeatures = QGeoServiceProvider::AnyPlacesFeatures
110 enum NavigationFeature {
111 NoNavigationFeatures = QGeoServiceProvider::NoNavigationFeatures,
112 OnlineNavigationFeature = QGeoServiceProvider::OnlineNavigationFeature,
113 OfflineNavigationFeature = QGeoServiceProvider::OfflineNavigationFeature,
114 AnyNavigationFeatures = QGeoServiceProvider::AnyNavigationFeatures
117 Q_ENUM(RoutingFeature)
118 Q_DECLARE_FLAGS(RoutingFeatures, RoutingFeature)
119 Q_FLAG(RoutingFeatures)
121 Q_ENUM(GeocodingFeature)
122 Q_DECLARE_FLAGS(GeocodingFeatures, GeocodingFeature)
123 Q_FLAG(GeocodingFeatures)
125 Q_ENUM(MappingFeature)
126 Q_DECLARE_FLAGS(MappingFeatures, MappingFeature)
127 Q_FLAG(MappingFeatures)
129 Q_ENUM(PlacesFeature)
130 Q_DECLARE_FLAGS(PlacesFeatures, PlacesFeature)
131 Q_FLAG(PlacesFeatures)
133 Q_DECLARE_FLAGS(NavigationFeatures, NavigationFeature)
134 Q_FLAG(NavigationFeatures)
137 void classBegin() override {}
138 void componentComplete() override;
140 void setName(
const QString &name);
141 QString name()
const;
143 QQmlListProperty<QDeclarativePluginParameter> parameters();
144 QVariantMap parameterMap()
const;
146 QStringList availableServiceProviders();
148 QDeclarativeGeoServiceProviderRequirements *requirements()
const;
149 void setRequirements(QDeclarativeGeoServiceProviderRequirements *req);
151 QStringList preferred()
const;
152 void setPreferred(
const QStringList &val);
154 QGeoServiceProvider *sharedGeoServiceProvider()
const;
156 Q_INVOKABLE
bool supportsRouting(
const RoutingFeatures &feature = AnyRoutingFeatures)
const;
157 Q_INVOKABLE
bool supportsGeocoding(
const GeocodingFeatures &feature = AnyGeocodingFeatures)
const;
158 Q_INVOKABLE
bool supportsMapping(
const MappingFeatures &feature = AnyMappingFeatures)
const;
159 Q_INVOKABLE
bool supportsPlaces(
const PlacesFeatures &feature = AnyPlacesFeatures)
const;
160 Q_REVISION(5, 11) Q_INVOKABLE
bool supportsNavigation(
const NavigationFeature &feature = AnyNavigationFeatures)
const;
162 QStringList locales()
const;
163 void setLocales(
const QStringList &locales);
165 bool isAttached()
const;
167 void setAllowExperimental(
bool allow);
168 bool allowExperimental()
const;
171 void nameChanged(
const QString &name);
172 void localesChanged();
174 void preferredChanged(
const QStringList &preferences);
175 void allowExperimentalChanged(
bool allow);
178 bool parametersReady();
180 static void parameter_append(QQmlListProperty<QDeclarativePluginParameter> *prop, QDeclarativePluginParameter *mapObject);
181 static qsizetype parameter_count(QQmlListProperty<QDeclarativePluginParameter> *prop);
182 static QDeclarativePluginParameter *parameter_at(QQmlListProperty<QDeclarativePluginParameter> *prop, qsizetype index);
183 static void parameter_clear(QQmlListProperty<QDeclarativePluginParameter> *prop);
185 std::unique_ptr<QGeoServiceProvider> sharedProvider_;
187 QList<QDeclarativePluginParameter *> parameters_;
188 std::unique_ptr<QDeclarativeGeoServiceProviderRequirements> required_;
189 bool complete_ =
false;
190 bool experimental_ =
false;
191 QStringList locales_;
193 Q_DISABLE_COPY(QDeclarativeGeoServiceProvider)
199 QML_NAMED_ELEMENT(PluginRequirements)
200 QML_UNCREATABLE(
"PluginRequirements is not intended instantiable by developer.")
201 QML_ADDED_IN_VERSION(5, 0)
202 Q_PROPERTY(QDeclarativeGeoServiceProvider::MappingFeatures mapping
203 READ mappingRequirements WRITE setMappingRequirements
204 NOTIFY mappingRequirementsChanged)
205 Q_PROPERTY(QDeclarativeGeoServiceProvider::RoutingFeatures routing
206 READ routingRequirements WRITE setRoutingRequirements
207 NOTIFY routingRequirementsChanged)
208 Q_PROPERTY(QDeclarativeGeoServiceProvider::GeocodingFeatures geocoding
209 READ geocodingRequirements WRITE setGeocodingRequirements
210 NOTIFY geocodingRequirementsChanged)
211 Q_PROPERTY(QDeclarativeGeoServiceProvider::PlacesFeatures places
212 READ placesRequirements WRITE setPlacesRequirements
213 NOTIFY placesRequirementsChanged)
214 Q_PROPERTY(QDeclarativeGeoServiceProvider::NavigationFeatures navigation
215 READ navigationRequirements WRITE setNavigationRequirements
216 NOTIFY navigationRequirementsChanged)
219 explicit QDeclarativeGeoServiceProviderRequirements(QObject *parent =
nullptr);
220 ~QDeclarativeGeoServiceProviderRequirements();
222 QDeclarativeGeoServiceProvider::MappingFeatures mappingRequirements()
const;
223 void setMappingRequirements(
const QDeclarativeGeoServiceProvider::MappingFeatures &features);
225 QDeclarativeGeoServiceProvider::RoutingFeatures routingRequirements()
const;
226 void setRoutingRequirements(
const QDeclarativeGeoServiceProvider::RoutingFeatures &features);
228 QDeclarativeGeoServiceProvider::GeocodingFeatures geocodingRequirements()
const;
229 void setGeocodingRequirements(
const QDeclarativeGeoServiceProvider::GeocodingFeatures &features);
231 QDeclarativeGeoServiceProvider::PlacesFeatures placesRequirements()
const;
232 void setPlacesRequirements(
const QDeclarativeGeoServiceProvider::PlacesFeatures &features);
234 QDeclarativeGeoServiceProvider::NavigationFeatures navigationRequirements()
const;
235 void setNavigationRequirements(
const QDeclarativeGeoServiceProvider::NavigationFeatures &features);
237 Q_INVOKABLE
bool matches(
const QGeoServiceProvider *provider)
const;
239 bool operator == (
const QDeclarativeGeoServiceProviderRequirements &rhs)
const;
242 void mappingRequirementsChanged(
const QDeclarativeGeoServiceProvider::MappingFeatures &features);
243 void routingRequirementsChanged(
const QDeclarativeGeoServiceProvider::RoutingFeatures &features);
244 void geocodingRequirementsChanged(
const QDeclarativeGeoServiceProvider::GeocodingFeatures &features);
245 void placesRequirementsChanged(
const QDeclarativeGeoServiceProvider::PlacesFeatures &features);
246 void navigationRequirementsChanged(
const QDeclarativeGeoServiceProvider::NavigationFeatures &features);
248 void requirementsChanged();
251 QDeclarativeGeoServiceProvider::MappingFeatures mapping_ = QDeclarativeGeoServiceProvider::NoMappingFeatures;
252 QDeclarativeGeoServiceProvider::RoutingFeatures routing_ = QDeclarativeGeoServiceProvider::NoRoutingFeatures;
253 QDeclarativeGeoServiceProvider::GeocodingFeatures geocoding_ = QDeclarativeGeoServiceProvider::NoGeocodingFeatures;
254 QDeclarativeGeoServiceProvider::PlacesFeatures places_ = QDeclarativeGeoServiceProvider::NoPlacesFeatures;
255 QDeclarativeGeoServiceProvider::NavigationFeatures navigation_ = QDeclarativeGeoServiceProvider::NoNavigationFeatures;