summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorabcd <qt-info@nokia.com>2011-07-31 21:33:56 +1000
committerabcd <qt_abcd1@ovi.com>2011-08-09 03:48:02 +0200
commit2904df66e87534ff348f7af13b0d513c8ecc746c (patch)
tree70fb416d39158f80d9445e1e9f0d1a2c6de20b48 /src
parent38e2574bf27f66100bf9ec16592f938a4b7a02b1 (diff)
downloadqtlocation-2904df66e87534ff348f7af13b0d513c8ecc746c.tar.gz
Rename QGeoSearchManager to QGeocodingManager
Also do related renames like QGeoSearchReply to QGeocodeReply Change-Id: I31cc6da4fda03299e905b4938cdfcff3c20aa8c7 Reviewed-on: http://codereview.qt.nokia.com/2710 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: abcd <qt_abcd1@ovi.com>
Diffstat (limited to 'src')
-rw-r--r--src/imports/location/qdeclarativegeocodemodel.cpp42
-rw-r--r--src/imports/location/qdeclarativegeocodemodel_p.h14
-rw-r--r--src/imports/location/qdeclarativegeosearchmodel.cpp221
-rw-r--r--src/imports/location/qdeclarativegeosearchmodel_p.h137
-rw-r--r--src/imports/location/qdeclarativegeoserviceprovider.cpp10
-rw-r--r--src/imports/location/qdeclarativereversegeocodemodel.cpp144
-rw-r--r--src/imports/location/qdeclarativereversegeocodemodel_p.h84
-rw-r--r--src/location/maps/maps.pri18
-rw-r--r--src/location/maps/qgeocodereply.cpp (renamed from src/location/maps/qgeosearchreply.cpp)106
-rw-r--r--src/location/maps/qgeocodereply.h (renamed from src/location/maps/qgeosearchreply.h)20
-rw-r--r--src/location/maps/qgeocodereply_p.h (renamed from src/location/maps/qgeosearchreply_p.h)18
-rw-r--r--src/location/maps/qgeocodingmanager.cpp (renamed from src/location/maps/qgeosearchmanager.cpp)144
-rw-r--r--src/location/maps/qgeocodingmanager.h (renamed from src/location/maps/qgeosearchmanager.h)36
-rw-r--r--src/location/maps/qgeocodingmanager_p.h (renamed from src/location/maps/qgeosearchmanager_p.h)20
-rw-r--r--src/location/maps/qgeocodingmanagerengine.cpp (renamed from src/location/maps/qgeosearchmanagerengine.cpp)126
-rw-r--r--src/location/maps/qgeocodingmanagerengine.h (renamed from src/location/maps/qgeosearchmanagerengine.h)35
-rw-r--r--src/location/maps/qgeocodingmanagerengine_p.h (renamed from src/location/maps/qgeosearchmanagerengine_p.h)14
-rw-r--r--src/location/maps/qgeoserviceprovider.cpp54
-rw-r--r--src/location/maps/qgeoserviceprovider.h6
-rw-r--r--src/location/maps/qgeoserviceprovider_p.h8
-rw-r--r--src/location/maps/qgeoserviceproviderfactory.cpp10
-rw-r--r--src/location/maps/qgeoserviceproviderfactory.h2
-rw-r--r--src/plugins/geoservices/nokia/nokia.pro10
-rw-r--r--src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp (renamed from src/plugins/geoservices/nokia/qgeosearchreply_nokia.cpp)20
-rw-r--r--src/plugins/geoservices/nokia/qgeocodereply_nokia.h (renamed from src/plugins/geoservices/nokia/qgeosearchreply_nokia.h)8
-rw-r--r--src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.cpp (renamed from src/plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.cpp)52
-rw-r--r--src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.h (renamed from src/plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.h)22
-rw-r--r--src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp6
-rw-r--r--src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.h2
29 files changed, 396 insertions, 993 deletions
diff --git a/src/imports/location/qdeclarativegeocodemodel.cpp b/src/imports/location/qdeclarativegeocodemodel.cpp
index f3c826fd..c52596e6 100644
--- a/src/imports/location/qdeclarativegeocodemodel.cpp
+++ b/src/imports/location/qdeclarativegeocodemodel.cpp
@@ -45,7 +45,7 @@
#include <QtDeclarative/qdeclarativeinfo.h>
#include <qgeoserviceprovider.h>
-#include <qgeosearchmanager.h>
+#include <qgeocodingmanager.h>
QT_BEGIN_NAMESPACE
@@ -105,8 +105,8 @@ void QDeclarativeGeocodeModel::update()
if (!serviceProvider)
return;
- QGeoSearchManager *searchManager = serviceProvider->searchManager();
- if (!searchManager) {
+ QGeocodingManager *geocodingManager = serviceProvider->geocodingManager();
+ if (!geocodingManager) {
qmlInfo(this) << tr("Cannot geocode, search manager (/plugin) not set.");
return;
}
@@ -120,22 +120,22 @@ void QDeclarativeGeocodeModel::update()
if (coordinate_) {
setStatus(QDeclarativeGeocodeModel::Loading);
- reply_ = searchManager->reverseGeocode(coordinate_->coordinate(), boundingArea());
+ reply_ = geocodingManager->reverseGeocode(coordinate_->coordinate(), boundingArea());
if (reply_->isFinished()) {
- if (reply_->error() == QGeoSearchReply::NoError) {
- searchFinished(reply_);
+ if (reply_->error() == QGeocodeReply::NoError) {
+ geocodeFinished(reply_);
} else {
- searchError(reply_, reply_->error(), reply_->errorString());
+ geocodeError(reply_, reply_->error(), reply_->errorString());
}
}
} else if (address_) {
setStatus(QDeclarativeGeocodeModel::Loading);
- reply_ = searchManager->geocode(address_->address(), boundingArea());
+ reply_ = geocodingManager->geocode(address_->address(), boundingArea());
if (reply_->isFinished()) {
- if (reply_->error() == QGeoSearchReply::NoError) {
- searchFinished(reply_);
+ if (reply_->error() == QGeocodeReply::NoError) {
+ geocodeFinished(reply_);
} else {
- searchError(reply_, reply_->error(), reply_->errorString());
+ geocodeError(reply_, reply_->error(), reply_->errorString());
}
}
}
@@ -186,15 +186,15 @@ void QDeclarativeGeocodeModel::setPlugin(QDeclarativeGeoServiceProvider *plugin)
if (complete_)
emit pluginChanged();
QGeoServiceProvider *serviceProvider = plugin_->sharedGeoServiceProvider();
- QGeoSearchManager *searchManager = serviceProvider->searchManager();
- if (!searchManager || serviceProvider->error() != QGeoServiceProvider::NoError) {
+ QGeocodingManager *geocodingManager = serviceProvider->geocodingManager();
+ if (!geocodingManager || serviceProvider->error() != QGeoServiceProvider::NoError) {
qmlInfo(this) << tr("Warning: Plugin does not support (reverse) geocoding.");
return;
}
- connect(searchManager, SIGNAL(finished(QGeoSearchReply*)),
- this, SLOT(searchFinished(QGeoSearchReply*)));
- connect(searchManager, SIGNAL(error(QGeoSearchReply*,QGeoSearchReply::Error,QString)),
- this, SLOT(searchError(QGeoSearchReply*,QGeoSearchReply::Error,QString)));
+ connect(geocodingManager, SIGNAL(finished(QGeocodeReply*)),
+ this, SLOT(geocodeFinished(QGeocodeReply*)));
+ connect(geocodingManager, SIGNAL(error(QGeocodeReply*,QGeocodeReply::Error,QString)),
+ this, SLOT(geocodeError(QGeocodeReply*,QGeocodeReply::Error,QString)));
}
QDeclarativeGeoServiceProvider* QDeclarativeGeocodeModel::plugin() const
@@ -223,9 +223,9 @@ QObject* QDeclarativeGeocodeModel::bounds() const
return boundingArea_;
}
-void QDeclarativeGeocodeModel::searchFinished(QGeoSearchReply *reply)
+void QDeclarativeGeocodeModel::geocodeFinished(QGeocodeReply *reply)
{
- if (reply->error() != QGeoSearchReply::NoError) {
+ if (reply->error() != QGeocodeReply::NoError) {
return;
}
int oldCount = declarativeLocations_.count();
@@ -239,8 +239,8 @@ void QDeclarativeGeocodeModel::searchFinished(QGeoSearchReply *reply)
emit countChanged();
}
-void QDeclarativeGeocodeModel::searchError(QGeoSearchReply *reply,
- QGeoSearchReply::Error error,
+void QDeclarativeGeocodeModel::geocodeError(QGeocodeReply *reply,
+ QGeocodeReply::Error error,
const QString &errorString)
{
Q_UNUSED(error);
diff --git a/src/imports/location/qdeclarativegeocodemodel_p.h b/src/imports/location/qdeclarativegeocodemodel_p.h
index 5a649f2c..5c8da37c 100644
--- a/src/imports/location/qdeclarativegeocodemodel_p.h
+++ b/src/imports/location/qdeclarativegeocodemodel_p.h
@@ -45,7 +45,7 @@
#include "qdeclarativegeoserviceprovider_p.h"
#include "qdeclarativegeoboundingcircle_p.h"
-#include <qgeosearchreply.h>
+#include <qgeocodereply.h>
#include <QtDeclarative/qdeclarative.h>
#include <QDeclarativeParserStatus>
@@ -56,7 +56,7 @@
QT_BEGIN_NAMESPACE
class QGeoServiceProvider;
-class QGeoSearchManager;
+class QGeocodingManager;
class QDeclarativeGeoLocation;
class QDeclarativeGeocodeModel : public QAbstractListModel, public QDeclarativeParserStatus
@@ -131,13 +131,13 @@ public Q_SLOTS:
protected Q_SLOTS:
void queryContentChanged();
- void searchFinished(QGeoSearchReply *reply);
- void searchError(QGeoSearchReply *reply,
- QGeoSearchReply::Error error,
+ void geocodeFinished(QGeocodeReply *reply);
+ void geocodeError(QGeocodeReply *reply,
+ QGeocodeReply::Error error,
const QString &errorString);
protected:
- QGeoSearchManager* searchManager();
+ QGeocodingManager* searchManager();
void setStatus(Status status);
void setError(const QString &error);
bool autoUpdate_;
@@ -147,7 +147,7 @@ private:
void setLocations(const QList<QGeoLocation> &locations);
QGeoBoundingArea* boundingArea();
void abortRequest();
- QGeoSearchReply* reply_;
+ QGeocodeReply* reply_;
QDeclarativeGeoServiceProvider* plugin_;
QPointer<QObject> boundingArea_;
diff --git a/src/imports/location/qdeclarativegeosearchmodel.cpp b/src/imports/location/qdeclarativegeosearchmodel.cpp
deleted file mode 100644
index 220fffca..00000000
--- a/src/imports/location/qdeclarativegeosearchmodel.cpp
+++ /dev/null
@@ -1,221 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qdeclarativegeosearchmodel_p.h"
-
-#include "qdeclarativegeoplace_p.h"
-#include "qdeclarativelandmark_p.h"
-
-#include <qgeoserviceprovider.h>
-#include <qgeosearchmanager.h>
-
-QT_BEGIN_NAMESPACE
-
-QDeclarativeGeoSearchModel::QDeclarativeGeoSearchModel(QObject* parent)
- : QAbstractListModel(parent),
- plugin_(0),
- serviceProvider_(0),
- searchManager_(0),
- status_(QDeclarativeGeoSearchModel::Null)
-{
- QHash<int, QByteArray> roleNames;
- roleNames = QAbstractItemModel::roleNames();
- roleNames.insert(PlaceRole, "place");
- roleNames.insert(LandmarkRole, "landmark");
- setRoleNames(roleNames);
-}
-
-QDeclarativeGeoSearchModel::~QDeclarativeGeoSearchModel()
-{
- if (serviceProvider_)
- delete serviceProvider_;
-}
-
-// From QDeclarativeParserStatus
-void QDeclarativeGeoSearchModel::classBegin() {}
-void QDeclarativeGeoSearchModel::componentComplete() {}
-
-// From QAbstractListModel
-int QDeclarativeGeoSearchModel::rowCount(const QModelIndex &parent) const
-{
- return places_.count();
-}
-
-QVariant QDeclarativeGeoSearchModel::data(const QModelIndex &index, int role) const
-{
- if (!index.isValid())
- return QVariant();
-
- if (index.row() > places_.count())
- return QVariant();
-
- QGeoPlace place = places_.at(index.row());
-
- if (role == QDeclarativeGeoSearchModel::PlaceRole) {
- return QVariant::fromValue(new QDeclarativeGeoPlace(place, const_cast<QDeclarativeGeoSearchModel*>(this)));
- } else if (role == QDeclarativeGeoSearchModel::LandmarkRole) {
- if (place.isLandmark())
- return QVariant::fromValue(QLandmark(place));
- }
-
- return QVariant();
-}
-
-QVariant QDeclarativeGeoSearchModel::headerData(int section, Qt::Orientation /*orientation*/, int role) const
-{
- if (section != 0)
- return QVariant();
-
- if (role == QDeclarativeGeoSearchModel::PlaceRole) {
- return QString("Place");
- } else if (role == QDeclarativeGeoSearchModel::LandmarkRole) {
- return QString("Landmark");
- }
-
- return QVariant();
-}
-
-void QDeclarativeGeoSearchModel::setPlugin(QDeclarativeGeoServiceProvider *plugin)
-{
- if (plugin_ || !plugin)
- return;
-
- plugin_ = plugin;
-
- emit pluginChanged(plugin_);
-
- serviceProvider_ = new QGeoServiceProvider(plugin_->name(),
- plugin_->parameterMap());
-
- // check for error
-
- searchManager_ = serviceProvider_->searchManager();
-
- connect(searchManager_,
- SIGNAL(finished(QGeoSearchReply*)),
- this,
- SLOT(searchFinished(QGeoSearchReply*)));
-
- connect(searchManager_,
- SIGNAL(error(QGeoSearchReply*, QGeoSearchReply::Error, QString)),
- this,
- SLOT(searchError(QGeoSearchReply*, QGeoSearchReply::Error, QString)));
-}
-
-QDeclarativeGeoServiceProvider* QDeclarativeGeoSearchModel::plugin() const
-{
- return plugin_;
-}
-
-void QDeclarativeGeoSearchModel::searchFinished(QGeoSearchReply *reply)
-{
- if (reply->error() != QGeoSearchReply::NoError)
- return;
-
- setPlaces(reply->places());
-
- setError("");
- setStatus(QDeclarativeGeoSearchModel::Ready);
-
- reply->deleteLater();
-
- emit placesChanged();
-}
-
-void QDeclarativeGeoSearchModel::searchError(QGeoSearchReply *reply,
- QGeoSearchReply::Error error,
- const QString &errorString)
-{
- setError(errorString);
- setStatus(QDeclarativeGeoSearchModel::Error);
- reply->deleteLater();
-}
-
-QDeclarativeGeoSearchModel::Status QDeclarativeGeoSearchModel::status() const
-{
- return status_;
-}
-
-void QDeclarativeGeoSearchModel::setStatus(QDeclarativeGeoSearchModel::Status status)
-{
- if (status_ == status)
- return;
-
- status_ = status;
-
- emit statusChanged(status_);
-}
-
-QString QDeclarativeGeoSearchModel::error() const
-{
- return error_;
-}
-
-void QDeclarativeGeoSearchModel::setError(const QString &error)
-{
- if (error_ == error)
- return;
-
- error_ = error;
-
- emit errorChanged(error_);
-}
-
-QGeoSearchManager* QDeclarativeGeoSearchModel::searchManager()
-{
- return searchManager_;
-}
-
-QList<QGeoPlace> QDeclarativeGeoSearchModel::places() const
-{
- return places_;
-}
-
-void QDeclarativeGeoSearchModel::setPlaces(const QList<QGeoPlace> &places)
-{
- beginResetModel();
- places_ = places;
- endResetModel();
-}
-
-#include "moc_qdeclarativegeosearchmodel_p.cpp"
-
-QT_END_NAMESPACE
diff --git a/src/imports/location/qdeclarativegeosearchmodel_p.h b/src/imports/location/qdeclarativegeosearchmodel_p.h
deleted file mode 100644
index 175a5721..00000000
--- a/src/imports/location/qdeclarativegeosearchmodel_p.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QDECLARATIVEGEOSEARCHMODEL_H
-#define QDECLARATIVEGEOSEARCHMODEL_H
-
-#include "qdeclarativegeoserviceprovider_p.h"
-
-#include <qgeosearchreply.h>
-
-#include <QtDeclarative/qdeclarative.h>
-#include <QDeclarativeParserStatus>
-#include <QAbstractListModel>
-
-QT_BEGIN_NAMESPACE
-
-class QGeoServiceProvider;
-class QGeoSearchManager;
-class QDeclarativeGeoPlace;
-
-class QDeclarativeGeoSearchModel : public QAbstractListModel, public QDeclarativeParserStatus
-{
- Q_OBJECT
- Q_ENUMS(Status)
-
- Q_PROPERTY(QDeclarativeGeoServiceProvider *plugin READ plugin WRITE setPlugin NOTIFY pluginChanged)
- Q_PROPERTY(Status status READ status NOTIFY statusChanged)
- Q_PROPERTY(QString error READ error NOTIFY errorChanged)
- Q_INTERFACES(QDeclarativeParserStatus)
-
-public:
- enum Status {
- Null,
- Ready,
- Loading,
- Error
- };
-
- enum Roles {
- PlaceRole = Qt::UserRole + 499,
- LandmarkRole = Qt::UserRole + 500
- };
-
- explicit QDeclarativeGeoSearchModel(QObject* parent = 0);
- virtual ~QDeclarativeGeoSearchModel();
-
- // From QDeclarativeParserStatus
- virtual void classBegin();
- virtual void componentComplete();
-
- // From QAbstractListModel
- virtual int rowCount(const QModelIndex &parent) const;
- virtual QVariant data(const QModelIndex &index, int role) const;
- virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
-
- void setPlugin(QDeclarativeGeoServiceProvider *plugin);
- QDeclarativeGeoServiceProvider* plugin() const;
-
- Status status() const;
-
- QString error() const;
-
-Q_SIGNALS:
- void pluginChanged(QDeclarativeGeoServiceProvider *plugin);
- void statusChanged(QDeclarativeGeoSearchModel::Status status);
- void errorChanged(const QString &error);
- void placesChanged();
-
-private Q_SLOTS:
- void searchFinished(QGeoSearchReply *reply);
- void searchError(QGeoSearchReply *reply,
- QGeoSearchReply::Error error,
- const QString &errorString);
-
-protected:
- QGeoSearchManager* searchManager();
-
- QList<QGeoPlace> places() const;
-
- void setStatus(Status status);
-
- void setError(const QString &error);
-
-private:
- void setPlaces(const QList<QGeoPlace> &places);
-
- QDeclarativeGeoServiceProvider* plugin_;
- QGeoServiceProvider* serviceProvider_;
- QGeoSearchManager* searchManager_;
-
- Status status_;
- QString error_;
- QList<QGeoPlace> places_;
-};
-
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/imports/location/qdeclarativegeoserviceprovider.cpp b/src/imports/location/qdeclarativegeoserviceprovider.cpp
index b2f1204e..aa7029ed 100644
--- a/src/imports/location/qdeclarativegeoserviceprovider.cpp
+++ b/src/imports/location/qdeclarativegeoserviceprovider.cpp
@@ -41,7 +41,7 @@
#include "qdeclarativegeoserviceprovider_p.h"
#include "qgeoserviceprovider.h"
-#include "qgeosearchmanager.h"
+#include "qgeocodingmanager.h"
#include "qgeomappingmanager.h"
#include "qgeoroutingmanager.h"
@@ -104,13 +104,13 @@ void QDeclarativeGeoServiceProvider::updateSupportStatus()
return;
}
- QGeoSearchManager* searchManager = serviceProvider->searchManager();
- if (!searchManager || serviceProvider->error() != QGeoServiceProvider::NoError) {
+ QGeocodingManager* geocodingManager = serviceProvider->geocodingManager();
+ if (!geocodingManager || serviceProvider->error() != QGeoServiceProvider::NoError) {
setSupportsGeocoding(false);
setSupportsReverseGeocoding(false);
} else {
- setSupportsGeocoding(searchManager->supportsGeocoding());
- setSupportsReverseGeocoding(searchManager->supportsReverseGeocoding());
+ setSupportsGeocoding(geocodingManager->supportsGeocoding());
+ setSupportsReverseGeocoding(geocodingManager->supportsReverseGeocoding());
}
QGeoRoutingManager* routingManager = serviceProvider->routingManager();
diff --git a/src/imports/location/qdeclarativereversegeocodemodel.cpp b/src/imports/location/qdeclarativereversegeocodemodel.cpp
deleted file mode 100644
index ecd46014..00000000
--- a/src/imports/location/qdeclarativereversegeocodemodel.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qdeclarativereversegeocodemodel_p.h"
-
-#include <qgeosearchmanager.h>
-
-QT_BEGIN_NAMESPACE
-
-QDeclarativeReverseGeocodeModel::QDeclarativeReverseGeocodeModel(QObject *parent)
- : QDeclarativeGeoSearchModel(parent),
- complete_(false) {}
-
-QDeclarativeReverseGeocodeModel::~QDeclarativeReverseGeocodeModel() {}
-
-void QDeclarativeReverseGeocodeModel::setCoordinate(QDeclarativeCoordinate *coordinate)
-{
- if (coordinate_.coordinate() == coordinate->coordinate())
- return;
-
- coordinate_.setCoordinate(coordinate->coordinate());
-
- emit coordinateChanged(&coordinate_);
-
- if (complete_)
- update();
-}
-
-QDeclarativeCoordinate* QDeclarativeReverseGeocodeModel::coordinate()
-{
- return &coordinate_;
-}
-
-void QDeclarativeReverseGeocodeModel::componentComplete()
-{
- if (!searchManager())
- return;
-
- complete_ = true;
- update();
-}
-
-void QDeclarativeReverseGeocodeModel::update()
-{
- if (searchManager() && coordinate_.coordinate().isValid()) {
-
- setStatus(QDeclarativeGeoSearchModel::Loading);
-
- searchManager()->reverseGeocode(coordinate_.coordinate());
-
- // TODO check for finished
- }
-}
-
-QVariant QDeclarativeReverseGeocodeModel::data(const QModelIndex &index, int role) const
-{
- if (!index.isValid())
- return QVariant();
-
- if (index.row() > places().count())
- return QVariant();
-
- QGeoPlace place = places().at(index.row());
-
- if (role == Qt::DisplayRole) {
- QGeoAddress address = place.address();
-
- QStringList addressStrings;
- if (!address.street().isEmpty())
- addressStrings << address.street();
- if (!address.city().isEmpty())
- addressStrings << address.city();
-
- QStringList stateLine;
- if (!address.state().isEmpty())
- stateLine << address.state();
- if (!address.postcode().isEmpty())
- stateLine << address.postcode();
- if (!address.country().isEmpty())
- stateLine << address.country();
-
- QString stateString = stateLine.join(" ");
-
- if (!stateString.isEmpty())
- addressStrings << stateString;
-
- return addressStrings.join(", ");
- }
-
- return QDeclarativeGeoSearchModel::data(index, role);
-}
-
-QVariant QDeclarativeReverseGeocodeModel::headerData(int section, Qt::Orientation orientation, int role) const
-{
- if (section != 0)
- return QVariant();
-
- if (role == Qt::DisplayRole)
- return QString("Address");
-
- return QDeclarativeGeoSearchModel::headerData(section, orientation, role);
-}
-
-#include "moc_qdeclarativereversegeocodemodel_p.cpp"
-
-QT_END_NAMESPACE
diff --git a/src/imports/location/qdeclarativereversegeocodemodel_p.h b/src/imports/location/qdeclarativereversegeocodemodel_p.h
deleted file mode 100644
index fd58e7b6..00000000
--- a/src/imports/location/qdeclarativereversegeocodemodel_p.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QDECLARATIVEREVERSEGEOCODEMODEL_H
-#define QDECLARATIVEREVERSEGEOCODEMODEL_H
-
-#include "qdeclarativegeosearchmodel_p.h"
-
-#include "qdeclarativecoordinate_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QDeclarativeReverseGeocodeModel : public QDeclarativeGeoSearchModel
-{
-
- Q_OBJECT
-
- Q_PROPERTY(QDeclarativeCoordinate* coordinate READ coordinate WRITE setCoordinate NOTIFY coordinateChanged)
-
-public:
- explicit QDeclarativeReverseGeocodeModel(QObject *parent = 0);
- ~QDeclarativeReverseGeocodeModel();
-
- void setCoordinate(QDeclarativeCoordinate *coordinate);
- QDeclarativeCoordinate* coordinate();
-
- // From QDeclarativeParserStatus
- virtual void componentComplete();
-
- // From QAbstractListModel
- virtual QVariant data(const QModelIndex &index, int role) const;
- virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
-
-Q_SIGNALS:
- void coordinateChanged(QDeclarativeCoordinate *coordinate);
-
-private:
- void update();
-
- bool complete_;
- QDeclarativeCoordinate coordinate_;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/location/maps/maps.pri b/src/location/maps/maps.pri
index 6a5e8f1b..ffe5bd8e 100644
--- a/src/location/maps/maps.pri
+++ b/src/location/maps/maps.pri
@@ -4,6 +4,9 @@ INCLUDEPATH += maps
include(tiled/tiled.pri)
PUBLIC_HEADERS += \
+ maps/qgeocodingmanager.h \
+ maps/qgeocodingmanagerengine.h \
+ maps/qgeocodereply.h \
maps/qgeomaneuver.h \
maps/qgeomapcircleobject.h \
maps/qgeomapcustomobject.h \
@@ -26,14 +29,14 @@ PUBLIC_HEADERS += \
maps/qgeoroutesegment.h \
maps/qgeoroutingmanager.h \
maps/qgeoroutingmanagerengine.h \
- maps/qgeosearchmanager.h \
- maps/qgeosearchmanagerengine.h \
- maps/qgeosearchreply.h \
maps/qgeoserviceprovider.h \
maps/qgeoserviceproviderfactory.h \
maps/qgraphicsgeomap.h
PRIVATE_HEADERS += \
+ maps/qgeocodingmanager_p.h \
+ maps/qgeocodingmanagerengine_p.h \
+ maps/qgeocodereply_p.h \
maps/qgeomaneuver_p.h \
maps/qgeomapcircleobject_p.h \
maps/qgeomapcustomobject_p.h \
@@ -56,14 +59,14 @@ PRIVATE_HEADERS += \
maps/qgeoroutesegment_p.h \
maps/qgeoroutingmanager_p.h \
maps/qgeoroutingmanagerengine_p.h \
- maps/qgeosearchmanager_p.h \
- maps/qgeosearchmanagerengine_p.h \
- maps/qgeosearchreply_p.h \
maps/qgeoserviceprovider_p.h \
maps/qgraphicsgeomap_p.h \
maps/qgeomapobjectengine_p.h
SOURCES += \
+ maps/qgeocodingmanager.cpp \
+ maps/qgeocodingmanagerengine.cpp \
+ maps/qgeocodereply.cpp \
maps/qgeomaneuver.cpp \
maps/qgeomapcircleobject.cpp \
maps/qgeomapcustomobject.cpp \
@@ -85,9 +88,6 @@ SOURCES += \
maps/qgeoroutesegment.cpp \
maps/qgeoroutingmanager.cpp \
maps/qgeoroutingmanagerengine.cpp \
- maps/qgeosearchmanager.cpp \
- maps/qgeosearchmanagerengine.cpp \
- maps/qgeosearchreply.cpp \
maps/qgeoserviceprovider.cpp \
maps/qgeoserviceproviderfactory.cpp \
maps/qgraphicsgeomap.cpp \
diff --git a/src/location/maps/qgeosearchreply.cpp b/src/location/maps/qgeocodereply.cpp
index dd8ed226..65739aa7 100644
--- a/src/location/maps/qgeosearchreply.cpp
+++ b/src/location/maps/qgeocodereply.cpp
@@ -39,15 +39,15 @@
**
****************************************************************************/
-#include "qgeosearchreply.h"
-#include "qgeosearchreply_p.h"
+#include "qgeocodereply.h"
+#include "qgeocodereply_p.h"
QT_BEGIN_NAMESPACE
/*!
- \class QGeoSearchReply
+ \class QGeocodeReply
- \brief The QGeoSearchReply class manages an operation started by an
- instance of QGeoSearchManager.
+ \brief The QGeocodeReply class manages an operation started by an
+ instance of QGeocodingManager.
\inmodule QtLocation
@@ -55,21 +55,21 @@ QT_BEGIN_NAMESPACE
\ingroup maps-places
- Instances of QGeoSearchReply manage the state and results of these
+ Instances of QGeocodeReply manage the state and results of these
operations.
The isFinished(), error() and errorString() methods provide information
on whether the operation has completed and if it completed successfully.
- The finished() and error(QGeoSearchReply::Error,QString)
+ The finished() and error(QGeocodeReply::Error,QString)
signals can be used to monitor the progress of the operation.
- It is possible that a newly created QGeoSearchReply may be in a finished
+ It is possible that a newly created QGeocodeReply may be in a finished
state, most commonly because an error has occurred. Since such an instance
will never emit the finished() or
- error(QGeoSearchReply::Error,QString) signals, it is
+ error(QGeocodeReply::Error,QString) signals, it is
important to check the result of isFinished() before making the connections
- to the signals. The documentation for QGeoSearchManager demonstrates how
+ to the signals. The documentation for QGeocodingManager demonstrates how
this might be carried out.
If the operation completes successfully the results will be able to be
@@ -77,14 +77,14 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \enum QGeoSearchReply::Error
+ \enum QGeocodeReply::Error
Describes an error which prevented the completion of the operation.
\value NoError
No error has occurred.
\value EngineNotSetError
- The search manager that was used did not have a QGeoSearchManagerEngine instance associated with it.
+ The geocoding manager that was used did not have a QGeocodingManagerEngine instance associated with it.
\value CommunicationError
An error occurred while communicating with the service provider.
\value ParseError
@@ -99,23 +99,23 @@ QT_BEGIN_NAMESPACE
*/
/*!
- Constructs a search reply with the specified \a parent.
+ Constructs a geocode reply with the specified \a parent.
*/
-QGeoSearchReply::QGeoSearchReply(QObject *parent)
+QGeocodeReply::QGeocodeReply(QObject *parent)
: QObject(parent),
- d_ptr(new QGeoSearchReplyPrivate()) {}
+ d_ptr(new QGeocodeReplyPrivate()) {}
/*!
- Constructs a search reply with a given \a error and \a errorString and the specified \a parent.
+ Constructs a geocode reply with a given \a error and \a errorString and the specified \a parent.
*/
-QGeoSearchReply::QGeoSearchReply(Error error, const QString &errorString, QObject *parent)
+QGeocodeReply::QGeocodeReply(Error error, const QString &errorString, QObject *parent)
: QObject(parent),
- d_ptr(new QGeoSearchReplyPrivate(error, errorString)) {}
+ d_ptr(new QGeocodeReplyPrivate(error, errorString)) {}
/*!
- Destroys this search reply object.
+ Destroys this reply object.
*/
-QGeoSearchReply::~QGeoSearchReply()
+QGeocodeReply::~QGeocodeReply()
{
delete d_ptr;
}
@@ -126,11 +126,11 @@ QGeoSearchReply::~QGeoSearchReply()
If \a finished is true, this will cause the finished() signal to be
emitted.
- If the operation completed successfully, QGeoSearchReply::setLocations()
+ If the operation completed successfully, QGeocodeReply::setLocations()
should be called before this function. If an error occurred,
- QGeoSearchReply::setError() should be used instead.
+ QGeocodeReply::setError() should be used instead.
*/
-void QGeoSearchReply::setFinished(bool finished)
+void QGeocodeReply::setFinished(bool finished)
{
d_ptr->isFinished = finished;
if (d_ptr->isFinished)
@@ -141,7 +141,7 @@ void QGeoSearchReply::setFinished(bool finished)
Return true if the operation completed successfully or encountered an
error which cause the operation to come to a halt.
*/
-bool QGeoSearchReply::isFinished() const
+bool QGeocodeReply::isFinished() const
{
return d_ptr->isFinished;
}
@@ -153,7 +153,7 @@ bool QGeoSearchReply::isFinished() const
This wil also cause error() and finished() signals to be emitted, in that
order.
*/
-void QGeoSearchReply::setError(QGeoSearchReply::Error error, const QString &errorString)
+void QGeocodeReply::setError(QGeocodeReply::Error error, const QString &errorString)
{
d_ptr->error = error;
d_ptr->errorString = errorString;
@@ -164,9 +164,9 @@ void QGeoSearchReply::setError(QGeoSearchReply::Error error, const QString &erro
/*!
Returns the error state of this reply.
- If the result is QGeoSearchReply::NoError then no error has occurred.
+ If the result is QGeocodeReply::NoError then no error has occurred.
*/
-QGeoSearchReply::Error QGeoSearchReply::error() const
+QGeocodeReply::Error QGeocodeReply::error() const
{
return d_ptr->error;
}
@@ -179,9 +179,9 @@ QGeoSearchReply::Error QGeoSearchReply::error() const
which case this will also return an empty string.
To determine whether an error has occurred, check to see if
- QGeoSearchReply::error() is equal to QGeoSearchReply::NoError.
+ QGeocodeReply::error() is equal to QGeocodeReply::NoError.
*/
-QString QGeoSearchReply::errorString() const
+QString QGeocodeReply::errorString() const
{
return d_ptr->errorString;
}
@@ -189,7 +189,7 @@ QString QGeoSearchReply::errorString() const
/*!
Sets the viewport which contains the results to \a viewport.
*/
-void QGeoSearchReply::setViewport(QGeoBoundingArea *viewport)
+void QGeocodeReply::setViewport(QGeoBoundingArea *viewport)
{
d_ptr->viewport = viewport;
}
@@ -198,9 +198,9 @@ void QGeoSearchReply::setViewport(QGeoBoundingArea *viewport)
Returns the viewport which contains the results.
This function will return 0 if no viewport bias
- was specified in the QGeoSearchManager function which created this reply.
+ was specified in the QGeocodingManager function which created this reply.
*/
-QGeoBoundingArea* QGeoSearchReply::viewport() const
+QGeoBoundingArea* QGeocodeReply::viewport() const
{
return d_ptr->viewport;
}
@@ -209,9 +209,9 @@ QGeoBoundingArea* QGeoSearchReply::viewport() const
Returns a list of locations.
The locations are the results of the operation corresponding to the
- QGeoSearchManager function which created this reply.
+ QGeocodingManager function which created this reply.
*/
-QList<QGeoLocation> QGeoSearchReply::locations() const
+QList<QGeoLocation> QGeocodeReply::locations() const
{
return d_ptr->locations;
}
@@ -219,7 +219,7 @@ QList<QGeoLocation> QGeoSearchReply::locations() const
/*!
Adds \a location to the list of locations in this reply.
*/
-void QGeoSearchReply::addLocation(const QGeoLocation &location)
+void QGeocodeReply::addLocation(const QGeoLocation &location)
{
d_ptr->locations.append(location);
}
@@ -227,7 +227,7 @@ void QGeoSearchReply::addLocation(const QGeoLocation &location)
/*!
Sets the list of \a locations in the reply.
*/
-void QGeoSearchReply::setLocations(const QList<QGeoLocation> &locations)
+void QGeocodeReply::setLocations(const QList<QGeoLocation> &locations)
{
d_ptr->locations = locations;
}
@@ -237,7 +237,7 @@ void QGeoSearchReply::setLocations(const QList<QGeoLocation> &locations)
This will do nothing if the reply is finished.
*/
-void QGeoSearchReply::abort()
+void QGeocodeReply::abort()
{
if (!isFinished())
setFinished(true);
@@ -250,12 +250,8 @@ void QGeoSearchReply::abort()
This may be more than locations().length() if the number of responses
was less than the number requested.
-
- If QGeoSearchManager::search() is used along with
- QGeoSearchManager::setAdditionalLandmarkManagers the number of results can
- be as high as limit * (1 + number of additional landmark managers).
*/
-int QGeoSearchReply::limit() const
+int QGeocodeReply::limit() const
{
return d_ptr->limit;
}
@@ -264,7 +260,7 @@ int QGeoSearchReply::limit() const
Returns the offset into the entire result set at which to start
fetching results.
*/
-int QGeoSearchReply::offset() const
+int QGeocodeReply::offset() const
{
return d_ptr->offset;
}
@@ -274,7 +270,7 @@ int QGeoSearchReply::offset() const
If \a limit is -1 then all available responses will be returned.
*/
-void QGeoSearchReply::setLimit(int limit)
+void QGeocodeReply::setLimit(int limit)
{
d_ptr->limit = limit;
}
@@ -283,27 +279,27 @@ void QGeoSearchReply::setLimit(int limit)
Sets the offset in the entire result set at which to start
fetching result to \a offset.
*/
-void QGeoSearchReply::setOffset(int offset)
+void QGeocodeReply::setOffset(int offset)
{
d_ptr->offset = offset;
}
/*!
- \fn void QGeoSearchReply::finished()
+ \fn void QGeocodeReply::finished()
This signal is emitted when this reply has finished processing.
- If error() equals QGeoSearchReply::NoError then the processing
+ If error() equals QGeocodeReply::NoError then the processing
finished successfully.
- This signal and QGeoSearchManager::finished() will be
+ This signal and QGeocodingManager::finished() will be
emitted at the same time.
\note Do no delete this reply object in the slot connected to this
signal. Use deleteLater() instead.
*/
/*!
- \fn void QGeoSearchReply::error(QGeoSearchReply::Error error, const QString &errorString)
+ \fn void QGeocodeReply::error(QGeocodeReply::Error error, const QString &errorString)
This signal is emitted when an error has been detected in the processing of
this reply. The finished() signal will probably follow.
@@ -311,7 +307,7 @@ void QGeoSearchReply::setOffset(int offset)
The error will be described by the error code \a error. If \a errorString is
not empty it will contain a textual description of the error.
- This signal and QGeoSearchManager::error() will be emitted at the same time.
+ This signal and QGeocodingManager::error() will be emitted at the same time.
\note Do no delete this reply object in the slot connected to this
signal. Use deleteLater() instead.
@@ -320,15 +316,15 @@ void QGeoSearchReply::setOffset(int offset)
/*******************************************************************************
*******************************************************************************/
-QGeoSearchReplyPrivate::QGeoSearchReplyPrivate()
- : error(QGeoSearchReply::NoError),
+QGeocodeReplyPrivate::QGeocodeReplyPrivate()
+ : error(QGeocodeReply::NoError),
errorString(QLatin1String("")),
isFinished(false),
viewport(0),
limit(-1),
offset(0) {}
-QGeoSearchReplyPrivate::QGeoSearchReplyPrivate(QGeoSearchReply::Error error, const QString &errorString)
+QGeocodeReplyPrivate::QGeocodeReplyPrivate(QGeocodeReply::Error error, const QString &errorString)
: error(error),
errorString(errorString),
isFinished(true),
@@ -336,9 +332,9 @@ QGeoSearchReplyPrivate::QGeoSearchReplyPrivate(QGeoSearchReply::Error error, con
limit(-1),
offset(0) {}
-QGeoSearchReplyPrivate::~QGeoSearchReplyPrivate() {}
+QGeocodeReplyPrivate::~QGeocodeReplyPrivate() {}
-#include "moc_qgeosearchreply.cpp"
+#include "moc_qgeocodereply.cpp"
QT_END_NAMESPACE
diff --git a/src/location/maps/qgeosearchreply.h b/src/location/maps/qgeocodereply.h
index fc0c4d4c..4da67d5e 100644
--- a/src/location/maps/qgeosearchreply.h
+++ b/src/location/maps/qgeocodereply.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QGEOSEARCHREPLY_H
-#define QGEOSEARCHREPLY_H
+#ifndef QGEOCODEREPLY_H
+#define QGEOCODEREPLY_H
#include "qgeolocation.h"
@@ -49,9 +49,9 @@
QT_BEGIN_NAMESPACE
-class QGeoSearchReplyPrivate;
+class QGeocodeReplyPrivate;
-class Q_LOCATION_EXPORT QGeoSearchReply : public QObject
+class Q_LOCATION_EXPORT QGeocodeReply : public QObject
{
Q_OBJECT
@@ -66,8 +66,8 @@ public:
UnknownError
};
- QGeoSearchReply(Error error, const QString &errorString, QObject *parent = 0);
- virtual ~QGeoSearchReply();
+ QGeocodeReply(Error error, const QString &errorString, QObject *parent = 0);
+ virtual ~QGeocodeReply();
bool isFinished() const;
Error error() const;
@@ -83,10 +83,10 @@ public:
Q_SIGNALS:
void finished();
- void error(QGeoSearchReply::Error error, const QString &errorString = QString());
+ void error(QGeocodeReply::Error error, const QString &errorString = QString());
protected:
- QGeoSearchReply(QObject* parent = 0);
+ QGeocodeReply(QObject* parent = 0);
void setError(Error error, const QString &errorString);
void setFinished(bool finished);
@@ -99,8 +99,8 @@ protected:
void setOffset(int offset);
private:
- QGeoSearchReplyPrivate *d_ptr;
- Q_DISABLE_COPY(QGeoSearchReply)
+ QGeocodeReplyPrivate *d_ptr;
+ Q_DISABLE_COPY(QGeocodeReply)
};
QT_END_NAMESPACE
diff --git a/src/location/maps/qgeosearchreply_p.h b/src/location/maps/qgeocodereply_p.h
index 16431a6a..afcab0da 100644
--- a/src/location/maps/qgeosearchreply_p.h
+++ b/src/location/maps/qgeocodereply_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QGEOSEARCHREPLY_P_H
-#define QGEOSEARCHREPLY_P_H
+#ifndef QGEOCODEREPLY_P_H
+#define QGEOCODEREPLY_P_H
//
// W A R N I N G
@@ -53,7 +53,7 @@
// We mean it.
//
-#include "qgeosearchreply.h"
+#include "qgeocodereply.h"
#include "qgeoboundingarea.h"
@@ -63,14 +63,14 @@ QT_BEGIN_NAMESPACE
class QGeoLocation;
-class QGeoSearchReplyPrivate
+class QGeocodeReplyPrivate
{
public:
- QGeoSearchReplyPrivate();
- QGeoSearchReplyPrivate(QGeoSearchReply::Error error, const QString& errorString);
- ~QGeoSearchReplyPrivate();
+ QGeocodeReplyPrivate();
+ QGeocodeReplyPrivate(QGeocodeReply::Error error, const QString& errorString);
+ ~QGeocodeReplyPrivate();
- QGeoSearchReply::Error error;
+ QGeocodeReply::Error error;
QString errorString;
bool isFinished;
@@ -80,7 +80,7 @@ public:
int limit;
int offset;
private:
- Q_DISABLE_COPY(QGeoSearchReplyPrivate)
+ Q_DISABLE_COPY(QGeocodeReplyPrivate)
};
QT_END_NAMESPACE
diff --git a/src/location/maps/qgeosearchmanager.cpp b/src/location/maps/qgeocodingmanager.cpp
index c9e6f784..26382dee 100644
--- a/src/location/maps/qgeosearchmanager.cpp
+++ b/src/location/maps/qgeocodingmanager.cpp
@@ -39,9 +39,9 @@
**
****************************************************************************/
-#include "qgeosearchmanager.h"
-#include "qgeosearchmanager_p.h"
-#include "qgeosearchmanagerengine.h"
+#include "qgeocodingmanager.h"
+#include "qgeocodingmanager_p.h"
+#include "qgeocodingmanagerengine.h"
#include "qgeoboundingbox.h"
#include "qgeoboundingcircle.h"
@@ -51,10 +51,10 @@
QT_BEGIN_NAMESPACE
/*!
- \class QGeoSearchManager
+ \class QGeocodingManager
- \brief The QGeoSearchManager class provides support for searching
- operations related to geographic information.
+ \brief The QGeocodingManager class provides support for geocoding
+ operations.
\inmodule QtLocation
@@ -63,18 +63,18 @@ QT_BEGIN_NAMESPACE
\ingroup maps-places
The geocode(), reverseGeocode() and search() functions return
- QGeoSearchReply objects, which manage these operations and report on the
+ QGeocodeReply objects, which manage these operations and report on the
result of the operations and any errors which may have occurred.
The geocode() and reverseGeocode() functions can be used to convert
QGeoAddress instances to QGeoCoordinate instances and vice-versa.
- The search() function allows a user to perform a free text search
- for location information. If the string provided can be interpreted as
+ The geocode() function is also overloaded to allow a user to perform a free text
+ geocoding operation, if the string provided can be interpreted as
an address it can be geocoded to coordinate information.
- Instances of QGeoSearchManager can be accessed with
- QGeoServiceProvider::searchManager().
+ Instances of QGeocodingManager can be accessed with
+ QGeoServiceProvider::geocodingManager().
*/
/*!
@@ -82,47 +82,47 @@ QT_BEGIN_NAMESPACE
implementation provided by \a engine.
This constructor is used interally by QGeoServiceProviderFactory. Regular
- users should acquire instances of QGeoSearchManager with
- QGeoServiceProvider::searchManager();
+ users should acquire instances of QGeocodingManager with
+ QGeoServiceProvider::geocodingManager();
*/
-QGeoSearchManager::QGeoSearchManager(QGeoSearchManagerEngine *engine, QObject *parent)
+QGeocodingManager::QGeocodingManager(QGeocodingManagerEngine *engine, QObject *parent)
: QObject(parent),
- d_ptr(new QGeoSearchManagerPrivate())
+ d_ptr(new QGeocodingManagerPrivate())
{
d_ptr->engine = engine;
if (d_ptr->engine) {
d_ptr->engine->setParent(this);
connect(d_ptr->engine,
- SIGNAL(finished(QGeoSearchReply*)),
+ SIGNAL(finished(QGeocodeReply*)),
this,
- SIGNAL(finished(QGeoSearchReply*)));
+ SIGNAL(finished(QGeocodeReply*)));
connect(d_ptr->engine,
- SIGNAL(error(QGeoSearchReply*, QGeoSearchReply::Error, QString)),
+ SIGNAL(error(QGeocodeReply*, QGeocodeReply::Error, QString)),
this,
- SIGNAL(error(QGeoSearchReply*, QGeoSearchReply::Error, QString)));
+ SIGNAL(error(QGeocodeReply*, QGeocodeReply::Error, QString)));
} else {
- qFatal("The search manager engine that was set for this search manager was NULL.");
+ qFatal("The geocoding manager engine that was set for this geocoding manager was NULL.");
}
}
/*!
Destroys this manager.
*/
-QGeoSearchManager::~QGeoSearchManager()
+QGeocodingManager::~QGeocodingManager()
{
delete d_ptr;
}
/*!
Returns the name of the engine which implements the behaviour of this
- search manager.
+ geocoding manager.
The combination of managerName() and managerVersion() should be unique
amongst the plugin implementations.
*/
-QString QGeoSearchManager::managerName() const
+QString QGeocodingManager::managerName() const
{
// if (!d_ptr->engine)
// return QString();
@@ -132,12 +132,12 @@ QString QGeoSearchManager::managerName() const
/*!
Returns the version of the engine which implements the behaviour of this
- search manager.
+ geocoding manager.
The combination of managerName() and managerVersion() should be unique
amongst the plugin implementations.
*/
-int QGeoSearchManager::managerVersion() const
+int QGeocodingManager::managerVersion() const
{
// if (!d_ptr->engine)
// return -1;
@@ -149,16 +149,16 @@ int QGeoSearchManager::managerVersion() const
Begins the geocoding of \a address. Geocoding is the process of finding a
coordinate that corresponds to a given address.
- A QGeoSearchReply object will be returned, which can be used to manage the
+ A QGeocodeReply object will be returned, which can be used to manage the
geocoding operation and to return the results of the operation.
- This manager and the returned QGeoSearchReply object will emit signals
+ This manager and the returned QGeocodeReply object will emit signals
indicating if the operation completes or if errors occur.
If supportsGeocoding() returns false an
- QGeoSearchReply::UnsupportedOptionError will occur.
+ QGeocodeReply::UnsupportedOptionError will occur.
- Once the operation has completed, QGeoSearchReply::locations() can be used to
+ Once the operation has completed, QGeocodeReply::locations() can be used to
retrieve the results, which will consist of a list of QGeoLocation objects.
These object represent a combination of coordinate and address data.
@@ -172,14 +172,14 @@ int QGeoSearchManager::managerVersion() const
service will attempt to geocode all matches for the specified data.
The user is responsible for deleting the returned reply object, although
- this can be done in the slot connected to QGeoSearchManager::finished(),
- QGeoSearchManager::error(), QGeoSearchReply::finished() or
- QGeoSearchReply::error() with deleteLater().
+ this can be done in the slot connected to QGeocodingManager::finished(),
+ QGeocodingManager::error(), QGeocodeReply::finished() or
+ QGeocodeReply::error() with deleteLater().
*/
-QGeoSearchReply* QGeoSearchManager::geocode(const QGeoAddress &address, QGeoBoundingArea *bounds)
+QGeocodeReply* QGeocodingManager::geocode(const QGeoAddress &address, QGeoBoundingArea *bounds)
{
// if (!d_ptr->engine)
-// return new QGeoSearchReply(QGeoSearchReply::EngineNotSetError, "The search manager was not created with a valid engine.", this);
+// return new QGeocodeReply(QGeocodeReply::EngineNotSetError, "The geocoding manager was not created with a valid engine.", this);
return d_ptr->engine->geocode(address, bounds);
}
@@ -189,16 +189,16 @@ QGeoSearchReply* QGeoSearchManager::geocode(const QGeoAddress &address, QGeoBoun
Begins the reverse geocoding of \a coordinate. Reverse geocoding is the
process of finding an address that corresponds to a given coordinate.
- A QGeoSearchReply object will be returned, which can be used to manage the
+ A QGeocodeReply object will be returned, which can be used to manage the
reverse geocoding operation and to return the results of the operation.
- This manager and the returned QGeoSearchReply object will emit signals
+ This manager and the returned QGeocodeReply object will emit signals
indicating if the operation completes or if errors occur.
If supportsReverseGeocoding() returns false an
- QGeoSearchReply::UnsupportedOptionError will occur.
+ QGeocodeReply::UnsupportedOptionError will occur.
- At that point QGeoSearchReply::locations() can be used to retrieve the
+ At that point QGeocodeReply::locations() can be used to retrieve the
results, which will consist of a list of QGeoLocation objects. These object
represent a combination of coordinate and address data.
@@ -217,41 +217,35 @@ QGeoSearchReply* QGeoSearchManager::geocode(const QGeoAddress &address, QGeoBoun
limit the results to thos that are contained within \a bounds.
The user is responsible for deleting the returned reply object, although
- this can be done in the slot connected to QGeoSearchManager::finished(),
- QGeoSearchManager::error(), QGeoSearchReply::finished() or
- QGeoSearchReply::error() with deleteLater().
+ this can be done in the slot connected to QGeocodingManager::finished(),
+ QGeocodingManager::error(), QGeocodeReply::finished() or
+ QGeocodeReply::error() with deleteLater().
*/
-QGeoSearchReply* QGeoSearchManager::reverseGeocode(const QGeoCoordinate &coordinate, QGeoBoundingArea *bounds)
+QGeocodeReply* QGeocodingManager::reverseGeocode(const QGeoCoordinate &coordinate, QGeoBoundingArea *bounds)
{
// if (!d_ptr->engine)
-// return new QGeoSearchReply(QGeoSearchReply::EngineNotSetError, "The search manager was not created with a valid engine.", this);
+// return new QGeocodeReply(QGeocodeReply::EngineNotSetError, "The geocoding manager was not created with a valid engine.", this);
return d_ptr->engine->reverseGeocode(coordinate, bounds);
}
/*!
- Begins searching for a location matching \a searchString. The value of
- \a searchTypes will determine whether the search is for addresses only,
- for landmarks only or for both.
+ Begins geocoding for a location matching \a address.
- A QGeoSearchReply object will be returned, which can be used to manage the
+ A QGeocodeReply object will be returned, which can be used to manage the
geocoding operation and to return the results of the operation.
- This manager and the returned QGeoSearchReply object will emit signals
+ This manager and the returned QGeocodeReply object will emit signals
indicating if the operation completes or if errors occur.
- If supportsGeocoding() returns false and \a searchTypes is
- QGeoSearchManager::SearchGeocode an
- QGeoSearchReply::UnsupportedOptionError will occur.
-
- Once the operation has completed, QGeoSearchReply::locations() can be used to
+ Once the operation has completed, QGeocodeReply::locations() can be used to
retrieve the results, which will consist of a list of QGeoLocation objects.
These object represent a combination of coordinate and address data.
If \a limit is -1 the entire result set will be returned, otherwise at most
\a limit results will be returned.
- The \a offset parameter is used to ask the search service to not return the
+ The \a offset parameter is used to ask the geocoding service to not return the
first \a offset results.
The \a limit and \a offset results are used together to implement paging.
@@ -260,19 +254,19 @@ QGeoSearchReply* QGeoSearchManager::reverseGeocode(const QGeoCoordinate &coordin
limit the results to thos that are contained within \a bounds.
The user is responsible for deleting the returned reply object, although
- this can be done in the slot connected to QGeoSearchManager::finished(),
- QGeoSearchManager::error(), QGeoSearchReply::finished() or
- QGeoSearchReply::error() with deleteLater().
+ this can be done in the slot connected to QGeocodingManager::finished(),
+ QGeocodingManager::error(), QGeocodeReply::finished() or
+ QGeocodeReply::error() with deleteLater().
*/
-QGeoSearchReply* QGeoSearchManager::search(const QString &searchString,
+QGeocodeReply* QGeocodingManager::geocode(const QString &address,
int limit,
int offset,
QGeoBoundingArea *bounds)
{
// if (!d_ptr->engine)
-// return new QGeoSearchReply(QGeoSearchReply::EngineNotSetError, "The search manager was not created with a valid engine.", this);
+// return new QGeocodeReply(QGeocodeReply::EngineNotSetError, "The geocoding manager was not created with a valid engine.", this);
- QGeoSearchReply *reply = d_ptr->engine->search(searchString,
+ QGeocodeReply *reply = d_ptr->engine->geocode(address,
limit,
offset,
bounds);
@@ -282,7 +276,7 @@ QGeoSearchReply* QGeoSearchManager::search(const QString &searchString,
/*!
Returns whether this manager supports geocoding.
*/
-bool QGeoSearchManager::supportsGeocoding() const
+bool QGeocodingManager::supportsGeocoding() const
{
// if (!d_ptr->engine)
// return false;
@@ -293,7 +287,7 @@ bool QGeoSearchManager::supportsGeocoding() const
/*!
Returns whether this manager supports reverse geocoding.
*/
-bool QGeoSearchManager::supportsReverseGeocoding() const
+bool QGeocodingManager::supportsReverseGeocoding() const
{
return d_ptr->engine->supportsReverseGeocoding();
}
@@ -301,34 +295,34 @@ bool QGeoSearchManager::supportsReverseGeocoding() const
/*!
Sets the locale to be used by the this manager to \a locale.
- If this search manager supports returning the results
+ If this geocoding manager supports returning the results
in different languages, they will be returned in the language of \a locale.
The locale used defaults to the system locale if this is not set.
*/
-void QGeoSearchManager::setLocale(const QLocale &locale)
+void QGeocodingManager::setLocale(const QLocale &locale)
{
d_ptr->engine->setLocale(locale);
}
/*!
- Returns the locale used to hint to this search manager about what
+ Returns the locale used to hint to this geocoding manager about what
language to use for the results.
*/
-QLocale QGeoSearchManager::locale() const
+QLocale QGeocodingManager::locale() const
{
return d_ptr->engine->locale();
}
/*!
-\fn void QGeoSearchManager::finished(QGeoSearchReply* reply)
+\fn void QGeocodingManager::finished(QGeocodeReply* reply)
This signal is emitted when \a reply has finished processing.
- If reply::error() equals QGeoSearchReply::NoError then the processing
+ If reply::error() equals QGeocodeReply::NoError then the processing
finished successfully.
- This signal and QGeoSearchReply::finished() will be emitted at the same
+ This signal and QGeocodeReply::finished() will be emitted at the same
time.
\note Do no delete the \a reply object in the slot connected to this
@@ -336,15 +330,15 @@ QLocale QGeoSearchManager::locale() const
*/
/*!
-\fn void QGeoSearchManager::error(QGeoSearchReply* reply, QGeoSearchReply::Error error, QString errorString)
+\fn void QGeocodingManager::error(QGeocodeReply* reply, QGeocodeReply::Error error, QString errorString)
This signal is emitted when an error has been detected in the processing of
- \a reply. The QGeoSearchManager::finished() signal will probably follow.
+ \a reply. The QGeocodingManager::finished() signal will probably follow.
The error will be described by the error code \a error. If \a errorString is
not empty it will contain a textual description of the error.
- This signal and QGeoSearchReply::error() will be emitted at the same time.
+ This signal and QGeocodeReply::error() will be emitted at the same time.
\note Do no delete the \a reply object in the slot connected to this
signal. Use deleteLater() instead.
@@ -353,10 +347,10 @@ QLocale QGeoSearchManager::locale() const
/*******************************************************************************
*******************************************************************************/
-QGeoSearchManagerPrivate::QGeoSearchManagerPrivate()
+QGeocodingManagerPrivate::QGeocodingManagerPrivate()
: engine(0) {}
-QGeoSearchManagerPrivate::~QGeoSearchManagerPrivate()
+QGeocodingManagerPrivate::~QGeocodingManagerPrivate()
{
if (engine)
delete engine;
@@ -365,6 +359,6 @@ QGeoSearchManagerPrivate::~QGeoSearchManagerPrivate()
/*******************************************************************************
*******************************************************************************/
-#include "moc_qgeosearchmanager.cpp"
+#include "moc_qgeocodingmanager.cpp"
QT_END_NAMESPACE
diff --git a/src/location/maps/qgeosearchmanager.h b/src/location/maps/qgeocodingmanager.h
index 8255afa7..a981c9c6 100644
--- a/src/location/maps/qgeosearchmanager.h
+++ b/src/location/maps/qgeocodingmanager.h
@@ -39,10 +39,10 @@
**
****************************************************************************/
-#ifndef QGEOSEARCHMANAGER_H
-#define QGEOSEARCHMANAGER_H
+#ifndef QGEOCODINGMANAGER_H
+#define QGEOCODINGMANAGER_H
-#include "qgeosearchreply.h"
+#include "qgeocodereply.h"
#include "qgeoboundingbox.h"
#include <QObject>
@@ -52,30 +52,28 @@
QT_BEGIN_NAMESPACE
class QLocale;
-class QLandmarkManager;
+class QGeocodingManagerEngine;
+class QGeocodingManagerPrivate;
-class QGeoSearchManagerEngine;
-class QGeoSearchManagerPrivate;
-
-class Q_LOCATION_EXPORT QGeoSearchManager : public QObject
+class Q_LOCATION_EXPORT QGeocodingManager : public QObject
{
Q_OBJECT
public:
- ~QGeoSearchManager();
+ ~QGeocodingManager();
QString managerName() const;
int managerVersion() const;
- QGeoSearchReply* geocode(const QGeoAddress &address,
+ QGeocodeReply* geocode(const QGeoAddress &address,
QGeoBoundingArea *bounds = 0);
- QGeoSearchReply* reverseGeocode(const QGeoCoordinate &coordinate,
- QGeoBoundingArea *bounds = 0);
-
- QGeoSearchReply* search(const QString &searchString,
+ QGeocodeReply* geocode(const QString &searchString,
int limit = -1,
int offset = 0,
QGeoBoundingArea *bounds = 0);
+ QGeocodeReply* reverseGeocode(const QGeoCoordinate &coordinate,
+ QGeoBoundingArea *bounds = 0);
+
bool supportsGeocoding() const;
bool supportsReverseGeocoding() const;
@@ -83,14 +81,14 @@ public:
QLocale locale() const;
Q_SIGNALS:
- void finished(QGeoSearchReply* reply);
- void error(QGeoSearchReply* reply, QGeoSearchReply::Error error, QString errorString = QString());
+ void finished(QGeocodeReply* reply);
+ void error(QGeocodeReply* reply, QGeocodeReply::Error error, QString errorString = QString());
private:
- QGeoSearchManager(QGeoSearchManagerEngine *engine, QObject *parent = 0);
+ QGeocodingManager(QGeocodingManagerEngine *engine, QObject *parent = 0);
- QGeoSearchManagerPrivate *d_ptr;
- Q_DISABLE_COPY(QGeoSearchManager)
+ QGeocodingManagerPrivate *d_ptr;
+ Q_DISABLE_COPY(QGeocodingManager)
friend class QGeoServiceProvider;
};
diff --git a/src/location/maps/qgeosearchmanager_p.h b/src/location/maps/qgeocodingmanager_p.h
index 451b05c7..4cf00514 100644
--- a/src/location/maps/qgeosearchmanager_p.h
+++ b/src/location/maps/qgeocodingmanager_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QGEOSEARCHMANAGER_P_H
-#define QGEOSEARCHMANAGER_P_H
+#ifndef QGEOCODINGMANAGER_P_H
+#define QGEOCODINGMANAGER_P_H
//
// W A R N I N G
@@ -53,26 +53,26 @@
// We mean it.
//
-#include "qgeosearchmanager.h"
+#include "qgeocodingmanager.h"
-#include "qgeosearchreply.h"
+#include "qgeocodereply.h"
#include <QList>
QT_BEGIN_NAMESPACE
-class QGeoSearchManagerEngine;
+class QGeocodingManagerEngine;
-class QGeoSearchManagerPrivate
+class QGeocodingManagerPrivate
{
public:
- QGeoSearchManagerPrivate();
- ~QGeoSearchManagerPrivate();
+ QGeocodingManagerPrivate();
+ ~QGeocodingManagerPrivate();
- QGeoSearchManagerEngine *engine;
+ QGeocodingManagerEngine *engine;
private:
- Q_DISABLE_COPY(QGeoSearchManagerPrivate)
+ Q_DISABLE_COPY(QGeocodingManagerPrivate)
};
QT_END_NAMESPACE
diff --git a/src/location/maps/qgeosearchmanagerengine.cpp b/src/location/maps/qgeocodingmanagerengine.cpp
index 14bee38b..cdbee203 100644
--- a/src/location/maps/qgeosearchmanagerengine.cpp
+++ b/src/location/maps/qgeocodingmanagerengine.cpp
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#include "qgeosearchmanagerengine.h"
-#include "qgeosearchmanagerengine_p.h"
+#include "qgeocodingmanagerengine.h"
+#include "qgeocodingmanagerengine_p.h"
#include "qgeoaddress.h"
#include "qgeocoordinate.h"
@@ -48,11 +48,11 @@
QT_BEGIN_NAMESPACE
/*!
- \class QGeoSearchManagerEngine
+ \class QGeocodingManagerEngine
- \brief The QGeoSearchManagerEngine class provides an interface and
+ \brief The QGeocodingManagerEngine class provides an interface and
convenience methods to implementers of QGeoServiceProvider plugins who want
- to provide support for searching operations related to geographic data.
+ to provide support for geocoding operations.
\inmodule QtLocation
\since 1.1
@@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE
In the default implementation, supportsGeocoding() and supportsReverseGeocoding() returns false while
geocode() and reverseGeocode()
- cause QGeoSearchReply::UnsupportedOptionError to occur.
+ cause QGeocodeReply::UnsupportedOptionError to occur.
If the service provider supports geocoding the subclass should provide an
implementation of geocode() and call setSupportsGeocoding(true) at
@@ -72,21 +72,21 @@ QT_BEGIN_NAMESPACE
setSupportsReverseGeocoding(true) at some point in time before
reverseGeoocode() is called.
- A subclass of QGeoSearchManagerEngine will often make use of a subclass
- fo QGeoSearchReply internally, in order to add any engine-specific
+ A subclass of QGeocodingManagerEngine will often make use of a subclass
+ fo QGeocodeReply internally, in order to add any engine-specific
data (such as a QNetworkReply object for network-based services) to the
- QGeoSearchReply instances used by the engine.
+ QGeocodeReply instances used by the engine.
- \sa QGeoSearchManager
+ \sa QGeocodingManager
*/
/*!
Constructs a new engine with the specified \a parent, using \a parameters
to pass any implementation specific data to the engine.
*/
-QGeoSearchManagerEngine::QGeoSearchManagerEngine(const QMap<QString, QVariant> &parameters, QObject *parent)
+QGeocodingManagerEngine::QGeocodingManagerEngine(const QMap<QString, QVariant> &parameters, QObject *parent)
: QObject(parent),
- d_ptr(new QGeoSearchManagerEnginePrivate())
+ d_ptr(new QGeocodingManagerEnginePrivate())
{
Q_UNUSED(parameters)
}
@@ -94,7 +94,7 @@ QGeoSearchManagerEngine::QGeoSearchManagerEngine(const QMap<QString, QVariant> &
/*!
Destroys this engine.
*/
-QGeoSearchManagerEngine::~QGeoSearchManagerEngine()
+QGeocodingManagerEngine::~QGeocodingManagerEngine()
{
delete d_ptr;
}
@@ -106,7 +106,7 @@ QGeoSearchManagerEngine::~QGeoSearchManagerEngine()
The combination of managerName() and managerVersion() should be unique
amongst plugin implementations.
*/
-void QGeoSearchManagerEngine::setManagerName(const QString &managerName)
+void QGeocodingManagerEngine::setManagerName(const QString &managerName)
{
d_ptr->managerName = managerName;
}
@@ -118,7 +118,7 @@ void QGeoSearchManagerEngine::setManagerName(const QString &managerName)
The combination of managerName() and managerVersion() should be unique
amongst plugin implementations.
*/
-QString QGeoSearchManagerEngine::managerName() const
+QString QGeocodingManagerEngine::managerName() const
{
return d_ptr->managerName;
}
@@ -129,7 +129,7 @@ QString QGeoSearchManagerEngine::managerName() const
The combination of managerName() and managerVersion() should be unique
amongst plugin implementations.
*/
-void QGeoSearchManagerEngine::setManagerVersion(int managerVersion)
+void QGeocodingManagerEngine::setManagerVersion(int managerVersion)
{
d_ptr->managerVersion = managerVersion;
}
@@ -140,7 +140,7 @@ void QGeoSearchManagerEngine::setManagerVersion(int managerVersion)
The combination of managerName() and managerVersion() should be unique
amongst plugin implementations.
*/
-int QGeoSearchManagerEngine::managerVersion() const
+int QGeocodingManagerEngine::managerVersion() const
{
return d_ptr->managerVersion;
}
@@ -149,16 +149,16 @@ int QGeoSearchManagerEngine::managerVersion() const
Begins the geocoding of \a address. Geocoding is the process of finding a
coordinate that corresponds to a given address.
- A QGeoSearchReply object will be returned, which can be used to manage the
+ A QGeocodeReply object will be returned, which can be used to manage the
geocoding operation and to return the results of the operation.
- This engine and the returned QGeoSearchReply object will emit signals
+ This engine and the returned QGeocodeReply object will emit signals
indicating if the operation completes or if errors occur.
If supportsGeocoding() returns false an
- QGeoSearchReply::UnsupportedOptionError will occur.
+ QGeocodeReply::UnsupportedOptionError will occur.
- Once the operation has completed, QGeoSearchReply::locations() can be used to
+ Once the operation has completed, QGeocodeReply::locations() can be used to
retrieve the results, which will consist of a list of QGeoLocation objects.
These object represent a combination of coordinate and address data.
@@ -172,16 +172,16 @@ int QGeoSearchManagerEngine::managerVersion() const
service will attempt to geocode all matches for the specified data.
The user is responsible for deleting the returned reply object, although
- this can be done in the slot connected to QGeoSearchManagerEngine::finished(),
- QGeoSearchManagerEngine::error(), QGeoSearchReply::finished() or
- QGeoSearchReply::error() with deleteLater().
+ this can be done in the slot connected to QGeocodingManagerEngine::finished(),
+ QGeocodingManagerEngine::error(), QGeocodeReply::finished() or
+ QGeocodeReply::error() with deleteLater().
*/
-QGeoSearchReply* QGeoSearchManagerEngine::geocode(const QGeoAddress &address,
+QGeocodeReply* QGeocodingManagerEngine::geocode(const QGeoAddress &address,
QGeoBoundingArea *bounds)
{
Q_UNUSED(address)
Q_UNUSED(bounds)
- return new QGeoSearchReply(QGeoSearchReply::UnsupportedOptionError,
+ return new QGeocodeReply(QGeocodeReply::UnsupportedOptionError,
QLatin1String("Geocoding is not supported by this service provider."), this);
}
@@ -189,16 +189,16 @@ QGeoSearchReply* QGeoSearchManagerEngine::geocode(const QGeoAddress &address,
Begins the reverse geocoding of \a coordinate. Reverse geocoding is the
process of finding an address that corresponds to a given coordinate.
- A QGeoSearchReply object will be returned, which can be used to manage the
+ A QGeocodeReply object will be returned, which can be used to manage the
reverse geocoding operation and to return the results of the operation.
- This engine and the returned QGeoSearchReply object will emit signals
+ This engine and the returned QGeocodeReply object will emit signals
indicating if the operation completes or if errors occur.
If supportsReverseGeocoding() returns false an
- QGeoSearchReply::UnsupportedOptionError will occur.
+ QGeocodeReply::UnsupportedOptionError will occur.
- At that point QGeoSearchReply::locations() can be used to retrieve the
+ At that point QGeocodeReply::locations() can be used to retrieve the
results, which will consist of a list of QGeoLocation objects. These object
represent a combination of coordinate and address data.
@@ -217,36 +217,36 @@ QGeoSearchReply* QGeoSearchManagerEngine::geocode(const QGeoAddress &address,
limit the results to those that are contained by \a bounds.
The user is responsible for deleting the returned reply object, although
- this can be done in the slot connected to QGeoSearchManagerEngine::finished(),
- QGeoSearchManagerEngine::error(), QGeoSearchReply::finished() or
- QGeoSearchReply::error() with deleteLater().
+ this can be done in the slot connected to QGeocodingManagerEngine::finished(),
+ QGeocodingManagerEngine::error(), QGeocodeReply::finished() or
+ QGeocodeReply::error() with deleteLater().
*/
-QGeoSearchReply* QGeoSearchManagerEngine::reverseGeocode(const QGeoCoordinate &coordinate,
+QGeocodeReply* QGeocodingManagerEngine::reverseGeocode(const QGeoCoordinate &coordinate,
QGeoBoundingArea *bounds)
{
Q_UNUSED(coordinate)
Q_UNUSED(bounds)
- return new QGeoSearchReply(QGeoSearchReply::UnsupportedOptionError,
+ return new QGeocodeReply(QGeocodeReply::UnsupportedOptionError,
QLatin1String("Reverse geocoding is not supported by this service provider."), this);
}
/*!
- Begins searching for a location matching \a searchString.
+ Begins geocoding for a location matching \a address.
- A QGeoSearchReply object will be returned, which can be used to manage the
+ A QGeocodeReply object will be returned, which can be used to manage the
geocoding operation and to return the results of the operation.
- This engine and the returned QGeoSearchReply object will emit signals
+ This engine and the returned QGeocodeReply object will emit signals
indicating if the operation completes or if errors occur.
- Once the operation has completed, QGeoSearchReply::locations() can be used to
+ Once the operation has completed, QGeocodeReply::locations() can be used to
retrieve the results, which will consist of a list of QGeoLocation objects.
These object represent a combination of coordinate and address data.
If \a limit is -1 the entire result set will be returned, otherwise at most
\a limit results will be returned.
- The \a offset parameter is used to ask the search service to not return the
+ The \a offset parameter is used to ask the geocoding service to not return the
first \a offset results.
The \a limit and \a offset results are used together to implement paging.
@@ -255,21 +255,21 @@ QGeoSearchReply* QGeoSearchManagerEngine::reverseGeocode(const QGeoCoordinate &c
limit the results to those that are contained by \a bounds.
The user is responsible for deleting the returned reply object, although
- this can be done in the slot connected to QGeoSearchManagerEngine::finished(),
- QGeoSearchManagerEngine::error(), QGeoSearchReply::finished() or
- QGeoSearchReply::error() with deleteLater().
+ this can be done in the slot connected to QGeocodingManagerEngine::finished(),
+ QGeocodingManagerEngine::error(), QGeocodeReply::finished() or
+ QGeocodeReply::error() with deleteLater().
*/
-QGeoSearchReply* QGeoSearchManagerEngine::search(const QString &searchString,
+QGeocodeReply* QGeocodingManagerEngine::geocode(const QString &address,
int limit,
int offset,
QGeoBoundingArea *bounds)
{
- Q_UNUSED(searchString)
+ Q_UNUSED(address)
Q_UNUSED(limit)
Q_UNUSED(offset)
Q_UNUSED(bounds)
- return new QGeoSearchReply(QGeoSearchReply::UnsupportedOptionError,
+ return new QGeocodeReply(QGeocodeReply::UnsupportedOptionError,
QLatin1String("Searching is not supported by this service provider."), this);
}
@@ -280,7 +280,7 @@ QGeoSearchReply* QGeoSearchManagerEngine::search(const QString &searchString,
reports its capabilities correctly. If this function is not used the
engine will report that it does not support geocoding.
*/
-void QGeoSearchManagerEngine::setSupportsGeocoding(bool supported)
+void QGeocodingManagerEngine::setSupportsGeocoding(bool supported)
{
d_ptr->supportsGeocoding = supported;
}
@@ -288,7 +288,7 @@ void QGeoSearchManagerEngine::setSupportsGeocoding(bool supported)
/*!
Returns whether this engine supports geocoding.
*/
-bool QGeoSearchManagerEngine::supportsGeocoding() const
+bool QGeocodingManagerEngine::supportsGeocoding() const
{
return d_ptr->supportsGeocoding;
}
@@ -300,7 +300,7 @@ bool QGeoSearchManagerEngine::supportsGeocoding() const
reports its capabilities correctly. If this function is not used the
engine will report that it does not support reverse geocoding.
*/
-void QGeoSearchManagerEngine::setSupportsReverseGeocoding(bool supported)
+void QGeocodingManagerEngine::setSupportsReverseGeocoding(bool supported)
{
d_ptr->supportsReverseGeocoding = supported;
}
@@ -308,7 +308,7 @@ void QGeoSearchManagerEngine::setSupportsReverseGeocoding(bool supported)
/*!
Returns whether this engine supports reverse geocoding.
*/
-bool QGeoSearchManagerEngine::supportsReverseGeocoding() const
+bool QGeocodingManagerEngine::supportsReverseGeocoding() const
{
return d_ptr->supportsReverseGeocoding;
}
@@ -316,34 +316,34 @@ bool QGeoSearchManagerEngine::supportsReverseGeocoding() const
/*!
Sets the locale to be used by the this manager to \a locale.
- If this search manager supports returning the results
+ If this geocoding manager supports returning the results
in different languages, they will be returned in the language of \a locale.
The locale used defaults to the system locale if this is not set.
*/
-void QGeoSearchManagerEngine::setLocale(const QLocale &locale)
+void QGeocodingManagerEngine::setLocale(const QLocale &locale)
{
d_ptr->locale = locale;
}
/*!
- Returns the locale used to hint to this search manager about what
+ Returns the locale used to hint to this geocoding manager about what
language to use for the results.
*/
-QLocale QGeoSearchManagerEngine::locale() const
+QLocale QGeocodingManagerEngine::locale() const
{
return d_ptr->locale;
}
/*!
-\fn void QGeoSearchManagerEngine::finished(QGeoSearchReply* reply)
+\fn void QGeocodingManagerEngine::finished(QGeocodeReply* reply)
This signal is emitted when \a reply has finished processing.
- If reply::error() equals QGeoSearchReply::NoError then the processing
+ If reply::error() equals QGeocodeReply::NoError then the processing
finished successfully.
- This signal and QGeoSearchReply::finished() will be emitted at the same
+ This signal and QGeocodeReply::finished() will be emitted at the same
time.
\note Do no delete the \a reply object in the slot connected to this
@@ -351,15 +351,15 @@ QLocale QGeoSearchManagerEngine::locale() const
*/
/*!
-\fn void QGeoSearchManagerEngine::error(QGeoSearchReply* reply, QGeoSearchReply::Error error, QString errorString)
+\fn void QGeocodingManagerEngine::error(QGeocodeReply* reply, QGeocodeReply::Error error, QString errorString)
This signal is emitted when an error has been detected in the processing of
- \a reply. The QGeoSearchManagerEngine::finished() signal will probably follow.
+ \a reply. The QGeocodingManagerEngine::finished() signal will probably follow.
The error will be described by the error code \a error. If \a errorString is
not empty it will contain a textual description of the error.
- This signal and QGeoSearchReply::error() will be emitted at the same time.
+ This signal and QGeocodeReply::error() will be emitted at the same time.
\note Do no delete the \a reply object in the slot connected to this
signal. Use deleteLater() instead.
@@ -368,15 +368,15 @@ QLocale QGeoSearchManagerEngine::locale() const
/*******************************************************************************
*******************************************************************************/
-QGeoSearchManagerEnginePrivate::QGeoSearchManagerEnginePrivate()
+QGeocodingManagerEnginePrivate::QGeocodingManagerEnginePrivate()
: managerVersion(-1),
supportsGeocoding(false),
supportsReverseGeocoding(false) {}
-QGeoSearchManagerEnginePrivate::~QGeoSearchManagerEnginePrivate()
+QGeocodingManagerEnginePrivate::~QGeocodingManagerEnginePrivate()
{
}
-#include "moc_qgeosearchmanagerengine.cpp"
+#include "moc_qgeocodingmanagerengine.cpp"
QT_END_NAMESPACE
diff --git a/src/location/maps/qgeosearchmanagerengine.h b/src/location/maps/qgeocodingmanagerengine.h
index 48bd7775..44df5e1c 100644
--- a/src/location/maps/qgeosearchmanagerengine.h
+++ b/src/location/maps/qgeocodingmanagerengine.h
@@ -39,11 +39,11 @@
**
****************************************************************************/
-#ifndef QGEOSEARCHMANAGERENGINE_H
-#define QGEOSEARCHMANAGERENGINE_H
+#ifndef QGEOCODINGMANAGERENGINE_H
+#define QGEOCODINGMANAGERENGINE_H
-#include "qgeosearchmanager.h"
-#include "qgeosearchreply.h"
+#include "qgeocodingmanager.h"
+#include "qgeocodereply.h"
#include "qgeoboundingbox.h"
#include <QObject>
@@ -51,27 +51,28 @@
QT_BEGIN_NAMESPACE
-class QGeoSearchManagerEnginePrivate;
+class QGeocodingManagerEnginePrivate;
-class Q_LOCATION_EXPORT QGeoSearchManagerEngine : public QObject
+class Q_LOCATION_EXPORT QGeocodingManagerEngine : public QObject
{
Q_OBJECT
public:
- QGeoSearchManagerEngine(const QMap<QString, QVariant> &parameters, QObject *parent = 0);
- virtual ~QGeoSearchManagerEngine();
+ QGeocodingManagerEngine(const QMap<QString, QVariant> &parameters, QObject *parent = 0);
+ virtual ~QGeocodingManagerEngine();
QString managerName() const;
int managerVersion() const;
- virtual QGeoSearchReply* geocode(const QGeoAddress &address,
+ virtual QGeocodeReply* geocode(const QGeoAddress &address,
QGeoBoundingArea *bounds);
- virtual QGeoSearchReply* reverseGeocode(const QGeoCoordinate &coordinate,
- QGeoBoundingArea *bounds);
-
- virtual QGeoSearchReply* search(const QString &searchString,
+ virtual QGeocodeReply* geocode(const QString &address,
int limit,
int offset,
QGeoBoundingArea *bounds);
+ virtual QGeocodeReply* reverseGeocode(const QGeoCoordinate &coordinate,
+ QGeoBoundingArea *bounds);
+
+
bool supportsGeocoding() const;
bool supportsReverseGeocoding() const;
@@ -80,8 +81,8 @@ public:
QLocale locale() const;
Q_SIGNALS:
- void finished(QGeoSearchReply* reply);
- void error(QGeoSearchReply* reply, QGeoSearchReply::Error error, QString errorString = QString());
+ void finished(QGeocodeReply* reply);
+ void error(QGeocodeReply* reply, QGeocodeReply::Error error, QString errorString = QString());
protected:
void setSupportsGeocoding(bool supported);
@@ -91,8 +92,8 @@ private:
void setManagerName(const QString &managerName);
void setManagerVersion(int managerVersion);
- QGeoSearchManagerEnginePrivate *d_ptr;
- Q_DISABLE_COPY(QGeoSearchManagerEngine)
+ QGeocodingManagerEnginePrivate *d_ptr;
+ Q_DISABLE_COPY(QGeocodingManagerEngine)
friend class QGeoServiceProvider;
};
diff --git a/src/location/maps/qgeosearchmanagerengine_p.h b/src/location/maps/qgeocodingmanagerengine_p.h
index 44ce49af..0f3d46c7 100644
--- a/src/location/maps/qgeosearchmanagerengine_p.h
+++ b/src/location/maps/qgeocodingmanagerengine_p.h
@@ -39,8 +39,8 @@
**
****************************************************************************/
-#ifndef QGEOSEARCHMANAGERENGINE_P_H
-#define QGEOSEARCHMANAGERENGINE_P_H
+#ifndef QGEOCODINGMANAGERENGINE_P_H
+#define QGEOCODINGMANAGERENGINE_P_H
//
// W A R N I N G
@@ -53,18 +53,18 @@
// We mean it.
//
-#include "qgeosearchmanagerengine.h"
+#include "qgeocodingmanagerengine.h"
#include <QList>
#include <QLocale>
QT_BEGIN_NAMESPACE
-class QGeoSearchManagerEnginePrivate
+class QGeocodingManagerEnginePrivate
{
public:
- QGeoSearchManagerEnginePrivate();
- ~QGeoSearchManagerEnginePrivate();
+ QGeocodingManagerEnginePrivate();
+ ~QGeocodingManagerEnginePrivate();
QString managerName;
int managerVersion;
@@ -75,7 +75,7 @@ public:
QLocale locale;
private:
- Q_DISABLE_COPY(QGeoSearchManagerEnginePrivate)
+ Q_DISABLE_COPY(QGeocodingManagerEnginePrivate)
};
QT_END_NAMESPACE
diff --git a/src/location/maps/qgeoserviceprovider.cpp b/src/location/maps/qgeoserviceprovider.cpp
index 360514ea..52bcec36 100644
--- a/src/location/maps/qgeoserviceprovider.cpp
+++ b/src/location/maps/qgeoserviceprovider.cpp
@@ -43,11 +43,11 @@
#include "qgeoserviceprovider_p.h"
#include "qgeoserviceproviderfactory.h"
-#include "qgeosearchmanager.h"
+#include "qgeocodingmanager.h"
#include "qgeomappingmanager.h"
#include "qgeoroutingmanager.h"
#include "qplacemanager.h"
-#include "qgeosearchmanagerengine.h"
+#include "qgeocodingmanagerengine.h"
#include "qgeomappingmanagerengine.h"
#include "qgeoroutingmanagerengine.h"
#include "qplacemanagerengine.h"
@@ -153,50 +153,50 @@ QGeoServiceProvider::~QGeoServiceProvider()
}
/*!
- Returns the QGeoSearchManager made available by the service
+ Returns the QGeocodingManager made available by the service
provider.
This function will return 0 if the service provider does not provide
any geocoding services.
- This function will attempt to construct a QGeoSearchManager instance
+ This function will attempt to construct a QGeocodingManager instance
when it is called for the first time. If the attempt is successful the
- QGeoSearchManager will be cached, otherwise each call of this function
- will attempt to construct a QGeoSearchManager instance until the
+ QGeocodingManager will be cached, otherwise each call of this function
+ will attempt to construct a QGeocodingManager instance until the
construction is successful.
After this function has been called, error() and errorString() will
report any errors which occurred during the construction of the
- QGeoSearchManager.
+ QGeocodingManager.
*/
-QGeoSearchManager* QGeoServiceProvider::searchManager() const
+QGeocodingManager* QGeoServiceProvider::geocodingManager() const
{
- if (!d_ptr->factory || (d_ptr->searchError != QGeoServiceProvider::NoError))
+ if (!d_ptr->factory || (d_ptr->geocodeError != QGeoServiceProvider::NoError))
return 0;
- if (!d_ptr->searchManager) {
- QGeoSearchManagerEngine *engine = d_ptr->factory->createSearchManagerEngine(d_ptr->parameterMap,
- &(d_ptr->searchError),
- &(d_ptr->searchErrorString));
+ if (!d_ptr->geocodingManager) {
+ QGeocodingManagerEngine *engine = d_ptr->factory->createGeocodingManagerEngine(d_ptr->parameterMap,
+ &(d_ptr->geocodeError),
+ &(d_ptr->geocodeErrorString));
if (engine) {
engine->setManagerName(d_ptr->factory->providerName());
engine->setManagerVersion(d_ptr->factory->providerVersion());
- d_ptr->searchManager = new QGeoSearchManager(engine);
+ d_ptr->geocodingManager = new QGeocodingManager(engine);
} else {
- d_ptr->searchError = QGeoServiceProvider::NotSupportedError;
- d_ptr->searchErrorString = QLatin1String("The service provider does not support searchManager().");
+ d_ptr->geocodeError = QGeoServiceProvider::NotSupportedError;
+ d_ptr->geocodeErrorString = QLatin1String("The service provider does not support geocodingManager().");
}
- if (d_ptr->searchError != QGeoServiceProvider::NoError) {
- if (d_ptr->searchManager)
- delete d_ptr->searchManager;
- d_ptr->searchManager = 0;
- d_ptr->error = d_ptr->searchError;
- d_ptr->errorString = d_ptr->searchErrorString;
+ if (d_ptr->geocodeError != QGeoServiceProvider::NoError) {
+ if (d_ptr->geocodingManager)
+ delete d_ptr->geocodingManager;
+ d_ptr->geocodingManager = 0;
+ d_ptr->error = d_ptr->geocodeError;
+ d_ptr->errorString = d_ptr->geocodeErrorString;
}
}
- return d_ptr->searchManager;
+ return d_ptr->geocodingManager;
}
/*!
@@ -362,11 +362,11 @@ QString QGeoServiceProvider::errorString() const
QGeoServiceProviderPrivate::QGeoServiceProviderPrivate()
: factory(0),
- searchManager(0),
+ geocodingManager(0),
routingManager(0),
mappingManager(0),
placeManager(0),
- searchError(QGeoServiceProvider::NoError),
+ geocodeError(QGeoServiceProvider::NoError),
routingError(QGeoServiceProvider::NoError),
mappingError(QGeoServiceProvider::NoError),
placeError(QGeoServiceProvider::NoError),
@@ -374,8 +374,8 @@ QGeoServiceProviderPrivate::QGeoServiceProviderPrivate()
QGeoServiceProviderPrivate::~QGeoServiceProviderPrivate()
{
- if (searchManager)
- delete searchManager;
+ if (geocodingManager)
+ delete geocodingManager;
if (routingManager)
delete routingManager;
diff --git a/src/location/maps/qgeoserviceprovider.h b/src/location/maps/qgeoserviceprovider.h
index ebda46c7..7dcc9a90 100644
--- a/src/location/maps/qgeoserviceprovider.h
+++ b/src/location/maps/qgeoserviceprovider.h
@@ -54,11 +54,11 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
class QStringList;
-class QGeoSearchManager;
+class QGeocodingManager;
class QGeoMappingManager;
class QGeoRoutingManager;
class QPlaceManager;
-class QGeoSearchManagerEngine;
+class QGeocodingManagerEngine;
class QGeoMappingManagerEngine;
class QGeoRoutingManagerEngine;
class QPlaceManagerEngine;
@@ -80,7 +80,7 @@ public:
~QGeoServiceProvider();
- QGeoSearchManager* searchManager() const;
+ QGeocodingManager* geocodingManager() const;
QGeoMappingManager* mappingManager() const;
QGeoRoutingManager* routingManager() const;
QPlaceManager *placeManager() const;
diff --git a/src/location/maps/qgeoserviceprovider_p.h b/src/location/maps/qgeoserviceprovider_p.h
index bb194e09..0d2bb772 100644
--- a/src/location/maps/qgeoserviceprovider_p.h
+++ b/src/location/maps/qgeoserviceprovider_p.h
@@ -59,7 +59,7 @@
QT_BEGIN_NAMESPACE
-class QGeoSearchManager;
+class QGeocodingManager;
class QGeoRoutingManager;
class QGeoMappingManager;
@@ -77,17 +77,17 @@ public:
QMap<QString, QVariant> parameterMap;
- QGeoSearchManager *searchManager;
+ QGeocodingManager *geocodingManager;
QGeoRoutingManager *routingManager;
QGeoMappingManager *mappingManager;
QPlaceManager *placeManager;
- QGeoServiceProvider::Error searchError;
+ QGeoServiceProvider::Error geocodeError;
QGeoServiceProvider::Error routingError;
QGeoServiceProvider::Error mappingError;
QGeoServiceProvider::Error placeError;
- QString searchErrorString;
+ QString geocodeErrorString;
QString routingErrorString;
QString mappingErrorString;
QString placeErrorString;
diff --git a/src/location/maps/qgeoserviceproviderfactory.cpp b/src/location/maps/qgeoserviceproviderfactory.cpp
index 196f6877..20d10834 100644
--- a/src/location/maps/qgeoserviceproviderfactory.cpp
+++ b/src/location/maps/qgeoserviceproviderfactory.cpp
@@ -88,8 +88,8 @@ amongst the plugins.
*/
/*!
- Returns a new QGeoSearchManagerEngine instance, initialized with \a
- parameters, which implements the location searching functionality.
+ Returns a new QGeocodingManagerEngine instance, initialized with \a
+ parameters, which implements the location geocoding functionality.
If \a error is not 0 it should be set to QGeoServiceProvider::NoError on
success or an appropriate QGeoServiceProvider::Error on failure.
@@ -100,7 +100,7 @@ amongst the plugins.
The default implementation returns 0, which causes a
QGeoServiceProvider::NotSupportedError in QGeoServiceProvider.
*/
-QGeoSearchManagerEngine* QGeoServiceProviderFactory::createSearchManagerEngine(const QMap<QString, QVariant> &parameters,
+QGeocodingManagerEngine* QGeoServiceProviderFactory::createGeocodingManagerEngine(const QMap<QString, QVariant> &parameters,
QGeoServiceProvider::Error *error,
QString *errorString) const
{
@@ -113,7 +113,7 @@ QGeoSearchManagerEngine* QGeoServiceProviderFactory::createSearchManagerEngine(c
/*!
Returns a new QGeoMappingManagerEngine instance, initialized with \a
- parameters, which implements the location searching functionality.
+ parameters, which implements mapping functionality.
If \a error is not 0 it should be set to QGeoServiceProvider::NoError on
success or an appropriate QGeoServiceProvider::Error on failure.
@@ -137,7 +137,7 @@ QGeoMappingManagerEngine* QGeoServiceProviderFactory::createMappingManagerEngine
/*!
Returns a new QGeoRoutingManagerEngine instance, initialized with \a
- parameters, which implements the location searching functionality.
+ parameters, which implements routing functionality.
If \a error is not 0 it should be set to QGeoServiceProvider::NoError on
success or an appropriate QGeoServiceProvider::Error on failure.
diff --git a/src/location/maps/qgeoserviceproviderfactory.h b/src/location/maps/qgeoserviceproviderfactory.h
index d8a80dd4..9877b5e8 100644
--- a/src/location/maps/qgeoserviceproviderfactory.h
+++ b/src/location/maps/qgeoserviceproviderfactory.h
@@ -59,7 +59,7 @@ public:
virtual QString providerName() const = 0;
virtual int providerVersion() const = 0;
- virtual QGeoSearchManagerEngine* createSearchManagerEngine(const QMap<QString, QVariant> &parameters,
+ virtual QGeocodingManagerEngine* createGeocodingManagerEngine(const QMap<QString, QVariant> &parameters,
QGeoServiceProvider::Error *error,
QString *errorString) const;
virtual QGeoMappingManagerEngine* createMappingManagerEngine(const QMap<QString, QVariant> &parameters,
diff --git a/src/plugins/geoservices/nokia/nokia.pro b/src/plugins/geoservices/nokia/nokia.pro
index 4ed75df4..807a8249 100644
--- a/src/plugins/geoservices/nokia/nokia.pro
+++ b/src/plugins/geoservices/nokia/nokia.pro
@@ -9,27 +9,27 @@ DESTDIR = $$QT.location.plugins/geoservices
#QTDIR_build:REQUIRES += "contains(QT_CONFIG, location)"
HEADERS += \
+ qgeocodereply_nokia.h \
qgeocodexmlparser.h \
+ qgeocodingmanagerengine_nokia.h \
qgeomappingmanagerengine_nokia.h \
qgeomapreply_nokia.h \
qgeoroutereply_nokia.h \
qgeoroutexmlparser.h \
qgeoroutingmanagerengine_nokia.h \
- qgeosearchmanagerengine_nokia.h \
- qgeosearchreply_nokia.h \
qgeoserviceproviderplugin_nokia.h \
marclanguagecodes.h \
qgeotiledmapdata_nokia.h
SOURCES += \
+ qgeocodereply_nokia.cpp \
qgeocodexmlparser.cpp \
+ qgeocodingmanagerengine_nokia.cpp \
qgeomappingmanagerengine_nokia.cpp \
qgeomapreply_nokia.cpp \
qgeoroutereply_nokia.cpp \
qgeoroutexmlparser.cpp \
qgeoroutingmanagerengine_nokia.cpp \
- qgeosearchmanagerengine_nokia.cpp \
- qgeosearchreply_nokia.cpp \
qgeoserviceproviderplugin_nokia.cpp \
qgeotiledmapdata_nokia.cpp
@@ -45,7 +45,7 @@ symbian {
TARGET.UID3 = 0x2002BFCA
pluginDep.sources = $${TARGET}.dll
pluginDep.path = $${QT_PLUGINS_BASE_DIR}/$${PLUGIN_TYPE}
- DEPLOYMENT += pluginDep
+ DEPLOYMENT += pluginDep
LIBS += -lefsrv
}
diff --git a/src/plugins/geoservices/nokia/qgeosearchreply_nokia.cpp b/src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp
index 836e00e3..7db3120c 100644
--- a/src/plugins/geoservices/nokia/qgeosearchreply_nokia.cpp
+++ b/src/plugins/geoservices/nokia/qgeocodereply_nokia.cpp
@@ -46,13 +46,13 @@
**
****************************************************************************/
-#include "qgeosearchreply_nokia.h"
+#include "qgeocodereply_nokia.h"
#include "qgeocodexmlparser.h"
QT_BEGIN_NAMESPACE
-QGeoSearchReplyNokia::QGeoSearchReplyNokia(QNetworkReply *reply, int limit, int offset, QGeoBoundingArea *viewport, QObject *parent)
- : QGeoSearchReply(parent),
+QGeocodeReplyNokia::QGeocodeReplyNokia(QNetworkReply *reply, int limit, int offset, QGeoBoundingArea *viewport, QObject *parent)
+ : QGeocodeReply(parent),
m_reply(reply)
{
connect(m_reply,
@@ -70,12 +70,12 @@ QGeoSearchReplyNokia::QGeoSearchReplyNokia(QNetworkReply *reply, int limit, int
setViewport(viewport);
}
-QGeoSearchReplyNokia::~QGeoSearchReplyNokia()
+QGeocodeReplyNokia::~QGeocodeReplyNokia()
{
//TODO: possible mem leak -> m_reply->deleteLater() ?
}
-void QGeoSearchReplyNokia::abort()
+void QGeocodeReplyNokia::abort()
{
if (!m_reply)
return;
@@ -86,14 +86,14 @@ void QGeoSearchReplyNokia::abort()
m_reply = 0;
}
-void QGeoSearchReplyNokia::networkFinished()
+void QGeocodeReplyNokia::networkFinished()
{
if (!m_reply)
return;
if (m_reply->error() != QNetworkReply::NoError) {
// Removed because this is already done in networkError, which previously caused _two_ errors to be raised for every error.
- //setError(QGeoSearchReply::CommunicationError, m_reply->errorString());
+ //setError(QGeoCodeReply::CommunicationError, m_reply->errorString());
//m_reply->deleteLater();
//m_reply = 0;
return;
@@ -112,21 +112,21 @@ void QGeoSearchReplyNokia::networkFinished()
setLocations(locations);
setFinished(true);
} else {
- setError(QGeoSearchReply::ParseError, parser.errorString());
+ setError(QGeocodeReply::ParseError, parser.errorString());
}
m_reply->deleteLater();
m_reply = 0;
}
-void QGeoSearchReplyNokia::networkError(QNetworkReply::NetworkError error)
+void QGeocodeReplyNokia::networkError(QNetworkReply::NetworkError error)
{
Q_UNUSED(error)
if (!m_reply)
return;
- setError(QGeoSearchReply::CommunicationError, m_reply->errorString());
+ setError(QGeocodeReply::CommunicationError, m_reply->errorString());
m_reply->deleteLater();
m_reply = 0;
diff --git a/src/plugins/geoservices/nokia/qgeosearchreply_nokia.h b/src/plugins/geoservices/nokia/qgeocodereply_nokia.h
index 9c47dd6b..940341e1 100644
--- a/src/plugins/geoservices/nokia/qgeosearchreply_nokia.h
+++ b/src/plugins/geoservices/nokia/qgeocodereply_nokia.h
@@ -49,17 +49,17 @@
#ifndef QGEOPLACESREPLY_NOKIA_H
#define QGEOPLACESREPLY_NOKIA_H
-#include <qgeosearchreply.h>
+#include <qgeocodereply.h>
#include <QNetworkReply>
QT_BEGIN_NAMESPACE
-class QGeoSearchReplyNokia : public QGeoSearchReply
+class QGeocodeReplyNokia : public QGeocodeReply
{
Q_OBJECT
public:
- QGeoSearchReplyNokia(QNetworkReply *reply, int limit, int offset, QGeoBoundingArea *viewport, QObject *parent = 0);
- ~QGeoSearchReplyNokia();
+ QGeocodeReplyNokia(QNetworkReply *reply, int limit, int offset, QGeoBoundingArea *viewport, QObject *parent = 0);
+ ~QGeocodeReplyNokia();
void abort();
diff --git a/src/plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.cpp b/src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.cpp
index 5ddaa480..01b2b916 100644
--- a/src/plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.cpp
+++ b/src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.cpp
@@ -46,8 +46,8 @@
**
****************************************************************************/
-#include "qgeosearchmanagerengine_nokia.h"
-#include "qgeosearchreply_nokia.h"
+#include "qgeocodingmanagerengine_nokia.h"
+#include "qgeocodereply_nokia.h"
#include "marclanguagecodes.h"
#include <qgeoaddress.h>
@@ -58,8 +58,8 @@
QT_BEGIN_NAMESPACE
-QGeoSearchManagerEngineNokia::QGeoSearchManagerEngineNokia(const QMap<QString, QVariant> &parameters, QGeoServiceProvider::Error *error, QString *errorString)
- : QGeoSearchManagerEngine(parameters),
+QGeocodingManagerEngineNokia::QGeocodingManagerEngineNokia(const QMap<QString, QVariant> &parameters, QGeoServiceProvider::Error *error, QString *errorString)
+ : QGeocodingManagerEngine(parameters),
m_host("loc.desktop.maps.svc.ovi.com"),
m_token(QGeoServiceProviderFactoryNokia::defaultToken),
m_referer(QGeoServiceProviderFactoryNokia::defaultReferer)
@@ -109,13 +109,13 @@ QGeoSearchManagerEngineNokia::QGeoSearchManagerEngineNokia(const QMap<QString, Q
*errorString = "";
}
-QGeoSearchManagerEngineNokia::~QGeoSearchManagerEngineNokia() {}
+QGeocodingManagerEngineNokia::~QGeocodingManagerEngineNokia() {}
-QGeoSearchReply* QGeoSearchManagerEngineNokia::geocode(const QGeoAddress &address,
+QGeocodeReply* QGeocodingManagerEngineNokia::geocode(const QGeoAddress &address,
QGeoBoundingArea *bounds)
{
if (!supportsGeocoding()) {
- QGeoSearchReply *reply = new QGeoSearchReply(QGeoSearchReply::UnsupportedOptionError, "Geocoding is not supported by this service provider.", this);
+ QGeocodeReply *reply = new QGeocodeReply(QGeocodeReply::UnsupportedOptionError, "Geocoding is not supported by this service provider.", this);
emit error(reply, reply->error(), reply->errorString());
return reply;
}
@@ -164,14 +164,14 @@ QGeoSearchReply* QGeoSearchManagerEngineNokia::geocode(const QGeoAddress &addres
// requestString += address.streetNumber();
// }
- return search(requestString, bounds);
+ return geocode(requestString, bounds);
}
-QGeoSearchReply* QGeoSearchManagerEngineNokia::reverseGeocode(const QGeoCoordinate &coordinate,
+QGeocodeReply* QGeocodingManagerEngineNokia::reverseGeocode(const QGeoCoordinate &coordinate,
QGeoBoundingArea *bounds)
{
if (!supportsReverseGeocoding()) {
- QGeoSearchReply *reply = new QGeoSearchReply(QGeoSearchReply::UnsupportedOptionError, "Reverse geocoding is not supported by this service provider.", this);
+ QGeocodeReply *reply = new QGeocodeReply(QGeocodeReply::UnsupportedOptionError, "Reverse geocoding is not supported by this service provider.", this);
emit error(reply, reply->error(), reply->errorString());
return reply;
}
@@ -189,10 +189,10 @@ QGeoSearchReply* QGeoSearchManagerEngineNokia::reverseGeocode(const QGeoCoordina
requestString += "&lg=";
requestString += languageToMarc(locale().language());
- return search(requestString, bounds);
+ return geocode(requestString, bounds);
}
-QGeoSearchReply* QGeoSearchManagerEngineNokia::search(const QString &searchString,
+QGeocodeReply* QGeocodingManagerEngineNokia::geocode(const QString &address,
int limit,
int offset,
QGeoBoundingArea *bounds)
@@ -208,7 +208,7 @@ QGeoSearchReply* QGeoSearchManagerEngineNokia::search(const QString &searchStrin
requestString += languageToMarc(locale().language());
requestString += "&obloc=";
- requestString += searchString;
+ requestString += address;
if (limit > 0) {
requestString += "&total=";
@@ -220,16 +220,16 @@ QGeoSearchReply* QGeoSearchManagerEngineNokia::search(const QString &searchStrin
requestString += QString::number(offset);
}
- return search(requestString, bounds, limit, offset);
+ return geocode(requestString, bounds, limit, offset);
}
-QGeoSearchReply* QGeoSearchManagerEngineNokia::search(QString requestString,
+QGeocodeReply* QGeocodingManagerEngineNokia::geocode(QString requestString,
QGeoBoundingArea *bounds,
int limit,
int offset)
{
QNetworkReply *networkReply = m_networkManager->get(QNetworkRequest(QUrl(requestString)));
- QGeoSearchReplyNokia *reply = new QGeoSearchReplyNokia(networkReply, limit, offset, bounds, this);
+ QGeocodeReplyNokia *reply = new QGeocodeReplyNokia(networkReply, limit, offset, bounds, this);
connect(reply,
SIGNAL(finished()),
@@ -237,14 +237,14 @@ QGeoSearchReply* QGeoSearchManagerEngineNokia::search(QString requestString,
SLOT(placesFinished()));
connect(reply,
- SIGNAL(error(QGeoSearchReply::Error, QString)),
+ SIGNAL(error(QGeocodeReply::Error, QString)),
this,
- SLOT(placesError(QGeoSearchReply::Error, QString)));
+ SLOT(placesError(QGeocodeReply::Error, QString)));
return reply;
}
-QString QGeoSearchManagerEngineNokia::trimDouble(double degree, int decimalDigits)
+QString QGeocodingManagerEngineNokia::trimDouble(double degree, int decimalDigits)
{
QString sDegree = QString::number(degree, 'g', decimalDigits);
@@ -256,14 +256,14 @@ QString QGeoSearchManagerEngineNokia::trimDouble(double degree, int decimalDigit
return QString::number(degree, 'g', decimalDigits + index);
}
-void QGeoSearchManagerEngineNokia::placesFinished()
+void QGeocodingManagerEngineNokia::placesFinished()
{
- QGeoSearchReply *reply = qobject_cast<QGeoSearchReply*>(sender());
+ QGeocodeReply *reply = qobject_cast<QGeocodeReply*>(sender());
if (!reply)
return;
- if (receivers(SIGNAL(finished(QGeoSearchReply*))) == 0) {
+ if (receivers(SIGNAL(finished(QGeocodeReply*))) == 0) {
reply->deleteLater();
return;
}
@@ -271,14 +271,14 @@ void QGeoSearchManagerEngineNokia::placesFinished()
emit finished(reply);
}
-void QGeoSearchManagerEngineNokia::placesError(QGeoSearchReply::Error error, const QString &errorString)
+void QGeocodingManagerEngineNokia::placesError(QGeocodeReply::Error error, const QString &errorString)
{
- QGeoSearchReply *reply = qobject_cast<QGeoSearchReply*>(sender());
+ QGeocodeReply *reply = qobject_cast<QGeocodeReply*>(sender());
if (!reply)
return;
- if (receivers(SIGNAL(error(QGeoSearchReply*, QGeoSearchReply::Error, QString))) == 0) {
+ if (receivers(SIGNAL(error(QGeocodeReply*, QGeocodeReply::Error, QString))) == 0) {
reply->deleteLater();
return;
}
@@ -286,7 +286,7 @@ void QGeoSearchManagerEngineNokia::placesError(QGeoSearchReply::Error error, con
emit this->error(reply, error, errorString);
}
-QString QGeoSearchManagerEngineNokia::languageToMarc(QLocale::Language language)
+QString QGeocodingManagerEngineNokia::languageToMarc(QLocale::Language language)
{
uint offset = 3 * (uint(language));
if (language == QLocale::C || offset + 3 > sizeof(marc_language_code_list))
diff --git a/src/plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.h b/src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.h
index dbaf94b5..d62780da 100644
--- a/src/plugins/geoservices/nokia/qgeosearchmanagerengine_nokia.h
+++ b/src/plugins/geoservices/nokia/qgeocodingmanagerengine_nokia.h
@@ -46,13 +46,13 @@
**
****************************************************************************/
-#ifndef QGEOSEARCHMANAGER_NOKIA_H
-#define QGEOSEARCHMANAGER_NOKIA_H
+#ifndef QGEOCODINGMANAGER_NOKIA_H
+#define QGEOCODINGMANAGER_NOKIA_H
#include "qgeoserviceproviderplugin_nokia.h"
#include <qgeoserviceprovider.h>
-#include <qgeosearchmanagerengine.h>
+#include <qgeocodingmanagerengine.h>
#include <QNetworkAccessManager>
#include <QLocale>
@@ -60,32 +60,32 @@
QT_BEGIN_NAMESPACE
-class QGeoSearchManagerEngineNokia : public QGeoSearchManagerEngine
+class QGeocodingManagerEngineNokia : public QGeocodingManagerEngine
{
Q_OBJECT
public:
- QGeoSearchManagerEngineNokia(const QMap<QString, QVariant> &parameters,
+ QGeocodingManagerEngineNokia(const QMap<QString, QVariant> &parameters,
QGeoServiceProvider::Error *error,
QString *errorString);
- ~QGeoSearchManagerEngineNokia();
+ ~QGeocodingManagerEngineNokia();
- QGeoSearchReply* geocode(const QGeoAddress &address,
+ QGeocodeReply* geocode(const QGeoAddress &address,
QGeoBoundingArea *bounds);
- QGeoSearchReply* reverseGeocode(const QGeoCoordinate &coordinate,
+ QGeocodeReply* reverseGeocode(const QGeoCoordinate &coordinate,
QGeoBoundingArea *bounds);
- QGeoSearchReply* search(const QString &searchString,
+ QGeocodeReply* geocode(const QString &searchString,
int limit,
int offset,
QGeoBoundingArea *bounds);
private slots:
void placesFinished();
- void placesError(QGeoSearchReply::Error error, const QString &errorString);
+ void placesError(QGeocodeReply::Error error, const QString &errorString);
private:
static QString trimDouble(double degree, int decimalDigits = 10);
- QGeoSearchReply* search(QString requestString, QGeoBoundingArea *bounds, int limit = -1, int offset = 0);
+ QGeocodeReply* geocode(QString requestString, QGeoBoundingArea *bounds, int limit = -1, int offset = 0);
QString languageToMarc(QLocale::Language language);
QNetworkAccessManager *m_networkManager;
diff --git a/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp b/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp
index bd79ee8d..4bd0020b 100644
--- a/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp
+++ b/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp
@@ -48,7 +48,7 @@
#include "qgeoserviceproviderplugin_nokia.h"
-#include "qgeosearchmanagerengine_nokia.h"
+#include "qgeocodingmanagerengine_nokia.h"
#include "qgeoroutingmanagerengine_nokia.h"
#include "qgeomappingmanagerengine_nokia.h"
#include "qplacemanagerengine_nokia.h"
@@ -72,11 +72,11 @@ int QGeoServiceProviderFactoryNokia::providerVersion() const
return 1;
}
-QGeoSearchManagerEngine* QGeoServiceProviderFactoryNokia::createSearchManagerEngine(const QMap<QString, QVariant> &parameters,
+QGeocodingManagerEngine* QGeoServiceProviderFactoryNokia::createGeocodingManagerEngine(const QMap<QString, QVariant> &parameters,
QGeoServiceProvider::Error *error,
QString *errorString) const
{
- return new QGeoSearchManagerEngineNokia(parameters, error, errorString);
+ return new QGeocodingManagerEngineNokia(parameters, error, errorString);
}
QGeoMappingManagerEngine* QGeoServiceProviderFactoryNokia::createMappingManagerEngine(const QMap<QString, QVariant> &parameters,
diff --git a/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.h b/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.h
index 97496fdf..d483347a 100644
--- a/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.h
+++ b/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.h
@@ -65,7 +65,7 @@ public:
QString providerName() const;
int providerVersion() const;
- QGeoSearchManagerEngine* createSearchManagerEngine(const QMap<QString, QVariant> &parameters,
+ QGeocodingManagerEngine* createGeocodingManagerEngine(const QMap<QString, QVariant> &parameters,
QGeoServiceProvider::Error *error,
QString *errorString) const;
QGeoMappingManagerEngine* createMappingManagerEngine(const QMap<QString, QVariant> &parameters,