Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qplacemanager.cpp
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#include "qplacemanager.h"
5
8
9#include <QtCore/QDebug>
10#include <QtCore/QLocale>
11
12
13#include <QtLocation/QPlace>
14#include <QtLocation/QPlaceCategory>
15#include <QtLocation/QPlaceContentReply>
16#include <QtLocation/QPlaceContentRequest>
17#include <QtLocation/QPlaceDetailsReply>
18#include <QtLocation/QPlaceIcon>
19#include <QtLocation/QPlaceIdReply>
20#include <QtLocation/QPlaceMatchReply>
21#include <QtLocation/QPlaceMatchRequest>
22#include <QtLocation/QPlaceReply>
23#include <QtLocation/QPlaceSearchSuggestionReply>
24#include <QtLocation/QPlaceSearchRequest>
25#include <QtLocation/QPlaceSearchResult>
26
28
121QPlaceManager::QPlaceManager(QPlaceManagerEngine *engine, QObject *parent)
122 : QObject(parent), d(engine)
123{
124 if (d) {
125 d->setParent(this);
126 d->d_ptr->manager = this;
127
128 qRegisterMetaType<QPlaceCategory>();
129
134
141
150 } else {
151 qFatal("The place manager engine that was set for this place manager was NULL.");
152 }
153}
154
160{
161 delete d;
162}
163
168{
169 return d->managerName();
170}
171
176{
177 return d->managerVersion();
178}
179
186{
187 return d->getPlaceDetails(placeId);
188}
189
199
209
221
228{
229 return d->savePlace(place);
230}
231
238{
239 return d->removePlace(placeId);
240}
241
249{
250 return d->saveCategory(category, parentId);
251}
252
259{
260 return d->removeCategory(categoryId);
261}
262
272
277{
278 return d->parentCategoryId(categoryId);
279}
280
286{
287 return d->childCategoryIds(parentId);
288}
289
294{
295 return d->category(categoryId);
296}
297
302QList<QPlaceCategory> QPlaceManager::childCategories(const QString &parentId) const
303{
304 return d->childCategories(parentId);
305}
306
325QList<QLocale> QPlaceManager::locales() const
326{
327 return d->locales();
328}
329
335{
336 QList<QLocale> locales;
337 locales << locale;
339}
340
344void QPlaceManager::setLocales(const QList<QLocale> &locales)
345{
347}
348
358{
359 return d->compatiblePlace(original);
360}
361
371
\inmodule QtCore
Definition qobject.h:103
void setParent(QObject *parent)
Makes the object a child of parent.
Definition qobject.cpp:2195
\inmodule QtLocation
\inmodule QtLocation
\inmodule QtLocation
\inmodule QtLocation
\inmodule QtLocation
\inmodule QtLocation
virtual QPlaceIdReply * removeCategory(const QString &categoryId)
Removes the category corresponding to categoryId from the manager engine's datastore.
virtual QPlaceIdReply * saveCategory(const QPlaceCategory &category, const QString &parentId)
Saves a category that is a child of the category specified by parentId.
void placeRemoved(const QString &placeId)
This signal is emitted if a place has been removed from the manager engine's datastore.
void finished(QPlaceReply *reply)
This signal is emitted when reply has finished processing.
void dataChanged()
This signal is emitted by the engine if there are large scale changes to its underlying datastore and...
virtual QPlaceSearchReply * search(const QPlaceSearchRequest &request)
Searches for places according to the parameters specified in request.
virtual QPlaceIdReply * savePlace(const QPlace &place)
Saves a specified place to the manager engine's datastore.
virtual QPlaceSearchSuggestionReply * searchSuggestions(const QPlaceSearchRequest &request)
Requests a set of search term suggestions according to the parameters specified in request.
virtual QPlaceDetailsReply * getPlaceDetails(const QString &placeId)
Retrieves details of place corresponding to the given placeId.
virtual QPlaceReply * initializeCategories()
Initializes the categories of the manager engine.
QString managerName() const
Returns the name which this engine implementation uses to distinguish itself from the implementations...
void placeAdded(const QString &placeId)
This signal is emitted if a place has been added to the manager engine's datastore.
int managerVersion() const
Returns the version of this engine implementation.
void categoryUpdated(const QPlaceCategory &category, const QString &parentCategoryId)
This signal is emitted if a category has been modified in the manager engine's datastore.
virtual QList< QLocale > locales() const
Returns a list of preferred locales.
void errorOccurred(QPlaceReply *, QPlaceReply::Error error, const QString &errorString=QString())
This signal is emitted when an error has been detected in the processing of reply.
virtual void setLocales(const QList< QLocale > &locales)
Set the list of preferred locales.
virtual QStringList childCategoryIds(const QString &categoryId) const
Returns the child category identifiers of the category corresponding to categoryId.
virtual QPlaceContentReply * getPlaceContent(const QPlaceContentRequest &request)
Retrieves content for a place according to the parameters specified in request.
virtual QPlaceMatchReply * matchingPlaces(const QPlaceMatchRequest &request)
Returns a reply which contains a list of places which correspond/match those specified in request.
virtual QList< QPlaceCategory > childCategories(const QString &parentId) const
Returns a list of categories that are children of the category corresponding to parentId.
void categoryAdded(const QPlaceCategory &category, const QString &parentCategoryId)
This signal is emitted if a category has been added to the manager engine's datastore.
void placeUpdated(const QString &placeId)
This signal is emitted if a place has been modified in the manager engine's datastore.
virtual QPlace compatiblePlace(const QPlace &original) const
Returns a pruned or modified version of the original place which is suitable to be saved by the manag...
void categoryRemoved(const QString &categoryId, const QString &parentCategoryId)
This signal is emitted when the category corresponding to categoryId has been removed from the manage...
virtual QPlaceIdReply * removePlace(const QString &placeId)
Removes the place corresponding to placeId from the manager engine's datastore.
virtual QPlaceCategory category(const QString &categoryId) const
Returns the category corresponding to the given categoryId.
virtual QString parentCategoryId(const QString &categoryId) const
Returns the parent category identifier of the category corresponding to categoryId.
QPlaceMatchReply * matchingPlaces(const QPlaceMatchRequest &request) const
Returns a reply which contains a list of places which correspond/match those specified in the request...
QList< QLocale > locales() const
Returns a list of preferred locales.
QPlaceCategory category(const QString &categoryId) const
Returns the category corresponding to the given categoryId.
void errorOccurred(QPlaceReply *, QPlaceReply::Error error, const QString &errorString=QString())
This signal is emitted when an error has been detected in the processing of reply.
QStringList childCategoryIds(const QString &parentId=QString()) const
Returns the child category identifiers of the category corresponding to parentId.
void categoryAdded(const QPlaceCategory &category, const QString &parentId)
This signal is emitted if a category has been added to the manager's datastore.
QPlaceIdReply * savePlace(const QPlace &place)
Saves a specified place.
QString managerName() const
Returns the name of the manager.
QPlaceSearchSuggestionReply * searchSuggestions(const QPlaceSearchRequest &request) const
Requests a set of search term suggestions according to the parameters specified in request.
QPlaceSearchReply * search(const QPlaceSearchRequest &query) const
Searches for places according to the parameters specified in request.
QPlaceDetailsReply * getPlaceDetails(const QString &placeId) const
Retrieves a details of place corresponding to the given placeId.
void placeUpdated(const QString &placeId)
This signal is emitted if a place has been modified in the manager's datastore.
void setLocale(const QLocale &locale)
Convenience function which sets the manager's list of preferred locales to a single locale.
QPlaceIdReply * removeCategory(const QString &categoryId)
Removes the category corresponding to categoryId from the manager.
QPlace compatiblePlace(const QPlace &place) const
Returns a pruned or modified version of the original place which is suitable to be saved into this ma...
QPlaceContentReply * getPlaceContent(const QPlaceContentRequest &request) const
Retrieves content for a place according to the parameters specified in request.
void finished(QPlaceReply *reply)
This signal is emitted when reply has finished processing.
QString parentCategoryId(const QString &categoryId) const
Returns the parent category identifier of the category corresponding to categoryId.
int managerVersion() const
Returns the manager version.
void placeAdded(const QString &placeId)
This signal is emitted if a place has been added to the manager engine's datastore.
QPlaceIdReply * saveCategory(const QPlaceCategory &category, const QString &parentId=QString())
Saves a category that is a child of the category specified by parentId.
QPlaceReply * initializeCategories()
Initializes the categories of the manager.
QList< QPlaceCategory > childCategories(const QString &parentId=QString()) const
Returns a list of categories that are children of the category corresponding to parentId.
~QPlaceManager()
Destroys the manager.
void categoryRemoved(const QString &categoryId, const QString &parentId)
This signal is emitted when the category corresponding to categoryId has been removed from the manage...
void dataChanged()
This signal is emitted by the manager if there are large scale changes to its underlying datastore an...
void setLocales(const QList< QLocale > &locale)
Set the list of preferred locales.
void placeRemoved(const QString &placeId)
This signal is emitted if a place has been removed from the manager's datastore.
QPlaceIdReply * removePlace(const QString &placeId)
Removes the place corresponding to placeId from the manager.
void categoryUpdated(const QPlaceCategory &category, const QString &parentId)
This signal is emitted if a category has been modified in the manager's datastore.
\inmodule QtLocation
\inmodule QtLocation
\inmodule QtLocation
Definition qplacereply.h:15
\inmodule QtLocation
\inmodule QtLocation
\inmodule QtLocation
Definition qplace.h:25
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
const QLoggingCategory & category()
[1]
Combined button and popup list for selecting options.
@ QueuedConnection
#define qFatal
Definition qlogging.h:168
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
QNetworkRequest request(url)
QJSEngine engine
[0]