diff options
author | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2012-06-19 12:55:53 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-21 04:09:32 +0200 |
commit | 6b68304f59de5fa3f6c861186d98b0c7fe54a4ba (patch) | |
tree | 1d94a6db5a3ad399149e44510a86c008c58814f2 /src/location/maps | |
parent | 4b10442e2e83bf7440837e469af344579d1ad9d5 (diff) |
Rename QGeoBoundingArea and related classes to QGeoShape.
QGeoBoundingArea is used for describing more than just a bounding area.
Renaming it to a more appropriate name, QGeoShape. The same is done
for subclasses and QML equivalents.
In C++:
QGeoBoundingArea -> QGeoShape
QGeoBoundingCircle -> QGeoCircle
QGeoBoundingBox -> QGeoRectangle
In QML:
BoundingArea -> GeoShape
BoundingCircle -> GeoCircle
BoundingBox -> GeoRectangle
Change-Id: I93c6df8f1b6c5179ed52fd8354a05f709063b1cf
Reviewed-by: abcd <amos.choy@nokia.com>
Diffstat (limited to 'src/location/maps')
-rw-r--r-- | src/location/maps/qgeocodereply.cpp | 4 | ||||
-rw-r--r-- | src/location/maps/qgeocodereply.h | 16 | ||||
-rw-r--r-- | src/location/maps/qgeocodereply_p.h | 4 | ||||
-rw-r--r-- | src/location/maps/qgeocodingmanager.cpp | 16 | ||||
-rw-r--r-- | src/location/maps/qgeocodingmanager.h | 8 | ||||
-rw-r--r-- | src/location/maps/qgeocodingmanagerengine.cpp | 14 | ||||
-rw-r--r-- | src/location/maps/qgeocodingmanagerengine.h | 24 | ||||
-rw-r--r-- | src/location/maps/qgeomappingmanager_p.h | 2 | ||||
-rw-r--r-- | src/location/maps/qgeomappingmanagerengine_p.h | 2 | ||||
-rw-r--r-- | src/location/maps/qgeoroute.cpp | 6 | ||||
-rw-r--r-- | src/location/maps/qgeoroute.h | 6 | ||||
-rw-r--r-- | src/location/maps/qgeoroute_p.h | 4 | ||||
-rw-r--r-- | src/location/maps/qgeorouterequest.cpp | 6 | ||||
-rw-r--r-- | src/location/maps/qgeorouterequest.h | 6 | ||||
-rw-r--r-- | src/location/maps/qgeorouterequest_p.h | 2 |
15 files changed, 58 insertions, 62 deletions
diff --git a/src/location/maps/qgeocodereply.cpp b/src/location/maps/qgeocodereply.cpp index f8b1fb23..c388c61d 100644 --- a/src/location/maps/qgeocodereply.cpp +++ b/src/location/maps/qgeocodereply.cpp @@ -186,7 +186,7 @@ QString QGeocodeReply::errorString() const /*! Sets the viewport which contains the results to \a viewport. */ -void QGeocodeReply::setViewport(const QGeoBoundingArea &viewport) +void QGeocodeReply::setViewport(const QGeoShape &viewport) { d_ptr->viewport = viewport; } @@ -197,7 +197,7 @@ void QGeocodeReply::setViewport(const QGeoBoundingArea &viewport) This function will return 0 if no viewport bias was specified in the QGeocodingManager function which created this reply. */ -QGeoBoundingArea QGeocodeReply::viewport() const +QGeoShape QGeocodeReply::viewport() const { return d_ptr->viewport; } diff --git a/src/location/maps/qgeocodereply.h b/src/location/maps/qgeocodereply.h index 5a988cb4..a9a2cf9b 100644 --- a/src/location/maps/qgeocodereply.h +++ b/src/location/maps/qgeocodereply.h @@ -42,17 +42,15 @@ #ifndef QGEOCODEREPLY_H #define QGEOCODEREPLY_H -#include "qgeolocation.h" - -#include <QObject> -#include <QList> +#include <QtCore/QObject> +#include <QtCore/QList> +#include <QtLocation/QGeoLocation> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE - - +class QGeoShape; class QGeocodeReplyPrivate; class Q_LOCATION_EXPORT QGeocodeReply : public QObject @@ -77,8 +75,8 @@ public: Error error() const; QString errorString() const; - QGeoBoundingArea viewport() const; - QList<QGeoLocation>locations() const; + QGeoShape viewport() const; + QList<QGeoLocation> locations() const; int limit() const; int offset() const; @@ -95,7 +93,7 @@ protected: void setError(Error error, const QString &errorString); void setFinished(bool finished); - void setViewport(const QGeoBoundingArea &viewport); + void setViewport(const QGeoShape &viewport); void addLocation(const QGeoLocation &location); void setLocations(const QList<QGeoLocation> &locations); diff --git a/src/location/maps/qgeocodereply_p.h b/src/location/maps/qgeocodereply_p.h index 3e32ddd4..9d274925 100644 --- a/src/location/maps/qgeocodereply_p.h +++ b/src/location/maps/qgeocodereply_p.h @@ -55,7 +55,7 @@ #include "qgeocodereply.h" -#include "qgeoboundingarea.h" +#include "qgeoshape.h" #include <QList> @@ -74,7 +74,7 @@ public: QString errorString; bool isFinished; - QGeoBoundingArea viewport; + QGeoShape viewport; QList<QGeoLocation> locations; int limit; diff --git a/src/location/maps/qgeocodingmanager.cpp b/src/location/maps/qgeocodingmanager.cpp index 3208bf44..3d7c1a07 100644 --- a/src/location/maps/qgeocodingmanager.cpp +++ b/src/location/maps/qgeocodingmanager.cpp @@ -43,8 +43,8 @@ #include "qgeocodingmanager_p.h" #include "qgeocodingmanagerengine.h" -#include "qgeoboundingbox.h" -#include "qgeoboundingcircle.h" +#include "qgeorectangle.h" +#include "qgeocircle.h" #include <QLocale> @@ -163,7 +163,7 @@ int QGeocodingManager::managerVersion() const This will usually occur if the geocoding service backend uses a different canonical form of addresses or if \a address was only partially filled out. - If \a bounds is non-null and valid QGeoBoundingArea it will be used to + If \a bounds is non-null and is a valid QGeoShape it will be used to limit the results to those that are contained within \a bounds. This is particularly useful if \a address is only partially filled out, as the service will attempt to geocode all matches for the specified data. @@ -173,7 +173,7 @@ int QGeocodingManager::managerVersion() const QGeocodingManager::error(), QGeocodeReply::finished() or QGeocodeReply::error() with deleteLater(). */ -QGeocodeReply *QGeocodingManager::geocode(const QGeoAddress &address, const QGeoBoundingArea &bounds) +QGeocodeReply *QGeocodingManager::geocode(const QGeoAddress &address, const QGeoShape &bounds) { // if (!d_ptr->engine) // return new QGeocodeReply(QGeocodeReply::EngineNotSetError, "The geocoding manager was not created with a valid engine.", this); @@ -210,7 +210,7 @@ QGeocodeReply *QGeocodingManager::geocode(const QGeoAddress &address, const QGeo As an example, some services will return address and coordinate pairs for the street address, the city, the state and the country. - If \a bounds is non-null and a valid QGeoBoundingBox it will be used to + If \a bounds is non-null and a valid QGeoRectangle it will be used to limit the results to those that are contained within \a bounds. The user is responsible for deleting the returned reply object, although @@ -218,7 +218,7 @@ QGeocodeReply *QGeocodingManager::geocode(const QGeoAddress &address, const QGeo QGeocodingManager::error(), QGeocodeReply::finished() or QGeocodeReply::error() with deleteLater(). */ -QGeocodeReply *QGeocodingManager::reverseGeocode(const QGeoCoordinate &coordinate, const QGeoBoundingArea &bounds) +QGeocodeReply *QGeocodingManager::reverseGeocode(const QGeoCoordinate &coordinate, const QGeoShape &bounds) { // if (!d_ptr->engine) // return new QGeocodeReply(QGeocodeReply::EngineNotSetError, "The geocoding manager was not created with a valid engine.", this); @@ -247,7 +247,7 @@ QGeocodeReply *QGeocodingManager::reverseGeocode(const QGeoCoordinate &coordinat The \a limit and \a offset results are used together to implement paging. - If \a bounds is non-null and a valid QGeoBoundingArea it will be used to + If \a bounds is non-null and a valid QGeoShape it will be used to limit the results to those that are contained within \a bounds. The user is responsible for deleting the returned reply object, although @@ -258,7 +258,7 @@ QGeocodeReply *QGeocodingManager::reverseGeocode(const QGeoCoordinate &coordinat QGeocodeReply *QGeocodingManager::geocode(const QString &address, int limit, int offset, - const QGeoBoundingArea &bounds) + const QGeoShape &bounds) { // if (!d_ptr->engine) // return new QGeocodeReply(QGeocodeReply::EngineNotSetError, "The geocoding manager was not created with a valid engine.", this); diff --git a/src/location/maps/qgeocodingmanager.h b/src/location/maps/qgeocodingmanager.h index b5ef6abb..bb10ac1d 100644 --- a/src/location/maps/qgeocodingmanager.h +++ b/src/location/maps/qgeocodingmanager.h @@ -43,7 +43,7 @@ #define QGEOCODINGMANAGER_H #include "qgeocodereply.h" -#include "qgeoboundingbox.h" +#include "qgeorectangle.h" #include <QObject> #include <QList> @@ -70,14 +70,14 @@ public: int managerVersion() const; QGeocodeReply *geocode(const QGeoAddress &address, - const QGeoBoundingArea &bounds = QGeoBoundingArea()); + const QGeoShape &bounds = QGeoShape()); QGeocodeReply *geocode(const QString &searchString, int limit = -1, int offset = 0, - const QGeoBoundingArea &bounds = QGeoBoundingArea()); + const QGeoShape &bounds = QGeoShape()); QGeocodeReply *reverseGeocode(const QGeoCoordinate &coordinate, - const QGeoBoundingArea &bounds = QGeoBoundingArea()); + const QGeoShape &bounds = QGeoShape()); void setLocale(const QLocale &locale); QLocale locale() const; diff --git a/src/location/maps/qgeocodingmanagerengine.cpp b/src/location/maps/qgeocodingmanagerengine.cpp index eef080cb..737cc58e 100644 --- a/src/location/maps/qgeocodingmanagerengine.cpp +++ b/src/location/maps/qgeocodingmanagerengine.cpp @@ -45,6 +45,8 @@ #include "qgeoaddress.h" #include "qgeocoordinate.h" +#include <QtLocation/QGeoShape> + QT_BEGIN_NAMESPACE /*! @@ -164,7 +166,7 @@ int QGeocodingManagerEngine::managerVersion() const This will usually occur if the geocoding service backend uses a different canonical form of addresses or if \a address was only partially filled out. - If \a bounds is non-null and a valid QGeoBoundingArea it will be used to + If \a bounds is non-null and a valid QGeoShape it will be used to limit the results to those that are contained by \a bounds. This is particularly useful if \a address is only partially filled out, as the service will attempt to geocode all matches for the specified data. @@ -175,7 +177,7 @@ int QGeocodingManagerEngine::managerVersion() const QGeocodeReply::error() with deleteLater(). */ QGeocodeReply *QGeocodingManagerEngine::geocode(const QGeoAddress &address, - const QGeoBoundingArea &bounds) + const QGeoShape &bounds) { Q_UNUSED(address) Q_UNUSED(bounds) @@ -211,7 +213,7 @@ QGeocodeReply *QGeocodingManagerEngine::geocode(const QGeoAddress &address, As an example, some services will return address and coordinate pairs for the street address, the city, the state and the country. - If \a bounds is non-null and a valid QGeoBoundingArea it will be used to + If \a bounds is non-null and a valid QGeoShape it will be used to limit the results to those that are contained by \a bounds. The user is responsible for deleting the returned reply object, although @@ -220,7 +222,7 @@ QGeocodeReply *QGeocodingManagerEngine::geocode(const QGeoAddress &address, QGeocodeReply::error() with deleteLater(). */ QGeocodeReply *QGeocodingManagerEngine::reverseGeocode(const QGeoCoordinate &coordinate, - const QGeoBoundingArea &bounds) + const QGeoShape &bounds) { Q_UNUSED(coordinate) Q_UNUSED(bounds) @@ -249,7 +251,7 @@ QGeocodeReply *QGeocodingManagerEngine::reverseGeocode(const QGeoCoordinate &coo The \a limit and \a offset results are used together to implement paging. - If \a bounds is non-null and a valid QGeoBoundingArea it will be used to + If \a bounds is non-null and a valid QGeoShape it will be used to limit the results to those that are contained by \a bounds. The user is responsible for deleting the returned reply object, although @@ -260,7 +262,7 @@ QGeocodeReply *QGeocodingManagerEngine::reverseGeocode(const QGeoCoordinate &coo QGeocodeReply *QGeocodingManagerEngine::geocode(const QString &address, int limit, int offset, - const QGeoBoundingArea &bounds) + const QGeoShape &bounds) { Q_UNUSED(address) Q_UNUSED(limit) diff --git a/src/location/maps/qgeocodingmanagerengine.h b/src/location/maps/qgeocodingmanagerengine.h index 64f560bf..5916fcda 100644 --- a/src/location/maps/qgeocodingmanagerengine.h +++ b/src/location/maps/qgeocodingmanagerengine.h @@ -42,19 +42,16 @@ #ifndef QGEOCODINGMANAGERENGINE_H #define QGEOCODINGMANAGERENGINE_H -#include "qgeocodingmanager.h" -#include "qgeocodereply.h" -#include "qgeoboundingbox.h" - -#include <QObject> -#include <QList> +#include <QtCore/QObject> +#include <QtLocation/qlocationglobal.h> +#include <QtLocation/QGeocodeReply> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE - - +class QGeoAddress; +class QGeoShape; class QGeocodingManagerEnginePrivate; class Q_LOCATION_EXPORT QGeocodingManagerEngine : public QObject @@ -67,14 +64,13 @@ public: QString managerName() const; int managerVersion() const; - virtual QGeocodeReply *geocode(const QGeoAddress &address, - const QGeoBoundingArea &bounds); + virtual QGeocodeReply *geocode(const QGeoAddress &address, const QGeoShape &bounds); virtual QGeocodeReply *geocode(const QString &address, - int limit, - int offset, - const QGeoBoundingArea &bounds); + int limit, + int offset, + const QGeoShape &bounds); virtual QGeocodeReply *reverseGeocode(const QGeoCoordinate &coordinate, - const QGeoBoundingArea &bounds); + const QGeoShape &bounds); void setLocale(const QLocale &locale); diff --git a/src/location/maps/qgeomappingmanager_p.h b/src/location/maps/qgeomappingmanager_p.h index 2b04a0e7..63dd1f67 100644 --- a/src/location/maps/qgeomappingmanager_p.h +++ b/src/location/maps/qgeomappingmanager_p.h @@ -65,7 +65,7 @@ QT_BEGIN_NAMESPACE class QGeoMap; class QLocale; -class QGeoBoundingBox; +class QGeoRectangle; class QGeoCoordinate; class QGeoMappingManagerPrivate; class QGeoMapRequestOptions; diff --git a/src/location/maps/qgeomappingmanagerengine_p.h b/src/location/maps/qgeomappingmanagerengine_p.h index bb9f2471..495014bf 100644 --- a/src/location/maps/qgeomappingmanagerengine_p.h +++ b/src/location/maps/qgeomappingmanagerengine_p.h @@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE class QLocale; -class QGeoBoundingBox; +class QGeoRectangle; class QGeoCoordinate; class QGeoMappingManagerPrivate; class QGeoMapRequestOptions; diff --git a/src/location/maps/qgeoroute.cpp b/src/location/maps/qgeoroute.cpp index 6614f7bc..9ec86133 100644 --- a/src/location/maps/qgeoroute.cpp +++ b/src/location/maps/qgeoroute.cpp @@ -42,7 +42,7 @@ #include "qgeoroute.h" #include "qgeoroute_p.h" -#include "qgeoboundingbox.h" +#include "qgeorectangle.h" #include "qgeoroutesegment.h" #include <QDateTime> @@ -165,7 +165,7 @@ QGeoRouteRequest QGeoRoute::request() const /*! Sets the bounding box which encompasses the entire route to \a bounds. */ -void QGeoRoute::setBounds(const QGeoBoundingBox &bounds) +void QGeoRoute::setBounds(const QGeoRectangle &bounds) { d_ptr->bounds = bounds; } @@ -173,7 +173,7 @@ void QGeoRoute::setBounds(const QGeoBoundingBox &bounds) /*! Returns a bounding box which encompasses the entire route. */ -QGeoBoundingBox QGeoRoute::bounds() const +QGeoRectangle QGeoRoute::bounds() const { return d_ptr->bounds; } diff --git a/src/location/maps/qgeoroute.h b/src/location/maps/qgeoroute.h index ea4d4cb1..d43debe7 100644 --- a/src/location/maps/qgeoroute.h +++ b/src/location/maps/qgeoroute.h @@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE -class QGeoBoundingBox; +class QGeoRectangle; class QGeoRouteSegment; class QGeoRoutePrivate; @@ -78,8 +78,8 @@ public: void setRequest(const QGeoRouteRequest &request); QGeoRouteRequest request() const; - void setBounds(const QGeoBoundingBox &bounds); - QGeoBoundingBox bounds() const; + void setBounds(const QGeoRectangle &bounds); + QGeoRectangle bounds() const; void setFirstRouteSegment(const QGeoRouteSegment &routeSegment); QGeoRouteSegment firstRouteSegment() const; diff --git a/src/location/maps/qgeoroute_p.h b/src/location/maps/qgeoroute_p.h index fbeaf84d..d0495e35 100644 --- a/src/location/maps/qgeoroute_p.h +++ b/src/location/maps/qgeoroute_p.h @@ -55,7 +55,7 @@ #include "qgeoroute.h" #include "qgeorouterequest.h" -#include "qgeoboundingbox.h" +#include "qgeorectangle.h" #include "qgeoroutesegment.h" #include <QSharedData> @@ -76,7 +76,7 @@ public: QString id; QGeoRouteRequest request; - QGeoBoundingBox bounds; + QGeoRectangle bounds; // QList<QGeoRouteSegment> routeSegments; int travelTime; diff --git a/src/location/maps/qgeorouterequest.cpp b/src/location/maps/qgeorouterequest.cpp index 26ae244b..4866aa31 100644 --- a/src/location/maps/qgeorouterequest.cpp +++ b/src/location/maps/qgeorouterequest.cpp @@ -43,7 +43,7 @@ #include "qgeorouterequest_p.h" #include "qgeocoordinate.h" -#include "qgeoboundingbox.h" +#include "qgeorectangle.h" QT_BEGIN_NAMESPACE @@ -304,7 +304,7 @@ QList<QGeoCoordinate> QGeoRouteRequest::waypoints() const /*! Sets \a areas as excluded areas that the route must not cross. */ -void QGeoRouteRequest::setExcludeAreas(const QList<QGeoBoundingBox> &areas) +void QGeoRouteRequest::setExcludeAreas(const QList<QGeoRectangle> &areas) { d_ptr->excludeAreas = areas; } @@ -312,7 +312,7 @@ void QGeoRouteRequest::setExcludeAreas(const QList<QGeoBoundingBox> &areas) /*! Returns areas the route must not cross. */ -QList<QGeoBoundingBox> QGeoRouteRequest::excludeAreas() const +QList<QGeoRectangle> QGeoRouteRequest::excludeAreas() const { return d_ptr->excludeAreas; } diff --git a/src/location/maps/qgeorouterequest.h b/src/location/maps/qgeorouterequest.h index c903183a..7f3dee78 100644 --- a/src/location/maps/qgeorouterequest.h +++ b/src/location/maps/qgeorouterequest.h @@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE class QGeoCoordinate; -class QGeoBoundingBox; +class QGeoRectangle; class QGeoRouteRequestPrivate; class Q_LOCATION_EXPORT QGeoRouteRequest @@ -127,8 +127,8 @@ public: void setWaypoints(const QList<QGeoCoordinate> &waypoints); QList<QGeoCoordinate> waypoints() const; - void setExcludeAreas(const QList<QGeoBoundingBox> &areas); - QList<QGeoBoundingBox> excludeAreas() const; + void setExcludeAreas(const QList<QGeoRectangle> &areas); + QList<QGeoRectangle> excludeAreas() const; // defaults to 0 void setNumberAlternativeRoutes(int alternatives); diff --git a/src/location/maps/qgeorouterequest_p.h b/src/location/maps/qgeorouterequest_p.h index 762384de..535fae22 100644 --- a/src/location/maps/qgeorouterequest_p.h +++ b/src/location/maps/qgeorouterequest_p.h @@ -72,7 +72,7 @@ public: bool operator ==(const QGeoRouteRequestPrivate &other) const; QList<QGeoCoordinate> waypoints; - QList<QGeoBoundingBox> excludeAreas; + QList<QGeoRectangle> excludeAreas; int numberAlternativeRoutes; QGeoRouteRequest::TravelModes travelModes; QMap < QGeoRouteRequest::FeatureType, |