summaryrefslogtreecommitdiff
path: root/src/location
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2013-08-16 10:02:13 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-02 14:30:40 +0200
commitd35d28017d731dba9e2a4f2622d2cec97e724e55 (patch)
treefd1fbbaeb20c641ca868a424f3ee051c7c6c3a28 /src/location
parentea5f625ab90406d7407bc961b90b3993230dd03a (diff)
downloadqtlocation-d35d28017d731dba9e2a4f2622d2cec97e724e55.tar.gz
Split QtLocation into QtPositioning and QtLocation
QtPositioning is not dependent on any gui component and mostly covers everything around the retrieval of position information. QtLocation covers place, map and navigation APIs. Several documentation issues were fixed during the process. Change-Id: I98e2a53065549a2fc43f93a75b4f65b5bc884c92 Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/location')
-rw-r--r--src/location/doc/images/example-weatherinfo.pngbin82081 -> 0 bytes
-rw-r--r--src/location/doc/images/flickr-demo.jpgbin35647 -> 0 bytes
-rw-r--r--src/location/doc/images/qml-flickr-1.jpgbin58111 -> 0 bytes
-rw-r--r--src/location/doc/qtlocation.qdocconf3
-rw-r--r--src/location/doc/snippets/cpp/cppqml.cpp20
-rw-r--r--src/location/doc/snippets/declarative/declarative-location.qml2
-rw-r--r--src/location/doc/snippets/declarative/declarative-map.qml168
-rw-r--r--src/location/doc/snippets/declarative/maps.qml9
-rw-r--r--src/location/doc/snippets/declarative/places.qml13
-rw-r--r--src/location/doc/snippets/declarative/places_loader.qml9
-rw-r--r--src/location/doc/src/cpp-qml.qdoc24
-rw-r--r--src/location/doc/src/examples/declarative-flickr.qdoc83
-rw-r--r--src/location/doc/src/examples/logfilepositionsource.qdoc87
-rw-r--r--src/location/doc/src/examples/qtlocation-examples.qdoc1
-rw-r--r--src/location/doc/src/examples/weatherinfo.qdoc109
-rw-r--r--src/location/doc/src/maps.qdoc38
-rw-r--r--src/location/doc/src/place-caveats.qdocinc2
-rw-r--r--src/location/doc/src/place-definition.qdocinc2
-rw-r--r--src/location/doc/src/plugins/nokia_terms.qdoc2
-rw-r--r--src/location/doc/src/position.qdoc191
-rw-r--r--src/location/doc/src/qml-maps.qdoc33
-rw-r--r--src/location/doc/src/qml-position.qdoc136
-rw-r--r--src/location/doc/src/qtlocation-cpp.qdoc25
-rw-r--r--src/location/doc/src/qtlocation-geoservices.qdoc62
-rw-r--r--src/location/doc/src/qtlocation-qml.qdoc30
-rw-r--r--src/location/doc/src/qtlocation.qdoc25
-rw-r--r--src/location/location.pro42
-rw-r--r--src/location/maps/qgeocodereply.h4
-rw-r--r--src/location/maps/qgeocodingmanager.h2
-rw-r--r--src/location/maps/qgeocodingmanagerengine.cpp2
-rw-r--r--src/location/maps/qgeocoordinateinterpolator_p.h3
-rw-r--r--src/location/maps/qgeoprojection_p.h2
-rw-r--r--src/location/maps/qgeoroute.h2
-rw-r--r--src/location/maps/qgeorouterequest.h2
-rw-r--r--src/location/maps/qgeoserviceprovider.cpp9
-rw-r--r--src/location/maps/qgeoserviceproviderfactory.cpp2
-rw-r--r--src/location/places/qplace.h8
-rw-r--r--src/location/qgeoaddress.cpp637
-rw-r--r--src/location/qgeoaddress.h108
-rw-r--r--src/location/qgeoaddress_p.h82
-rw-r--r--src/location/qgeoareamonitor.cpp256
-rw-r--r--src/location/qgeoareamonitor.h85
-rw-r--r--src/location/qgeocircle.cpp311
-rw-r--r--src/location/qgeocircle.h105
-rw-r--r--src/location/qgeocircle_p.h83
-rw-r--r--src/location/qgeocoordinate.cpp644
-rw-r--r--src/location/qgeocoordinate.h127
-rw-r--r--src/location/qgeocoordinate_p.h79
-rw-r--r--src/location/qgeolocation.cpp203
-rw-r--r--src/location/qgeolocation.h90
-rw-r--r--src/location/qgeolocation_p.h71
-rw-r--r--src/location/qgeopositioninfo.cpp332
-rw-r--r--src/location/qgeopositioninfo.h113
-rw-r--r--src/location/qgeopositioninfosource.cpp462
-rw-r--r--src/location/qgeopositioninfosource.h114
-rw-r--r--src/location/qgeopositioninfosource_p.h73
-rw-r--r--src/location/qgeopositioninfosourcefactory.cpp90
-rw-r--r--src/location/qgeopositioninfosourcefactory.h68
-rw-r--r--src/location/qgeorectangle.cpp899
-rw-r--r--src/location/qgeorectangle.h141
-rw-r--r--src/location/qgeorectangle_p.h83
-rw-r--r--src/location/qgeosatelliteinfo.cpp315
-rw-r--r--src/location/qgeosatelliteinfo.h114
-rw-r--r--src/location/qgeosatelliteinfosource.cpp320
-rw-r--r--src/location/qgeosatelliteinfosource.h97
-rw-r--r--src/location/qgeoshape.cpp307
-rw-r--r--src/location/qgeoshape.h103
-rw-r--r--src/location/qgeoshape_p.h90
-rw-r--r--src/location/qlocationutils.cpp357
-rw-r--r--src/location/qlocationutils_p.h118
-rw-r--r--src/location/qnmeapositioninfosource.cpp623
-rw-r--r--src/location/qnmeapositioninfosource.h96
-rw-r--r--src/location/qnmeapositioninfosource_p.h176
73 files changed, 176 insertions, 8948 deletions
diff --git a/src/location/doc/images/example-weatherinfo.png b/src/location/doc/images/example-weatherinfo.png
deleted file mode 100644
index 6557b57b..00000000
--- a/src/location/doc/images/example-weatherinfo.png
+++ /dev/null
Binary files differ
diff --git a/src/location/doc/images/flickr-demo.jpg b/src/location/doc/images/flickr-demo.jpg
deleted file mode 100644
index cfd12819..00000000
--- a/src/location/doc/images/flickr-demo.jpg
+++ /dev/null
Binary files differ
diff --git a/src/location/doc/images/qml-flickr-1.jpg b/src/location/doc/images/qml-flickr-1.jpg
deleted file mode 100644
index 14fc5c92..00000000
--- a/src/location/doc/images/qml-flickr-1.jpg
+++ /dev/null
Binary files differ
diff --git a/src/location/doc/qtlocation.qdocconf b/src/location/doc/qtlocation.qdocconf
index a5b10857..8e000634 100644
--- a/src/location/doc/qtlocation.qdocconf
+++ b/src/location/doc/qtlocation.qdocconf
@@ -36,13 +36,14 @@ qhp.QtLocation.subprojects.examples.selectors = fake:example
tagfile = ../../../doc/qtlocation/qtlocation.tags
-depends += qtcore qtdoc qtquick qtqml qtnetwork
+depends += qtcore qtdoc qtquick qtqml qtnetwork qtpositioning
headerdirs += .. \
../../imports/location
sourcedirs += .. \
../../imports/location \
+ ../../plugins/geoservices/nokia
exampledirs += ../../../examples \
../../../examples/declarative \
diff --git a/src/location/doc/snippets/cpp/cppqml.cpp b/src/location/doc/snippets/cpp/cppqml.cpp
index 93d2b603..34386ca8 100644
--- a/src/location/doc/snippets/cpp/cppqml.cpp
+++ b/src/location/doc/snippets/cpp/cppqml.cpp
@@ -48,10 +48,6 @@
#include <QtLocation/QPlaceUser>
#include <QtLocation/QPlaceRatings>
#include <QtLocation/QPlaceSupplier>
-#include <QtLocation/QGeoAddress>
-#include <QtLocation/QGeoRectangle>
-#include <QtLocation/QGeoCircle>
-#include <QtLocation/QGeoLocation>
void cppQmlInterface(QObject *qmlObject)
{
@@ -118,21 +114,5 @@ void cppQmlInterface(QObject *qmlObject)
//! [Supplier set]
qmlObject->setProperty("supplier", QVariant::fromValue(placeSupplier));
//! [Supplier set]
-
- //! [Address get]
- QGeoAddress geoAddress = qmlObject->property("address").value<QGeoAddress>();
- //! [Address get]
-
- //! [Address set]
- qmlObject->setProperty("address", QVariant::fromValue(geoAddress));
- //! [Address set]
-
- //! [Location get]
- QGeoLocation geoLocation = qmlObject->property("location").value<QGeoLocation>();
- //! [Location get]
-
- //! [Location set]
- qmlObject->setProperty("location", QVariant::fromValue(geoLocation));
- //! [Location set]
}
diff --git a/src/location/doc/snippets/declarative/declarative-location.qml b/src/location/doc/snippets/declarative/declarative-location.qml
index 111fe727..9b0efa42 100644
--- a/src/location/doc/snippets/declarative/declarative-location.qml
+++ b/src/location/doc/snippets/declarative/declarative-location.qml
@@ -40,7 +40,7 @@
//![0]
import QtQuick 2.0
-import QtLocation 5.0
+import QtPositioning 5.0
Rectangle {
id: page
diff --git a/src/location/doc/snippets/declarative/declarative-map.qml b/src/location/doc/snippets/declarative/declarative-map.qml
deleted file mode 100644
index d517580e..00000000
--- a/src/location/doc/snippets/declarative/declarative-map.qml
+++ /dev/null
@@ -1,168 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the examples of the Qt Mobility Components.
-**
-** $QT_BEGIN_LICENSE:BSD$
-** You may use this file under the terms of the BSD license as follows:
-**
-** "Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are
-** met:
-** * Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in
-** the documentation and/or other materials provided with the
-** distribution.
-** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
-** of its contributors may be used to endorse or promote products derived
-** from this software without specific prior written permission.
-**
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-import Qt 4.7
-import QtMobility.location 1.2
-
-Item {
- id: page
- width: 320
- height: 480
- focus: true
-
- PositionSource {
- id: myPositionSource
- active: true
- updateInterval: 2000
- nmeaSource: 'nmealog.txt'
- onPositionChanged: console.log("Position changed in PositionSource")
- }
- LandmarkBoxFilter {
- id: boxFilter
- topLeft: map.toCoordinate(Qt.point(0,0))
- bottomRight: map.toCoordinate(Qt.point(page.width, page.height))
- }
-
- LandmarkProximityFilter {
- id: proximityFilter
- center: myPositionSource.position.coordinate
- //center: Coordinate {latitude: -27; longitude: 153}
- radius: 500000
- }
-
- LandmarkModel {
- id: landmarkModelAll
- autoUpdate: true
- filter: boxFilter
- limit: 50
- onModelChanged: {
- console.log("All landmark model changed, landmark count: " + count)
- }
- }
-
- //! [LandmarkModel proximity filter]
- LandmarkModel {
- id: landmarkModelNear
- autoUpdate: true
- filter: proximityFilter
- limit: 50
- onModelChanged: {
- console.log("Near landmark model changed, landmark count: " + count)
- }
- }
- //! [LandmarkModel proximity filter]
-
- Rectangle {
- id: dataArea
- anchors.fill: parent
- color: "#343434"
-
- //![Basic MapObjects and View on Map]
- Map {
- id: map
- plugin : Plugin {name : "nokia"}
- anchors.fill: parent
- size.width: parent.width
- size.height: parent.height
- zoomLevel: 10
-
- MapObjectView {
- id: allLandmarks
- model: landmarkModelAll
- delegate: Component {
- MapCircle {
- color: "green"
- radius: 1000
- center: Coordinate {
- latitude: landmark.coordinate.latitude
- longitude: landmark.coordinate.longitude
- }
- }
- }
- }
-
- MapCircle {
- id: myPosition
- color: "yellow"
- radius: 1000
- center: myPositionSource.position.coordinate
- }
- //![Basic MapObjects and View on Map]
-
- MapObjectView {
- id: landmarksNearMe
- model: landmarkModelNear
- delegate: Component {
- MapGroup {
- MapCircle {
- color: "red"
- radius: 1000
- center: Coordinate {
- latitude: landmark.coordinate.latitude
- longitude: landmark.coordinate.longitude
- }
- }
- }
- }
- }
-
- // center: Coordinate {latitude: -27; longitude: 153}
- center: myPositionSource.position.coordinate
-
- onZoomLevelChanged: {
- console.log("Zoom changed")
- updateFilters();
- }
- onCenterChanged: {
- console.log("Center changed")
- updateFilters();
- }
- function updateFilters () {
- // The pixel coordinates used are the map's pixel coordinates, not
- // the absolute pixel coordinates of the application. Hence e.g. (0,0) is always
- // the top left point
- var topLeftCoordinate = map.toCoordinate(Qt.point(0,0))
- var bottomRightCoordinate = map.toCoordinate(Qt.point(map.size.width, map.size.height))
- boxFilter.topLeft = topLeftCoordinate;
- boxFilter.bottomRight = bottomRightCoordinate;
- }
- } // map
- } // dataArea
-} // page
diff --git a/src/location/doc/snippets/declarative/maps.qml b/src/location/doc/snippets/declarative/maps.qml
index fbb60b82..eb5d5bc1 100644
--- a/src/location/doc/snippets/declarative/maps.qml
+++ b/src/location/doc/snippets/declarative/maps.qml
@@ -41,11 +41,18 @@
//! [QtQuick import]
import QtQuick 2.0
//! [QtQuick import]
+import QtPositioning 5.0
//! [QtLocation import]
import QtLocation 5.0
//! [QtLocation import]
Item {
+ id: page
+
+ Plugin {
+ id: myPlugin
+ }
+
//! [MapRoute]
Map {
RouteModel {
@@ -81,7 +88,7 @@ Item {
property MapCircle circle
Component.onCompleted: {
- circle = Qt.createQmlObject('import QtLocation 5.0; MapCircle {}')
+ circle = Qt.createQmlObject('import QtLocation 5.0; MapCircle {}', page)
circle.center = positionSource.position.coordinate
circle.radius = 5000.0
circle.color = 'green'
diff --git a/src/location/doc/snippets/declarative/places.qml b/src/location/doc/snippets/declarative/places.qml
index 66c62cf7..862ab182 100644
--- a/src/location/doc/snippets/declarative/places.qml
+++ b/src/location/doc/snippets/declarative/places.qml
@@ -42,10 +42,15 @@
import QtQuick 2.0
//! [QtQuick import]
//! [QtLocation import]
+import QtPositioning 5.0
import QtLocation 5.0
//! [QtLocation import]
Item {
+ Plugin {
+ id: myPlugin
+ }
+
Place {
id: place
}
@@ -110,6 +115,9 @@ Item {
//! [ExtendedAttributes write]
}
+ Icon {
+ id: icon
+ }
//! [Icon]
Image {
source: icon.url(Qt.size(64, 64))
@@ -118,7 +126,7 @@ Item {
Image {
//! [Icon default]
- source: icon.url()
+ source: icon.url()
//! [Icon default]
}
@@ -207,7 +215,6 @@ Item {
ListView {
anchors.top: parent.top
- anchors.bottom: position.top
width: parent.width
spacing: 10
@@ -303,7 +310,7 @@ Item {
id: myPlace
plugin: myPlugin
- name: "Nokia Brisbane"
+ name: "Brisbane Technology Park"
location: Location {
address: Address {
street: "53 Brandl Street"
diff --git a/src/location/doc/snippets/declarative/places_loader.qml b/src/location/doc/snippets/declarative/places_loader.qml
index 9f10faf7..06301064 100644
--- a/src/location/doc/snippets/declarative/places_loader.qml
+++ b/src/location/doc/snippets/declarative/places_loader.qml
@@ -39,6 +39,7 @@
****************************************************************************/
import QtQuick 2.0
+import QtPositioning 5.0
import QtLocation 5.0
Rectangle {
@@ -60,13 +61,7 @@ Rectangle {
plugin: myPlugin
searchTerm: "pizza"
- searchArea: GeoCircle {
- center {
- // Brisbane
- longitude: 153.02778
- latitude: -27.46778
- }
- }
+ searchArea: QtLocation.circle( -27.46778, 153.02778 )
Component.onCompleted: update()
}
diff --git a/src/location/doc/src/cpp-qml.qdoc b/src/location/doc/src/cpp-qml.qdoc
index 3e38edb0..aabf1f8a 100644
--- a/src/location/doc/src/cpp-qml.qdoc
+++ b/src/location/doc/src/cpp-qml.qdoc
@@ -27,7 +27,7 @@
/*!
\page location-cpp-qml.html
-\title Interfaces between C++ and QML Code
+\title Interfaces between C++ and QML Code in Qt Positioning
\brief Some of the location QML types providing interfaces to access and modify properties in C++.
@@ -120,26 +120,4 @@ The following gets the QPlaceSupplier representing this object from C++:
The following sets the properties of this object based on a QPlaceSupplier object from C++:
\snippet cpp/cppqml.cpp Supplier set
-
-\section2 Address - QGeoAddress
-\target geoaddress
-The \l {Address::address} {Address.address} property is used to provide an interface between C++ and QML code. First a pointer to a
-Address object must be obtained from C++, then use the \l {QObject::property()}{property()} and
-\l {QObject::setProperty()}{setProperty()} functions to get and set the \c address property.
-The following gets the QGeoAddress representing this object from C++:
-\snippet cpp/cppqml.cpp Address get
-The following sets the properties of this object based on a QGeoAddress object from C++:
-\snippet cpp/cppqml.cpp Address set
-
-
-\section2 Location - QGeoLocation
-\target location
-The \l {Location::location} {Location.location} property is used to provide an interface between C++ and QML code. First a pointer to a
-Location object must be obtained from C++, then use the \l {QObject::property()}{property()} and
-\l {QObject::setProperty()}{setProperty()} functions to get and set the \c location property.
-The following gets the QGeoLocation representing this object from C++:
-\snippet cpp/cppqml.cpp Location get
-The following sets the properties of this object based on a QGeoLocation object from C++:
-\snippet cpp/cppqml.cpp Location set
-
*/
diff --git a/src/location/doc/src/examples/declarative-flickr.qdoc b/src/location/doc/src/examples/declarative-flickr.qdoc
deleted file mode 100644
index 99c2792d..00000000
--- a/src/location/doc/src/examples/declarative-flickr.qdoc
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \example declarative/flickr
- \title Flickr (QML)
- \ingroup qtlocation-examples
-
- \brief The Flickr example shows how to use the user's current location to
- fetch local content from a web service.
-
- This is a small example, illustrating one of the very core parts of the
- Qt Location API: the ability to retrieve and use the user's current
- geographic location.
-
- Key QML types shown in this example:
- \list
- \li \l{QtLocation5::PositionSource}{PositionSource}
- \li \l{XmlListModel}{XmlListModel}
- \endlist
-
- \image qml-flickr-1.jpg
-
- \section2 Retrieving the Current Location
-
- Retrieving the user's current location is achieved using the PositionSource
- type. In this example, we instantiate the PositionSource as part of the
- GeoTab component (the floating "window" describing current location and
- status).
-
- \snippet flickr/flickrmobile/GeoTab.qml possrc
-
- When the "Locate and update" button is pressed, we first interrogate the
- PositionSource to check if it has an available backend for positioning
- data. If it does not, we fall back to using a pre-recorded NMEA log
- for demonstration. We then instruct the PositionSource to update.
-
- \snippet flickr/flickrmobile/GeoTab.qml locatebutton-top
- \snippet flickr/flickrmobile/GeoTab.qml locatebutton-clicked
-
- To share the new position data with the rest of the application, we use
- properties that we have created on the GeoTab component:
-
- \snippet flickr/flickrmobile/GeoTab.qml props
-
- The longitude and latitude values retrieved here are eventually set on
- in properties on the RestModel component. The RestModel is an XmlListModel,
- which retrieves XML data from a URL and creates a data model by performing
- XPath queries on it.
-
- In this case, it retrieves data from the Flickr REST API online, based on
- our current location
-
- \snippet flickr/flickrcommon/RestModel.qml restmodel
-
- This model data is then shown in a variety of Qt Quick views to produce
- the example application.
-
-*/
diff --git a/src/location/doc/src/examples/logfilepositionsource.qdoc b/src/location/doc/src/examples/logfilepositionsource.qdoc
deleted file mode 100644
index 0e7ac773..00000000
--- a/src/location/doc/src/examples/logfilepositionsource.qdoc
+++ /dev/null
@@ -1,87 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
-\example logfilepositionsource
-\title Log File Position Source (C++)
-\ingroup qtlocation-examples
-
-\brief The Logfile Position Source shows how to create and work with a custom NMEA position source,
- for platforms without GPS.
-
-The data is read from a file which has positional data in NMEA format. The resulting time and
-position information is then displayed to the screen as simple text in date/time and
-latitude/longitude format.
-
-This example class reads location data from a text file, \e log.txt. The file specifies location
-data using a simple text format: it contains one location update per line, where each line contains
-a date/time, a latitude and a longitude, separated by spaces. The date/time is in ISO 8601 format
-and the latitude and longitude are in degrees decimal format. Here is an excerpt from \e log.txt:
-
-\code
-2009-08-24T22:25:01 -27.576082 153.092415
-2009-08-24T22:25:02 -27.576223 153.092530
-2009-08-24T22:25:03 -27.576364 153.092648
-\endcode
-
-The class reads this data and distributes it via the
-\l{QGeoPositionInfoSource::positionUpdated()}{positionUpdated()} signal.
-
-Here is the definition of the \c LogFilePositionSource class:
-
-\quotefromfile logfilepositionsource/logfilepositionsource.h
-\skipto class LogFilePositionSource
-\printuntil };
-
-The main methods overrided by the subclass are:
-
-\list
- \li \l{QGeoPositionInfoSource::startUpdates()}{startUpdates()}: called by client applications
- to start regular position updates.
- \li \l{QGeoPositionInfoSource::stopUpdates()}{stopUpdates()}: called by client applications to
- stop regular position updates.
- \li \l{QGeoPositionInfoSource::requestUpdate()}{requestUpdate()}: called by client applications
- to request a single update, with a specified timeout.
-\endlist
-
-When a position update is available, the subclass emits the
-\l{QGeoPositionInfoSource::positionUpdated()}{positionUpdated()} signal.
-
-Here are the key methods in the class implementation:
-
-\quotefromfile logfilepositionsource/logfilepositionsource.cpp
-\skipto LogFilePositionSource::LogFilePositionSource
-\printuntil /^\}/
-\skipto LogFilePositionSource::startUpdates
-\printuntil /^\}/
-\skipto LogFilePositionSource::stopUpdates
-\printuntil /^\}/
-\skipto LogFilePositionSource::requestUpdate
-\printuntil /^\}/
-\printuntil LogFilePositionSource::readNextPosition
-\printuntil /^\}/
-*/
diff --git a/src/location/doc/src/examples/qtlocation-examples.qdoc b/src/location/doc/src/examples/qtlocation-examples.qdoc
index 8a7fe532..146dba76 100644
--- a/src/location/doc/src/examples/qtlocation-examples.qdoc
+++ b/src/location/doc/src/examples/qtlocation-examples.qdoc
@@ -34,6 +34,5 @@
These are the Qt Location examples.
- \generatelist related
*/
diff --git a/src/location/doc/src/examples/weatherinfo.qdoc b/src/location/doc/src/examples/weatherinfo.qdoc
deleted file mode 100644
index ad5ad5d5..00000000
--- a/src/location/doc/src/examples/weatherinfo.qdoc
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
- \example weatherinfo
- \title Weather Info (C++/QML)
-
- \brief The Weather Info example shows how to use the user's current position
- to retrieve local content from a web service in a C++ plugin for QML.
-
- \ingroup qtlocation-examples
-
- Key Qt Location classes used in this example:
-
- \list
- \li \l{QGeoPositionInfo}
- \li \l{QGeoPositionInfoSource}
- \endlist
-
- \image ../images/example-weatherinfo.png
-
- The key part of this example is the application's data model, contained
- in the WeatherData and AppModel classes. WeatherData represents the weather
- information taken from the HTTP service. It is a simple data class, but we
- give it Q_PROPERTies to expose it nicely to QML, later.
-
- \snippet weatherinfo/appmodel.h 0
- \snippet weatherinfo/appmodel.h 1
-
- AppModel models the state of the entire application. At startup, the
- application first begins by waiting for network connectivity. We do
- this using the QNetworkConfigurationManager and QNetworkSession family
- of C++ APIs.
-
- \snippet weatherinfo/appmodel.cpp 0
- \snippet weatherinfo/appmodel.cpp 1
-
- Once the network session is open, we proceed to get the platform's
- default position source using QGeoPositionInfo::createDefaultSource()
-
- \snippet weatherinfo/appmodel.cpp 2
-
- If no default source is available, we take a static location and fetch
- weather for that. If, however, we do have a position source, we connect
- its positionUpdated() signal to a slot on the AppModel and call
- startUpdates(), which begins regular updates of device position.
-
- When a position update is received, we use the longitude and latitude
- of the returned coordinate to retrieve the current "city" name for use
- in the weather lookup.
-
- \snippet weatherinfo/appmodel.cpp 3
-
- To inform the UI about this process, the cityChanged() signal is emitted
- when a new city is used, and the weatherChanged() signal whenever a
- weather update occurs.
-
- \snippet weatherinfo/appmodel.h 2
- \snippet weatherinfo/appmodel.h 3
- \snippet weatherinfo/appmodel.h 4
-
- We use a QQmlListProperty for the weather forecast information,
- which contains the next 4 days of forecast weather. This makes it
- easy to access from QML.
-
- To expose these to the QML UI layer, we use the qmlRegisterType()
- function. We call this once for each type we wish to register, before
- loading the actual QML file.
-
- \snippet weatherinfo/main.cpp 0
- \snippet weatherinfo/main.cpp 1
-
- Finally, in the actual QML, we instantiate the AppModel.
-
- \snippet weatherinfo/weatherinfo.qml 0
- \snippet weatherinfo/weatherinfo.qml 1
- \snippet weatherinfo/weatherinfo.qml 2
-
- Once instantiated like this, we can use its properties elsewhere in the
- QML document:
-
- \snippet weatherinfo/weatherinfo.qml 3
- \snippet weatherinfo/weatherinfo.qml 4
-
-*/
diff --git a/src/location/doc/src/maps.qdoc b/src/location/doc/src/maps.qdoc
index 99cc9bca..3426d626 100644
--- a/src/location/doc/src/maps.qdoc
+++ b/src/location/doc/src/maps.qdoc
@@ -147,7 +147,7 @@ varying degrees of accuracy.
A geocoding query in QML is performed using the
\l{QtLocation5::GeocodeModel}{GeocodeModel} type. For an address-to-coordinate
query, its \c{query} property may be set to either an
-\l{QtLocation5::Address}{Address} object or a string containing the textual
+\l{QtPositioning5::Address}{Address} object or a string containing the textual
form of the address to search for. To perform the reverse, the same property
can be set to a \l {coordinate} instead. Results are made available in the
contents of the model.
@@ -161,7 +161,7 @@ contents of the model.
\li \l{QtLocation5::GeocodeModel}{GeocodeModel}
\li Queries the Plugin for geocoding translations and provides access to results via indexes in the model.
\row
- \li \l{QtLocation5::Address}{Address}
+ \li \l{QtPositioning5::Address}{Address}
\li Structured address for use in queries and results of geocoding.
\endtable
@@ -181,13 +181,13 @@ between the segments.
\b{Key Types}
\table
\row
- \li \l{QtLocation5::Route}{Routing}
+ \li \l{QtLocation5::Route}{Route}
\li The entire path to be navigated.
\row
- \li \l{QtLocation5::RouteSegment}{Segments}
+ \li \l{QtLocation5::RouteSegment}{RouteSegment}
\li The individual components of a route.
\row
- \li \l{QtLocation5::RouteManeuver}{Maneuvers}
+ \li \l{QtLocation5::RouteManeuver}{RouteManeuver}
\li The navigation information that joins segments.
\row
\li \l{QtLocation5::RouteModel}{RouteModel}
@@ -213,6 +213,10 @@ between the segments.
geographic coordinate from a street address) and navigation (including driving
and walking directions).
+Currently it is not possible to interact with maps via C++. Mapping applications
+must use the \l {Maps and Navigation (QML)} API.
+
+
\section1 Geocoding
In C++, an address-to-coordinate query is performed using the
@@ -234,4 +238,28 @@ on the same class. Instances of QGeocodingManager are available via
\li \l{QGeocodeReply}
\li Contains the results of a geocoding query.
\endtable
+
+\section1 Navigation
+
+In C++, a route query is performed using the \l{QGeoRoutingManager::calculateRoute()}{calculate()}
+method of the QGeoRoutingManager class. The returned route reply can contain
+multiple routes to the same destination.
+
+\b{Key Classes}
+\table
+ \row
+ \li \l{QGeoServiceProvider}
+ \li Provides a QGeocodingManager instance ready for use.
+ \row
+ \li \l{QGeoRoutingManager}
+ \li Accepts queries and produces QGeoRouteReply objects.
+ \row
+ \li \l{QGeoRouteReply}
+ \li Contains the results of a routing query.
+ \row
+ \li \l{QGeoRoute}
+ \li Contains information about a route.
+\endtable
+
+
*/
diff --git a/src/location/doc/src/place-caveats.qdocinc b/src/location/doc/src/place-caveats.qdocinc
index ce766338..d3d9bd0e 100644
--- a/src/location/doc/src/place-caveats.qdocinc
+++ b/src/location/doc/src/place-caveats.qdocinc
@@ -14,7 +14,7 @@
\endlist
It is possible that providers may only support a subset of these.
- See the \l {Qt Location Module#Plugin References and Parameters}{plugin documentation} for more
+ See the \l {Qt Location#Plugin References and Parameters}{plugin documentation} for more
details.
Saving of properties such as the rating, extended attributes,
diff --git a/src/location/doc/src/place-definition.qdocinc b/src/location/doc/src/place-definition.qdocinc
index d9bcc6b7..23987757 100644
--- a/src/location/doc/src/place-definition.qdocinc
+++ b/src/location/doc/src/place-definition.qdocinc
@@ -17,7 +17,7 @@ QPlace::detailsFetched() function can be queried to see if all available
details have been fetched, and if not, QPlaceManager::getPlaceDetails() can
be used to retrieve them. Precisely which details are populated during a
search and which need to be fetched individually may vary from provider to
-provider. See \l {Qt Location Module#Plugin References and Parameters}{plugin documentation} for
+provider. See \l {Qt Location#Plugin References and Parameters}{plugin documentation} for
more details.
The rich content of a place consists of items such as images, reviews and
diff --git a/src/location/doc/src/plugins/nokia_terms.qdoc b/src/location/doc/src/plugins/nokia_terms.qdoc
index c10bbbf0..2f29a60f 100644
--- a/src/location/doc/src/plugins/nokia_terms.qdoc
+++ b/src/location/doc/src/plugins/nokia_terms.qdoc
@@ -36,6 +36,6 @@ src/plugins/geoservices/nokia/NOKIA_TERMS_AND_CONDITIONS.txt in the Qt Location
package. The terms and conditions are reproduced below for convenience.
\legalese
-\include plugins/geoservices/nokia/NOKIA_TERMS_AND_CONDITIONS.txt
+\include NOKIA_TERMS_AND_CONDITIONS.txt.qdocinc
\endlegalese
*/
diff --git a/src/location/doc/src/position.qdoc b/src/location/doc/src/position.qdoc
deleted file mode 100644
index 75f54c31..00000000
--- a/src/location/doc/src/position.qdoc
+++ /dev/null
@@ -1,191 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
-\page location-positioning-cpp.html
-
-\title Positioning (C++)
-
-\brief The Location Positioning API enables location positioning by means of
-GPS or an NMEA data source.
-
-\section1 Positioning
-
-The Positioning component of the Qt Location API is about the geographical position, size
-and address of some place. Positioning contains a QGeoCoordinate class, containing latitude, longitude and altitude in meters. QGeoLocation contains a QGeoCoordinate plus address
-and size information (a bounding box) so that positions can be more than mathematical points.
-Movement into or out of the defined bounding box areas can be monitored. The API
-also allows the developer to control the source of the positional information
-as well.
-
-Location data involves a precisely specified position on the Earth's
-surface \unicode {0x2014} as provided by a latitude-longitude coordinate
-\unicode {0x2014} along with associated data, such as:
-
- \list
- \li The date and time at which the position was reported
- \li The velocity of the device that reported the position
- \li The altitude of the reported position (height above sea level)
- \li The bearing of the device in degrees, relative to true north
- \endlist
-
-This data can be extracted through a variety of methods. One of the most
-well known methods of positioning is GPS (Global Positioning System), a
-publicly available system that uses radiowave signals received from
-Earth-orbiting satellites to calculate the precise position and time of
-the receiver. Another popular method is 'Cell Identifier Positioning', which uses
-the cell identifier of the cell site that is currently serving the receiving
-device to calculate its approximate location. These and other positioning
-methods can all be used with the Location API; the only requirement for a
-location data source within the API is that it provides a
-latitude-longitude coordinate with a date/time value, with the option of
-providing the other attributes listed above.
-
-
-Location data sources are created by subclassing QGeoPositionInfoSource and
-providing QGeoPositionInfo objects through the
-QGeoPositionInfoSource::positionUpdated() signal. Clients that require
-location data can connect to the
-\l{QGeoPositionInfoSource::positionUpdated()}{positionUpdated()} signal and
-call \l{QGeoPositionInfoSource::startUpdates()}{startUpdates()} or
-\l{QGeoPositionInfoSource::requestUpdate()}{requestUpdate()} to trigger the
-distribution of location data. The location data distribution can be stopped by
-calling the \l {QGeoPositionInfoSource::stopUpdates()}{stopUpdates()} function.
-
-A default position source may be available on some platforms. Call
-QGeoPositionInfoSource::createDefaultSource() to create an instance of the default
-position source; the method returns 0 if no default source is available for
-the platform.
-
-If a problem occurs with access to the information source then an
-\l {QGeoPositionInfoSource::error()}{error()} signal is emitted.
-
-The QGeoAreaMonitor class enables client applications to be notified when
-the receiving device has moved in or out of a particular area, as specified
-by a coordinate and radius. If the platform provides built-in support for
-area monitoring, QGeoAreaMonitor::createDefaultMonitor() returns an instance of
-the default area monitor.
-
-Satellite information can also be distributed through the
-QGeoSatelliteInfoSource class. Call QGeoSatelliteInfoSource::createDefaultSource() to
-create an instance of the default satellite data source for the platform,
-if one is available. Alternatively, clients can subclass it to provide a
-custom satellite data source.
-
-
-
-\section2 Requesting Location Data from Data Sources
-
-To receive data from a source, connect to its
-\l{QGeoPositionInfoSource::positionUpdated()}{positionUpdated()} signal,
-then call either \l{QGeoPositionInfoSource::startUpdates()}{startUpdates()}
-or \l{QGeoPositionInfoSource::requestUpdate()}{requestUpdate()} to begin.
-
-Here is an example of a client that receives data from the default location
-data source, as returned by QGeoPositionInfoSource::createDefaultSource():
-
-\code
-class MyClass : public QObject
-{
- Q_OBJECT
-public:
- MyClass(QObject *parent = 0)
- : QObject(parent)
- {
- QGeoPositionInfoSource *source = QGeoPositionInfoSource::createDefaultSource(this);
- if (source) {
- connect(source, SIGNAL(positionUpdated(QGeoPositionInfo)),
- this, SLOT(positionUpdated(QGeoPositionInfo)));
- source->startUpdates();
- }
- }
-
-private slots:
- void positionUpdated(const QGeoPositionInfo &info)
- {
- qDebug() << "Position updated:" << info;
- }
-};
-
-\endcode
-
-\section2 Controlling Aspects of Data Sources
-
-The QGeoPositionInfoSource::setUpdateInterval() method can be used to
-control the rate at which position updates are received. For example, if
-the client application only requires updates once every 30 seconds, it can
-call \c setUpdateInterval(30000). (If no update interval is set, or
-\l {QGeoPositionInfoSource::}{setUpdateInterval()} is called with a value of 0, the source uses a default
-interval or some other internal logic to determine when updates should be
-provided.)
-
-QGeoPositionInfoSource::setPreferredPositioningMethods() enables client
-applications to request that a certain type of positioning method be used.
-For example, if the application prefers to use only satellite positioning,
-which offers fairly precise outdoor positioning but can be a heavy user of
-power resources, it can call this method with the
-QGeoPositionInfoSource::SatellitePositioningMethods value. However, this
-method should only be used in specialized client applications; in most
-cases, the default positioning methods should not be changed, as a source
-may internally use a variety of positioning methods that can be useful to
-the application.
-
-\section2 NMEA Data
-
-\l {http://en.wikipedia.org/wiki/NMEA_0183}{NMEA} is a common text-based
-protocol for specifying navigational data. For convenience, the
-QNmeaPositionInfoSource is provided to enable client applications to read
-and distribute NMEA data in either real-time mode (for example, when
-streaming from a GPS device) or simulation mode (for example, when reading
-from a NMEA log file). In simulation mode, the source will emit updates
-according to the time stamp of each NMEA sentence to produce a "replay"
-of the recorded data.
-
-Generally, the capabilities provided by the default position source as
-returned by QGeoPositionInfoSource::createDefaultSource(), along with the
-QNmeaPositionInfoSource class, are sufficient for retrieving location
-data. However, in some cases developers may wish to write their own custom
-location data source.
-
-The \l {Log File Position Source (C++)} example demonstrates how to subclass QGeoPositionInfoSource
-to create a custom positioning source.
-
-
-\section1 Examples
-
-\section3 \b{Flickr Example}
-
-The \l{Flickr QML}{Flickr Example} uses the Location to download thumbnail
-images from Flickr relevant to the current location.
-
-
-
-\section1 Location Position Classes
-
-\annotatedlist QtLocation-positioning
-
-*/
diff --git a/src/location/doc/src/qml-maps.qdoc b/src/location/doc/src/qml-maps.qdoc
index 45cf82f4..f63cc5a4 100644
--- a/src/location/doc/src/qml-maps.qdoc
+++ b/src/location/doc/src/qml-maps.qdoc
@@ -53,15 +53,41 @@ Interaction with the added items, and the \l Map itself, is handled by \l MapMou
are added as children of the
\l {Maps and Navigation (QML)#Putting Objects on a Map (Map Overlay Objects)}{MapItems} or \l Map.
-\section2 Position
+\section2 Position on map
+All position APIs are part of the \l {QtPositioning} module.
The basic piece of position information is the \l {coordinate}. A
coordinate encapsulates data for the latitude, longitude and altitude of the location. Altitude is
in meters. It also has a method to determine distance to another
\l {coordinate}. The \l {coordinate} type may
-also be held within a \l {QtLocation5::Location}{Location} element, this will also have information
+also be held within a \l {QtPositioning5::Location}{Location} element, this will also have information
on a bounding box size to determine sufficient proximity to the location and a location address.
+
+Here is an example of a client that uses a \l{PositionSource}{position source}
+to center a \l{Map}{map} on the current position:
+
+\code
+ Rectangle {
+
+ import QtPositioning 5.0
+ import QtLocation 5.0
+ ...
+
+ map : Map {
+ // initialize map
+ ...
+ }
+
+ PositionSource {
+ onPositionChanged: {
+ // center the map on the current position
+ map.center = position.coordinate
+ }
+ }
+ }
+\endcode
+
\section2 Geocoding
\l {http://en.wikipedia.org/wiki/Geocoding}{Geocoding} is the derivation of
@@ -194,9 +220,6 @@ example, by implementing the \c onValueChanged handler to update the Map
\section1 Types
-\section3 Positioning
-\annotatedlist qml-QtLocation5-positioning
-
\section3 Maps
\annotatedlist qml-QtLocation5-maps
diff --git a/src/location/doc/src/qml-position.qdoc b/src/location/doc/src/qml-position.qdoc
deleted file mode 100644
index 9553f6d2..00000000
--- a/src/location/doc/src/qml-position.qdoc
+++ /dev/null
@@ -1,136 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the documentation of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:FDL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Free Documentation License Usage
-** Alternatively, this file may be used under the terms of the GNU Free
-** Documentation License version 1.3 as published by the Free Software
-** Foundation and appearing in the file included in the packaging of
-** this file. Please review the following information to ensure
-** the GNU Free Documentation License version 1.3 requirements
-** will be met: http://www.gnu.org/copyleft/fdl.html.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-/*!
-\page location-positioning-qml.html
-
-\title Positioning (QML)
-
-\brief The Location Positioning API enables location positioning by means of
-GPS or an NMEA data source.
-
-\section1 Location Positioning
-
-Location data involves a precisely specified position on the Earth's
-surface \unicode {0x2014} as provided by a latitude-longitude coordinate
-\unicode {0x2014} along with associated data, such as:
-
- \list
- \li The date and time at which the position was reported
- \li The velocity of the device that reported the position
- \li The altitude of the reported position (height above sea level)
- \li The bearing of the device in degrees, relative to true north
- \endlist
-
-For more information see
-\l {http://en.wikipedia.org/wiki/Geographic_coordinate}{Geographic Coordinate}.
-
-This data can be extracted through a variety of methods. One of the most
-well known methods of positioning is GPS (Global Positioning System), a
-publicly available system that uses radiowave signals received from
-Earth-orbiting satellites to calculate the precise position and time of
-the receiver. Another popular method is 'Cell Identifier Positioning', which uses
-the cell identifier of the cell site that is currently serving the receiving
-device to calculate its approximate location. These and other positioning
-methods can all be used with the Location API; the only requirement for a
-location data source within the API is that it provides a
-latitude-longitude coordinate with a date/time value, with the option of
-providing the other attributes listed above.
-
-\section2 Coordinate
-
-The \l {coordinate} is a basic unit of geographical information. The
-\l {coordinate} type has attributes to hold the \c {latitude},
-\c longitude and \c altitude.
-
-\section2 Position
-
-The three dimensional position of an object such as a mobile device can be specified by giving
-the latitude, longitude and altitude. That is the values held in the
-l\ {coordinate} type. Additionally for computation of future
-positions we would like to know if the object is moving, what \l {Position::speed}{speed} it is
-doing and what is the \l {Position::timestamp}{timestamp} of the last position data. Position
-therefore includes values for the \l {Position::coordinate}{coordinate},
-\l {Position::speed}{speed} and a \l {Position::timestamp}{timestamp}. \l Position also takes
-responsibility for validation of sensible values for these properties. These are exposed as
-the \l {Position::latitudeValid}{latitudeValid}, \l {Position::longitudeValid}{longitudeValid},
-\l {Position::altitudeValid}{altitudeValid}, \l {Position::speedValid}{speedValid},
-\l {Position::horizontalAccuracyValid}{horizontalAccuracyValid}, and
-\l {Position::verticalAccuracyValid}{verticalAccuracyValid} properties.
-
-
-\section2 PositionSource
-
-We have a Position type, a \l {coordinate} type but where does the data come from?
-Also it is a good idea to be able to indicate alternative sources.
-Perhaps instead of directly picking up GPS satellites it might be desirable to do
-some testing using a datafile.
-
-The \l PositionSource type provides the developer with control,
-within the limits allowed by the platform, of the source of the
-geographical data. Apart from tradtional sources such as GPS and cell data the positional data can be
-sourced from a logfile which is in NMEA format.
-
-\l {http://en.wikipedia.org/wiki/NMEA}{NMEA} is a common text-based protocol for specifying navigational data. For convenience, the \l {PositionSource::nmeaSource}{nmeaSource} property is provided to enable QML applications to read NMEA data from a log file, the source will emit updates according to the time stamp of each NMEA sentence to produce a "replay" of the recorded data.
-
-
-\section2 Example: Centering the Map on the Current Position
-
-Here is an example of a client that uses a \l{PositionSource}{position source}
-to center a \l{Map}{map} on the current position:
-
-\code
-Rectangle {
-
- import QtLocation 5.0
- ...
-
- map : Map {
- // initialize map
- ...
- }
-
- PositionSource {
- onPositionChanged: {
- // center the map on the current position
- map.center = position.coordinate
- }
- }
-}
-\endcode
-
-
-\section2 \b{Flickr Example}
-
-The \l{Flickr (QML)}{Flickr Example} uses the Location to download thumbnail
-images from Flickr relevant to the current location.
-
-
-\section1 Position QML Components
-
-\annotatedlist qml-QtLocation5-positioning
-*/
diff --git a/src/location/doc/src/qtlocation-cpp.qdoc b/src/location/doc/src/qtlocation-cpp.qdoc
index c13360b5..0c0f946d 100644
--- a/src/location/doc/src/qtlocation-cpp.qdoc
+++ b/src/location/doc/src/qtlocation-cpp.qdoc
@@ -30,17 +30,16 @@
\title Qt Location C++ API
\brief Information about the Qt Location C++ API
-The Location API provides a library for location positioning, mapping and navigation.
+The Location API provides a library for mapping, navigation and place information.
\tableofcontents
-The Qt Location API provides the developer with a set of functions for determining
-the current location and using that information with maps and places of interest.
+The Qt Location API provides the developer with a set of functions to interact
+with maps, navigational data and places of interest. This is particularly useful
+when associated with current position information which can be retrieved via the
+\l QtPositioning module.
-Positioning information can be sourced from GPS satellites or a stream of data using
-NMEA formatted text. Once a position is acquired we can monitor the updated
-position to see if it moves into or out of a given region. With the Maps API
-we can associate the position with a map in various formats supplied by a backend.
+With the Maps API we can associate a position with a map in various formats supplied by a backend.
Then the Places API could be used to populate places on the Map or even
specify the current position as a place of interest and associate it with
an icon, contact details and other information.
@@ -50,25 +49,17 @@ Qt Location C++ API.
\table
\row
- \li \l {Positioning (C++)}{Location Positioning}
- \li Retrieving information about the current position.
- \row
\li \l {Maps and Navigation (C++)}{Maps and Navigation}
\li Displaying maps and finding routes.
\row
\li \l {Places (C++)} {Places}
\li Searching for and managing points of interest.
\row
- \li \l {Qt Location GeoServices}{Geoservices and Positioning Plugin Implementation}
+ \li \l {Qt Location GeoServices}{Geoservices Plugin Implementation}
\li Implement new geoservices and positioning plugins.
\endtable
-\section1 Positioning Classes
-
- \annotatedlist QtLocation-positioning
-
-
\section1 Geoservice Provider Classes
\annotatedlist QtLocation-common
@@ -76,6 +67,8 @@ Qt Location C++ API.
\section1 Maps and Navigation Classes
+Currently it is not possible to interact with maps data via C++. The only available interface is the \l {Maps and Navigation (QML)} API.
+
\annotatedlist QtLocation-maps
\annotatedlist QtLocation-routing
diff --git a/src/location/doc/src/qtlocation-geoservices.qdoc b/src/location/doc/src/qtlocation-geoservices.qdoc
index 7adb9b18..85c96b0f 100644
--- a/src/location/doc/src/qtlocation-geoservices.qdoc
+++ b/src/location/doc/src/qtlocation-geoservices.qdoc
@@ -33,29 +33,59 @@
The Qt Location provides the majority of its functionality through GeoService plugins. This
document outlines how to develop a new GeoService plugin.
+\section1 Plugin description
+
+Each plugin is described by a json file. The json describes the plugins capabilities and
+version. Below is an example of a json file used by the OpenStreenMap plugin:
+
+
+\quotefile ../../../plugins/geoservices/osm/osm_plugin.json
+
+The entries have the following meaning:
+
+\table
+ \header
+ \li Key
+ \li Description
+ \row
+ \li Keys
+ \li The unique name/key of the plugin. Each GeoService plugin must have a unique name.
+ \row
+ \li Provider
+ \li The provider name of the services. Multiple plugins may have the same name.
+ In such cases the Version string will be used to further distinguish the plugins.
+ \row
+ \li Experimental
+ \li Marks the service plugin as experimental. API developers may choose to ignore
+ such plugins when instanciating \l QGeoServiceProvider::QGeoServiceProvider().
+ \row
+ \li Version
+ \li The plugin version. If multiple plugins have the same provider name, the plugin
+ with the higest version will be used.
+ \row
+ \li Features
+ \li List of features provided by the plugin/service. Each feature is a string
+ representation of the corresponding features in \l QGeoServiceProvider. For more
+ details see \l QGeoServiceProvider::routingFeatures(),
+ \l QGeoServiceProvider::geocodingFeatures() and \l QGeoServiceProvider::placesFeatures().
+
+\endtable
+
\section1 Implementing Plugins
A plugin implementer needs to subclass QGeoServiceProviderFactory and as
many of the ManagerEngine classes as they want to provide implementations for.
-Subclassing QGeoServiceProviderFactory will only involve exposing a name and
-a version by overriding QGeoServiceProviderFactory::providerName() and
-QGeoServiceProviderFactory::providerVersion(), and overriding
-QGeoServiceProviderFactory::createSearchManagerEngine(),
-QGeoServiceProviderFactory::createMappingManagerEngine() and
-QGeoServiceProviderFactory::createRoutingManagerEngine() as appropriate.
-
-\section3 Tile-Based Map Convenience Classes
-
-Most of the current tile based mapping APIs are very similar, and so we
-provide a number of classes intended to make writing tile based mapping
-plugins much simpler.
+Subclassing QGeoServiceProviderFactory will only involves overriding of one of the following
+methods:
-If the Mercator projection and the most common tile addressing scheme is used this will mainly
-involve subclassing QGeoTiledMappingManagerEngine and providing an implementation of
-QGeoTiledMappingManagerEngine::getTileImage().
+\list
+ \li \l QGeoServiceProviderFactory::createGeocodingManagerEngine()
+ \li \l QGeoServiceProviderFactory::createRoutingManagerEngine()
+ \li \l QGeoServiceProviderFactory::createPlaceManagerEngine()
+\endlist
-\section1 GeoService Classes
+If a plugin does not provide an engine the relevant function should return 0.
\annotatedlist QtLocation-impl
diff --git a/src/location/doc/src/qtlocation-qml.qdoc b/src/location/doc/src/qtlocation-qml.qdoc
index 351552de..a24820bd 100644
--- a/src/location/doc/src/qtlocation-qml.qdoc
+++ b/src/location/doc/src/qtlocation-qml.qdoc
@@ -40,22 +40,9 @@ statement in the QML file.
\section2 Location QML Concepts
-Position information can come from a variety of sources including satellites,
-wifi, text files and so on. The position is described by the latitude,
-the longitude, and the altitude in meters. For more information see
-\l {http://en.wikipedia.org/wiki/Geographic_coordinate}{Geographic Coordinate}.
-
-The QML position is stored in a \l {coordinate} which contains the
-latitude, longitude and altitude of the device. The \l {QtLocation5::Location}{Location} contains
-this \l {coordinate} and adds an address, it also has a bounding box which
-defines the recommended viewing region when displaying the location.
-
-Now that the device has a position, with regular updates the API can determine
-the speed and heading of the device. It can also define a box or a circle that can
-produce a notification when the device either leaves or enters that region.
-
-Adding a \l {QtLocation5::Map}{Map} with positions of interest and
-\l {QtLocation5::Place}{Places}, then the device can be made aware of nearby features and related
+Provided that a position has been obtained this module can
+add a \l {QtLocation5::Map}{Map} with positions of interest and
+\l {QtLocation5::Place}{Places}. The user can be made aware of nearby features and related
information, displayed graphically. Features on the \l Map may be places of business, entertainment
and so on. They may include paths, roads, or forms of transport leading so that
navigation optimization and assistance are possible.
@@ -101,9 +88,6 @@ API.
\table
\row
- \li \l {Positioning (QML)}{Location Positioning}
- \li Retrieving information about the current position.
- \row
\li \l {Maps and Navigation (QML)}{Maps and Navigation}
\li Displaying maps and finding routes.
\row
@@ -111,18 +95,10 @@ API.
\li Searching for and managing points of interest.
\endtable
-\section1 Basic Types
-
-\annotatedlist qml-QtLocation5-basictypes
-
\section1 Common QML Types
\annotatedlist qml-QtLocation5-common
-\section1 Positioning QML Types
-
-\annotatedlist qml-QtLocation5-positioning
-
\section1 Maps QML Types
\annotatedlist qml-QtLocation5-maps
diff --git a/src/location/doc/src/qtlocation.qdoc b/src/location/doc/src/qtlocation.qdoc
index 06cd6d58..dc3fc14d 100644
--- a/src/location/doc/src/qtlocation.qdoc
+++ b/src/location/doc/src/qtlocation.qdoc
@@ -50,9 +50,7 @@
The .pro file should have the \e location keyword added
- \code
- QT += location
- \endcode
+ \code QT += location \endcode
See more in the \l{Qt Location}{Qt Location Overview}.
@@ -98,25 +96,12 @@ for example applications using routes may use
The .pro file should have the \e location keyword added
-\code
- QT += location
-\endcode
+\code QT += location \endcode
\section2 API Sub-Modules
-The API is split into three core sub-modules, which each have QML and C++
-APIs.
-
-\section3 Positioning
-Positioning includes all the functionality necessary to find and work with geographic
-coordinates. It can use a variety of external sources of information, including GPS. This
-provides us with a coordinate and altitude for the device with additional features
-such as speed and direction. This provides the fundamental location information used in the API.
-\table
-\row
- \li Positioning introduction:
- \li \l{Positioning (QML)}{for QML}
- \li \l{Positioning (C++)}{for C++}
-\endtable
+The API is split into sub-modules, which each have QML and C++ APIs. It focuses on
+Map and Place information. The required position data can be retrieved via the
+\l {QtPositioning} module.
\section3 Places
Places is
diff --git a/src/location/location.pro b/src/location/location.pro
index 5a053632..2ba446b6 100644
--- a/src/location/location.pro
+++ b/src/location/location.pro
@@ -1,54 +1,16 @@
TARGET = QtLocation
-QT = core-private
+QT = core-private positioning
QMAKE_DOCS = $$PWD/doc/qtlocation.qdocconf
OTHER_FILES += doc/src/*.qdoc # show .qdoc files in Qt Creator
PUBLIC_HEADERS += \
- qgeoaddress.h \
- qgeoareamonitor.h \
- qgeoshape.h \
- qgeorectangle.h \
- qgeocircle.h \
- qgeocoordinate.h \
- qgeolocation.h \
- qgeopositioninfo.h \
- qgeopositioninfosource.h \
- qgeosatelliteinfo.h \
- qgeosatelliteinfosource.h \
- qnmeapositioninfosource.h \
- qgeopositioninfosourcefactory.h \
qlocation.h \
qlocationglobal.h
-PRIVATE_HEADERS += \
- qgeoaddress_p.h \
- qgeoshape_p.h \
- qgeorectangle_p.h \
- qgeocircle_p.h \
- qgeolocation_p.h \
- qlocationutils_p.h \
- qnmeapositioninfosource_p.h \
- qgeocoordinate_p.h \
- qgeopositioninfosource_p.h
-
SOURCES += \
- qgeoaddress.cpp \
- qgeoareamonitor.cpp \
- qgeoshape.cpp \
- qgeorectangle.cpp \
- qgeocircle.cpp \
- qgeocoordinate.cpp \
- qgeolocation.cpp \
- qgeopositioninfo.cpp \
- qgeopositioninfosource.cpp \
- qgeosatelliteinfo.cpp \
- qgeosatelliteinfosource.cpp \
- qlocationutils.cpp \
- qnmeapositioninfosource.cpp \
- qgeopositioninfosourcefactory.cpp \
- qlocation.cpp
+ qlocation.cpp
qtHaveModule(3d): include(maps/maps.pri)
include(places/places.pri)
diff --git a/src/location/maps/qgeocodereply.h b/src/location/maps/qgeocodereply.h
index 9d492a0e..1f36633f 100644
--- a/src/location/maps/qgeocodereply.h
+++ b/src/location/maps/qgeocodereply.h
@@ -44,7 +44,9 @@
#include <QtCore/QObject>
#include <QtCore/QList>
-#include <QtLocation/QGeoLocation>
+#include <QtPositioning/QGeoLocation>
+
+#include <QtLocation/qlocationglobal.h>
QT_BEGIN_NAMESPACE
diff --git a/src/location/maps/qgeocodingmanager.h b/src/location/maps/qgeocodingmanager.h
index 94b2d50a..6604c25d 100644
--- a/src/location/maps/qgeocodingmanager.h
+++ b/src/location/maps/qgeocodingmanager.h
@@ -43,7 +43,7 @@
#define QGEOCODINGMANAGER_H
#include <QtLocation/QGeocodeReply>
-#include <QtLocation/QGeoRectangle>
+#include <QtPositioning/QGeoRectangle>
#include <QObject>
#include <QList>
diff --git a/src/location/maps/qgeocodingmanagerengine.cpp b/src/location/maps/qgeocodingmanagerengine.cpp
index 96508e0b..3ba59f68 100644
--- a/src/location/maps/qgeocodingmanagerengine.cpp
+++ b/src/location/maps/qgeocodingmanagerengine.cpp
@@ -45,7 +45,7 @@
#include "qgeoaddress.h"
#include "qgeocoordinate.h"
-#include <QtLocation/QGeoShape>
+#include <QtPositioning/QGeoShape>
QT_BEGIN_NAMESPACE
diff --git a/src/location/maps/qgeocoordinateinterpolator_p.h b/src/location/maps/qgeocoordinateinterpolator_p.h
index 6a6e3a21..1b75bfb4 100644
--- a/src/location/maps/qgeocoordinateinterpolator_p.h
+++ b/src/location/maps/qgeocoordinateinterpolator_p.h
@@ -52,7 +52,8 @@
// We mean it.
//
-#include "qgeocoordinate.h"
+#include <QtPositioning/QGeoCoordinate>
+#include <QtLocation/qlocationglobal.h>
QT_BEGIN_NAMESPACE
diff --git a/src/location/maps/qgeoprojection_p.h b/src/location/maps/qgeoprojection_p.h
index f8b5b32d..4dcf8b4c 100644
--- a/src/location/maps/qgeoprojection_p.h
+++ b/src/location/maps/qgeoprojection_p.h
@@ -56,7 +56,7 @@
#define M_PI (3.14159265358979323846)
#endif
-#include "qglobal.h"
+#include <qglobal.h>
#include <QtLocation/qlocationglobal.h>
QT_BEGIN_NAMESPACE
diff --git a/src/location/maps/qgeoroute.h b/src/location/maps/qgeoroute.h
index 0eb163f9..67287649 100644
--- a/src/location/maps/qgeoroute.h
+++ b/src/location/maps/qgeoroute.h
@@ -42,7 +42,7 @@
#ifndef QGEOROUTE_H
#define QGEOROUTE_H
-#include <QtLocation/QGeoCoordinate>
+#include <QtPositioning/QGeoCoordinate>
#include <QtLocation/QGeoRouteRequest>
#include <QExplicitlySharedDataPointer>
diff --git a/src/location/maps/qgeorouterequest.h b/src/location/maps/qgeorouterequest.h
index 7eb3fcba..bcc7d6ea 100644
--- a/src/location/maps/qgeorouterequest.h
+++ b/src/location/maps/qgeorouterequest.h
@@ -47,7 +47,7 @@
#include <QDateTime>
#include <QtLocation/qlocationglobal.h>
-#include <QtLocation/qgeocoordinate.h>
+#include <QtPositioning/qgeocoordinate.h>
QT_BEGIN_NAMESPACE
diff --git a/src/location/maps/qgeoserviceprovider.cpp b/src/location/maps/qgeoserviceprovider.cpp
index 25784421..dcfe326c 100644
--- a/src/location/maps/qgeoserviceprovider.cpp
+++ b/src/location/maps/qgeoserviceprovider.cpp
@@ -103,8 +103,13 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
Subclasses of QGeoServiceProvider guarantee that the different services
that they provide are interoperable.
- At this point only the Nokia Services plugin is packaged with Qt,
- which is accessible using the provider name "nokia".
+ At this point there are two GeoServices plugins packaged with Qt. They are
+ accessible using their provider names:
+
+ \list
+ \li "osm" -> \l {Qt Location Open Street Map Plugin}{OpenStreetMap}
+ \li "nokia" -> \l {Qt Location Nokia Plugin}{Nokia Services}
+ \endlist
*/
/*!
diff --git a/src/location/maps/qgeoserviceproviderfactory.cpp b/src/location/maps/qgeoserviceproviderfactory.cpp
index 2f282a67..e12e3515 100644
--- a/src/location/maps/qgeoserviceproviderfactory.cpp
+++ b/src/location/maps/qgeoserviceproviderfactory.cpp
@@ -101,6 +101,8 @@ QGeocodingManagerEngine *QGeoServiceProviderFactory::createGeocodingManagerEngin
The default implementation returns 0, which causes a
QGeoServiceProvider::NotSupportedError in QGeoServiceProvider.
+
+ \internal
*/
QGeoMappingManagerEngine *QGeoServiceProviderFactory::createMappingManagerEngine(const QMap<QString, QVariant> &parameters,
QGeoServiceProvider::Error *error,
diff --git a/src/location/places/qplace.h b/src/location/places/qplace.h
index b6eee885..5f5f0597 100644
--- a/src/location/places/qplace.h
+++ b/src/location/places/qplace.h
@@ -43,10 +43,10 @@
#define QPLACE_H
#include <QtCore/QSharedDataPointer>
-#include <QtLocation/QGeoAddress>
-#include <QtLocation/QGeoRectangle>
-#include <QtLocation/QGeoCoordinate>
-#include <QtLocation/QGeoLocation>
+#include <QtPositioning/QGeoAddress>
+#include <QtPositioning/QGeoRectangle>
+#include <QtPositioning/QGeoCoordinate>
+#include <QtPositioning/QGeoLocation>
#include <QtLocation/QPlaceCategory>
#include <QtLocation/QPlaceContent>
#include <QtLocation/QPlaceRatings>
diff --git a/src/location/qgeoaddress.cpp b/src/location/qgeoaddress.cpp
deleted file mode 100644
index 31cec9ab..00000000
--- a/src/location/qgeoaddress.cpp
+++ /dev/null
@@ -1,637 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qgeoaddress.h"
-#include "qgeoaddress_p.h"
-
-#include <QtCore/QStringList>
-
-#ifdef QGEOADDRESS_DEBUG
-#include <QDebug>
-#endif
-
-QT_BEGIN_NAMESPACE
-
-/*
- Combines a list of address parts into a single line.
-
- The parts parameter contains both address elements such as city, state and so on
- as well as separators such as spaces and commas.
-
- It is expected that an element is always followed by a separator and the last
- sepator is usually a new line delimeter.
-
- For example: Springfield, 8900
- would have four parts
- ["Springfield", ", ", "8900", "<br>"]
-
- The addressLine takes care of putting in separators appropriately or leaving
- them out depending on whether the adjacent elements are present or not.
- For example if city were empty in the above scenario the returned string is "8900<br>"
- If the postal code was empty, returned string is "Springfield<br>"
- If both city and postal code were empty, the returned string is "".
-*/
-static QString addressLine(const QStringList &parts)
-{
- QString line;
- Q_ASSERT(parts.count() % 2 == 0);
-
- //iterate until just before the last pair
- QString penultimateSeparator;
- for (int i = 0; i < parts.count() - 2; i += 2) {
- if (!parts.at(i).isEmpty()) {
- line.append(parts.at(i) + parts.at(i + 1));
- penultimateSeparator = parts.at(i + 1);
- }
- }
-
- if (parts.at(parts.count() - 2).isEmpty()) {
- line.chop(penultimateSeparator.length());
-
- if (!line.isEmpty())
- line.append(parts.at(parts.count() - 1));
- } else {
- line.append(parts.at(parts.count() - 2));
- line.append(parts.at(parts.count() - 1));
- }
-
- return line;
-}
-
-/*
- Returns a single formatted string representing the \a address. Lines of the address
- are delimited by \a newLine. By default lines are delimited by <br/>. The \l
- {QGeoAddress::countryCode} {countryCode} of the \a address determines the format of
- the resultant string.
-*/
-static QString formattedAddress(const QGeoAddress &address,
- const QString &newLine = QLatin1String("<br/>"))
-{
- const QString Comma(QLatin1String(", "));
- const QString Dash(QLatin1String("-"));
- const QString Space(QLatin1String(" "));
-
- QString text;
-
- if (address.countryCode() == QLatin1String("ALB")
- || address.countryCode() == QLatin1String("MTQ")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.postalCode() << Comma
- << address.city() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("AND")
- || address.countryCode() == QLatin1String("AUT")
- || address.countryCode() == QLatin1String("FRA")
- || address.countryCode() == QLatin1String("GLP")
- || address.countryCode() == QLatin1String("GUF")
- || address.countryCode() == QLatin1String("ITA")
- || address.countryCode() == QLatin1String("LUX")
- || address.countryCode() == QLatin1String("MCO")
- || address.countryCode() == QLatin1String("REU")
- || address.countryCode() == QLatin1String("RUS")
- || address.countryCode() == QLatin1String("SMR")
- || address.countryCode() == QLatin1String("VAT")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.postalCode() << Space
- << address.city() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("ARE")
- || address.countryCode() == QLatin1String("BHS")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.district() << Space
- << address.city() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("AUS")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << (address.district().isEmpty() ? address.city() : address.district())
- << Space << address.state() << Space << address.postalCode() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("BHR")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.district() << Comma
- << address.city() << Comma << address.state() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("BRA")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.district() << Space
- << address.city() << Dash << address.state() << Space << address.postalCode() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("BRN")
- || address.countryCode() == QLatin1String("JOR")
- || address.countryCode() == QLatin1String("LBN")
- || address.countryCode() == QLatin1String("NZL")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.district() << Space
- << address.city() << Space << address.postalCode() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("CAN")
- || address.countryCode() == QLatin1String("USA")
- || address.countryCode() == QLatin1String("VIR")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.city() << Comma << address.state() << Space
- << address.postalCode() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("CHN")) {
- text += addressLine(QStringList() << address.street() << Comma << address.city() << newLine);
- text += addressLine(QStringList() << address.postalCode() << Space << address.state() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("CHL")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.postalCode() << Space
- << address.district() << Comma << address.city() << Comma
- << address.state() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("CYM")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.state() << Space
- << address.postalCode() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("GBR")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.district() << Comma
- << address.city() << Comma << address.postalCode() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("GIB")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.city() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("HKG")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.district() << newLine);
- text += addressLine(QStringList() << address.city() << newLine);
- } else if (address.countryCode() == QLatin1String("IND")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.city() << Space << address.postalCode() << Space
- << address.state() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("IDN")
- || address.countryCode() == QLatin1String("JEY")
- || address.countryCode() == QLatin1String("LVA")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.city() << Comma << address.postalCode() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("IRL")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.district() << Comma << address.state() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("KWT")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.postalCode() << Comma
- << address.district() << Comma << address.city() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("MLT")
- || address.countryCode() == QLatin1String("SGP")
- || address.countryCode() == QLatin1String("UKR")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.city() << Space << address.postalCode() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("MEX")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.district() << newLine);
- text += addressLine(QStringList() << address.postalCode() << Space << address.city() << Comma
- << address.state() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("MYS")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.postalCode() << Space << address.city() << newLine);
- text += addressLine(QStringList() << address.state() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("OMN")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.district() << Comma
- << address.postalCode() << Comma
- << address.city() << Comma
- << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("PRI")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.district() << Comma << address.city() << Comma
- << address.state() << Comma << address.postalCode() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("QAT")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.district() << Space << address.city() << Comma
- << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("SAU")) {
- text += addressLine(QStringList() << address.street() << Space << address.district() << newLine);
- text += addressLine(QStringList() << address.city() << Space << address.postalCode() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("TWN")) {
- text += addressLine(QStringList() << address.street() << Comma
- << address.district() << Comma << address.city() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("THA")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.district() << Comma << address.city() << Space
- << address.postalCode() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("TUR")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.postalCode() << Space << address.district() << Comma
- << address.city() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("VEN")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.city() << Space << address.postalCode() << Comma
- << address.state() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else if (address.countryCode() == QLatin1String("ZAF")) {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.district() << Comma << address.city() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- } else {
- text += addressLine(QStringList() << address.street() << newLine);
- text += addressLine(QStringList() << address.postalCode() << Space << address.city() << newLine);
- text += addressLine(QStringList() << address.country() << newLine);
- }
-
- text.chop(newLine.length());
- return text;
-}
-
-QGeoAddressPrivate::QGeoAddressPrivate()
- : QSharedData(),
- m_autoGeneratedText(false)
-{
-}
-
-QGeoAddressPrivate::QGeoAddressPrivate(const QGeoAddressPrivate &other)
- : QSharedData(other),
- sCountry(other.sCountry),
- sCountryCode(other.sCountryCode),
- sState(other.sState),
- sCounty(other.sCounty),
- sCity(other.sCity),
- sDistrict(other.sDistrict),
- sStreet(other.sStreet),
- sPostalCode(other.sPostalCode),
- sText(other.sText),
- m_autoGeneratedText(false)
-{
-}
-
-QGeoAddressPrivate::~QGeoAddressPrivate()
-{
-}
-
-/*!
- \class QGeoAddress
- \inmodule QtLocation
- \ingroup QtLocation-positioning
- \ingroup QtLocation-places-data
- \ingroup QtLocation-places
- \since Qt Location 5.0
-
- \brief The QGeoAddress class represents an address of a \l QGeoLocation.
-
- The address' attributes are normalized to US feature names and can be mapped
- to the local feature levels (for example State matches "Bundesland" in Germany).
-
- The address contains a \l text() for displaying purposes and additional
- properties to access the components of an address:
-
- \list
- \li QGeoAddress::country()
- \li QGeoAddress::countryCode()
- \li QGeoAddress::state()
- \li QGeoAddress::city()
- \li QGeoAddress::district()
- \li QGeoAddress::street()
- \li QGeoAddress::postalCode()
- \endlist
-*/
-
-/*!
- Default constructor.
-*/
-QGeoAddress::QGeoAddress()
- : d(new QGeoAddressPrivate)
-{
-}
-
-/*!
- Constructs a copy of \a other.
-*/
-QGeoAddress::QGeoAddress(const QGeoAddress &other)
- : d(other.d)
-{
-}
-
-/*!
- Destroys this address.
-*/
-QGeoAddress::~QGeoAddress()
-{
-}
-
-/*!
- Assigns the given \a address to this address and
- returns a reference to this address.
-*/
-QGeoAddress &QGeoAddress::operator=(const QGeoAddress & address)
-{
- if (this == &address)
- return *this;
-
- d = address.d;
- return *this;
-}
-
-/*!
- Returns true if this address is equal to \a other,
- otherwise returns false.
-*/
-bool QGeoAddress::operator==(const QGeoAddress &other) const
-{
-#ifdef QGEOADDRESS_DEBUG
- qDebug() << "country" << (d->sCountry == other.country());
- qDebug() << "countryCode" << (d->sCountryCode == other.countryCode());
- qDebug() << "state:" << (d->sState == other.state());
- qDebug() << "county:" << (d->sCounty == other.county());
- qDebug() << "city:" << (d->sCity == other.city());
- qDebug() << "district:" << (d->sDistrict == other.district());
- qDebug() << "street:" << (d->sStreet == other.street());
- qDebug() << "postalCode:" << (d->sPostalCode == other.postalCode());
- qDebug() << "text:" << (text() == other.text());
-#endif
-
- return d->sCountry == other.country() &&
- d->sCountryCode == other.countryCode() &&
- d->sState == other.state() &&
- d->sCounty == other.county() &&
- d->sCity == other.city() &&
- d->sDistrict == other.district() &&
- d->sStreet == other.street() &&
- d->sPostalCode == other.postalCode() &&
- this->text() == other.text();
-}
-
-/*!
- \fn bool QGeoAddress::operator!=(const QGeoAddress &other) const
-
- Returns true if this address is not equal to \a other,
- otherwise returns false.
-*/
-
-/*!
- Returns the address as a single formatted string. It is the recommended string
- to use to display the address to the user. It typically takes the format of
- an address as found on an envelope, but this is not always necessarily the case.
-
- The adddress text is either automatically generated or explicitly assigned.
- This can be determined by checking \l {QGeoAddress::isTextGenerated()} {isTextGenerated}.
-
- If an empty string is provided to setText(), then isTextGenerated() will be set
- to true and text() will return a string which is locally formatted according to
- countryCode() and based on the elements of the address such as street, city and so on.
- Because the text string is generated from the address elements, a sequence
- of calls such as text(), setStreet(), text() may return different strings for each
- invocation of text().
-
- If a non-empty string is provided to setText(), then isTextGenerated() will be
- set to false and text() will always return the explicitly assigned string.
- Calls to modify other elements such as setStreet(), setCity() and so on will not
- affect the resultant string from text().
-*/
-QString QGeoAddress::text() const
-{
- if (d->sText.isEmpty())
- return formattedAddress(*this);
- else
- return d->sText;
-}
-
-/*!
- If \a text is not empty, explicitly assigns \a text as the string to be returned by
- text(). isTextGenerated() will return false.
-
- If \a text is empty, indicates that text() should be automatically generated
- from the address elements. isTextGenerated() will return true.
-*/
-void QGeoAddress::setText(const QString &text)
-{
- d->sText = text;
-}
-
-/*!
- Returns the country name.
-*/
-QString QGeoAddress::country() const
-{
- return d->sCountry;
-}
-
-/*!
- Sets the \a country name.
-*/
-void QGeoAddress::setCountry(const QString &country)
-{
- d->sCountry = country;
-}
-
-/*!
- Returns the country code according to ISO 3166-1 alpha-3
-*/
-QString QGeoAddress::countryCode() const
-{
- return d->sCountryCode;
-}
-
-/*!
- Sets the \a countryCode according to ISO 3166-1 alpha-3
-*/
-void QGeoAddress::setCountryCode(const QString &countryCode)
-{
- d->sCountryCode = countryCode;
-}
-
-/*!
- Returns the state. The state is considered the first subdivision below country.
-*/
-QString QGeoAddress::state() const
-{
- return d->sState;
-}
-
-/*!
- Sets the \a state.
-*/
-void QGeoAddress::setState(const QString &state)
-{
- d->sState = state;
-}
-
-/*!
- Returns the county. The county is considered the second subdivision below country.
-*/
-QString QGeoAddress::county() const
-{
- return d->sCounty;
-}
-
-/*!
- Sets the \a county.
-*/
-void QGeoAddress::setCounty(const QString &county)
-{
- d->sCounty = county;
-}
-
-/*!
- Returns the city.
-*/
-QString QGeoAddress::city() const
-{
- return d->sCity;
-}
-
-/*!
- Sets the \a city.
-*/
-void QGeoAddress::setCity(const QString &city)
-{
- d->sCity = city;
-}
-
-/*!
- Returns the district. The district is considered the subdivison below city.
-*/
-QString QGeoAddress::district() const
-{
- return d->sDistrict;
-}
-
-/*!
- Sets the \a district.
-*/
-void QGeoAddress::setDistrict(const QString &district)
-{
- d->sDistrict = district;
-}
-
-/*!
- Returns the street-level component of the address.
-
- This typically includes a street number and street name
- but may also contain things like a unit number, a building
- name, or anything else that might be used to
- distinguish one address from another.
-*/
-QString QGeoAddress::street() const
-{
- return d->sStreet;
-}
-
-/*!
- Sets the street-level component of the address to \a street.
-
- This typically includes a street number and street name
- but may also contain things like a unit number, a building
- name, or anything else that might be used to
- distinguish one address from another.
-*/
-void QGeoAddress::setStreet(const QString &street)
-{
- d->sStreet = street;
-}
-
-/*!
- Returns the postal code.
-*/
-QString QGeoAddress::postalCode() const
-{
- return d->sPostalCode;
-}
-
-/*!
- Sets the \a postalCode.
-*/
-void QGeoAddress::setPostalCode(const QString &postalCode)
-{
- d->sPostalCode = postalCode;
-}
-
-/*!
- Returns whether this address is empty. An address is considered empty
- if \e all of its fields are empty.
-*/
-bool QGeoAddress::isEmpty() const
-{
- return d->sCountry.isEmpty() &&
- d->sCountryCode.isEmpty() &&
- d->sState.isEmpty() &&
- d->sCounty.isEmpty() &&
- d->sCity.isEmpty() &&
- d->sDistrict.isEmpty() &&
- d->sStreet.isEmpty() &&
- d->sPostalCode.isEmpty() &&
- d->sText.isEmpty();
-
-}
-
-/*!
- Clears all of the address' data fields.
-*/
-void QGeoAddress::clear()
-{
- d->sCountry.clear();
- d->sCountryCode.clear();
- d->sState.clear();
- d->sCounty.clear();
- d->sCity.clear();
- d->sDistrict.clear();
- d->sStreet.clear();
- d->sPostalCode.clear();
- d->sText.clear();
-}
-
-/*!
- Returns true if QGeoAddress::text() is automatically generated from address elements,
- otherwise returns false if text() has been explicitly assigned.
-
- \sa text(), setText()
-*/
-bool QGeoAddress::isTextGenerated() const
-{
- return d->sText.isEmpty();
-}
-
-QT_END_NAMESPACE
-
diff --git a/src/location/qgeoaddress.h b/src/location/qgeoaddress.h
deleted file mode 100644
index c82f824b..00000000
--- a/src/location/qgeoaddress.h
+++ /dev/null
@@ -1,108 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGEOADDRESS_H
-#define QGEOADDRESS_H
-
-#include <QtCore/QMetaType>
-#include <QtCore/QSharedDataPointer>
-#include <QtLocation/qlocationglobal.h>
-
-QT_BEGIN_NAMESPACE
-
-class QString;
-class QGeoAddressPrivate;
-class Q_LOCATION_EXPORT QGeoAddress
-{
-public:
- QGeoAddress();
- QGeoAddress(const QGeoAddress &other);
- ~QGeoAddress();
-
- QGeoAddress &operator=(const QGeoAddress &other);
- bool operator==(const QGeoAddress &other) const;
- bool operator!=(const QGeoAddress &other) const {
- return !(other == *this);
- }
-
- QString text() const;
- void setText(const QString &text);
-
- QString country() const;
- void setCountry(const QString &country);
-
- QString countryCode() const;
- void setCountryCode(const QString &countryCode);
-
- QString state() const;
- void setState(const QString &state);
-
- QString county() const;
- void setCounty(const QString &county);
-
- QString city() const;
- void setCity(const QString &city);
-
- QString district() const;
- void setDistrict(const QString &district);
-
- QString postalCode() const;
- void setPostalCode(const QString &postalCode);
-
- QString street() const;
- void setStreet(const QString &street);
-
- bool isEmpty() const;
- void clear();
-
- bool isTextGenerated() const;
-
-private:
- QSharedDataPointer<QGeoAddressPrivate> d;
-};
-
-Q_DECLARE_TYPEINFO(QGeoAddress, Q_MOVABLE_TYPE);
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(QGeoAddress)
-
-#endif
diff --git a/src/location/qgeoaddress_p.h b/src/location/qgeoaddress_p.h
deleted file mode 100644
index 5135e8c2..00000000
--- a/src/location/qgeoaddress_p.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QLOCATION_GEOADDRESS_P_H
-#define QLOCATION_GEOADDRESS_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QString>
-#include <QSharedData>
-
-QT_BEGIN_NAMESPACE
-
-class QGeoAddressPrivate : public QSharedData
-{
-public:
- QGeoAddressPrivate();
- QGeoAddressPrivate(const QGeoAddressPrivate &other);
- ~QGeoAddressPrivate();
-
- QString sCountry; //!< country field
- QString sCountryCode; //!< country code field
- QString sState; //!< state field
- QString sCounty; //!< county field
- QString sCity; //!< city field
- QString sDistrict; //!< district field
- QString sStreet; //!< street name field
- QString sPostalCode; //!< postal code field
- QString sText;
- bool m_autoGeneratedText;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/location/qgeoareamonitor.cpp b/src/location/qgeoareamonitor.cpp
deleted file mode 100644
index 7462e1df..00000000
--- a/src/location/qgeoareamonitor.cpp
+++ /dev/null
@@ -1,256 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include <qgeoareamonitor.h>
-#include "qgeopositioninfosourcefactory.h"
-#include "qgeopositioninfosource_p.h"
-
-/*!
- \class QGeoAreaMonitor
- \inmodule QtLocation
- \ingroup QtLocation-positioning
- \since Qt Location 5.0
-
- \brief The QGeoAreaMonitor class enables the detection of proximity
- changes for a specified set of coordinates.
-
- A QGeoAreaMonitor emits signals when the current position is in
- range, or has moved out of range, of a specified circular area.
- The area is specified by a coordinate (the center point) and a
- radius (in meters).
-
- For example:
-
- \code
- public:
- MyClass::MyClass()
- {
- QGeoAreaMonitor *monitor = QGeoAreaMonitor::createDefaultMonitor();
- if (monitor) {
- connect(monitor, SIGNAL(areaEntered(QGeoPositionInfo)),
- this, SLOT(areaEntered(QGeoPositionInfo)));
- connect(monitor, SIGNAL(areaExited(QGeoPositionInfo)),
- this, SLOT(areaExited(QGeoPositionInfo)));
-
- QGeoCoordinate bigBenLocation(51.50104, -0.124632);
- monitor->setCenter(bigBenLocation);
- monitor->setRadius(100);
- } else {
- qDebug() << "Could not create default area monitor";
- }
- }
-
- public Q_SLOTS:
- void areaEntered(const QGeoPositionInfo &update)
- {
- qDebug() << "Now within 100 meters, current position is" << update.coordinate();
- }
-
- void areaExited(const QGeoPositionInfo &update)
- {
- qDebug() << "No longer within 100 meters, current position is" << update.coordinate();
- }
- \endcode
-*/
-
-QT_BEGIN_NAMESPACE
-
-class QGeoAreaMonitorPrivate
-{
-public:
- QGeoCoordinate coord;
- qreal radius;
-};
-
-
-/*!
- Creates a monitor with the given \a parent.
-*/
-QGeoAreaMonitor::QGeoAreaMonitor(QObject *parent)
- : QObject(parent),
- d(new QGeoAreaMonitorPrivate)
-{
- d->radius = qreal(0.0);
-}
-
-/*!
- Destroys the monitor.
-*/
-QGeoAreaMonitor::~QGeoAreaMonitor()
-{
- delete d;
-}
-
-/*!
- \property QGeoAreaMonitor::center
- \brief holds the center of the area to be monitored.
-
- When the center is set, if the radius has already been set and
- the current position is within the monitored area, areaEntered()
- is emitted immediately.
-
- By default, contains an invalid coordinate.
-
- Note: Subclass implementations must call the base implementation of
- setCenter() so that center() returns the correct value.
-*/
-void QGeoAreaMonitor::setCenter(const QGeoCoordinate &coordinate)
-{
- d->coord = coordinate;
-}
-
-QGeoCoordinate QGeoAreaMonitor::center() const
-{
- return d->coord;
-}
-
-/*!
- \property QGeoAreaMonitor::radius
- \brief holds the radius of the area to be monitored, in meters.
-
- If the specified radius is less than the minimum supported radius, the
- radius is set to the minimum radius.
-
- When this property is set, if the center coordinate has already been set and
- the current position is within the monitored area, areaEntered()
- is emitted immediately.
-
- By default, this property is 0.
-
- Note: Subclass implementations must call the base implementation of
- setRadius() so that radius() returns the correct value.
-*/
-void QGeoAreaMonitor::setRadius(qreal radius)
-{
- d->radius = radius;
-}
-
-qreal QGeoAreaMonitor::radius() const
-{
- return d->radius;
-}
-
-/*!
- Creates and returns a monitor with the given \a parent that
- monitors areas using resources on the underlying system.
-
- Returns 0 if the system has no support for position monitoring.
-*/
-QGeoAreaMonitor *QGeoAreaMonitor::createDefaultMonitor(QObject *parent)
-{
- QList<QJsonObject> plugins = QGeoPositionInfoSourcePrivate::pluginsSorted();
- foreach (const QJsonObject &obj, plugins) {
- if (obj.value(QStringLiteral("Monitor")).isBool()
- && obj.value(QStringLiteral("Monitor")).toBool())
- {
- QGeoPositionInfoSourcePrivate d;
- d.metaData = obj;
- d.loadPlugin();
- QGeoAreaMonitor *s = 0;
- if (d.factory)
- s = d.factory->areaMonitor(parent);
- return s;
- }
- }
-
- return 0;
-}
-
-/*!
- Creates and returns a monitor with the given \a parent,
- by loading the plugin named \a sourceName.
-
- Returns 0 if the plugin cannot be found.
-*/
-QGeoAreaMonitor *QGeoAreaMonitor::createMonitor(const QString &sourceName, QObject *parent)
-{
- QHash<QString, QJsonObject> plugins = QGeoPositionInfoSourcePrivate::plugins();
- if (plugins.contains(sourceName)) {
- QGeoPositionInfoSourcePrivate d;
- d.metaData = plugins.value(sourceName);
- d.loadPlugin();
- QGeoAreaMonitor *s = 0;
- if (d.factory)
- s = d.factory->areaMonitor(parent);
- return s;
- }
-
- return 0;
-}
-
-/*!
- Returns a list of available monitor plugins, including the default system
- backend if one is available.
-*/
-QStringList QGeoAreaMonitor::availableMonitors()
-{
- QStringList plugins;
- QHash<QString, QJsonObject> meta = QGeoPositionInfoSourcePrivate::plugins();
- foreach (const QString &name, meta.keys()) {
- if (meta.value(name).value(QStringLiteral("Monitor")).isBool()
- && meta.value(name).value(QStringLiteral("Monitor")).toBool()) {
- plugins << name;
- }
- }
-
- return plugins;
-}
-
-
-
-/*!
- \fn void QGeoAreaMonitor::areaEntered(const QGeoPositionInfo &update);
-
- Emitted when the current position has moved from a position outside the
- monitored area to a position within the monitored area.
-
- The \a update holds the new position.
-*/
-
-/*!
- \fn void QGeoAreaMonitor::areaExited(const QGeoPositionInfo &update);
-
- Emitted when the current position has moved from a position within the
- monitored area to a position outside the monitored area.
-
- The \a update holds the new position.
-*/
-
-QT_END_NAMESPACE
diff --git a/src/location/qgeoareamonitor.h b/src/location/qgeoareamonitor.h
deleted file mode 100644
index 62438d0b..00000000
--- a/src/location/qgeoareamonitor.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QGEOAREAMONITOR_H
-#define QGEOAREAMONITOR_H
-
-#include <QtLocation/QGeoCoordinate>
-
-#include <QObject>
-#include <QStringList>
-
-QT_BEGIN_NAMESPACE
-
-class QGeoPositionInfo;
-class QGeoAreaMonitorPrivate;
-class Q_LOCATION_EXPORT QGeoAreaMonitor : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QGeoCoordinate center READ center WRITE setCenter)
- Q_PROPERTY(qreal radius READ radius WRITE setRadius)
-
-public:
- explicit QGeoAreaMonitor(QObject *parent);
- virtual ~QGeoAreaMonitor() = 0;
-
- virtual void setCenter(const QGeoCoordinate &coordinate);
- QGeoCoordinate center() const;
-
- virtual void setRadius(qreal radius);
- qreal radius() const;
-
- static QGeoAreaMonitor *createDefaultMonitor(QObject *parent);
- static QGeoAreaMonitor *createMonitor(const QString& sourceName, QObject *parent);
- static QStringList availableMonitors();
-
-Q_SIGNALS:
- void areaEntered(const QGeoPositionInfo &update);
- void areaExited(const QGeoPositionInfo &update);
-
-private:
- Q_DISABLE_COPY(QGeoAreaMonitor)
- QGeoAreaMonitorPrivate *d;
-};
-
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/location/qgeocircle.cpp b/src/location/qgeocircle.cpp
deleted file mode 100644
index 6c77d934..00000000
--- a/src/location/qgeocircle.cpp
+++ /dev/null
@@ -1,311 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qgeocircle.h"
-#include "qgeocircle_p.h"
-
-#include "qgeocoordinate.h"
-#include "qnumeric.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGeoCircle
- \inmodule QtLocation
- \ingroup QtLocation-positioning
- \since Qt Location 5.0
-
- \brief The QGeoCircle class defines a circular geographic area.
-
- The circle is defined in terms of a QGeoCoordinate which specifies the
- center of the circle and a qreal which specifies the radius of the circle
- in meters.
-
- The circle is considered invalid if the center coordinate is invalid
- or if the radius is less than zero.
-*/
-
-#ifdef Q_NO_USING_KEYWORD
-/*!
- \fn bool QGeoCircle::operator==(const QGeoShape &other) const
-
- Returns true if \a other is equal to this geo circle; otherwise returns false.
-*/
-
-/*!
- \fn bool QGeoCircle::operator!=(const QGeoShape &other) const
-
- Returns true if \a other is not equal to this geo circle; otherwise returns false.
-*/
-#endif
-
-inline QGeoCirclePrivate *QGeoCircle::d_func()
-{
- return static_cast<QGeoCirclePrivate *>(d_ptr.data());
-}
-
-inline const QGeoCirclePrivate *QGeoCircle::d_func() const
-{
- return static_cast<const QGeoCirclePrivate *>(d_ptr.constData());
-}
-
-/*!
- Constructs a new, invalid geo circle.
-*/
-QGeoCircle::QGeoCircle()
-: QGeoShape(new QGeoCirclePrivate)
-{
-}
-
-/*!
- Constructs a new geo circle centered at \a center and with a radius of \a radius meters.
-*/
-QGeoCircle::QGeoCircle(const QGeoCoordinate &center, qreal radius)
-{
- d_ptr = new QGeoCirclePrivate(center, radius);
-}
-
-/*!
- Constructs a new geo circle from the contents of \a other.
-*/
-QGeoCircle::QGeoCircle(const QGeoCircle &other)
-: QGeoShape(other)
-{
-}
-
-/*!
- Constructs a new geo circle from the contents of \a other.
-*/
-QGeoCircle::QGeoCircle(const QGeoShape &other)
-: QGeoShape(other)
-{
- if (type() != QGeoShape::CircleType)
- d_ptr = new QGeoCirclePrivate;
-}
-
-/*!
- Destroys this geo circle.
-*/
-QGeoCircle::~QGeoCircle() {}
-
-/*!
- Assigns \a other to this geo circle and returns a reference to this geo circle.
-*/
-QGeoCircle &QGeoCircle::operator=(const QGeoCircle &other)
-{
- QGeoShape::operator=(other);
- return *this;
-}
-
-/*!
- Returns whether this geo circle is equal to \a other.
-*/
-bool QGeoCircle::operator==(const QGeoCircle &other) const
-{
- Q_D(const QGeoCircle);
-
- return *d == *other.d_func();
-}
-
-/*!
- Returns whether this geo circle is not equal to \a other.
-*/
-bool QGeoCircle::operator!=(const QGeoCircle &other) const
-{
- Q_D(const QGeoCircle);
-
- return !(*d == *other.d_func());
-}
-
-bool QGeoCirclePrivate::isValid() const
-{
- return center.isValid() && !qIsNaN(radius) && radius >= -1e-7;
-}
-
-bool QGeoCirclePrivate::isEmpty() const
-{
- return !isValid() || radius <= 1e-7;
-}
-
-/*!
- Sets the center coordinate of this geo circle to \a center.
-*/
-void QGeoCircle::setCenter(const QGeoCoordinate &center)
-{
- Q_D(QGeoCircle);
-
- d->center = center;
-}
-
-/*!
- Returns the center coordinate of this geo circle.
-*/
-QGeoCoordinate QGeoCircle::center() const
-{
- Q_D(const QGeoCircle);
-
- return d->center;
-}
-
-/*!
- Sets the radius in meters of this geo circle to \a radius.
-*/
-void QGeoCircle::setRadius(qreal radius)
-{
- Q_D(QGeoCircle);
-
- d->radius = radius;
-}
-
-/*!
- Returns the radius in meters of this geo circle.
-*/
-qreal QGeoCircle::radius() const
-{
- Q_D(const QGeoCircle);
-
- return d->radius;
-}
-
-bool QGeoCirclePrivate::contains(const QGeoCoordinate &coordinate) const
-{
- if (!isValid() || !coordinate.isValid())
- return false;
-
- return center.distanceTo(coordinate) <= radius;
-}
-
-/*!
- Translates this geo circle by \a degreesLatitude northwards and \a degreesLongitude eastwards.
-
- Negative values of \a degreesLatitude and \a degreesLongitude correspond to
- southward and westward translation respectively.
-*/
-void QGeoCircle::translate(double degreesLatitude, double degreesLongitude)
-{
- // TODO handle dlat, dlon larger than 360 degrees
-
- Q_D(QGeoCircle);
-
- double lat = d->center.latitude();
- double lon = d->center.longitude();
-
- lat += degreesLatitude;
- lon += degreesLongitude;
-
- if (lon < -180.0)
- lon += 360.0;
- if (lon > 180.0)
- lon -= 360.0;
-
- if (lat > 90.0) {
- lat = 180.0 - lat;
- if (lon < 0.0)
- lon = 180.0;
- else
- lon -= 180;
- }
-
- if (lat < -90.0) {
- lat = 180.0 + lat;
- if (lon < 0.0)
- lon = 180.0;
- else
- lon -= 180;
- }
-
- d->center = QGeoCoordinate(lat, lon);
-}
-
-/*!
- Returns a copy of this geo circle translated by \a degreesLatitude northwards and
- \a degreesLongitude eastwards.
-
- Negative values of \a degreesLatitude and \a degreesLongitude correspond to
- southward and westward translation respectively.
-
- \sa translate()
-*/
-QGeoCircle QGeoCircle::translated(double degreesLatitude, double degreesLongitude) const
-{
- QGeoCircle result(*this);
- result.translate(degreesLatitude, degreesLongitude);
- return result;
-}
-
-/*******************************************************************************
-*******************************************************************************/
-
-QGeoCirclePrivate::QGeoCirclePrivate()
-: QGeoShapePrivate(QGeoShape::CircleType), radius(-1.0)
-{
-}
-
-QGeoCirclePrivate::QGeoCirclePrivate(const QGeoCoordinate &center, qreal radius)
-: QGeoShapePrivate(QGeoShape::CircleType), center(center), radius(radius)
-{
-}
-
-QGeoCirclePrivate::QGeoCirclePrivate(const QGeoCirclePrivate &other)
-: QGeoShapePrivate(QGeoShape::CircleType), center(other.center),
- radius(other.radius)
-{
-}
-
-QGeoCirclePrivate::~QGeoCirclePrivate() {}
-
-QGeoShapePrivate *QGeoCirclePrivate::clone() const
-{
- return new QGeoCirclePrivate(*this);
-}
-
-bool QGeoCirclePrivate::operator==(const QGeoShapePrivate &other) const
-{
- if (!QGeoShapePrivate::operator==(other))
- return false;
-
- const QGeoCirclePrivate &otherCircle = static_cast<const QGeoCirclePrivate &>(other);
-
- return radius == otherCircle.radius && center == otherCircle.center;
-}
-
-QT_END_NAMESPACE
-
diff --git a/src/location/qgeocircle.h b/src/location/qgeocircle.h
deleted file mode 100644
index 158a48a6..00000000
--- a/src/location/qgeocircle.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGEOCIRCLE_H
-#define QGEOCIRCLE_H
-
-#include <QtLocation/QGeoShape>
-
-QT_BEGIN_NAMESPACE
-
-class QGeoCoordinate;
-class QGeoCirclePrivate;
-
-class Q_LOCATION_EXPORT QGeoCircle : public QGeoShape
-{
-public:
- QGeoCircle();
- QGeoCircle(const QGeoCoordinate &center, qreal radius = -1.0);
- QGeoCircle(const QGeoCircle &other);
- QGeoCircle(const QGeoShape &other);
-
- ~QGeoCircle();
-
- QGeoCircle &operator=(const QGeoCircle &other);
-
-#ifdef Q_NO_USING_KEYWORD
- bool operator==(const QGeoShape &other) const
- {
- return QGeoShape::operator==(other);
- }
-#else
- using QGeoShape::operator==;
-#endif
- bool operator==(const QGeoCircle &other) const;
-
-#ifdef Q_NO_USING_KEYWORD
- bool operator!=(const QGeoShape &other) const
- {
- return QGeoShape::operator!=(other);
- }
-#else
- using QGeoShape::operator!=;
-#endif
- bool operator!=(const QGeoCircle &other) const;
-
- void setCenter(const QGeoCoordinate &center);
- QGeoCoordinate center() const;
-
- void setRadius(qreal radius);
- qreal radius() const;
-
- void translate(double degreesLatitude, double degreesLongitude);
- QGeoCircle translated(double degreesLatitude, double degreesLongitude) const;
-
-private:
- inline QGeoCirclePrivate *d_func();
- inline const QGeoCirclePrivate *d_func() const;
-};
-
-Q_DECLARE_TYPEINFO(QGeoCircle, Q_MOVABLE_TYPE);
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(QGeoCircle)
-
-#endif
-
diff --git a/src/location/qgeocircle_p.h b/src/location/qgeocircle_p.h
deleted file mode 100644
index 065a1276..00000000
--- a/src/location/qgeocircle_p.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGEOCIRCLE_P_H
-#define QGEOCIRCLE_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qgeoshape_p.h"
-#include "qgeocoordinate.h"
-
-QT_BEGIN_NAMESPACE
-
-class QGeoCirclePrivate : public QGeoShapePrivate
-{
-public:
- QGeoCirclePrivate();
- QGeoCirclePrivate(const QGeoCoordinate &center, qreal radius);
- QGeoCirclePrivate(const QGeoCirclePrivate &other);
- ~QGeoCirclePrivate();
-
- bool isValid() const;
- bool isEmpty() const;
- bool contains(const QGeoCoordinate &coordinate) const;
-
- QGeoShapePrivate *clone() const;
-
- bool operator==(const QGeoShapePrivate &other) const;
-
- QGeoCoordinate center;
- qreal radius;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/location/qgeocoordinate.cpp b/src/location/qgeocoordinate.cpp
deleted file mode 100644
index c2b2bb50..00000000
--- a/src/location/qgeocoordinate.cpp
+++ /dev/null
@@ -1,644 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "qgeocoordinate.h"
-#include "qgeocoordinate_p.h"
-#include "qlocationutils_p.h"
-
-#include <QDateTime>
-#include <QHash>
-#include <QDataStream>
-#include <QDebug>
-#include <qnumeric.h>
-
-#include <math.h>
-
-#include <QDebug>
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-QT_BEGIN_NAMESPACE
-
-static const double qgeocoordinate_EARTH_MEAN_RADIUS = 6371.0072;
-
-inline static double qgeocoordinate_degToRad(double deg)
-{
- return deg * M_PI / 180;
-}
-inline static double qgeocoordinate_radToDeg(double rad)
-{
- return rad * 180 / M_PI;
-}
-
-
-QGeoCoordinatePrivate::QGeoCoordinatePrivate() {
- lat = qQNaN();
- lng = qQNaN();
- alt = qQNaN();
-}
-
-QGeoCoordinatePrivate::QGeoCoordinatePrivate(const QGeoCoordinatePrivate &other)
- : QSharedData(other),
- lat(other.lat),
- lng(other.lng),
- alt(other.alt)
-{}
-
-QGeoCoordinatePrivate::~QGeoCoordinatePrivate()
-{}
-
-
-/*!
- \class QGeoCoordinate
- \inmodule QtLocation
- \ingroup QtLocation-positioning
- \since Qt Location 5.0
-
- \brief The QGeoCoordinate class defines a geographical position on the surface of the Earth.
-
- A QGeoCoordinate is defined by latitude, longitude, and optionally, altitude.
-
- Use type() to determine whether a coordinate is a 2D coordinate (has
- latitude and longitude only) or 3D coordinate (has latitude, longitude
- and altitude). Use distanceTo() and azimuthTo() to calculate the distance
- and bearing between coordinates.
-
- The coordinate values should be specified using the WGS84 datum. For more information
- on geographical terms see this article on \l {http://en.wikipedia.org/wiki/Geographic_coordinate_system}{coordinates} and
- another on \l {http://en.wikipedia.org/wiki/Geodetic_system}{geodetic systems}
- including WGS84.
-
- Azimuth in this context is equivalent to a compass bearing based on true north.
-*/
-
-/*!
- \enum QGeoCoordinate::CoordinateType
- Defines the types of a coordinate.
-
- \value InvalidCoordinate An invalid coordinate. A coordinate is invalid if its latitude or longitude values are invalid.
- \value Coordinate2D A coordinate with valid latitude and longitude values.
- \value Coordinate3D A coordinate with valid latitude and longitude values, and also an altitude value.
-*/
-
-/*!
- \enum QGeoCoordinate::CoordinateFormat
- Defines the possible formatting options for toString().
-
- \value Degrees Returns a string representation of the coordinates in decimal degrees format.
- \value DegreesWithHemisphere Returns a string representation of the coordinates in decimal degrees format, using 'N', 'S', 'E' or 'W' to indicate the hemispheres of the coordinates.
- \value DegreesMinutes Returns a string representation of the coordinates in degrees-minutes format.
- \value DegreesMinutesWithHemisphere Returns a string representation of the coordinates in degrees-minutes format, using 'N', 'S', 'E' or 'W' to indicate the hemispheres of the coordinates.
- \value DegreesMinutesSeconds Returns a string representation of the coordinates in degrees-minutes-seconds format.
- \value DegreesMinutesSecondsWithHemisphere Returns a string representation of the coordinates in degrees-minutes-seconds format, using 'N', 'S', 'E' or 'W' to indicate the hemispheres of the coordinates.
-
- \sa toString()
-*/
-
-
-/*!
- Constructs a coordinate. The coordinate will be invalid until
- setLatitude() and setLongitude() have been called.
-*/
-QGeoCoordinate::QGeoCoordinate()
- : d(new QGeoCoordinatePrivate)
-{
-}
-
-/*!
- Constructs a coordinate with the given \a latitude and \a longitude.
-
- If the latitude is not between -90 to 90 inclusive, or the longitude
- is not between -180 to 180 inclusive, none of the values are set and
- the type() will be QGeoCoordinate::InvalidCoordinate.
-
- \sa isValid()
-*/
-QGeoCoordinate::QGeoCoordinate(double latitude, double longitude)
- : d(new QGeoCoordinatePrivate)
-{
- if (QLocationUtils::isValidLat(latitude) && QLocationUtils::isValidLong(longitude)) {
- d->lat = latitude;
- d->lng = longitude;
- }
-}
-
-/*!
- Constructs a coordinate with the given \a latitude, \a longitude
- and \a altitude.
-
- If the latitude is not between -90 to 90 inclusive, or the longitude
- is not between -180 to 180 inclusive, none of the values are set and
- the type() will be QGeoCoordinate::InvalidCoordinate.
-
- Note that \a altitude specifies the meters above sea level.
-
- \sa isValid()
-*/
-QGeoCoordinate::QGeoCoordinate(double latitude, double longitude, double altitude)
- : d(new QGeoCoordinatePrivate)
-{
- if (QLocationUtils::isValidLat(latitude) && QLocationUtils::isValidLong(longitude)) {
- d->lat = latitude;
- d->lng = longitude;
- d->alt = altitude;
- }
-}
-
-/*!
- Constructs a coordinate from the contents of \a other.
-*/
-QGeoCoordinate::QGeoCoordinate(const QGeoCoordinate &other)
- : d(other.d)
-{}
-
-/*!
- Assigns \a other to this coordinate and returns a reference to this coordinate.
-*/
-QGeoCoordinate &QGeoCoordinate::operator=(const QGeoCoordinate &other)
-{
- if (this == &other)
- return *this;
-
- d = other.d;
- return (*this);
-}
-
-/*!
- Destroys the coordinate object.
-*/
-QGeoCoordinate::~QGeoCoordinate()
-{
-}
-
-/*!
- Returns true if the latitude, longitude and altitude of this
- coordinate are the same as those of \a other.
-
- The longitude will be ignored if the latitude is +/- 90 degrees.
-*/
-bool QGeoCoordinate::operator==(const QGeoCoordinate &other) const
-{
- bool latEqual = (qIsNaN(d->lat) && qIsNaN(other.d->lat))
- || qFuzzyCompare(d->lat, other.d->lat);
- bool lngEqual = (qIsNaN(d->lng) && qIsNaN(other.d->lng))
- || qFuzzyCompare(d->lng, other.d->lng);
- bool altEqual = (qIsNaN(d->alt) && qIsNaN(other.d->alt))
- || qFuzzyCompare(d->alt, other.d->alt);
-
- if (!qIsNaN(d->lat) && ((d->lat == 90.0) || (d->lat == -90.0)))
- lngEqual = true;
-
- return (latEqual && lngEqual && altEqual);
-}
-
-/*!
- \fn bool QGeoCoordinate::operator!=(const QGeoCoordinate &other) const;
-
- Returns true if the latitude, longitude or altitude of this
- coordinate are not the same as those of \a other.
-*/
-
-/*!
- Returns true if the type() is Coordinate2D or Coordinate3D.
-*/
-bool QGeoCoordinate::isValid() const
-{
- CoordinateType t = type();
- return t == Coordinate2D || t == Coordinate3D;
-}
-
-/*!
- Returns the type of this coordinate.
-*/
-QGeoCoordinate::CoordinateType QGeoCoordinate::type() const
-{
- if (QLocationUtils::isValidLat(d->lat)
- && QLocationUtils::isValidLong(d->lng)) {
- if (qIsNaN(d->alt))
- return Coordinate2D;
- return Coordinate3D;
- }
- return InvalidCoordinate;
-}
-
-
-/*!
- Returns the latitude, in decimal degrees. The return value is undefined
- if the latitude has not been set.
-
- A positive latitude indicates the Northern Hemisphere, and a negative
- latitude indicates the Southern Hemisphere.
-
- \sa setLatitude(), type()
-*/
-double QGeoCoordinate::latitude() const
-{
- return d->lat;
-}
-
-/*!
- Sets the latitude (in decimal degrees) to \a latitude. The value should
- be in the WGS84 datum.
-
- To be valid, the latitude must be between -90 to 90 inclusive.
-
- \sa latitude()
-*/
-void QGeoCoordinate::setLatitude(double latitude)
-{
- d->lat = latitude;
-}
-
-/*!
- Returns the longitude, in decimal degrees. The return value is undefined
- if the longitude has not been set.
-
- A positive longitude indicates the Eastern Hemisphere, and a negative
- longitude indicates the Western Hemisphere.
-
- \sa setLongitude(), type()
-*/
-double QGeoCoordinate::longitude() const
-{
- return d->lng;
-}
-
-/*!
- Sets the longitude (in decimal degrees) to \a longitude. The value should
- be in the WGS84 datum.
-
- To be valid, the longitude must be between -180 to 180 inclusive.
-
- \sa longitude()
-*/
-void QGeoCoordinate::setLongitude(double longitude)
-{
- d->lng = longitude;
-}
-
-/*!
- Returns the altitude (meters above sea level).
-
- The return value is undefined if the altitude has not been set.
-
- \sa setAltitude(), type()
-*/
-double QGeoCoordinate::altitude() const
-{
- return d->alt;
-}
-
-/*!
- Sets the altitude (meters above sea level) to \a altitude.
-
- \sa altitude()
-*/
-void QGeoCoordinate::setAltitude(double altitude)
-{
- d->alt = altitude;
-}
-
-/*!
- Returns the distance (in meters) from this coordinate to the coordinate
- specified by \a other. Altitude is not used in the calculation.
-
- This calculation returns the great-circle distance between the two
- coordinates, with an assumption that the Earth is spherical for the
- purpose of this calculation.
-
- Returns 0 if the type of this coordinate or the type of \a other is
- QGeoCoordinate::InvalidCoordinate.
-*/
-qreal QGeoCoordinate::distanceTo(const QGeoCoordinate &other) const
-{
- if (type() == QGeoCoordinate::InvalidCoordinate
- || other.type() == QGeoCoordinate::InvalidCoordinate) {
- return 0;
- }
-
- // Haversine formula
- double dlat = qgeocoordinate_degToRad(other.d->lat - d->lat);
- double dlon = qgeocoordinate_degToRad(other.d->lng - d->lng);
- double haversine_dlat = sin(dlat / 2.0);
- haversine_dlat *= haversine_dlat;
- double haversine_dlon = sin(dlon / 2.0);
- haversine_dlon *= haversine_dlon;
- double y = haversine_dlat
- + cos(qgeocoordinate_degToRad(d->lat))
- * cos(qgeocoordinate_degToRad(other.d->lat))
- * haversine_dlon;
- double x = 2 * asin(sqrt(y));
- return qreal(x * qgeocoordinate_EARTH_MEAN_RADIUS * 1000);
-}
-
-/*!
- Returns the azimuth (or bearing) in degrees from this coordinate to the
- coordinate specified by \a other. Altitude is not used in the calculation.
-
- The bearing returned is the bearing from the origin to \a other along the
- great-circle between the two coordinates. There is an assumption that the
- Earth is spherical for the purpose of this calculation.
-
- Returns 0 if the type of this coordinate or the type of \a other is
- QGeoCoordinate::InvalidCoordinate.
-*/
-qreal QGeoCoordinate::azimuthTo(const QGeoCoordinate &other) const
-{
- if (type() == QGeoCoordinate::InvalidCoordinate
- || other.type() == QGeoCoordinate::InvalidCoordinate) {
- return 0;
- }
-
- double dlon = qgeocoordinate_degToRad(other.d->lng - d->lng);
- double lat1Rad = qgeocoordinate_degToRad(d->lat);
- double lat2Rad = qgeocoordinate_degToRad(other.d->lat);
-
- double y = sin(dlon) * cos(lat2Rad);
- double x = cos(lat1Rad) * sin(lat2Rad) - sin(lat1Rad) * cos(lat2Rad) * cos(dlon);
-
- double whole;
- double fraction = modf(qgeocoordinate_radToDeg(atan2(y, x)), &whole);
- return qreal((int(whole + 360) % 360) + fraction);
-}
-
-void QGeoCoordinatePrivate::atDistanceAndAzimuth(const QGeoCoordinate &coord,
- qreal distance, qreal azimuth,
- double *lon, double *lat)
-{
- double latRad = qgeocoordinate_degToRad(coord.d->lat);
- double lonRad = qgeocoordinate_degToRad(coord.d->lng);
- double cosLatRad = cos(latRad);
- double sinLatRad = sin(latRad);
-
- double azimuthRad = qgeocoordinate_degToRad(azimuth);
-
- double ratio = (distance / (qgeocoordinate_EARTH_MEAN_RADIUS * 1000.0));
- double cosRatio = cos(ratio);
- double sinRatio = sin(ratio);
-
- double resultLatRad = asin(sinLatRad * cosRatio
- + cosLatRad * sinRatio * cos(azimuthRad));
- double resultLonRad = lonRad + atan2(sin(azimuthRad) * sinRatio * cosLatRad,
- cosRatio - sinLatRad * sin(resultLatRad));
-
- *lat = qgeocoordinate_radToDeg(resultLatRad);
- *lon = qgeocoordinate_radToDeg(resultLonRad);
-}
-
-/*!
- Returns the coordinate that is reached by traveling \a distance meters
- from the current coordinate at \a azimuth (or bearing) along a great-circle.
- There is an assumption that the Earth is spherical for the purpose of this
- calculation.
-
- The altitude will have \a distanceUp added to it.
-
- Returns an invalid coordinate if this coordinate is invalid.
-*/
-QGeoCoordinate QGeoCoordinate::atDistanceAndAzimuth(qreal distance, qreal azimuth, qreal distanceUp) const
-{
- if (!isValid())
- return QGeoCoordinate();
-
- double resultLon, resultLat;
- QGeoCoordinatePrivate::atDistanceAndAzimuth(*this, distance, azimuth,
- &resultLon, &resultLat);
-
- if (resultLon > 180.0)
- resultLon -= 360.0;
- else if (resultLon < -180.0)
- resultLon += 360.0;
-
- double resultAlt = d->alt + distanceUp;
- return QGeoCoordinate(resultLat, resultLon, resultAlt);
-}
-
-/*!
- Returns this coordinate as a string in the specified \a format.
-
- For example, if this coordinate has a latitude of -27.46758, a longitude
- of 153.027892 and an altitude of 28.1, these are the strings
- returned depending on \a format:
-
- \table
- \header
- \li \a format value
- \li Returned string
- \row
- \li \l Degrees
- \li -27.46758\unicode{0xB0}, 153.02789\unicode{0xB0}, 28.1m
- \row
- \li \l DegreesWithHemisphere
- \li 27.46758\unicode{0xB0} S, 153.02789\unicode{0xB0} E, 28.1m
- \row
- \li \l DegreesMinutes
- \li -27\unicode{0xB0} 28.054', 153\unicode{0xB0} 1.673', 28.1m
- \row
- \li \l DegreesMinutesWithHemisphere
- \li 27\unicode{0xB0} 28.054 S', 153\unicode{0xB0} 1.673' E, 28.1m
- \row
- \li \l DegreesMinutesSeconds
- \li -27\unicode{0xB0} 28' 3.2", 153\unicode{0xB0} 1' 40.4", 28.1m
- \row
- \li \l DegreesMinutesSecondsWithHemisphere
- \li 27\unicode{0xB0} 28' 3.2" S, 153\unicode{0xB0} 1' 40.4" E, 28.1m
- \endtable
-
- The altitude field is omitted if no altitude is set.
-
- If the coordinate is invalid, an empty string is returned.
-*/
-QString QGeoCoordinate::toString(CoordinateFormat format) const
-{
- if (type() == QGeoCoordinate::InvalidCoordinate)
- return QString();
-
- QString latStr;
- QString longStr;
-
- double absLat = qAbs(d->lat);
- double absLng = qAbs(d->lng);
- QChar symbol(0x00B0); // degrees symbol
-
- switch (format) {
- case Degrees:
- case DegreesWithHemisphere: {
- latStr = QString::number(absLat, 'f', 5) + symbol;
- longStr = QString::number(absLng, 'f', 5) + symbol;
- break;
- }
- case DegreesMinutes:
- case DegreesMinutesWithHemisphere: {
- double latMin = (absLat - int(absLat)) * 60;
- double lngMin = (absLng - int(absLng)) * 60;
- latStr = QString::fromLatin1("%1%2 %3'")
- .arg(QString::number(int(absLat)))
- .arg(symbol)
- .arg(QString::number(latMin, 'f', 3));
- longStr = QString::fromLatin1("%1%2 %3'")
- .arg(QString::number(int(absLng)))
- .arg(symbol)
- .arg(QString::number(lngMin, 'f', 3));
- break;
- }
- case DegreesMinutesSeconds:
- case DegreesMinutesSecondsWithHemisphere: {
- double latMin = (absLat - int(absLat)) * 60;
- double lngMin = (absLng - int(absLng)) * 60;
- double latSec = (latMin - int(latMin)) * 60;
- double lngSec = (lngMin - int(lngMin)) * 60;
-
- latStr = QString::fromLatin1("%1%2 %3' %4\"")
- .arg(QString::number(int(absLat)))
- .arg(symbol)
- .arg(QString::number(int(latMin)))
- .arg(QString::number(latSec, 'f', 1));
- longStr = QString::fromLatin1("%1%2 %3' %4\"")
- .arg(QString::number(int(absLng)))
- .arg(symbol)
- .arg(QString::number(int(lngMin)))
- .arg(QString::number(lngSec, 'f', 1));
- break;
- }
- }
-
- // now add the "-" to the start, or append the hemisphere char
- switch (format) {
- case Degrees:
- case DegreesMinutes:
- case DegreesMinutesSeconds: {
- if (d->lat < 0)
- latStr.insert(0, QLatin1String("-"));
- if (d->lng < 0)
- longStr.insert(0, QLatin1String("-"));
- break;
- }
- case DegreesWithHemisphere:
- case DegreesMinutesWithHemisphere:
- case DegreesMinutesSecondsWithHemisphere: {
- if (d->lat < 0)
- latStr.append(QString::fromLatin1(" S"));
- else if (d->lat > 0)
- latStr.append(QString::fromLatin1(" N"));
- if (d->lng < 0)
- longStr.append(QString::fromLatin1(" W"));
- else if (d->lng > 0)
- longStr.append(QString::fromLatin1(" E"));
- break;
- }
- }
-
- if (qIsNaN(d->alt))
- return QString::fromLatin1("%1, %2").arg(latStr, longStr);
- return QString::fromLatin1("%1, %2, %3m").arg(latStr, longStr, QString::number(d->alt));
-}
-
-#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug dbg, const QGeoCoordinate &coord)
-{
- double lat = coord.latitude();
- double lng = coord.longitude();
-
- dbg.nospace() << "QGeoCoordinate(";
- if (qIsNaN(lat))
- dbg.nospace() << '?';
- else
- dbg.nospace() << lat;
- dbg.nospace() << ", ";
- if (qIsNaN(lng))
- dbg.nospace() << '?';
- else
- dbg.nospace() << lng;
- if (coord.type() == QGeoCoordinate::Coordinate3D) {
- dbg.nospace() << ", ";
- dbg.nospace() << coord.altitude();
- }
- dbg.nospace() << ')';
- return dbg;
-}
-#endif
-
-#ifndef QT_NO_DATASTREAM
-/*!
- \fn QDataStream &operator<<(QDataStream &stream, const QGeoCoordinate &coordinate)
-
- \relates QGeoCoordinate
-
- Writes the given \a coordinate to the specified \a stream.
-
- \sa {Serializing Qt Data Types}
-*/
-
-QDataStream &operator<<(QDataStream &stream, const QGeoCoordinate &coordinate)
-{
- stream << coordinate.latitude();
- stream << coordinate.longitude();
- stream << coordinate.altitude();
- return stream;
-}
-#endif
-
-#ifndef QT_NO_DATASTREAM
-/*!
- \fn QDataStream &operator>>(QDataStream &stream, QGeoCoordinate &coordinate)
- \relates QGeoCoordinate
-
- Reads a coordinate from the specified \a stream into the given
- \a coordinate.
-
- \sa {Serializing Qt Data Types}
-*/
-
-QDataStream &operator>>(QDataStream &stream, QGeoCoordinate &coordinate)
-{
- double value;
- stream >> value;
- coordinate.setLatitude(value);
- stream >> value;
- coordinate.setLongitude(value);
- stream >> value;
- coordinate.setAltitude(value);
- return stream;
-}
-#endif
-
-QT_END_NAMESPACE
diff --git a/src/location/qgeocoordinate.h b/src/location/qgeocoordinate.h
deleted file mode 100644
index 4948ad97..00000000
--- a/src/location/qgeocoordinate.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGEOCOORDINATE_H
-#define QGEOCOORDINATE_H
-
-#include <QtCore/QMetaType>
-#include <QtCore/QString>
-#include <QSharedDataPointer>
-#include <QtLocation/qlocationglobal.h>
-
-QT_BEGIN_NAMESPACE
-
-class QDebug;
-class QDataStream;
-
-class QGeoCoordinatePrivate;
-class Q_LOCATION_EXPORT QGeoCoordinate
-{
-public:
- enum CoordinateType {
- InvalidCoordinate,
- Coordinate2D,
- Coordinate3D
- };
-
- enum CoordinateFormat {
- Degrees,
- DegreesWithHemisphere,
- DegreesMinutes,
- DegreesMinutesWithHemisphere,
- DegreesMinutesSeconds,
- DegreesMinutesSecondsWithHemisphere
- };
-
- QGeoCoordinate();
- QGeoCoordinate(double latitude, double longitude);
- QGeoCoordinate(double latitude, double longitude, double altitude);
- QGeoCoordinate(const QGeoCoordinate &other);
- ~QGeoCoordinate();
-
- QGeoCoordinate &operator=(const QGeoCoordinate &other);
-
- bool operator==(const QGeoCoordinate &other) const;
- inline bool operator!=(const QGeoCoordinate &other) const {
- return !operator==(other);
- }
-
- bool isValid() const;
- CoordinateType type() const;
-
- void setLatitude(double latitude);
- double latitude() const;
-
- void setLongitude(double longitude);
- double longitude() const;
-
- void setAltitude(double altitude);
- double altitude() const;
-
- qreal distanceTo(const QGeoCoordinate &other) const;
- qreal azimuthTo(const QGeoCoordinate &other) const;
-
- QGeoCoordinate atDistanceAndAzimuth(qreal distance, qreal azimuth, qreal distanceUp = 0.0) const;
-
- QString toString(CoordinateFormat format = DegreesMinutesSecondsWithHemisphere) const;
-
-private:
- QSharedDataPointer<QGeoCoordinatePrivate> d;
-
- friend class QGeoCoordinatePrivate;
-};
-
-Q_DECLARE_TYPEINFO(QGeoCoordinate, Q_MOVABLE_TYPE);
-
-#ifndef QT_NO_DEBUG_STREAM
-Q_LOCATION_EXPORT QDebug operator<<(QDebug, const QGeoCoordinate &);
-#endif
-
-#ifndef QT_NO_DATASTREAM
-Q_LOCATION_EXPORT QDataStream &operator<<(QDataStream &stream, const QGeoCoordinate &coordinate);
-Q_LOCATION_EXPORT QDataStream &operator>>(QDataStream &stream, QGeoCoordinate &coordinate);
-#endif
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(QGeoCoordinate)
-
-#endif
diff --git a/src/location/qgeocoordinate_p.h b/src/location/qgeocoordinate_p.h
deleted file mode 100644
index 86bb4820..00000000
--- a/src/location/qgeocoordinate_p.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGEOCOORDINATE_P_H
-#define QGEOCOORDINATE_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QSharedData>
-#include "qgeocoordinate.h"
-
-QT_BEGIN_NAMESPACE
-
-class QGeoCoordinatePrivate : public QSharedData
-{
-public:
- QGeoCoordinatePrivate();
- QGeoCoordinatePrivate(const QGeoCoordinatePrivate &other);
- ~QGeoCoordinatePrivate();
-
- double lat;
- double lng;
- double alt;
-
- static void atDistanceAndAzimuth(const QGeoCoordinate &coord,
- qreal distance, qreal azimuth,
- double *lon, double *lat);
-};
-
-QT_END_NAMESPACE
-
-#endif // QGEOCOORDINATE_P_H
diff --git a/src/location/qgeolocation.cpp b/src/location/qgeolocation.cpp
deleted file mode 100644
index 1b43881e..00000000
--- a/src/location/qgeolocation.cpp
+++ /dev/null
@@ -1,203 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qgeolocation.h"
-#include "qgeolocation_p.h"
-
-QT_USE_NAMESPACE
-
-QGeoLocationPrivate::QGeoLocationPrivate()
- : QSharedData()
-{
-}
-
-QGeoLocationPrivate::QGeoLocationPrivate(const QGeoLocationPrivate &other)
- : QSharedData()
-{
- this->address = other.address;
- this->coordinate = other.coordinate;
- this->viewport = other.viewport;
-}
-
-QGeoLocationPrivate::~QGeoLocationPrivate()
-{
-}
-
-bool QGeoLocationPrivate::operator==(const QGeoLocationPrivate &other) const
-{
- return (this->address == other.address
- && this->coordinate == other.coordinate
- && this->viewport == other.viewport);
-
-}
-
-bool QGeoLocationPrivate::isEmpty() const
-{
- return (address.isEmpty()
- && !coordinate.isValid()
- && viewport.isEmpty()
- );
-}
-
-/*!
- \class QGeoLocation
- \inmodule QtLocation
- \ingroup QtLocation-positioning
- \ingroup QtLocation-places
- \ingroup QtLocation-places-data
- \since Qt Location 5.0
-
- \brief The QGeoLocation class represents basic information about a location.
-
- A QGeoLocation consists of a coordinate and corresponding address, along with an optional
- bounding box which is the recommended region to be displayed when viewing the location.
-*/
-
-/*!
- \fn bool QGeoLocation::operator!=(const QGeoLocation &other) const
-
- Returns true if this location is not equal to \a other, otherwise returns false.
-*/
-
-/*!
- Constructs an new location object.
-*/
-QGeoLocation::QGeoLocation()
- : d(new QGeoLocationPrivate)
-{
-}
-
-/*!
- Constructs a copy of \a other
-*/
-QGeoLocation::QGeoLocation(const QGeoLocation &other)
- :d(other.d)
-{
-}
-
-/*!
- Destroys the location object.
-*/
-QGeoLocation::~QGeoLocation()
-{
-}
-
-/*!
- Assigns \a other to this location and returns a reference to this location.
-*/
-QGeoLocation &QGeoLocation::operator =(const QGeoLocation &other)
-{
- if (this == &other)
- return *this;
-
- d = other.d;
- return *this;
-}
-
-/*!
- Returns true if this location is equal to \a other,
- otherwise returns false.
-*/
-bool QGeoLocation::operator==(const QGeoLocation &other) const
-{
- return (*(d.constData()) == *(other.d.constData()));
-}
-
-/*!
- Returns the address of the location.
-*/
-QGeoAddress QGeoLocation::address() const
-{
- return d->address;
-}
-
-/*!
- Sets the \a address of the location.
-*/
-void QGeoLocation::setAddress(const QGeoAddress &address)
-{
- d->address = address;
-}
-
-/*!
- Returns the coordinate of the location.
-*/
-QGeoCoordinate QGeoLocation::coordinate() const
-{
- return d->coordinate;
-}
-
-/*!
- Sets the \a coordinate of the location.
-*/
-void QGeoLocation::setCoordinate(const QGeoCoordinate &coordinate)
-{
- d->coordinate = coordinate;
-}
-
-/*!
- Returns a bounding box which represents the recommended region
- to display when viewing this location.
-
- For example, a building's location may have a region centered around the building,
- but the region is large enough to show it's immediate surrounding geographical
- context.
-*/
-QGeoRectangle QGeoLocation::boundingBox() const
-{
- return d->viewport;
-}
-
-/*!
- Sets the \a boundingBox of the location.
-*/
-void QGeoLocation::setBoundingBox(const QGeoRectangle &boundingBox)
-{
- d->viewport = boundingBox;
-}
-
-/*!
- Returns true if all fields of the location are 0; otherwise returns false.
-*/
-bool QGeoLocation::isEmpty() const
-{
- return d->isEmpty();
-}
diff --git a/src/location/qgeolocation.h b/src/location/qgeolocation.h
deleted file mode 100644
index d3f1718a..00000000
--- a/src/location/qgeolocation.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGEOLOCATION_H
-#define QGEOLOCATION_H
-
-#include <QtCore/QSharedDataPointer>
-#include <QtCore/QMetaType>
-#include <QtLocation/qlocationglobal.h>
-
-QT_BEGIN_NAMESPACE
-
-class QGeoAddress;
-class QGeoCoordinate;
-class QGeoRectangle;
-class QGeoLocationPrivate;
-
-class Q_LOCATION_EXPORT QGeoLocation
-{
-public:
- QGeoLocation();
- QGeoLocation(const QGeoLocation &other);
-
- ~QGeoLocation();
-
- QGeoLocation &operator=(const QGeoLocation &other);
-
- bool operator==(const QGeoLocation &other) const;
- bool operator!=(const QGeoLocation &other) const {
- return !(other == *this);
- }
-
- QGeoAddress address() const;
- void setAddress(const QGeoAddress &address);
- QGeoCoordinate coordinate() const;
- void setCoordinate(const QGeoCoordinate &position);
- QGeoRectangle boundingBox() const;
- void setBoundingBox(const QGeoRectangle &box);
-
- bool isEmpty() const;
-
-private:
- QSharedDataPointer<QGeoLocationPrivate> d;
-};
-
-Q_DECLARE_TYPEINFO(QGeoLocation, Q_MOVABLE_TYPE);
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(QGeoLocation)
-
-#endif
diff --git a/src/location/qgeolocation_p.h b/src/location/qgeolocation_p.h
deleted file mode 100644
index 8fc814cb..00000000
--- a/src/location/qgeolocation_p.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGEOLOCATION_P_H
-#define QGEOLOCATION_P_H
-
-#include <QtCore/QSharedData>
-#include <QtLocation/QGeoAddress>
-#include <QtLocation/QGeoCoordinate>
-#include <QtLocation/QGeoRectangle>
-
-QT_BEGIN_NAMESPACE
-
-class QGeoLocationPrivate : public QSharedData
-{
-public:
- QGeoLocationPrivate();
- QGeoLocationPrivate(const QGeoLocationPrivate &other);
-
- ~QGeoLocationPrivate();
-
- bool operator==(const QGeoLocationPrivate &other) const;
-
- bool isEmpty() const;
-
- QGeoAddress address;
- QGeoCoordinate coordinate;
- QGeoRectangle viewport;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/location/qgeopositioninfo.cpp b/src/location/qgeopositioninfo.cpp
deleted file mode 100644
index 7cd5be32..00000000
--- a/src/location/qgeopositioninfo.cpp
+++ /dev/null
@@ -1,332 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "qgeopositioninfo.h"
-
-#include <QHash>
-#include <QDebug>
-#include <QDataStream>
-
-QT_BEGIN_NAMESPACE
-
-class QGeoPositionInfoPrivate
-{
-public:
- QDateTime timestamp;
- QGeoCoordinate coord;
- QHash<int, qreal> doubleAttribs;
-};
-
-/*!
- \class QGeoPositionInfo
- \inmodule QtLocation
- \ingroup QtLocation-positioning
- \since Qt Location 5.0
-
- \brief The QGeoPositionInfo class contains information gathered on a global position, direction and velocity at a particular point in time.
-
- A QGeoPositionInfo contains, at a minimum, a geographical coordinate and
- a timestamp. It may also have heading and speed measurements as well as
- estimates of the accuracy of the provided data.
-
- \sa QGeoPositionInfoSource
-*/
-
-/*!
- \enum QGeoPositionInfo::Attribute
- Defines the attributes for positional information.
-
- \value Direction The bearing measured in degrees clockwise from true north to the direction of travel.
- \value GroundSpeed The ground speed, in meters/sec.
- \value VerticalSpeed The vertical speed, in meters/sec.
- \value MagneticVariation The angle between the horizontal component of the magnetic field and true north, in degrees. Also known as magnetic declination. A positive value indicates a clockwise direction from true north and a negative value indicates a counter-clockwise direction.
- \value HorizontalAccuracy The accuracy of the provided latitude-longitude value, in meters.
- \value VerticalAccuracy The accuracy of the provided altitude value, in meters.
-*/
-
-/*!
- Creates an invalid QGeoPositionInfo object.
-
- \sa isValid()
-*/
-QGeoPositionInfo::QGeoPositionInfo()
- : d(new QGeoPositionInfoPrivate)
-{
-}
-
-/*!
- Creates a QGeoPositionInfo for the given \a coordinate and \a timestamp.
-*/
-QGeoPositionInfo::QGeoPositionInfo(const QGeoCoordinate &coordinate, const QDateTime &timestamp)
- : d(new QGeoPositionInfoPrivate)
-{
- d->timestamp = timestamp;
- d->coord = coordinate;
-}
-
-/*!
- Creates a QGeoPositionInfo with the values of \a other.
-*/
-QGeoPositionInfo::QGeoPositionInfo(const QGeoPositionInfo &other)
- : d(new QGeoPositionInfoPrivate)
-{
- operator=(other);
-}
-
-/*!
- Destroys a QGeoPositionInfo object.
-*/
-QGeoPositionInfo::~QGeoPositionInfo()
-{
- delete d;
-}
-
-/*!
- Assigns the values from \a other to this QGeoPositionInfo.
-*/
-QGeoPositionInfo &QGeoPositionInfo::operator=(const QGeoPositionInfo & other)
-{
- if (this == &other)
- return *this;
-
- d->timestamp = other.d->timestamp;
- d->coord = other.d->coord;
- d->doubleAttribs = other.d->doubleAttribs;
-
- return *this;
-}
-
-/*!
- Returns true if all of this object's values are the same as those of
- \a other.
-*/
-bool QGeoPositionInfo::operator==(const QGeoPositionInfo &other) const
-{
- return d->timestamp == other.d->timestamp
- && d->coord == other.d->coord
- && d->doubleAttribs == other.d->doubleAttribs;
-}
-
-/*!
- \fn bool QGeoPositionInfo::operator!=(const QGeoPositionInfo &other) const
-
- Returns true if any of this object's values are not the same as those of
- \a other.
-*/
-
-/*!
- Returns true if the timestamp() and coordinate() values are both valid.
-
- \sa QGeoCoordinate::isValid(), QDateTime::isValid()
-*/
-bool QGeoPositionInfo::isValid() const
-{
- return d->timestamp.isValid() && d->coord.isValid();
-}
-
-/*!
- Sets the date and time at which this position was reported to \a timestamp.
-
- The \a timestamp must be in UTC time.
-
- \sa timestamp()
-*/
-void QGeoPositionInfo::setTimestamp(const QDateTime &timestamp)
-{
- d->timestamp = timestamp;
-}
-
-/*!
- Returns the date and time at which this position was reported, in UTC time.
-
- Returns an invalid QDateTime if no date/time value has been set.
-
- \sa setTimestamp()
-*/
-QDateTime QGeoPositionInfo::timestamp() const
-{
- return d->timestamp;
-}
-
-/*!
- Sets the coordinate for this position to \a coordinate.
-
- \sa coordinate()
-*/
-void QGeoPositionInfo::setCoordinate(const QGeoCoordinate &coordinate)
-{
- d->coord = coordinate;
-}
-
-/*!
- Returns the coordinate for this position.
-
- Returns an invalid coordinate if no coordinate has been set.
-
- \sa setCoordinate()
-*/
-QGeoCoordinate QGeoPositionInfo::coordinate() const
-{
- return d->coord;
-}
-
-/*!
- Sets the value for \a attribute to \a value.
-
- \sa attribute()
-*/
-void QGeoPositionInfo::setAttribute(Attribute attribute, qreal value)
-{
- d->doubleAttribs[int(attribute)] = value;
-}
-
-/*!
- Returns the value of the specified \a attribute as a qreal value.
-
- Returns -1 if the value has not been set, although this may also
- be a legitimate value for some attributes.
-
- The function hasAttribute() should be used to determine whether or
- not a value has been set for an attribute.
-
- \sa hasAttribute(), setAttribute()
-*/
-qreal QGeoPositionInfo::attribute(Attribute attribute) const
-{
- if (d->doubleAttribs.contains(int(attribute)))
- return d->doubleAttribs[int(attribute)];
- return -1;
-}
-
-/*!
- Removes the specified \a attribute and its value.
-*/
-void QGeoPositionInfo::removeAttribute(Attribute attribute)
-{
- d->doubleAttribs.remove(int(attribute));
-}
-
-/*!
- Returns true if the specified \a attribute is present for this
- QGeoPositionInfo object.
-*/
-bool QGeoPositionInfo::hasAttribute(Attribute attribute) const
-{
- return d->doubleAttribs.contains(int(attribute));
-}
-
-#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug dbg, const QGeoPositionInfo &info)
-{
- dbg.nospace() << "QGeoPositionInfo(" << info.d->timestamp;
- dbg.nospace() << ", ";
- dbg.nospace() << info.d->coord;
-
- QList<int> attribs = info.d->doubleAttribs.keys();
- qStableSort(attribs.begin(), attribs.end()); // Output a sorted list from an unsorted hash.
- for (int i = 0; i < attribs.count(); ++i) {
- dbg.nospace() << ", ";
- switch (attribs[i]) {
- case QGeoPositionInfo::Direction:
- dbg.nospace() << "Direction=";
- break;
- case QGeoPositionInfo::GroundSpeed:
- dbg.nospace() << "GroundSpeed=";
- break;
- case QGeoPositionInfo::VerticalSpeed:
- dbg.nospace() << "VerticalSpeed=";
- break;
- case QGeoPositionInfo::MagneticVariation:
- dbg.nospace() << "MagneticVariation=";
- break;
- case QGeoPositionInfo::HorizontalAccuracy:
- dbg.nospace() << "HorizontalAccuracy=";
- break;
- case QGeoPositionInfo::VerticalAccuracy:
- dbg.nospace() << "VerticalAccuracy=";
- break;
- }
- dbg.nospace() << info.d->doubleAttribs[attribs[i]];
- }
- dbg.nospace() << ')';
- return dbg;
-}
-#endif
-
-#ifndef QT_NO_DATASTREAM
-/*!
- \fn QDataStream &operator<<(QDataStream &stream, const QGeoPositionInfo &info)
- \relates QGeoPositionInfo
-
- Writes the given \a info to the specified \a stream.
-
- \sa {Serializing Qt Data Types}
-*/
-
-QDataStream &operator<<(QDataStream &stream, const QGeoPositionInfo &info)
-{
- stream << info.d->timestamp;
- stream << info.d->coord;
- stream << info.d->doubleAttribs;
- return stream;
-}
-#endif
-
-#ifndef QT_NO_DATASTREAM
-/*!
- \fn QDataStream &operator>>(QDataStream &stream, QGeoPositionInfo &info)
- \relates QGeoPositionInfo
-
- Reads a coordinate from the specified \a stream into the given
- \a info.
-
- \sa {Serializing Qt Data Types}
-*/
-
-QDataStream &operator>>(QDataStream &stream, QGeoPositionInfo &info)
-{
- stream >> info.d->timestamp;
- stream >> info.d->coord;
- stream >> info.d->doubleAttribs;
- return stream;
-}
-#endif
-
-QT_END_NAMESPACE
diff --git a/src/location/qgeopositioninfo.h b/src/location/qgeopositioninfo.h
deleted file mode 100644
index ac2f51ba..00000000
--- a/src/location/qgeopositioninfo.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QGEOPOSITIONINFO_H
-#define QGEOPOSITIONINFO_H
-
-#include <QtLocation/QGeoCoordinate>
-
-#include <QDateTime>
-
-QT_BEGIN_NAMESPACE
-
-class QDebug;
-class QDataStream;
-
-class QGeoPositionInfoPrivate;
-class Q_LOCATION_EXPORT QGeoPositionInfo
-{
-public:
- enum Attribute {
- Direction,
- GroundSpeed,
- VerticalSpeed,
- MagneticVariation,
- HorizontalAccuracy,
- VerticalAccuracy
- };
-
- QGeoPositionInfo();
- QGeoPositionInfo(const QGeoCoordinate &coordinate, const QDateTime &updateTime);
- QGeoPositionInfo(const QGeoPositionInfo &other);
- ~QGeoPositionInfo();
-
- QGeoPositionInfo &operator=(const QGeoPositionInfo &other);
-
- bool operator==(const QGeoPositionInfo &other) const;
- inline bool operator!=(const QGeoPositionInfo &other) const {
- return !operator==(other);
- }
-
- bool isValid() const;
-
- void setTimestamp(const QDateTime &timestamp);
- QDateTime timestamp() const;
-
- void setCoordinate(const QGeoCoordinate &coordinate);
- QGeoCoordinate coordinate() const;
-
- void setAttribute(Attribute attribute, qreal value);
- qreal attribute(Attribute attribute) const;
- void removeAttribute(Attribute attribute);
- bool hasAttribute(Attribute attribute) const;
-
-private:
-#ifndef QT_NO_DEBUG_STREAM
- friend Q_LOCATION_EXPORT QDebug operator<<(QDebug dbg, const QGeoPositionInfo &info);
-#endif
-#ifndef QT_NO_DATASTREAM
- friend Q_LOCATION_EXPORT QDataStream &operator<<(QDataStream &stream, const QGeoPositionInfo &info);
- friend Q_LOCATION_EXPORT QDataStream &operator>>(QDataStream &stream, QGeoPositionInfo &info);
-#endif
- QGeoPositionInfoPrivate *d;
-};
-
-#ifndef QT_NO_DEBUG_STREAM
-Q_LOCATION_EXPORT QDebug operator<<(QDebug dbg, const QGeoPositionInfo &info);
-#endif
-
-#ifndef QT_NO_DATASTREAM
-Q_LOCATION_EXPORT QDataStream &operator<<(QDataStream &stream, const QGeoPositionInfo &info);
-Q_LOCATION_EXPORT QDataStream &operator>>(QDataStream &stream, QGeoPositionInfo &info);
-#endif
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/location/qgeopositioninfosource.cpp b/src/location/qgeopositioninfosource.cpp
deleted file mode 100644
index 15f65f46..00000000
--- a/src/location/qgeopositioninfosource.cpp
+++ /dev/null
@@ -1,462 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include <qgeopositioninfosource.h>
-#include "qgeopositioninfosource_p.h"
-#include "qgeopositioninfosourcefactory.h"
-
-#include <QFile>
-#include <QPluginLoader>
-#include <QStringList>
-#include <QJsonObject>
-#include <QCryptographicHash>
-#include <QtCore/private/qfactoryloader_p.h>
-#include <QtCore/private/qlibrary_p.h>
-
-QT_BEGIN_NAMESPACE
-
-#ifndef QT_NO_LIBRARY
-Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
- ("org.qt-project.qt.position.sourcefactory/5.0",
- QLatin1String("/position")))
-#endif
-
-/*!
- \class QGeoPositionInfoSource
- \inmodule QtLocation
- \ingroup QtLocation-positioning
- \since Qt Location 5.0
-
- \brief The QGeoPositionInfoSource class is an abstract base class for the distribution of positional updates.
-
- The static function QGeoPositionInfoSource::createDefaultSource() creates a default
- position source that is appropriate for the platform, if one is available.
- Otherwise, QGeoPositionInfoSource will check for available plugins that
- implement the QGeoPositionInfoSourceFactory interface.
-
- Users of a QGeoPositionInfoSource subclass can request the current position using
- requestUpdate(), or start and stop regular position updates using
- startUpdates() and stopUpdates(). When an update is available,
- positionUpdated() is emitted. The last known position can be accessed with
- lastKnownPosition().
-
- If regular position updates are required, setUpdateInterval() can be used
- to specify how often these updates should be emitted. If no interval is
- specified, updates are simply provided whenever they are available.
- For example:
-
- \code
- // Emit updates every 10 seconds if available
- QGeoPositionInfoSource *source = QGeoPositionInfoSource::createDefaultSource(0);
- if (source)
- source->setUpdateInterval(10000);
- \endcode
-
- To remove an update interval that was previously set, call
- setUpdateInterval() with a value of 0.
-
- Note that the position source may have a minimum value requirement for
- update intervals, as returned by minimumUpdateInterval().
-
- \warning On Windows CE it is not possible to detect if a device is GPS enabled.
- The default position source on a Windows CE device without GPS support will never provide any position data.
-*/
-
-/*!
- \enum QGeoPositionInfoSource::PositioningMethod
- Defines the types of positioning methods.
-
- \value SatellitePositioningMethods Satellite-based positioning methods such as GPS or GLONASS.
- \value NonSatellitePositioningMethods Other positioning methods such as 3GPP cell identifier or WiFi based positioning.
- \value AllPositioningMethods Satellite-based positioning methods as soon as available. Otherwise non-satellite based methods.
-*/
-
-void QGeoPositionInfoSourcePrivate::loadMeta()
-{
- metaData = plugins().value(providerName);
-}
-
-void QGeoPositionInfoSourcePrivate::loadPlugin()
-{
- int idx = int(metaData.value(QStringLiteral("index")).toDouble());
- if (idx < 0)
- return;
- factory = qobject_cast<QGeoPositionInfoSourceFactory *>(loader()->instance(idx));
-}
-
-QHash<QString, QJsonObject> QGeoPositionInfoSourcePrivate::plugins(bool reload)
-{
- static QHash<QString, QJsonObject> plugins;
- static bool alreadyDiscovered = false;
-
- if (reload == true)
- alreadyDiscovered = false;
-
- if (!alreadyDiscovered) {
- loadPluginMetadata(plugins);
- alreadyDiscovered = true;
- }
- return plugins;
-}
-
-static bool pluginComparator(const QJsonObject &p1, const QJsonObject &p2)
-{
- const QString prio = QStringLiteral("Priority");
- if (p1.contains(prio) && !p2.contains(prio))
- return true;
- if (!p1.contains(prio) && p2.contains(prio))
- return false;
- if (p1.value(prio).isDouble() && !p2.value(prio).isDouble())
- return true;
- if (!p1.value(prio).isDouble() && p2.value(prio).isDouble())
- return false;
- return (p1.value(prio).toDouble() > p2.value(prio).toDouble());
-}
-
-QList<QJsonObject> QGeoPositionInfoSourcePrivate::pluginsSorted()
-{
- QList<QJsonObject> list = plugins().values();
- qStableSort(list.begin(), list.end(), pluginComparator);
- return list;
-}
-
-void QGeoPositionInfoSourcePrivate::loadPluginMetadata(QHash<QString, QJsonObject> &plugins)
-{
- QFactoryLoader *l = loader();
- QList<QJsonObject> meta = l->metaData();
- for (int i = 0; i < meta.size(); ++i) {
- QJsonObject obj = meta.at(i).value(QStringLiteral("MetaData")).toObject();
- obj.insert(QStringLiteral("index"), i);
- plugins.insertMulti(obj.value(QStringLiteral("Provider")).toString(), obj);
- }
-}
-
-/*!
- Creates a position source with the specified \a parent.
-*/
-
-QGeoPositionInfoSource::QGeoPositionInfoSource(QObject *parent)
- : QObject(parent),
- d(new QGeoPositionInfoSourcePrivate)
-{
- d->interval = 0;
- d->methods = 0;
-}
-
-/*!
- Destroys the position source.
-*/
-QGeoPositionInfoSource::~QGeoPositionInfoSource()
-{
- delete d;
-}
-
-/*!
- \property QGeoPositionInfoSource::sourceName
- \brief This property holds the unique name of the position source
- implementation in use.
-
- This is the same name that can be passed to createSource() in order to
- create a new instance of a particular position source implementation.
-*/
-QString QGeoPositionInfoSource::sourceName() const
-{
- return d->metaData.value(QStringLiteral("Provider")).toString();
-}
-
-/*!
- \property QGeoPositionInfoSource::updateInterval
- \brief This property holds the requested interval in milliseconds between each update.
-
- If the update interval is not set (or is set to 0) the
- source will provide updates as often as necessary.
-
- If the update interval is set, the source will provide updates at an
- interval as close to the requested interval as possible. If the requested
- interval is less than the minimumUpdateInterval(),
- the minimum interval is used instead.
-
- Changes to the update interval will happen as soon as is practical, however the
- time the change takes may vary between implementations. Whether or not the elapsed
- time from the previous interval is counted as part of the new interval is also
- implementation dependent.
-
- The default value for this property is 0.
-
- Note: Subclass implementations must call the base implementation of
- setUpdateInterval() so that updateInterval() returns the correct value.
-*/
-void QGeoPositionInfoSource::setUpdateInterval(int msec)
-{
- d->interval = msec;
-}
-
-int QGeoPositionInfoSource::updateInterval() const
-{
- return d->interval;
-}
-
-/*!
- Sets the preferred positioning methods for this source to \a methods.
-
- If \a methods includes a method that is not supported by the source, the
- unsupported method will be ignored.
-
- If \a methods does not include any methods supported by the source, the
- preferred methods will be set to the set of methods which the source supports.
-
- \b {Note:} When reimplementing this method, subclasses must call the
- base method implementation to ensure preferredPositioningMethods() returns the correct value.
-
- \sa supportedPositioningMethods()
-*/
-void QGeoPositionInfoSource::setPreferredPositioningMethods(PositioningMethods methods)
-{
- d->methods = methods & supportedPositioningMethods();
- if (d->methods == 0) {
- d->methods = supportedPositioningMethods();
- }
-}
-
-/*!
- Returns the positioning methods set by setPreferredPositioningMethods().
-*/
-QGeoPositionInfoSource::PositioningMethods QGeoPositionInfoSource::preferredPositioningMethods() const
-{
- return d->methods;
-}
-
-/*!
- Creates and returns a position source with the given \a parent that
- reads from the system's default sources of location data, or the plugin
- with the highest available priority.
-
- Returns 0 if the system has no default position source, no valid plugins
- could be found or the user does not have the permission to access the current position.
-*/
-QGeoPositionInfoSource *QGeoPositionInfoSource::createDefaultSource(QObject *parent)
-{
- QList<QJsonObject> plugins = QGeoPositionInfoSourcePrivate::pluginsSorted();
- foreach (const QJsonObject &obj, plugins) {
- if (obj.value(QStringLiteral("Position")).isBool()
- && obj.value(QStringLiteral("Position")).toBool())
- {
- QGeoPositionInfoSourcePrivate d;
- d.metaData = obj;
- d.loadPlugin();
- QGeoPositionInfoSource *s = 0;
- if (d.factory)
- s = d.factory->positionInfoSource(parent);
- if (s) {
- s->d->metaData = d.metaData;
- return s;
- }
- }
- }
- return 0;
-}
-
-
-/*!
- Creates and returns a position source with the given \a parent,
- by loading the plugin named \a sourceName.
-
- Returns 0 if the plugin cannot be found.
-*/
-QGeoPositionInfoSource *QGeoPositionInfoSource::createSource(const QString &sourceName, QObject *parent)
-{
- QHash<QString, QJsonObject> plugins = QGeoPositionInfoSourcePrivate::plugins();
- if (plugins.contains(sourceName))
- {
- QGeoPositionInfoSourcePrivate d;
- d.metaData = plugins.value(sourceName);
- d.loadPlugin();
- QGeoPositionInfoSource *src = 0;
- if (d.factory)
- src = d.factory->positionInfoSource(parent);
- if (src)
- {
- src->d->metaData = d.metaData;
- return src;
- }
- }
- return 0;
-}
-
-
-/*!
- Returns a list of available source plugins. This includes any default backend
- plugin for the current platform.
-*/
-QStringList QGeoPositionInfoSource::availableSources()
-{
- QStringList plugins;
- QHash<QString, QJsonObject> meta = QGeoPositionInfoSourcePrivate::plugins();
- foreach (const QString &name, meta.keys()) {
- if (meta.value(name).value(QStringLiteral("Position")).isBool()
- && meta.value(name).value(QStringLiteral("Position")).toBool()) {
- plugins << name;
- }
- }
-
- return plugins;
-}
-
-/*!
- \fn QGeoPositionInfo QGeoPositionInfoSource::lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const = 0;
-
- Returns an update containing the last known position, or a null update
- if none is available.
-
- If \a fromSatellitePositioningMethodsOnly is true, this returns the last
- known position received from a satellite positioning method; if none
- is available, a null update is returned.
-*/
-
-/*!
- \fn virtual PositioningMethods QGeoPositionInfoSource::supportedPositioningMethods() const = 0;
-
- Returns the positioning methods available to this source.
-
- \sa setPreferredPositioningMethods()
-*/
-
-
-/*!
- \property QGeoPositionInfoSource::minimumUpdateInterval
- \brief This property holds the minimum time (in milliseconds) required to retrieve a position update.
-
- This is the minimum value accepted by setUpdateInterval() and
- requestUpdate().
-*/
-
-
-/*!
- \fn virtual void QGeoPositionInfoSource::startUpdates() = 0;
-
- Starts emitting updates at regular intervals as specified by setUpdateInterval().
-
- If setUpdateInterval() has not been called, the source will emit updates
- as soon as they become available.
-
- An updateTimout() signal will be emitted if this QGeoPositionInfoSource subclass determines
- that it will not be able to provide regular updates. This could happen if a satellite fix is
- lost or if a hardware error is detected. Position updates will recommence if the data becomes
- available later on. The updateTimout() signal will not be emitted again until after the
- periodic updates resume.
-*/
-
-/*!
- \fn virtual void QGeoPositionInfoSource::stopUpdates() = 0;
-
- Stops emitting updates at regular intervals.
-*/
-
-/*!
- \fn virtual void QGeoPositionInfoSource::requestUpdate(int timeout = 0);
-
- Attempts to get the current position and emit positionUpdated() with
- this information. If the current position cannot be found within the given \a timeout
- (in milliseconds) or if \a timeout is less than the value returned by
- minimumUpdateInterval(), updateTimeout() is emitted.
-
- If the timeout is zero, the timeout defaults to a reasonable timeout
- period as appropriate for the source.
-
- This does nothing if another update request is in progress. However
- it can be called even if startUpdates() has already been called and
- regular updates are in progress.
-
- If the source uses multiple positioning methods, it tries to get the
- current position from the most accurate positioning method within the
- given timeout.
-*/
-
-/*!
- \fn virtual QGeoPositionInfoSource::Error QGeoPositionInfoSource::error() const;
-
- Returns the type of error that last occurred.
-
-*/
-
-/*!
- \fn void QGeoPositionInfoSource::positionUpdated(const QGeoPositionInfo &update);
-
- If startUpdates() or requestUpdate() is called, this signal is emitted
- when an update becomes available.
-
- The \a update value holds the value of the new update.
-*/
-
-/*!
- \fn void QGeoPositionInfoSource::updateTimeout();
-
- If requestUpdate() was called, this signal will be emitted if the current position could not
- be retrieved within the specified timeout.
-
- If startUpdates() has been called, this signal will be emitted if this QGeoPositionInfoSource
- subclass determines that it will not be able to provide further regular updates. This signal
- will not be emitted again until after the regular updates resume.
-*/
-
-/*!
- \fn void QGeoPositionInfoSource::error(QGeoPositionInfoSource::Error positioningError)
-
- This signal is emitted after an error occurred. The \a positioningError
- parameter describes the type of error that occurred.
-
-*/
-
-/*!
- \enum QGeoPositionInfoSource::Error
-
- The Error enumeration represents the errors which can occur.
-
- \value AccessError The connection setup to the remote positioning backend failed because the
- application lacked the required privileges.
- \value ClosedError The remote positioning backend closed the connection, which happens for example in case
- the user is switching location services to off. This object becomes invalid and should be deleted.
- A call to createDefaultSource() can be used to create a new source later on.
- \value UnknownSourceError An unidentified error occurred.
- */
-
-#include "moc_qgeopositioninfosource.cpp"
-
-QT_END_NAMESPACE
diff --git a/src/location/qgeopositioninfosource.h b/src/location/qgeopositioninfosource.h
deleted file mode 100644
index 931316ce..00000000
--- a/src/location/qgeopositioninfosource.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QGEOPOSITIONINFOSOURCE_H
-#define QGEOPOSITIONINFOSOURCE_H
-
-#include <QtLocation/QGeoPositionInfo>
-
-#include <QObject>
-
-QT_BEGIN_NAMESPACE
-
-class QGeoPositionInfoSourcePrivate;
-class Q_LOCATION_EXPORT QGeoPositionInfoSource : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(int updateInterval READ updateInterval WRITE setUpdateInterval)
- Q_PROPERTY(int minimumUpdateInterval READ minimumUpdateInterval)
- Q_PROPERTY(QString sourceName READ sourceName)
-
-public:
- enum Error {
- AccessError,
- ClosedError, /* 1 */
- UnknownSourceError = -1
- };
- Q_ENUMS(Error)
-
- enum PositioningMethod {
- SatellitePositioningMethods = 0x000000ff,
- NonSatellitePositioningMethods = 0xffffff00,
- AllPositioningMethods = 0xffffffff
- };
- Q_DECLARE_FLAGS(PositioningMethods, PositioningMethod)
-
- explicit QGeoPositionInfoSource(QObject *parent);
- virtual ~QGeoPositionInfoSource();
-
- virtual void setUpdateInterval(int msec);
- int updateInterval() const;
-
- virtual void setPreferredPositioningMethods(PositioningMethods methods);
- PositioningMethods preferredPositioningMethods() const;
-
- virtual QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const = 0;
-
- virtual PositioningMethods supportedPositioningMethods() const = 0;
- virtual int minimumUpdateInterval() const = 0;
-
- QString sourceName() const;
-
- static QGeoPositionInfoSource *createDefaultSource(QObject *parent);
- static QGeoPositionInfoSource *createSource(const QString &sourceName, QObject *parent);
- static QStringList availableSources();
- virtual Error error() const = 0;
-
-public Q_SLOTS:
- virtual void startUpdates() = 0;
- virtual void stopUpdates() = 0;
-
- virtual void requestUpdate(int timeout = 0) = 0;
-
-Q_SIGNALS:
- void positionUpdated(const QGeoPositionInfo &update);
- void updateTimeout();
- void error(QGeoPositionInfoSource::Error);
-
-private:
- Q_DISABLE_COPY(QGeoPositionInfoSource)
- QGeoPositionInfoSourcePrivate *d;
-};
-
-Q_DECLARE_OPERATORS_FOR_FLAGS(QGeoPositionInfoSource::PositioningMethods)
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/location/qgeopositioninfosource_p.h b/src/location/qgeopositioninfosource_p.h
deleted file mode 100644
index 97baadbf..00000000
--- a/src/location/qgeopositioninfosource_p.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGEOPOSITIONINFOSOURCE_P_H
-#define QGEOPOSITIONINFOSOURCE_P_H
-
-#include "qgeopositioninfosource.h"
-#include "qgeopositioninfosourcefactory.h"
-#include <QJsonObject>
-#include <QString>
-#include <QHash>
-#include <QList>
-
-QT_BEGIN_NAMESPACE
-
-class QGeoPositionInfoSourcePrivate
-{
-public:
- int interval;
- QGeoPositionInfoSource::PositioningMethods methods;
- QJsonObject metaData;
- QGeoPositionInfoSourceFactory *factory;
- QString providerName;
-
- void loadMeta();
- void loadPlugin();
-
- static QHash<QString, QJsonObject> plugins(bool reload = false);
- static void loadPluginMetadata(QHash<QString, QJsonObject> &list);
- static QList<QJsonObject> pluginsSorted();
-};
-
-QT_END_NAMESPACE
-
-#endif // QGEOPOSITIONINFOSOURCE_P_H
diff --git a/src/location/qgeopositioninfosourcefactory.cpp b/src/location/qgeopositioninfosourcefactory.cpp
deleted file mode 100644
index 0c0a0404..00000000
--- a/src/location/qgeopositioninfosourcefactory.cpp
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qgeopositioninfosourcefactory.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGeoPositionInfoSourceFactory
- \inmodule QtLocation
- \ingroup QtLocation-impl
- \since Qt Location 5.0
-
- \brief The QGeoPositionInfoSourceFactory class is a factory class used
- as the plugin interface for external providers of positioning data.
-
- The other functions must be overridden by all plugins, other than
- sourcePriority() which defaults to returning 0. Higher values of
- priority will be preferred to lower ones.
-*/
-
-/*!
- \fn QGeoPositionInfoSource *QGeoPositionInfoSourceFactory::positionInfoSource(QObject *parent)
-
- Returns a new QGeoPositionInfoSource associated with this plugin
- with parent \a parent. Can also return 0, in which case the plugin
- loader will use the factory with the next highest priority.
- */
-
-/*!
- \fn QGeoSatelliteInfoSource *QGeoPositionInfoSourceFactory::satelliteInfoSource(QObject *parent)
-
- Returns a new QGeoSatelliteInfoSource associated with this plugin
- with parent \a parent. Can also return 0, in which case the plugin
- loader will use the factory with the next highest priority.
- */
-
-/*!
- \fn QGeoAreaMonitor *QGeoPositionInfoSourceFactory::areaMonitor(QObject *parent);
-
- Returns a new QGeoAreaMonitor associated with this plugin with parent \a parent.
- Can also return 0, in which case the plugin loader will use the factory with the
- next highest priority.
- */
-
-/*!
- Destroys the position info source factory.
-*/
-QGeoPositionInfoSourceFactory::~QGeoPositionInfoSourceFactory()
-{}
-
-QT_END_NAMESPACE
diff --git a/src/location/qgeopositioninfosourcefactory.h b/src/location/qgeopositioninfosourcefactory.h
deleted file mode 100644
index 7ddb801d..00000000
--- a/src/location/qgeopositioninfosourcefactory.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGEOPOSITIONINFOSOURCEFACTORY_H
-#define QGEOPOSITIONINFOSOURCEFACTORY_H
-
-#include <QtLocation/QGeoPositionInfoSource>
-#include <QtLocation/QGeoSatelliteInfoSource>
-#include <QtLocation/QGeoAreaMonitor>
-#include <QList>
-
-QT_BEGIN_NAMESPACE
-
-class Q_LOCATION_EXPORT QGeoPositionInfoSourceFactory
-{
-public:
- virtual ~QGeoPositionInfoSourceFactory();
-
- virtual QGeoPositionInfoSource *positionInfoSource(QObject *parent) = 0;
- virtual QGeoSatelliteInfoSource *satelliteInfoSource(QObject *parent) = 0;
- virtual QGeoAreaMonitor *areaMonitor(QObject *parent) = 0;
-};
-
-#define QT_POSITION_SOURCE_INTERFACE
-Q_DECLARE_INTERFACE(QGeoPositionInfoSourceFactory,
- "org.qt-project.qt.position.sourcefactory/5.0")
-
-QT_END_NAMESPACE
-
-#endif // QGEOPOSITIONINFOSOURCEFACTORY_H
diff --git a/src/location/qgeorectangle.cpp b/src/location/qgeorectangle.cpp
deleted file mode 100644
index 4ee4f16f..00000000
--- a/src/location/qgeorectangle.cpp
+++ /dev/null
@@ -1,899 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qgeorectangle.h"
-#include "qgeorectangle_p.h"
-
-#include "qgeocoordinate.h"
-#include "qnumeric.h"
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGeoRectangle
- \inmodule QtLocation
- \ingroup QtLocation-positioning
- \since Qt Location 5.0
-
- \brief The QGeoRectangle class defines a rectangular geographic area.
-
- The rectangle is defined in terms of a QGeoCoordinate which specifies the
- top left coordinate of the rectangle and a QGeoCoordinate which specifies
- the bottom right coordinate of the rectangle.
-
- A geo rectangle is considered invalid if the top left or bottom right
- coordinates are invalid or if the top left coordinate is south of the
- bottom right coordinate.
-
- Geo rectangles can never cross the poles.
-
- Several methods behave as though the geo rectangle is defined in terms of a
- center coordinate, the width of the geo rectangle in degrees and the height
- of the geo rectangle in degrees.
-
- If the height or center of a geo rectangle is adjusted such that it would
- cross one of the poles the height is modified such that the geo rectangle
- touches but does not cross the pole and that the center coordinate is still
- in the center of the geo rectangle.
-*/
-
-#ifdef Q_NO_USING_KEYWORD
-/*!
- \fn bool QGeoRectangle::operator==(const QGeoShape &other) const
-
- Returns true if \a other is equivalent to this geo rectangle; otherwise returns false.
-*/
-
-/*!
- \fn bool QGeoRectangle::operator!=(const QGeoShape &other) const
-
- Returns true if \a other is not equivalent to this geo rectangle; otherwise returns false.
-*/
-
-/*!
- \fn bool QGeoRectangle::contains(const QGeoCoordinate &coordinate) const
-
- Returns true if \a coordinate is within this geo rectangle; otherwise returns false.
-*/
-#endif
-
-inline QGeoRectanglePrivate *QGeoRectangle::d_func()
-{
- return static_cast<QGeoRectanglePrivate *>(d_ptr.data());
-}
-
-inline const QGeoRectanglePrivate *QGeoRectangle::d_func() const
-{
- return static_cast<const QGeoRectanglePrivate *>(d_ptr.constData());
-}
-
-/*!
- Constructs a new, invalid geo rectangle.
-*/
-QGeoRectangle::QGeoRectangle()
-: QGeoShape(new QGeoRectanglePrivate)
-{
-}
-
-/*!
- Constructs a new geo rectangle centered at \a center with a
- width in degrees of \a degreesWidth and a height in degrees of \a degreesHeight.
-
- If \a degreesHeight would take the geo rectangle beyond one of the poles,
- the height of the geo rectangle will be truncated such that the geo rectangle
- only extends up to the pole. The center of the geo rectangle will be
- unchanged, and the height will be adjusted such that the center point is at
- the center of the truncated geo rectangle.
-*/
-QGeoRectangle::QGeoRectangle(const QGeoCoordinate &center, double degreesWidth, double degreesHeight)
-{
- d_ptr = new QGeoRectanglePrivate(center, center);
- setWidth(degreesWidth);
- setHeight(degreesHeight);
-}
-
-/*!
- Constructs a new geo rectangle with a top left coordinate \a topLeft and a bottom right
- coordinate \a bottomRight.
-*/
-QGeoRectangle::QGeoRectangle(const QGeoCoordinate &topLeft, const QGeoCoordinate &bottomRight)
-{
- d_ptr = new QGeoRectanglePrivate(topLeft, bottomRight);
-}
-
-/*!
- Constructs a geo rectangle from the contents of \a other.
-*/
-QGeoRectangle::QGeoRectangle(const QGeoRectangle &other)
-: QGeoShape(other)
-{
-}
-
-/*!
- Constructs a geo rectangle from the contents of \a other.
-*/
-QGeoRectangle::QGeoRectangle(const QGeoShape &other)
-: QGeoShape(other)
-{
- if (type() != QGeoShape::RectangleType)
- d_ptr = new QGeoRectanglePrivate;
-}
-
-/*!
- Destroys this geo rectangle.
-*/
-QGeoRectangle::~QGeoRectangle()
-{
-}
-
-/*!
- Assigns \a other to this geo rectangle and returns a reference to this geo rectangle.
-*/
-QGeoRectangle &QGeoRectangle::operator=(const QGeoRectangle &other)
-{
- QGeoShape::operator=(other);
- return *this;
-}
-
-/*!
- Returns whether this geo rectangle is equal to \a other.
-*/
-bool QGeoRectangle::operator==(const QGeoRectangle &other) const
-{
- Q_D(const QGeoRectangle);
-
- return *d == *other.d_func();
-}
-
-/*!
- Returns whether this geo rectangle is not equal to \a other.
-*/
-bool QGeoRectangle::operator!=(const QGeoRectangle &other) const
-{
- Q_D(const QGeoRectangle);
-
- return !(*d == *other.d_func());
-}
-
-bool QGeoRectanglePrivate::isValid() const
-{
- return topLeft.isValid() && bottomRight.isValid() &&
- topLeft.latitude() >= bottomRight.latitude();
-}
-
-bool QGeoRectanglePrivate::isEmpty() const
-{
- if (!isValid())
- return true;
-
- return topLeft.latitude() == bottomRight.latitude() ||
- topLeft.longitude() == bottomRight.longitude();
-}
-
-/*!
- Sets the top left coordinate of this geo rectangle to \a topLeft.
-*/
-void QGeoRectangle::setTopLeft(const QGeoCoordinate &topLeft)
-{
- Q_D(QGeoRectangle);
-
- d->topLeft = topLeft;
-}
-
-/*!
- Returns the top left coordinate of this geo rectangle.
-*/
-QGeoCoordinate QGeoRectangle::topLeft() const
-{
- Q_D(const QGeoRectangle);
-
- return d->topLeft;
-}
-
-/*!
- Sets the top right coordinate of this geo rectangle to \a topRight.
-*/
-void QGeoRectangle::setTopRight(const QGeoCoordinate &topRight)
-{
- Q_D(QGeoRectangle);
-
- d->topLeft.setLatitude(topRight.latitude());
- d->bottomRight.setLongitude(topRight.longitude());
-}
-
-/*!
- Returns the top right coordinate of this geo rectangle.
-*/
-QGeoCoordinate QGeoRectangle::topRight() const
-{
- // TODO remove?
- if (!isValid())
- return QGeoCoordinate();
-
- Q_D(const QGeoRectangle);
-
- return QGeoCoordinate(d->topLeft.latitude(), d->bottomRight.longitude());
-}
-
-/*!
- Sets the bottom left coordinate of this geo rectangle to \a bottomLeft.
-*/
-void QGeoRectangle::setBottomLeft(const QGeoCoordinate &bottomLeft)
-{
- Q_D(QGeoRectangle);
-
- d->bottomRight.setLatitude(bottomLeft.latitude());
- d->topLeft.setLongitude(bottomLeft.longitude());
-}
-
-/*!
- Returns the bottom left coordinate of this geo rectangle.
-*/
-QGeoCoordinate QGeoRectangle::bottomLeft() const
-{
- // TODO remove?
- if (!isValid())
- return QGeoCoordinate();
-
- Q_D(const QGeoRectangle);
-
- return QGeoCoordinate(d->bottomRight.latitude(), d->topLeft.longitude());
-}
-
-/*!
- Sets the bottom right coordinate of this geo rectangle to \a bottomRight.
-*/
-void QGeoRectangle::setBottomRight(const QGeoCoordinate &bottomRight)
-{
- Q_D(QGeoRectangle);
-
- d->bottomRight = bottomRight;
-}
-
-/*!
- Returns the bottom right coordinate of this geo rectangle.
-*/
-QGeoCoordinate QGeoRectangle::bottomRight() const
-{
- Q_D(const QGeoRectangle);
-
- return d->bottomRight;
-}
-
-/*!
- Sets the center of this geo rectangle to \a center.
-
- If this causes the geo rectangle to cross on of the poles the height of the
- geo rectangle will be truncated such that the geo rectangle only extends up
- to the pole. The center of the geo rectangle will be unchanged, and the
- height will be adjusted such that the center point is at the center of the
- truncated geo rectangle.
-
-*/
-void QGeoRectangle::setCenter(const QGeoCoordinate &center)
-{
- Q_D(QGeoRectangle);
-
- if (!isValid()) {
- d->topLeft = center;
- d->bottomRight = center;
- return;
- }
- double width = this->width();
- double height = this->height();
-
- double tlLat = center.latitude() + height / 2.0;
- double tlLon = center.longitude() - width / 2.0;
- double brLat = center.latitude() - height / 2.0;
- double brLon = center.longitude() + width / 2.0;
-
- if (tlLon < -180.0)
- tlLon += 360.0;
- if (tlLon > 180.0)
- tlLon -= 360.0;
-
- if (brLon < -180.0)
- brLon += 360.0;
- if (brLon > 180.0)
- brLon -= 360.0;
-
- if (tlLat > 90.0) {
- brLat = 2 * center.latitude() - 90.0;
- tlLat = 90.0;
- }
-
- if (tlLat < -90.0) {
- brLat = -90.0;
- tlLat = -90.0;
- }
-
- if (brLat > 90.0) {
- tlLat = 90.0;
- brLat = 90.0;
- }
-
- if (brLat < -90.0) {
- tlLat = 2 * center.latitude() + 90.0;
- brLat = -90.0;
- }
-
- if (width == 360.0) {
- tlLon = -180.0;
- brLon = 180.0;
- }
-
- d->topLeft = QGeoCoordinate(tlLat, tlLon);
- d->bottomRight = QGeoCoordinate(brLat, brLon);
-}
-
-/*!
- Returns the center of this geo rectangle.
-*/
-QGeoCoordinate QGeoRectangle::center() const
-{
- if (!isValid())
- return QGeoCoordinate();
-
- Q_D(const QGeoRectangle);
-
- double cLat = (d->topLeft.latitude() + d->bottomRight.latitude()) / 2.0;
-
- double cLon = (d->bottomRight.longitude() + d->topLeft.longitude()) / 2.0;
- if (d->topLeft.longitude() > d->bottomRight.longitude()) {
- cLon = cLon - 180.0;
- }
-
- if (cLon < -180.0)
- cLon += 360.0;
- if (cLon > 180.0)
- cLon -= 360.0;
-
- return QGeoCoordinate(cLat, cLon);
-}
-
-/*!
- Sets the width of this geo rectangle in degrees to \a degreesWidth.
-
- If \a degreesWidth is less than 0.0 or if this geo rectangle is invalid this
- function does nothing. To set up the values of an invalid
- geo rectangle based on the center, width and height you should use
- setCenter() first in order to make the geo rectangle valid.
-
- If \a degreesWidth is greater than 360.0 then 360.0 is used as the width,
- the leftmost longitude of the geo rectangle is set to -180.0 degrees and the
- rightmost longitude of the geo rectangle is set to 180.0 degrees.
-*/
-void QGeoRectangle::setWidth(double degreesWidth)
-{
- if (!isValid())
- return;
-
- if (degreesWidth < 0.0)
- return;
-
- Q_D(QGeoRectangle);
-
- if (degreesWidth >= 360.0) {
- d->topLeft.setLongitude(-180.0);
- d->bottomRight.setLongitude(180.0);
- return;
- }
-
- double tlLat = d->topLeft.latitude();
- double brLat = d->bottomRight.latitude();
-
- QGeoCoordinate c = center();
-
- double tlLon = c.longitude() - degreesWidth / 2.0;
-
- if (tlLon < -180.0)
- tlLon += 360.0;
- if (tlLon > 180.0)
- tlLon -= 360.0;
-
- double brLon = c.longitude() + degreesWidth / 2.0;
-
- if (brLon < -180.0)
- brLon += 360.0;
- if (brLon > 180.0)
- brLon -= 360.0;
-
- d->topLeft = QGeoCoordinate(tlLat, tlLon);
- d->bottomRight = QGeoCoordinate(brLat, brLon);
-}
-
-/*!
- Returns the width of this geo rectangle in degrees.
-
- The return value is undefined if this geo rectangle is invalid.
-*/
-double QGeoRectangle::width() const
-{
- if (!isValid())
- return qQNaN();
-
- Q_D(const QGeoRectangle);
-
- double result = d->bottomRight.longitude() - d->topLeft.longitude();
- if (result < 0.0)
- result += 360.0;
- if (result > 360.0)
- result -= 360.0;
-
- return result;
-}
-
-/*!
- Sets the height of this geo rectangle in degrees to \a degreesHeight.
-
- If \a degreesHeight is less than 0.0 or if this geo rectangle is invalid
- this function does nothing. To set up the values of an invalid
- geo rectangle based on the center, width and height you should use
- setCenter() first in order to make the geo rectangle valid.
-
- If the change in height would cause the geo rectangle to cross a pole
- the height is adjusted such that the geo rectangle only touches the pole.
-
- This change is done such that the center coordinate is still at the
- center of the geo rectangle, which may result in a geo rectangle with
- a smaller height than might otherwise be expected.
-
- If \a degreesHeight is greater than 180.0 then 180.0 is used as the height.
-*/
-void QGeoRectangle::setHeight(double degreesHeight)
-{
- if (!isValid())
- return;
-
- if (degreesHeight < 0.0)
- return;
-
- if (degreesHeight >= 180.0) {
- degreesHeight = 180.0;
- }
-
- Q_D(QGeoRectangle);
-
- double tlLon = d->topLeft.longitude();
- double brLon = d->bottomRight.longitude();
-
- QGeoCoordinate c = center();
-
- double tlLat = c.latitude() + degreesHeight / 2.0;
- double brLat = c.latitude() - degreesHeight / 2.0;
-
- if (tlLat > 90.0) {
- brLat = 2* c.latitude() - 90.0;
- tlLat = 90.0;
- }
-
- if (tlLat < -90.0) {
- brLat = -90.0;
- tlLat = -90.0;
- }
-
- if (brLat > 90.0) {
- tlLat = 90.0;
- brLat = 90.0;
- }
-
- if (brLat < -90.0) {
- tlLat = 2 * c.latitude() + 90.0;
- brLat = -90.0;
- }
-
- d->topLeft = QGeoCoordinate(tlLat, tlLon);
- d->bottomRight = QGeoCoordinate(brLat, brLon);
-}
-
-/*!
- Returns the height of this geo rectangle in degrees.
-
- The return value is undefined if this geo rectangle is invalid.
-*/
-double QGeoRectangle::height() const
-{
- if (!isValid())
- return qQNaN();
-
- Q_D(const QGeoRectangle);
-
- double result = d->topLeft.latitude() - d->bottomRight.latitude();
- if (result < 0.0)
- result = qQNaN();
- return result;
-}
-
-bool QGeoRectanglePrivate::contains(const QGeoCoordinate &coordinate) const
-{
- if (!isValid() || !coordinate.isValid())
- return false;
-
- double left = topLeft.longitude();
- double right = bottomRight.longitude();
- double top = topLeft.latitude();
- double bottom = bottomRight.latitude();
-
- double lon = coordinate.longitude();
- double lat = coordinate.latitude();
-
- if (lat > top)
- return false;
- if (lat < bottom)
- return false;
-
- if ((lat == 90.0) && (top == 90.0))
- return true;
-
- if ((lat == -90.0) && (bottom == -90.0))
- return true;
-
- if (left <= right) {
- if ((lon < left) || (lon > right))
- return false;
- } else {
- if ((lon < left) && (lon > right))
- return false;
- }
-
- return true;
-}
-
-/*!
- Returns whether the geo rectangle \a rectangle is contained within this
- geo rectangle.
-*/
-bool QGeoRectangle::contains(const QGeoRectangle &rectangle) const
-{
- Q_D(const QGeoRectangle);
-
- return (d->contains(rectangle.topLeft())
- && d->contains(rectangle.topRight())
- && d->contains(rectangle.bottomLeft())
- && d->contains(rectangle.bottomRight()));
-}
-
-/*!
- Returns whether the geo rectangle \a rectangle intersects this geo rectangle.
-
- If the top or bottom edges of both geo rectangles are at one of the poles
- the geo rectangles are considered to be intersecting, since the longitude
- is irrelevant when the edges are at the pole.
-*/
-bool QGeoRectangle::intersects(const QGeoRectangle &rectangle) const
-{
- Q_D(const QGeoRectangle);
-
- double left1 = d->topLeft.longitude();
- double right1 = d->bottomRight.longitude();
- double top1 = d->topLeft.latitude();
- double bottom1 = d->bottomRight.latitude();
-
- double left2 = rectangle.d_func()->topLeft.longitude();
- double right2 = rectangle.d_func()->bottomRight.longitude();
- double top2 = rectangle.d_func()->topLeft.latitude();
- double bottom2 = rectangle.d_func()->bottomRight.latitude();
-
- if (top1 < bottom2)
- return false;
-
- if (bottom1 > top2)
- return false;
-
- if ((top1 == 90.0) && (top1 == top2))
- return true;
-
- if ((bottom1 == -90.0) && (bottom1 == bottom2))
- return true;
-
- if (left1 < right1) {
- if (left2 < right2) {
- if ((left1 > right2) || (right1 < left2))
- return false;
- } else {
- if ((left1 > right2) && (right1 < left2))
- return false;
- }
- } else {
- if (left2 < right2) {
- if ((left2 > right1) && (right2 < left1))
- return false;
- } else {
- // if both wrap then they have to intersect
- }
- }
-
- return true;
-}
-
-/*!
- Translates this geo rectangle by \a degreesLatitude northwards and \a
- degreesLongitude eastwards.
-
- Negative values of \a degreesLatitude and \a degreesLongitude correspond to
- southward and westward translation respectively.
-
- If the translation would have caused the geo rectangle to cross a pole the
- geo rectangle will be translated until the top or bottom edge of the geo rectangle
- touches the pole but not further.
-*/
-void QGeoRectangle::translate(double degreesLatitude, double degreesLongitude)
-{
- // TODO handle dlat, dlon larger than 360 degrees
-
- Q_D(QGeoRectangle);
-
- double tlLat = d->topLeft.latitude();
- double tlLon = d->topLeft.longitude();
- double brLat = d->bottomRight.latitude();
- double brLon = d->bottomRight.longitude();
-
- if ((tlLat != 90.0) || (brLat != -90.0)) {
- tlLat += degreesLatitude;
- brLat += degreesLatitude;
- }
-
- if ( (tlLon != -180.0) || (brLon != 180.0) ) {
- tlLon += degreesLongitude;
- brLon += degreesLongitude;
- }
-
- if (tlLon < -180.0)
- tlLon += 360.0;
- if (tlLon > 180.0)
- tlLon -= 360.0;
-
- if (brLon < -180.0)
- brLon += 360.0;
- if (brLon > 180.0)
- brLon -= 360.0;
-
- if (tlLat > 90.0)
- tlLat = 90.0;
-
- if (tlLat < -90.0)
- tlLat = -90.0;
-
- if (brLat > 90.0)
- brLat = 90.0;
-
- if (brLat < -90.0)
- brLat = -90.0;
-
- d->topLeft = QGeoCoordinate(tlLat, tlLon);
- d->bottomRight = QGeoCoordinate(brLat, brLon);
-}
-
-/*!
- Returns a copy of this geo rectangle translated by \a degreesLatitude northwards and \a
- degreesLongitude eastwards.
-
- Negative values of \a degreesLatitude and \a degreesLongitude correspond to
- southward and westward translation respectively.
-
- \sa translate()
-*/
-QGeoRectangle QGeoRectangle::translated(double degreesLatitude, double degreesLongitude) const
-{
- QGeoRectangle result(*this);
- result.translate(degreesLatitude, degreesLongitude);
- return result;
-}
-
-/*!
- Returns the smallest geo rectangle which contains both this geo rectangle and \a rectangle.
-
- If the centers of the two geo rectangles are separated by exactly 180.0 degrees then the
- width is set to 360.0 degrees with the leftmost longitude set to -180.0 degrees and the
- rightmost longitude set to 180.0 degrees. This is done to ensure that the result is
- independent of the order of the operands.
-
-*/
-QGeoRectangle QGeoRectangle::united(const QGeoRectangle &rectangle) const
-{
- QGeoRectangle result(*this);
- result |= rectangle;
- return result;
-}
-
-/*!
- \fn QGeoRectangle QGeoRectangle::operator|(const QGeoRectangle &rectangle) const
-
- Returns the smallest geo rectangle which contains both this geo rectangle and \a rectangle.
-
- If the centers of the two geo rectangles are separated by exactly 180.0 degrees then the
- width is set to 360.0 degrees with the leftmost longitude set to -180.0 degrees and the
- rightmost longitude set to 180.0 degrees. This is done to ensure that the result is
- independent of the order of the operands.
-
-*/
-
-/*!
- Returns the smallest geo rectangle which contains both this geo rectangle and \a rectangle.
-
- If the centers of the two geo rectangles are separated by exactly 180.0 degrees then the
- width is set to 360.0 degrees with the leftmost longitude set to -180.0 degrees and the
- rightmost longitude set to 180.0 degrees. This is done to ensure that the result is
- independent of the order of the operands.
-
-*/
-QGeoRectangle &QGeoRectangle::operator|=(const QGeoRectangle &rectangle)
-{
- // If non-intersecting goes for most narrow box
-
- Q_D(QGeoRectangle);
-
- double left1 = d->topLeft.longitude();
- double right1 = d->bottomRight.longitude();
- double top1 = d->topLeft.latitude();
- double bottom1 = d->bottomRight.latitude();
-
- double left2 = rectangle.d_func()->topLeft.longitude();
- double right2 = rectangle.d_func()->bottomRight.longitude();
- double top2 = rectangle.d_func()->topLeft.latitude();
- double bottom2 = rectangle.d_func()->bottomRight.latitude();
-
- double top = qMax(top1, top2);
- double bottom = qMin(bottom1, bottom2);
-
- double left = 0.0;
- double right = 0.0;
-
- bool wrap1 = (left1 > right1);
- bool wrap2 = (left2 > right2);
-
- if ((wrap1 && wrap2) || (!wrap1 && !wrap2)) {
-
- double w = qAbs((left1 + right1 - left2 - right2) / 2.0);
-
- if (w < 180.0) {
- left = qMin(left1, left2);
- right = qMax(right1, right2);
- } else if (w > 180.0) {
- left = qMax(left1, left2);
- right = qMin(right1, right2);
- } else {
- left = -180.0;
- right = 180.0;
- }
-
- } else {
- double wrapLeft = 0.0;
- double wrapRight = 0.0;
- double nonWrapLeft = 0.0;
- double nonWrapRight = 0.0;
-
- if (wrap1) {
- wrapLeft = left1;
- wrapRight = right1;
- nonWrapLeft = left2;
- nonWrapRight = right2;
- } else {
- wrapLeft = left2;
- wrapRight = right2;
- nonWrapLeft = left1;
- nonWrapRight = right1;
- }
-
- bool joinWrapLeft = (nonWrapRight >= wrapLeft);
- bool joinWrapRight = (nonWrapLeft <= wrapRight);
-
- if (joinWrapLeft) {
- if (joinWrapRight) {
- left = -180.0;
- right = 180.0;
- } else {
- left = nonWrapLeft;
- right = wrapRight;
- }
- } else {
- if (joinWrapRight) {
- left = wrapLeft;
- right = nonWrapRight;
- } else {
- double wrapRightDistance = nonWrapLeft - wrapRight;
- double wrapLeftDistance = wrapLeft - nonWrapRight;
-
- if (wrapLeftDistance == wrapRightDistance) {
- left = -180.0;
- right = 180.0;
- } else if (wrapLeftDistance < wrapRightDistance) {
- left = nonWrapLeft;
- right = wrapRight;
- } else {
- left = wrapLeft;
- right = nonWrapRight;
- }
- }
- }
- }
-
- if (((left1 == -180) && (right1 == 180.0))
- || ((left2 == -180) && (right2 == 180.0))) {
- left = -180;
- right = 180;
- }
-
- d->topLeft = QGeoCoordinate(top, left);
- d->bottomRight = QGeoCoordinate(bottom, right);
-
- return *this;
-}
-
-/*******************************************************************************
-*******************************************************************************/
-
-QGeoRectanglePrivate::QGeoRectanglePrivate()
-: QGeoShapePrivate(QGeoShape::RectangleType)
-{
-}
-
-QGeoRectanglePrivate::QGeoRectanglePrivate(const QGeoCoordinate &topLeft,
- const QGeoCoordinate &bottomRight)
-: QGeoShapePrivate(QGeoShape::RectangleType), topLeft(topLeft), bottomRight(bottomRight)
-{
-}
-
-QGeoRectanglePrivate::QGeoRectanglePrivate(const QGeoRectanglePrivate &other)
-: QGeoShapePrivate(QGeoShape::RectangleType), topLeft(other.topLeft),
- bottomRight(other.bottomRight)
-{
-}
-
-QGeoRectanglePrivate::~QGeoRectanglePrivate() {}
-
-QGeoShapePrivate *QGeoRectanglePrivate::clone() const
-{
- return new QGeoRectanglePrivate(*this);
-}
-
-bool QGeoRectanglePrivate::operator==(const QGeoShapePrivate &other) const
-{
- if (!QGeoShapePrivate::operator==(other))
- return false;
-
- const QGeoRectanglePrivate &otherBox = static_cast<const QGeoRectanglePrivate &>(other);
-
- return topLeft == otherBox.topLeft && bottomRight == otherBox.bottomRight;
-}
-
-QT_END_NAMESPACE
-
diff --git a/src/location/qgeorectangle.h b/src/location/qgeorectangle.h
deleted file mode 100644
index 5d0ab579..00000000
--- a/src/location/qgeorectangle.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGEORECTANGLE_H
-#define QGEORECTANGLE_H
-
-#include <QtLocation/QGeoShape>
-
-QT_BEGIN_NAMESPACE
-
-class QGeoCoordinate;
-class QGeoRectanglePrivate;
-
-class Q_LOCATION_EXPORT QGeoRectangle : public QGeoShape
-{
-public:
- QGeoRectangle();
- QGeoRectangle(const QGeoCoordinate &center, double degreesWidth, double degreesHeight);
- QGeoRectangle(const QGeoCoordinate &topLeft, const QGeoCoordinate &bottomRight);
- QGeoRectangle(const QGeoRectangle &other);
- QGeoRectangle(const QGeoShape &other);
-
- ~QGeoRectangle();
-
- QGeoRectangle &operator=(const QGeoRectangle &other);
-
-#ifdef Q_NO_USING_KEYWORD
- bool operator==(const QGeoShape &other) const
- {
- return QGeoShape::operator==(other);
- }
-#else
- using QGeoShape::operator==;
-#endif
- bool operator==(const QGeoRectangle &other) const;
-
-#ifdef Q_NO_USING_KEYWORD
- bool operator!=(const QGeoShape &other) const
- {
- return QGeoShape::operator!=(other);
- }
-#else
- using QGeoShape::operator!=;
-#endif
- bool operator!=(const QGeoRectangle &other) const;
-
- void setTopLeft(const QGeoCoordinate &topLeft);
- QGeoCoordinate topLeft() const;
-
- void setTopRight(const QGeoCoordinate &topRight);
- QGeoCoordinate topRight() const;
-
- void setBottomLeft(const QGeoCoordinate &bottomLeft);
- QGeoCoordinate bottomLeft() const;
-
- void setBottomRight(const QGeoCoordinate &bottomRight);
- QGeoCoordinate bottomRight() const;
-
- void setCenter(const QGeoCoordinate &center);
- QGeoCoordinate center() const;
-
- void setWidth(double degreesWidth);
- double width() const;
-
- void setHeight(double degreesHeight);
- double height() const;
-
-#ifdef Q_NO_USING_KEYWORD
- bool contains(const QGeoCoordinate &coordinate) const
- {
- return QGeoShape::contains(coordinate);
- }
-#else
- using QGeoShape::contains;
-#endif
- bool contains(const QGeoRectangle &rectangle) const;
- bool intersects(const QGeoRectangle &rectangle) const;
-
- void translate(double degreesLatitude, double degreesLongitude);
- QGeoRectangle translated(double degreesLatitude, double degreesLongitude) const;
-
- QGeoRectangle united(const QGeoRectangle &rectangle) const;
- QGeoRectangle operator|(const QGeoRectangle &rectangle) const;
- QGeoRectangle &operator|=(const QGeoRectangle &rectangle);
-
-private:
- inline QGeoRectanglePrivate *d_func();
- inline const QGeoRectanglePrivate *d_func() const;
-};
-
-Q_DECLARE_TYPEINFO(QGeoRectangle, Q_MOVABLE_TYPE);
-
-inline QGeoRectangle QGeoRectangle::operator|(const QGeoRectangle &rectangle) const
-{
- return united(rectangle);
-}
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(QGeoRectangle)
-
-#endif
-
diff --git a/src/location/qgeorectangle_p.h b/src/location/qgeorectangle_p.h
deleted file mode 100644
index f61a2a91..00000000
--- a/src/location/qgeorectangle_p.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGEORECTANGLE_P_H
-#define QGEORECTANGLE_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qgeoshape_p.h"
-#include "qgeocoordinate.h"
-
-QT_BEGIN_NAMESPACE
-
-class QGeoRectanglePrivate : public QGeoShapePrivate
-{
-public:
- QGeoRectanglePrivate();
- QGeoRectanglePrivate(const QGeoCoordinate &topLeft, const QGeoCoordinate &bottomRight);
- QGeoRectanglePrivate(const QGeoRectanglePrivate &other);
- ~QGeoRectanglePrivate();
-
- bool isValid() const;
- bool isEmpty() const;
- bool contains(const QGeoCoordinate &coordinate) const;
-
- QGeoShapePrivate *clone() const;
-
- bool operator==(const QGeoShapePrivate &other) const;
-
- QGeoCoordinate topLeft;
- QGeoCoordinate bottomRight;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/location/qgeosatelliteinfo.cpp b/src/location/qgeosatelliteinfo.cpp
deleted file mode 100644
index acb2ce75..00000000
--- a/src/location/qgeosatelliteinfo.cpp
+++ /dev/null
@@ -1,315 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "qgeosatelliteinfo.h"
-
-#include <QHash>
-#include <QDebug>
-#include <QDataStream>
-
-QT_BEGIN_NAMESPACE
-
-class QGeoSatelliteInfoPrivate
-{
-public:
- int signal;
- int satId;
- QGeoSatelliteInfo::SatelliteSystem system;
- QHash<int, qreal> doubleAttribs;
-};
-
-
-/*!
- \class QGeoSatelliteInfo
- \inmodule QtLocation
- \ingroup QtLocation-positioning
- \since Qt Location 5.0
-
- \brief The QGeoSatelliteInfo class contains basic information about a satellite.
-
- \sa QGeoSatelliteInfoSource
-*/
-
-/*!
- \enum QGeoSatelliteInfo::Attribute
- Defines the attributes for the satellite information.
- \value Elevation The elevation of the satellite, in degrees.
- \value Azimuth The azimuth to true north, in degrees.
-*/
-
-/*!
- \enum QGeoSatelliteInfo::SatelliteSystem
- Defines the GNSS system of the satellite.
- \value Undefined Not defined.
- \value GPS Global Positioning System (USA).
- \value GLONASS Global Positioning System (Russia).
-
-*/
-
-
-/*!
- Creates a satellite information object.
-*/
-QGeoSatelliteInfo::QGeoSatelliteInfo()
- : d(new QGeoSatelliteInfoPrivate)
-{
- d->signal = -1;
- d->satId = -1;
- d->system = QGeoSatelliteInfo::Undefined;
-}
-
-/*!
- Creates a satellite information object with the values of \a other.
-*/
-
-QGeoSatelliteInfo::QGeoSatelliteInfo(const QGeoSatelliteInfo &other)
- : d(new QGeoSatelliteInfoPrivate)
-{
- operator=(other);
-}
-
-/*!
- Destroys a satellite information object.
-*/
-QGeoSatelliteInfo::~QGeoSatelliteInfo()
-{
- delete d;
-}
-
-/*!
- Assigns the values from \a other to this object.
-*/
-QGeoSatelliteInfo &QGeoSatelliteInfo::operator=(const QGeoSatelliteInfo & other)
-{
- if (this == &other)
- return *this;
-
- d->signal = other.d->signal;
- d->satId = other.d->satId;
- d->system = other.d->system;
- d->doubleAttribs = other.d->doubleAttribs;
- return *this;
-}
-
-/*!
- Returns true if all the information for this satellite
- are the same as those of \a other.
-*/
-bool QGeoSatelliteInfo::operator==(const QGeoSatelliteInfo &other) const
-{
- return d->signal == other.d->signal
- && d->satId == other.d->satId
- && d->system == other.d->system
- && d->doubleAttribs == other.d->doubleAttribs;
-}
-
-/*!
- \fn bool QGeoSatelliteInfo::operator!=(const QGeoSatelliteInfo &other) const;
-
- Returns true if any of the information for this satellite
- are not the same as those of \a other.
-*/
-
-
-/*!
- Sets the Satellite System (GPS, GLONASS, ...) to \a system.
-*/
-void QGeoSatelliteInfo::setSatelliteSystem(SatelliteSystem system)
-{
- d->system = system;
-}
-
-/*!
- Returns the Satellite System (GPS, GLONASS, ...)
-*/
-QGeoSatelliteInfo::SatelliteSystem QGeoSatelliteInfo::satelliteSystem() const
-{
- return d->system;
-}
-
-/*!
- Sets the satellite identifier number to \a satId.
-
- The satellite identifier number can be used to identify a satellite inside the satellite system.
- For satellite system GPS the satellite identifier number represents the PRN (Pseudo-random noise) number.
- For satellite system GLONASS the satellite identifier number represents the slot number.
-*/
-void QGeoSatelliteInfo::setSatelliteIdentifier(int satId)
-{
- d->satId = satId;
-}
-
-/*!
- Returns the satellite identifier number.
-
- The satellite identifier number can be used to identify a satellite inside the satellite system.
- For satellite system GPS the satellite identifier number represents the PRN (Pseudo-random noise) number.
- For satellite system GLONASS the satellite identifier number represents the slot number.
-*/
-int QGeoSatelliteInfo::satelliteIdentifier() const
-{
- return d->satId;
-}
-
-/*!
- Sets the signal strength to \a signalStrength, in decibels.
-*/
-void QGeoSatelliteInfo::setSignalStrength(int signalStrength)
-{
- d->signal = signalStrength;
-}
-
-/*!
- Returns the signal strength, or -1 if the value has not been set.
-*/
-int QGeoSatelliteInfo::signalStrength() const
-{
- return d->signal;
-}
-
-/*!
- Sets the value for \a attribute to \a value.
-*/
-void QGeoSatelliteInfo::setAttribute(Attribute attribute, qreal value)
-{
- d->doubleAttribs[int(attribute)] = value;
-}
-
-/*!
- Returns the value of the specified \a attribute as a qreal value.
-
- Returns -1 if the value has not been set.
-
- \sa hasAttribute(), setAttribute()
-*/
-qreal QGeoSatelliteInfo::attribute(Attribute attribute) const
-{
- if (d->doubleAttribs.contains(int(attribute)))
- return d->doubleAttribs[int(attribute)];
- return -1;
-}
-
-/*!
- Removes the specified \a attribute and its value.
-*/
-void QGeoSatelliteInfo::removeAttribute(Attribute attribute)
-{
- d->doubleAttribs.remove(int(attribute));
-}
-
-/*!
- Returns true if the specified \a attribute is present in this update.
-*/
-bool QGeoSatelliteInfo::hasAttribute(Attribute attribute) const
-{
- return d->doubleAttribs.contains(int(attribute));
-}
-
-#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug dbg, const QGeoSatelliteInfo &info)
-{
- dbg.nospace() << "QGeoSatelliteInfo(system=" << info.d->system;
- dbg.nospace() << ", satId=" << info.d->satId;
- dbg.nospace() << ", signal-strength=" << info.d->signal;
-
-
- QList<int> attribs = info.d->doubleAttribs.keys();
- for (int i = 0; i < attribs.count(); ++i) {
- dbg.nospace() << ", ";
- switch (attribs[i]) {
- case QGeoSatelliteInfo::Elevation:
- dbg.nospace() << "Elevation=";
- break;
- case QGeoSatelliteInfo::Azimuth:
- dbg.nospace() << "Azimuth=";
- break;
- }
- dbg.nospace() << info.d->doubleAttribs[attribs[i]];
- }
- dbg.nospace() << ')';
- return dbg;
-}
-#endif
-
-#ifndef QT_NO_DATASTREAM
-/*!
- \fn QDataStream &operator<<(QDataStream &stream, const QGeoSatelliteInfo &info)
- \relates QGeoSatelliteInfo
-
- Writes the given \a info to the specified \a stream.
-
- \sa \link datastreamformat.html Format of the QDataStream operators \endlink
-
-*/
-
-QDataStream &operator<<(QDataStream &stream, const QGeoSatelliteInfo &info)
-{
- stream << info.d->signal;
- stream << info.d->doubleAttribs;
- stream << info.d->satId;
- stream << info.d->system;
- return stream;
-}
-#endif
-
-#ifndef QT_NO_DATASTREAM
-/*!
- \fn QDataStream &operator>>(QDataStream &stream, QGeoSatelliteInfo &info)
- \relates QGeoSatelliteInfo
-
- Reads satellite information from the specified \a stream into the given
- \a info.
-
- \sa \link datastreamformat.html Format of the QDataStream operators \endlink
-*/
-
-QDataStream &operator>>(QDataStream &stream, QGeoSatelliteInfo &info)
-{
- int system;
- stream >> info.d->signal;
- stream >> info.d->doubleAttribs;
- stream >> info.d->satId;
- stream >> system;
- info.d->system = (QGeoSatelliteInfo::SatelliteSystem)system;
- return stream;
-}
-#endif
-
-QT_END_NAMESPACE
diff --git a/src/location/qgeosatelliteinfo.h b/src/location/qgeosatelliteinfo.h
deleted file mode 100644
index e2afb4ff..00000000
--- a/src/location/qgeosatelliteinfo.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QGEOSATELLITEINFO_H
-#define QGEOSATELLITEINFO_H
-
-#include <QtLocation/qlocationglobal.h>
-
-QT_BEGIN_NAMESPACE
-
-class QDebug;
-class QDataStream;
-
-class QGeoSatelliteInfoPrivate;
-class Q_LOCATION_EXPORT QGeoSatelliteInfo
-{
-public:
- enum Attribute {
- Elevation,
- Azimuth
- };
-
- enum SatelliteSystem {
- Undefined = 0x00,
- GPS = 0x01,
- GLONASS = 0x02
- };
-
- QGeoSatelliteInfo();
- QGeoSatelliteInfo(const QGeoSatelliteInfo &other);
- ~QGeoSatelliteInfo();
-
- QGeoSatelliteInfo &operator=(const QGeoSatelliteInfo &other);
-
- bool operator==(const QGeoSatelliteInfo &other) const;
- inline bool operator!=(const QGeoSatelliteInfo &other) const {
- return !operator==(other);
- }
-
- void setSatelliteSystem(SatelliteSystem system);
- SatelliteSystem satelliteSystem() const;
-
- void setSatelliteIdentifier(int satId);
- int satelliteIdentifier() const;
-
- void setSignalStrength(int signalStrength);
- int signalStrength() const;
-
- void setAttribute(Attribute attribute, qreal value);
- qreal attribute(Attribute attribute) const;
- void removeAttribute(Attribute attribute);
-
- bool hasAttribute(Attribute attribute) const;
-
-private:
-#ifndef QT_NO_DEBUG_STREAM
- friend Q_LOCATION_EXPORT QDebug operator<<(QDebug dbg, const QGeoSatelliteInfo &info);
-#endif
-#ifndef QT_NO_DATASTREAM
- friend Q_LOCATION_EXPORT QDataStream &operator<<(QDataStream &stream, const QGeoSatelliteInfo &info);
- friend Q_LOCATION_EXPORT QDataStream &operator>>(QDataStream &stream, QGeoSatelliteInfo &info);
-#endif
- QGeoSatelliteInfoPrivate *d;
-};
-
-#ifndef QT_NO_DEBUG_STREAM
-Q_LOCATION_EXPORT QDebug operator<<(QDebug dbg, const QGeoSatelliteInfo &info);
-#endif
-
-#ifndef QT_NO_DATASTREAM
-Q_LOCATION_EXPORT QDataStream &operator<<(QDataStream &stream, const QGeoSatelliteInfo &info);
-Q_LOCATION_EXPORT QDataStream &operator>>(QDataStream &stream, QGeoSatelliteInfo &info);
-#endif
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/location/qgeosatelliteinfosource.cpp b/src/location/qgeosatelliteinfosource.cpp
deleted file mode 100644
index 509d4781..00000000
--- a/src/location/qgeosatelliteinfosource.cpp
+++ /dev/null
@@ -1,320 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include <qgeosatelliteinfosource.h>
-#include "qgeopositioninfosourcefactory.h"
-#include "qgeopositioninfosource_p.h"
-#include <QPluginLoader>
-#include <QStringList>
-#include <QCryptographicHash>
-#include <QtCore/private/qfactoryloader_p.h>
-#include <QFile>
-
-QT_BEGIN_NAMESPACE
-
-/*!
- \class QGeoSatelliteInfoSource
- \inmodule QtLocation
- \ingroup QtLocation-positioning
- \since Qt Location 5.0
-
- \brief The QGeoSatelliteInfoSource class is an abstract base class for the distribution of satellite information updates.
-
- The static function QGeoSatelliteInfoSource::createDefaultSource() creates a default
- satellite data source that is appropriate for the platform, if one is
- available. Otherwise, available QGeoPositionInfoSourceFactory plugins will
- be checked for one that has a satellite data source available.
-
- Call startUpdates() and stopUpdates() to start and stop regular updates,
- or requestUpdate() to request a single update.
- When an update is available, satellitesInViewUpdated() and/or
- satellitesInUseUpdated() will be emitted.
-
- If regular satellite updates are required, setUpdateInterval() can be used
- to specify how often these updates should be emitted. If no interval is
- specified, updates are simply provided whenever they are available.
- For example:
-
- \code
- // Emit updates every 10 seconds if available
- QGeoSatelliteInfoSource *source = QGeoSatelliteInfoSource::createDefaultSource(0);
- if (source)
- source->setUpdateInterval(10000);
- \endcode
-
- To remove an update interval that was previously set, call
- setUpdateInterval() with a value of 0.
-
- Note that the satellite source may have a minimum value requirement for
- update intervals, as returned by minimumUpdateInterval().
-
- \warning On Windows CE it is not possible to detect if a device is GPS enabled.
- The default satellite source on a Windows CE device without GPS support will never provide any satellite data.
-*/
-
-class QGeoSatelliteInfoSourcePrivate
-{
-public:
- int interval;
-};
-
-/*!
- Creates a satellite source with the specified \a parent.
-*/
-QGeoSatelliteInfoSource::QGeoSatelliteInfoSource(QObject *parent)
- : QObject(parent),
- d(new QGeoSatelliteInfoSourcePrivate)
-{
- d->interval = 0;
-}
-
-/*!
- Destroys the satellite source.
-*/
-QGeoSatelliteInfoSource::~QGeoSatelliteInfoSource()
-{
- delete d;
-}
-
-/*!
- \property QGeoSatelliteInfoSource::updateInterval
- \brief This property holds the requested interval in milliseconds between each update.
-
- If the update interval is not set (or is set to 0) the
- source will provide updates as often as necessary.
-
- If the update interval is set, the source will provide updates at an
- interval as close to the requested interval as possible. If the requested
- interval is less than the minimumUpdateInterval(),
- the minimum interval is used instead.
-
- Changes to the update interval will happen as soon as is practical, however the
- time the change takes may vary between implementations. Whether or not the elapsed
- time from the previous interval is counted as part of the new interval is also
- implementation dependent.
-
- The default value for this property is 0.
-
- Note: Subclass implementations must call the base implementation of
- setUpdateInterval() so that updateInterval() returns the correct value.
-*/
-void QGeoSatelliteInfoSource::setUpdateInterval(int msec)
-{
- d->interval = msec;
-}
-
-int QGeoSatelliteInfoSource::updateInterval() const
-{
- return d->interval;
-}
-
-
-
-/*!
- Creates and returns a source with the specified \a parent that reads
- from the system's default source of satellite update information, or the
- highest priority available plugin.
-
- Returns 0 if the system has no default position source, no valid plugins
- could be found or the user does not have the permission to access the satellite data.
-*/
-QGeoSatelliteInfoSource *QGeoSatelliteInfoSource::createDefaultSource(QObject *parent)
-{
- QList<QJsonObject> plugins = QGeoPositionInfoSourcePrivate::pluginsSorted();
- foreach (const QJsonObject &obj, plugins) {
- if (obj.value(QStringLiteral("Satellite")).isBool()
- && obj.value(QStringLiteral("Satellite")).toBool())
- {
- QGeoPositionInfoSourcePrivate d;
- d.metaData = obj;
- d.loadPlugin();
- QGeoSatelliteInfoSource *s = 0;
- if (d.factory)
- s = d.factory->satelliteInfoSource(parent);
- return s;
- }
- }
-
- return 0;
-}
-
-/*!
- Creates and returns a source with the given \a parent,
- by loading the plugin named \a sourceName.
-
- Returns 0 if the plugin cannot be found.
-*/
-QGeoSatelliteInfoSource *QGeoSatelliteInfoSource::createSource(const QString &sourceName, QObject *parent)
-{
- QHash<QString, QJsonObject> plugins = QGeoPositionInfoSourcePrivate::plugins();
- if (plugins.contains(sourceName)) {
- QGeoPositionInfoSourcePrivate d;
- d.metaData = plugins.value(sourceName);
- d.loadPlugin();
- QGeoSatelliteInfoSource *src = 0;
- if (d.factory)
- src = d.factory->satelliteInfoSource(parent);
- return src;
- }
-
- return 0;
-}
-
-/*!
- Returns a list of available source plugins, including the default system
- backend if one is available.
-*/
-QStringList QGeoSatelliteInfoSource::availableSources()
-{
- QStringList plugins;
- QHash<QString, QJsonObject> meta = QGeoPositionInfoSourcePrivate::plugins();
- foreach (const QString &name, meta.keys()) {
- if (meta.value(name).value(QStringLiteral("Satellite")).isBool()
- && meta.value(name).value(QStringLiteral("Satellite")).toBool()) {
- plugins << name;
- }
- }
-
- return plugins;
-}
-
-/*!
- \fn void QGeoSatelliteInfoSource::satellitesInViewUpdated(const QList<QGeoSatelliteInfo> &satellites);
-
- If startUpdates() or requestUpdate() is called, this signal is emitted
- when an update is available on the satellites that are
- currently in view.
-
- The \a satellites parameter holds the satellites currently in view.
-*/
-
-/*!
- \fn void QGeoSatelliteInfoSource::satellitesInUseUpdated(const QList<QGeoSatelliteInfo> &satellites);
-
- If startUpdates() or requestUpdate() is called, this signal is emitted
- when an update is available on the number of satellites that are
- currently in use.
-
- These are the satellites that are used to get a "fix" - that
- is, those used to determine the current position.
-
- The \a satellites parameter holds the satellites currently in use.
-*/
-
-/*!
- \property QGeoSatelliteInfoSource::minimumUpdateInterval
- \brief This property holds the minimum time (in milliseconds) required to retrieve a satellite update.
-
- This is the minimum value accepted by setUpdateInterval() and
- requestUpdate().
-*/
-
-
-/*!
- \fn virtual void QGeoSatelliteInfoSource::startUpdates() = 0;
-
- Starts emitting updates at regular intervals. The updates will be
- provided whenever new satellite information becomes available.
-
- \sa satellitesInViewUpdated(), satellitesInUseUpdated()
-*/
-
-/*!
- \fn virtual void QGeoSatelliteInfoSource::stopUpdates() = 0;
-
- Stops emitting updates at regular intervals.
-*/
-
-/*!
- \fn virtual void QGeoSatelliteInfoSource::requestUpdate(int timeout = 0);
-
- Attempts to get the current satellite information and emit
- satellitesInViewUpdated() and satellitesInUseUpdated() with this
- information. If the current position cannot be found
- within the given \a timeout (in milliseconds) or if \a timeout is less than the value returned by
- minimumUpdateInterval(), requestTimeout() is
- emitted.
-
- If the timeout is zero, the timeout defaults to a reasonable timeout
- period as appropriate for the source.
-
- This does nothing if another update request is in progress. However
- it can be called even if startUpdates() has already been called and
- regular updates are in progress.
-*/
-
-/*!
- \fn void QGeoSatelliteInfoSource::requestTimeout();
-
- Emitted if requestUpdate() was called and the current satellite
- information could not be retrieved within the specified timeout.
-*/
-
-/*!
- \fn QGeoSatelliteInfoSource::Error QGeoSatelliteInfoSource::error() const = 0
-
- Returns the last error that occurred.
-*/
-
-/*!
- \fn void QGeoSatelliteInfoSource::error(QGeoSatelliteInfoSource::Error satelliteError)
-
- This signal is emitted after an error occurred. The \a satelliteError
- parameter describes the type of error that occurred.
-
-*/
-
-/*!
- \enum QGeoSatelliteInfoSource::Error
-
- The Error enumeration represents the errors which can occur.
-
- \value AccessError The connection setup to the remote positioning backend failed because the
- application lacked the required privileges.
- \value ClosedError The remote satellite backend closed the connection, which happens for example in case
- the user is switching location services to off. This object becomes invalid and should be deleted.
- A new satellite source can be created by calling createDefaultSource() later on.
- \value UnknownSourceError An unidentified error occurred.
- */
-
-
-#include "moc_qgeosatelliteinfosource.cpp"
-
-QT_END_NAMESPACE
diff --git a/src/location/qgeosatelliteinfosource.h b/src/location/qgeosatelliteinfosource.h
deleted file mode 100644
index c7f734b6..00000000
--- a/src/location/qgeosatelliteinfosource.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QGEOSATELLITEINFOSOURCE_H
-#define QGEOSATELLITEINFOSOURCE_H
-
-#include <QtLocation/QGeoSatelliteInfo>
-
-#include <QObject>
-#include <QList>
-
-QT_BEGIN_NAMESPACE
-
-class QGeoSatelliteInfoSourcePrivate;
-class Q_LOCATION_EXPORT QGeoSatelliteInfoSource : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(int updateInterval READ updateInterval WRITE setUpdateInterval)
- Q_PROPERTY(int minimumUpdateInterval READ minimumUpdateInterval)
-
-public:
- enum Error {
- AccessError,
- ClosedError, /* 1 */
- UnknownSourceError = -1
- };
- Q_ENUMS(Error)
-
- explicit QGeoSatelliteInfoSource(QObject *parent);
- virtual ~QGeoSatelliteInfoSource();
-
- static QGeoSatelliteInfoSource *createDefaultSource(QObject *parent);
- static QGeoSatelliteInfoSource *createSource(const QString &sourceName, QObject *parent);
- static QStringList availableSources();
-
- virtual void setUpdateInterval(int msec);
- int updateInterval() const;
- virtual int minimumUpdateInterval() const = 0;
- virtual Error error() const = 0;
-
-public Q_SLOTS:
- virtual void startUpdates() = 0;
- virtual void stopUpdates() = 0;
-
- virtual void requestUpdate(int timeout = 0) = 0;
-
-Q_SIGNALS:
- void satellitesInViewUpdated(const QList<QGeoSatelliteInfo> &satellites);
- void satellitesInUseUpdated(const QList<QGeoSatelliteInfo> &satellites);
- void requestTimeout();
- void error(QGeoSatelliteInfoSource::Error);
-
-private:
- Q_DISABLE_COPY(QGeoSatelliteInfoSource)
- QGeoSatelliteInfoSourcePrivate *d;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/location/qgeoshape.cpp b/src/location/qgeoshape.cpp
deleted file mode 100644
index 5481b1cf..00000000
--- a/src/location/qgeoshape.cpp
+++ /dev/null
@@ -1,307 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qgeoshape.h"
-#include "qgeoshape_p.h"
-#include "qgeorectangle.h"
-#include "qgeocircle.h"
-
-#ifndef QT_NO_DEBUG_STREAM
-#include <QtCore/QDebug>
-#endif
-
-#ifndef QT_NO_DATASTREAM
-#include <QtCore/QDataStream>
-#endif
-
-QT_BEGIN_NAMESPACE
-
-QGeoShapePrivate::QGeoShapePrivate(QGeoShape::ShapeType type)
-: type(type)
-{
-}
-
-QGeoShapePrivate::~QGeoShapePrivate()
-{
-}
-
-bool QGeoShapePrivate::operator==(const QGeoShapePrivate &other) const
-{
- return type == other.type;
-}
-
-/*!
- \class QGeoShape
- \inmodule QtLocation
- \ingroup QtLocation-positioning
- \since Qt Location 5.0
-
- \brief The QGeoShape class defines a geographic area.
-
- This class is the base class for classes which specify a geographic
- area.
-
- For the sake of consistency, subclasses should describe the specific
- details of the associated areas in terms of QGeoCoordinate instances
- and distances in meters.
-*/
-
-/*!
- \enum QGeoShape::ShapeType
-
- Describes the type of the shape.
-
- \value UnknownType A shape of unknown type.
- \value RectangleType A rectangular shape.
- \value CircleType A circular shape.
-*/
-
-inline QGeoShapePrivate *QGeoShape::d_func()
-{
- return static_cast<QGeoShapePrivate *>(d_ptr.data());
-}
-
-inline const QGeoShapePrivate *QGeoShape::d_func() const
-{
- return static_cast<const QGeoShapePrivate *>(d_ptr.constData());
-}
-
-/*!
- Constructs a new invalid geo shape of \l UnknownType.
-*/
-QGeoShape::QGeoShape()
-{
-}
-
-/*!
- Constructs a new geo shape which is a copy of \a other.
-*/
-QGeoShape::QGeoShape(const QGeoShape &other)
-: d_ptr(other.d_ptr)
-{
-}
-
-/*!
- \internal
-*/
-QGeoShape::QGeoShape(QGeoShapePrivate *d)
-: d_ptr(d)
-{
-}
-
-/*!
- Destroys this geo shape.
-*/
-QGeoShape::~QGeoShape()
-{
-}
-
-/*!
- Returns the type of this geo shape.
-*/
-QGeoShape::ShapeType QGeoShape::type() const
-{
- Q_D(const QGeoShape);
-
- if (d)
- return d->type;
- else
- return UnknownType;
-}
-
-/*!
- Returns whether this geo shape is valid.
-
- An geo shape is considered to be invalid if some of the data that is required to
- unambiguously describe the geo shape has not been set or has been set to an
- unsuitable value.
-*/
-bool QGeoShape::isValid() const
-{
- Q_D(const QGeoShape);
-
- if (d)
- return d->isValid();
- else
- return false;
-}
-
-/*!
- Returns whether this geo shape is empty.
-
- An empty geo shape is a region which has a geometrical area of 0.
-*/
-bool QGeoShape::isEmpty() const
-{
- Q_D(const QGeoShape);
-
- if (d)
- return d->isEmpty();
- else
- return true;
-}
-
-/*!
- Returns whether the coordinate \a coordinate is contained within this geo shape.
-*/
-bool QGeoShape::contains(const QGeoCoordinate &coordinate) const
-{
- Q_D(const QGeoShape);
-
- if (d)
- return d->contains(coordinate);
- else
- return false;
-}
-
-
-/*!
- Returns true if the \a other geo shape is equivalent to this geo shape, otherwise returns
- false.
-*/
-bool QGeoShape::operator==(const QGeoShape &other) const
-{
- Q_D(const QGeoShape);
-
- if (d == other.d_func())
- return true;
-
- if (!d || !(other.d_func()))
- return false;
-
- return *d == *other.d_func();
-}
-
-/*!
- Returns true if the \a other geo shape is not equivalent to this geo shape, otherwise returns
- false.
-*/
-bool QGeoShape::operator!=(const QGeoShape &other) const
-{
- return !(*this == other);
-}
-
-/*!
- Assigns \a other to this geo shape and returns a reference to this geo shape.
-*/
-QGeoShape &QGeoShape::operator=(const QGeoShape &other)
-{
- if (this == &other)
- return *this;
-
- d_ptr = other.d_ptr;
- return *this;
-}
-
-#ifndef QT_NO_DEBUG_STREAM
-QDebug operator<<(QDebug dbg, const QGeoShape &shape)
-{
- //dbg << *shape.d_func();
- dbg.nospace() << "QGeoShape(";
- switch (shape.type()) {
- case QGeoShape::UnknownType:
- dbg.nospace() << "Unknown";
- break;
- case QGeoShape::RectangleType:
- dbg.nospace() << "Rectangle";
- break;
- case QGeoShape::CircleType:
- dbg.nospace() << "Circle";
- }
-
- dbg.nospace() << ')';
-
- return dbg;
-}
-#endif
-
-#ifndef QT_NO_DATASTREAM
-QDataStream &operator<<(QDataStream &stream, const QGeoShape &shape)
-{
- stream << quint32(shape.type());
- switch (shape.type()) {
- case QGeoShape::UnknownType:
- break;
- case QGeoShape::RectangleType: {
- QGeoRectangle r = shape;
- stream << r.topLeft() << r.bottomRight();
- break;
- }
- case QGeoShape::CircleType: {
- QGeoCircle c = shape;
- stream << c.center() << c.radius();
- break;
- }
- }
-
- return stream;
-}
-
-QDataStream &operator>>(QDataStream &stream, QGeoShape &shape)
-{
- quint32 type;
- stream >> type;
-
- switch (type) {
- case QGeoShape::UnknownType:
- shape = QGeoShape();
- break;
- case QGeoShape::RectangleType: {
- QGeoCoordinate tl;
- QGeoCoordinate br;
- stream >> tl >> br;
- shape = QGeoRectangle(tl, br);
- break;
- }
- case QGeoShape::CircleType: {
- QGeoCoordinate c;
- qreal r;
- stream >> c >> r;
- shape = QGeoCircle(c, r);
- break;
- }
- }
-
- return stream;
-}
-#endif
-
-QT_END_NAMESPACE
diff --git a/src/location/qgeoshape.h b/src/location/qgeoshape.h
deleted file mode 100644
index 8be73aeb..00000000
--- a/src/location/qgeoshape.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGEOSHAPE_H
-#define QGEOSHAPE_H
-
-#include <QtCore/QSharedDataPointer>
-#include <QtLocation/QGeoCoordinate>
-
-QT_BEGIN_NAMESPACE
-
-class QDebug;
-class QGeoShapePrivate;
-
-class Q_LOCATION_EXPORT QGeoShape
-{
-public:
- QGeoShape();
- QGeoShape(const QGeoShape &other);
- ~QGeoShape();
-
- enum ShapeType {
- UnknownType,
- RectangleType,
- CircleType
- };
-
- ShapeType type() const;
-
- bool isValid() const;
- bool isEmpty() const;
- bool contains(const QGeoCoordinate &coordinate) const;
-
- bool operator==(const QGeoShape &other) const;
- bool operator!=(const QGeoShape &other) const;
-
- QGeoShape &operator=(const QGeoShape &other);
-
-protected:
- QGeoShape(QGeoShapePrivate *d);
-
- QSharedDataPointer<QGeoShapePrivate> d_ptr;
-
-private:
- inline QGeoShapePrivate *d_func();
- inline const QGeoShapePrivate *d_func() const;
-};
-
-Q_DECLARE_TYPEINFO(QGeoShape, Q_MOVABLE_TYPE);
-
-#ifndef QT_NO_DEBUG_STREAM
-Q_LOCATION_EXPORT QDebug operator<<(QDebug, const QGeoShape &);
-#endif
-
-#ifndef QT_NO_DATASTREAM
-Q_LOCATION_EXPORT QDataStream &operator<<(QDataStream &stream, const QGeoShape &shape);
-Q_LOCATION_EXPORT QDataStream &operator>>(QDataStream &stream, QGeoShape &shape);
-#endif
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(QGeoShape)
-
-#endif
-
diff --git a/src/location/qgeoshape_p.h b/src/location/qgeoshape_p.h
deleted file mode 100644
index 497df8d2..00000000
--- a/src/location/qgeoshape_p.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QGEOSHAPE_P_H
-#define QGEOSHAPE_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtCore/QSharedData>
-
-#include "qgeoshape.h"
-
-QT_BEGIN_NAMESPACE
-
-class QGeoShapePrivate : public QSharedData
-{
-public:
- explicit QGeoShapePrivate(QGeoShape::ShapeType type);
- virtual ~QGeoShapePrivate();
-
- virtual bool isValid() const = 0;
- virtual bool isEmpty() const = 0;
- virtual bool contains(const QGeoCoordinate &coordinate) const = 0;
-
- virtual QGeoShapePrivate *clone() const = 0;
-
- virtual bool operator==(const QGeoShapePrivate &other) const;
-
- QGeoShape::ShapeType type;
-};
-
-// don't use the copy constructor when detaching from a QSharedDataPointer, use virtual clone()
-// call instead.
-template <>
-Q_INLINE_TEMPLATE QGeoShapePrivate *QSharedDataPointer<QGeoShapePrivate>::clone()
-{
- return d->clone();
-}
-
-QT_END_NAMESPACE
-
-#endif
-
diff --git a/src/location/qlocationutils.cpp b/src/location/qlocationutils.cpp
deleted file mode 100644
index accb8373..00000000
--- a/src/location/qlocationutils.cpp
+++ /dev/null
@@ -1,357 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "qlocationutils_p.h"
-#include "qgeopositioninfo.h"
-
-#include <QTime>
-#include <QList>
-#include <QByteArray>
-#include <QDebug>
-
-#include <math.h>
-
-QT_BEGIN_NAMESPACE
-
-// converts e.g. 15306.0235 from NMEA sentence to 153.100392
-static double qlocationutils_nmeaDegreesToDecimal(double nmeaDegrees)
-{
- double deg;
- double min = 100.0 * modf(nmeaDegrees / 100.0, &deg);
- return deg + (min / 60.0);
-}
-
-static void qlocationutils_readGga(const char *data, int size, QGeoPositionInfo *info, bool *hasFix)
-{
- QByteArray sentence(data, size);
- QList<QByteArray> parts = sentence.split(',');
- QGeoCoordinate coord;
-
- if (hasFix && parts.count() > 6 && parts[6].count() > 0)
- *hasFix = parts[6].toInt() > 0;
-
- if (parts.count() > 1 && parts[1].count() > 0) {
- QTime time;
- if (QLocationUtils::getNmeaTime(parts[1], &time))
- info->setTimestamp(QDateTime(QDate(), time, Qt::UTC));
- }
-
- if (parts.count() > 5 && parts[3].count() == 1 && parts[5].count() == 1) {
- double lat;
- double lng;
- if (QLocationUtils::getNmeaLatLong(parts[2], parts[3][0], parts[4], parts[5][0], &lat, &lng)) {
- coord.setLatitude(lat);
- coord.setLongitude(lng);
- }
- }
-
- if (parts.count() > 9 && parts[9].count() > 0) {
- bool hasAlt = false;
- double alt = parts[9].toDouble(&hasAlt);
- if (hasAlt)
- coord.setAltitude(alt);
- }
-
- if (coord.type() != QGeoCoordinate::InvalidCoordinate)
- info->setCoordinate(coord);
-}
-
-static void qlocationutils_readGll(const char *data, int size, QGeoPositionInfo *info, bool *hasFix)
-{
- QByteArray sentence(data, size);
- QList<QByteArray> parts = sentence.split(',');
- QGeoCoordinate coord;
-
- if (hasFix && parts.count() > 6 && parts[6].count() > 0)
- *hasFix = (parts[6][0] == 'A');
-
- if (parts.count() > 5 && parts[5].count() > 0) {
- QTime time;
- if (QLocationUtils::getNmeaTime(parts[5], &time))
- info->setTimestamp(QDateTime(QDate(), time, Qt::UTC));
- }
-
- if (parts.count() > 4 && parts[2].count() == 1 && parts[4].count() == 1) {
- double lat;
- double lng;
- if (QLocationUtils::getNmeaLatLong(parts[1], parts[2][0], parts[3], parts[4][0], &lat, &lng)) {
- coord.setLatitude(lat);
- coord.setLongitude(lng);
- }
- }
-
- if (coord.type() != QGeoCoordinate::InvalidCoordinate)
- info->setCoordinate(coord);
-}
-
-static void qlocationutils_readRmc(const char *data, int size, QGeoPositionInfo *info, bool *hasFix)
-{
- QByteArray sentence(data, size);
- QList<QByteArray> parts = sentence.split(',');
- QGeoCoordinate coord;
- QDate date;
- QTime time;
-
- if (hasFix && parts.count() > 2 && parts[2].count() > 0)
- *hasFix = (parts[2][0] == 'A');
-
- if (parts.count() > 9 && parts[9].count() == 6) {
- date = QDate::fromString(QString::fromLatin1(parts[9]), QLatin1String("ddMMyy"));
- if (date.isValid())
- date = date.addYears(100); // otherwise starts from 1900
- else
- date = QDate();
- }
-
- if (parts.count() > 1 && parts[1].count() > 0)
- QLocationUtils::getNmeaTime(parts[1], &time);
-
- if (parts.count() > 6 && parts[4].count() == 1 && parts[6].count() == 1) {
- double lat;
- double lng;
- if (QLocationUtils::getNmeaLatLong(parts[3], parts[4][0], parts[5], parts[6][0], &lat, &lng)) {
- coord.setLatitude(lat);
- coord.setLongitude(lng);
- }
- }
-
- bool parsed = false;
- double value = 0.0;
- if (parts.count() > 7 && parts[7].count() > 0) {
- value = parts[7].toDouble(&parsed);
- if (parsed)
- info->setAttribute(QGeoPositionInfo::GroundSpeed, qreal(value * 1.852 / 3.6)); // knots -> m/s
- }
- if (parts.count() > 8 && parts[8].count() > 0) {
- value = parts[8].toDouble(&parsed);
- if (parsed)
- info->setAttribute(QGeoPositionInfo::Direction, qreal(value));
- }
- if (parts.count() > 11 && parts[11].count() == 1
- && (parts[11][0] == 'E' || parts[11][0] == 'W')) {
- value = parts[10].toDouble(&parsed);
- if (parsed) {
- if (parts[11][0] == 'W')
- value *= -1;
- info->setAttribute(QGeoPositionInfo::MagneticVariation, qreal(value));
- }
- }
-
- if (coord.type() != QGeoCoordinate::InvalidCoordinate)
- info->setCoordinate(coord);
-
- info->setTimestamp(QDateTime(date, time, Qt::UTC));
-}
-
-static void qlocationutils_readVtg(const char *data, int size, QGeoPositionInfo *info, bool *hasFix)
-{
- if (hasFix)
- *hasFix = false;
-
- QByteArray sentence(data, size);
- QList<QByteArray> parts = sentence.split(',');
-
- bool parsed = false;
- double value = 0.0;
- if (parts.count() > 1 && parts[1].count() > 0) {
- value = parts[1].toDouble(&parsed);
- if (parsed)
- info->setAttribute(QGeoPositionInfo::Direction, qreal(value));
- }
- if (parts.count() > 7 && parts[7].count() > 0) {
- value = parts[7].toDouble(&parsed);
- if (parsed)
- info->setAttribute(QGeoPositionInfo::GroundSpeed, qreal(value / 3.6)); // km/h -> m/s
- }
-}
-
-static void qlocationutils_readZda(const char *data, int size, QGeoPositionInfo *info, bool *hasFix)
-{
- if (hasFix)
- *hasFix = false;
-
- QByteArray sentence(data, size);
- QList<QByteArray> parts = sentence.split(',');
- QDate date;
- QTime time;
-
- if (parts.count() > 1 && parts[1].count() > 0)
- QLocationUtils::getNmeaTime(parts[1], &time);
-
- if (parts.count() > 4 && parts[2].count() > 0 && parts[3].count() > 0
- && parts[4].count() == 4) { // must be full 4-digit year
- int day = parts[2].toUInt();
- int month = parts[3].toUInt();
- int year = parts[4].toUInt();
- if (day > 0 && month > 0 && year > 0)
- date.setDate(year, month, day);
- }
-
- info->setTimestamp(QDateTime(date, time, Qt::UTC));
-}
-
-bool QLocationUtils::getPosInfoFromNmea(const char *data, int size, QGeoPositionInfo *info, bool *hasFix)
-{
- if (!info)
- return false;
-
- if (hasFix)
- *hasFix = false;
- if (size < 6 || data[0] != '$' || !hasValidNmeaChecksum(data, size))
- return false;
-
- if (data[3] == 'G' && data[4] == 'G' && data[5] == 'A') {
- // "$--GGA" sentence.
- qlocationutils_readGga(data, size, info, hasFix);
- return true;
- }
-
- if (data[3] == 'G' && data[4] == 'L' && data[5] == 'L') {
- // "$--GLL" sentence.
- qlocationutils_readGll(data, size, info, hasFix);
- return true;
- }
-
- if (data[3] == 'R' && data[4] == 'M' && data[5] == 'C') {
- // "$--RMC" sentence.
- qlocationutils_readRmc(data, size, info, hasFix);
- return true;
- }
-
- if (data[3] == 'V' && data[4] == 'T' && data[5] == 'G') {
- // "$--VTG" sentence.
- qlocationutils_readVtg(data, size, info, hasFix);
- return true;
- }
-
- if (data[3] == 'Z' && data[4] == 'D' && data[5] == 'A') {
- // "$--ZDA" sentence.
- qlocationutils_readZda(data, size, info, hasFix);
- return true;
- }
-
- return false;
-}
-
-bool QLocationUtils::hasValidNmeaChecksum(const char *data, int size)
-{
- int asteriskIndex = -1;
- for (int i = 0; i < size; ++i) {
- if (data[i] == '*') {
- asteriskIndex = i;
- break;
- }
- }
-
- const int CSUM_LEN = 2;
- if (asteriskIndex < 0 || asteriskIndex + CSUM_LEN >= size)
- return false;
-
- // XOR byte value of all characters between '$' and '*'
- int result = 0;
- for (int i = 1; i < asteriskIndex; ++i)
- result ^= data[i];
- /*
- char calc[CSUM_LEN + 1];
- ::snprintf(calc, CSUM_LEN + 1, "%02x", result);
- return ::strncmp(calc, &data[asteriskIndex+1], 2) == 0;
- */
-
- QByteArray checkSumBytes(&data[asteriskIndex + 1], 2);
- bool ok = false;
- int checksum = checkSumBytes.toInt(&ok,16);
- return ok && checksum == result;
-}
-
-bool QLocationUtils::getNmeaTime(const QByteArray &bytes, QTime *time)
-{
- int dotIndex = bytes.indexOf('.');
- QTime tempTime;
-
- if (dotIndex < 0) {
- tempTime = QTime::fromString(QString::fromLatin1(bytes.constData()),
- QLatin1String("hhmmss"));
- } else {
- tempTime = QTime::fromString(QString::fromLatin1(bytes.mid(0, dotIndex)),
- QLatin1String("hhmmss"));
- bool hasMsecs = false;
- int midLen = qMin(3, bytes.size() - dotIndex - 1);
- int msecs = bytes.mid(dotIndex + 1, midLen).toUInt(&hasMsecs);
- if (hasMsecs)
- tempTime = tempTime.addMSecs(msecs);
- }
-
- if (tempTime.isValid()) {
- *time = tempTime;
- return true;
- }
- return false;
-}
-
-bool QLocationUtils::getNmeaLatLong(const QByteArray &latString, char latDirection, const QByteArray &lngString, char lngDirection, double *lat, double *lng)
-{
- if ((latDirection != 'N' && latDirection != 'S')
- || (lngDirection != 'E' && lngDirection != 'W')) {
- return false;
- }
-
- bool hasLat = false;
- bool hasLong = false;
- double tempLat = latString.toDouble(&hasLat);
- double tempLng = lngString.toDouble(&hasLong);
- if (hasLat && hasLong) {
- tempLat = qlocationutils_nmeaDegreesToDecimal(tempLat);
- if (latDirection == 'S')
- tempLat *= -1;
- tempLng = qlocationutils_nmeaDegreesToDecimal(tempLng);
- if (lngDirection == 'W')
- tempLng *= -1;
-
- if (isValidLat(tempLat) && isValidLong(tempLng)) {
- *lat = tempLat;
- *lng = tempLng;
- return true;
- }
- }
- return false;
-}
-
-QT_END_NAMESPACE
-
diff --git a/src/location/qlocationutils_p.h b/src/location/qlocationutils_p.h
deleted file mode 100644
index 700bfa64..00000000
--- a/src/location/qlocationutils_p.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QLOCATIONUTILS_P_H
-#define QLOCATIONUTILS_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtCore/QtGlobal>
-
-QT_BEGIN_NAMESPACE
-class QTime;
-class QByteArray;
-
-class QGeoPositionInfo;
-class QLocationUtils
-{
-public:
- inline static bool isValidLat(double lat) {
- return lat >= -90 && lat <= 90;
- }
- inline static bool isValidLong(double lng) {
- return lng >= -180 && lng <= 180;
- }
-
- inline static double clipLat(double lat) {
- if (lat > 90)
- lat = 90;
- else if (lat < -90)
- lat = -90;
- return lat;
- }
-
- inline static double wrapLong(double lng) {
- if (lng > 180)
- lng -= 360;
- else if (lng < -180)
- lng += 360;
- return lng;
- }
-
- /*
- Creates a QGeoPositionInfo from a GGA, GLL, RMC, VTG or ZDA sentence.
-
- Note:
- - GGA and GLL sentences have time but not date so the update's
- QDateTime object will have an invalid date.
- - RMC reports date with a two-digit year so in this case the year
- is assumed to be after the year 2000.
- */
- Q_AUTOTEST_EXPORT static bool getPosInfoFromNmea(const char *data, int size, QGeoPositionInfo *info, bool *hasFix = 0);
-
- /*
- Returns true if the given NMEA sentence has a valid checksum.
- */
- Q_AUTOTEST_EXPORT static bool hasValidNmeaChecksum(const char *data, int size);
-
- /*
- Returns time from a string in hhmmss or hhmmss.z+ format.
- */
- Q_AUTOTEST_EXPORT static bool getNmeaTime(const QByteArray &bytes, QTime *time);
-
- /*
- Accepts for example ("2734.7964", 'S', "15306.0124", 'E') and returns the
- lat-long values. Fails if lat or long fail isValidLat() or isValidLong().
- */
- Q_AUTOTEST_EXPORT static bool getNmeaLatLong(const QByteArray &latString, char latDirection, const QByteArray &lngString, char lngDirection, double *lat, double *lon);
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/location/qnmeapositioninfosource.cpp b/src/location/qnmeapositioninfosource.cpp
deleted file mode 100644
index 6232a8bb..00000000
--- a/src/location/qnmeapositioninfosource.cpp
+++ /dev/null
@@ -1,623 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "qnmeapositioninfosource_p.h"
-#include "qlocationutils_p.h"
-
-#include <QIODevice>
-#include <QBasicTimer>
-#include <QTimerEvent>
-#include <QTimer>
-
-
-QT_BEGIN_NAMESPACE
-
-QNmeaRealTimeReader::QNmeaRealTimeReader(QNmeaPositionInfoSourcePrivate *sourcePrivate)
- : QNmeaReader(sourcePrivate)
-{
-}
-
-void QNmeaRealTimeReader::readAvailableData()
-{
- while (m_proxy->m_device->canReadLine()){
- QGeoPositionInfo update;
- bool hasFix = false;
-
- char buf[1024];
- qint64 size = m_proxy->m_device->readLine(buf, sizeof(buf));
- if (m_proxy->parsePosInfoFromNmeaData(buf, size, &update, &hasFix))
- m_proxy->notifyNewUpdate(&update, hasFix);
- }
-}
-
-
-//============================================================
-
-QNmeaSimulatedReader::QNmeaSimulatedReader(QNmeaPositionInfoSourcePrivate *sourcePrivate)
- : QNmeaReader(sourcePrivate),
- m_currTimerId(-1),
- m_hasValidDateTime(false)
-{
-}
-
-QNmeaSimulatedReader::~QNmeaSimulatedReader()
-{
- if (m_currTimerId > 0)
- killTimer(m_currTimerId);
-}
-
-void QNmeaSimulatedReader::readAvailableData()
-{
- if (m_currTimerId > 0) // we are already reading
- return;
-
- if (!m_hasValidDateTime) { // first update
- Q_ASSERT(m_proxy->m_device && (m_proxy->m_device->openMode() & QIODevice::ReadOnly));
-
- if (!setFirstDateTime()) {
- //m_proxy->notifyReachedEndOfFile();
- qWarning("QNmeaPositionInfoSource: cannot find NMEA sentence with valid date & time");
- return;
- }
-
- m_hasValidDateTime = true;
- simulatePendingUpdate();
-
- } else {
- // previously read to EOF, but now new data has arrived
- processNextSentence();
- }
-}
-
-bool QNmeaSimulatedReader::setFirstDateTime()
-{
- // find the first update with valid date and time
- QGeoPositionInfo update;
- bool hasFix = false;
- while (m_proxy->m_device->bytesAvailable() > 0) {
- char buf[1024];
- qint64 size = m_proxy->m_device->readLine(buf, sizeof(buf));
- if (size <= 0)
- continue;
- bool ok = m_proxy->parsePosInfoFromNmeaData(buf, size, &update, &hasFix);
- if (ok && update.timestamp().isValid()) {
- QPendingGeoPositionInfo pending;
- pending.info = update;
- pending.hasFix = hasFix;
- m_pendingUpdates.enqueue(pending);
- return true;
- }
- }
- return false;
-}
-
-void QNmeaSimulatedReader::simulatePendingUpdate()
-{
- if (m_pendingUpdates.size() > 0) {
- // will be dequeued in processNextSentence()
- QPendingGeoPositionInfo &pending = m_pendingUpdates.head();
- if (pending.info.coordinate().type() != QGeoCoordinate::InvalidCoordinate)
- m_proxy->notifyNewUpdate(&pending.info, pending.hasFix);
- }
-
- processNextSentence();
-}
-
-void QNmeaSimulatedReader::timerEvent(QTimerEvent *event)
-{
- killTimer(event->timerId());
- m_currTimerId = -1;
- simulatePendingUpdate();
-}
-
-void QNmeaSimulatedReader::processNextSentence()
-{
- QGeoPositionInfo info;
- bool hasFix = false;
- int timeToNextUpdate = -1;
- QTime prevTime;
- if (m_pendingUpdates.size() > 0)
- prevTime = m_pendingUpdates.head().info.timestamp().time();
-
- // find the next update with a valid time (as long as the time is valid,
- // we can calculate when the update should be emitted)
- while (m_proxy->m_device && m_proxy->m_device->bytesAvailable() > 0) {
- char buf[1024];
- qint64 size = m_proxy->m_device->readLine(buf, sizeof(buf));
- if (size <= 0)
- continue;
- if (m_proxy->parsePosInfoFromNmeaData(buf, size, &info, &hasFix)) {
- QTime time = info.timestamp().time();
- if (time.isValid()) {
- if (!prevTime.isValid()) {
- timeToNextUpdate = 0;
- break;
- }
- timeToNextUpdate = prevTime.msecsTo(time);
- if (timeToNextUpdate >= 0)
- break;
- }
- }
- }
-
- if (timeToNextUpdate < 0)
- return;
-
- m_pendingUpdates.dequeue();
-
- QPendingGeoPositionInfo pending;
- pending.info = info;
- pending.hasFix = hasFix;
- m_pendingUpdates.enqueue(pending);
- m_currTimerId = startTimer(timeToNextUpdate);
-}
-
-
-//============================================================
-
-
-QNmeaPositionInfoSourcePrivate::QNmeaPositionInfoSourcePrivate(QNmeaPositionInfoSource *parent, QNmeaPositionInfoSource::UpdateMode updateMode)
- : QObject(parent),
- m_updateMode(updateMode),
- m_device(0),
- m_invokedStart(false),
- m_positionError(QGeoPositionInfoSource::UnknownSourceError),
- m_source(parent),
- m_nmeaReader(0),
- m_updateTimer(0),
- m_requestTimer(0),
- m_noUpdateLastInterval(false),
- m_updateTimeoutSent(false),
- m_connectedReadyRead(false)
-{
-}
-
-QNmeaPositionInfoSourcePrivate::~QNmeaPositionInfoSourcePrivate()
-{
- delete m_nmeaReader;
- delete m_updateTimer;
-}
-
-bool QNmeaPositionInfoSourcePrivate::openSourceDevice()
-{
- if (!m_device) {
- qWarning("QNmeaPositionInfoSource: no QIODevice data source, call setDevice() first");
- return false;
- }
-
- if (!m_device->isOpen() && !m_device->open(QIODevice::ReadOnly)) {
- qWarning("QNmeaPositionInfoSource: cannot open QIODevice data source");
- return false;
- }
-
- connect(m_device, SIGNAL(aboutToClose()), SLOT(sourceDataClosed()));
- connect(m_device, SIGNAL(readChannelFinished()), SLOT(sourceDataClosed()));
- connect(m_device, SIGNAL(destroyed()), SLOT(sourceDataClosed()));
-
- return true;
-}
-
-void QNmeaPositionInfoSourcePrivate::sourceDataClosed()
-{
- if (m_nmeaReader && m_device && m_device->bytesAvailable())
- m_nmeaReader->readAvailableData();
-}
-
-void QNmeaPositionInfoSourcePrivate::readyRead()
-{
- if (m_nmeaReader)
- m_nmeaReader->readAvailableData();
-}
-
-bool QNmeaPositionInfoSourcePrivate::initialize()
-{
- if (m_nmeaReader)
- return true;
-
- if (!openSourceDevice())
- return false;
-
- if (m_updateMode == QNmeaPositionInfoSource::RealTimeMode)
- m_nmeaReader = new QNmeaRealTimeReader(this);
- else
- m_nmeaReader = new QNmeaSimulatedReader(this);
-
- return true;
-}
-
-void QNmeaPositionInfoSourcePrivate::prepareSourceDevice()
-{
- // some data may already be available
- if (m_updateMode == QNmeaPositionInfoSource::SimulationMode) {
- if (m_nmeaReader && m_device->bytesAvailable())
- m_nmeaReader->readAvailableData();
- }
-
- if (!m_connectedReadyRead) {
- connect(m_device, SIGNAL(readyRead()), SLOT(readyRead()));
- m_connectedReadyRead = true;
- }
-}
-
-bool QNmeaPositionInfoSourcePrivate::parsePosInfoFromNmeaData(const char *data, int size,
- QGeoPositionInfo *posInfo, bool *hasFix)
-{
- return m_source->parsePosInfoFromNmeaData(data, size, posInfo, hasFix);
-}
-
-void QNmeaPositionInfoSourcePrivate::startUpdates()
-{
- if (m_invokedStart)
- return;
-
- m_invokedStart = true;
- m_pendingUpdate = QGeoPositionInfo();
- m_noUpdateLastInterval = false;
-
- bool initialized = initialize();
- if (!initialized)
- return;
-
- if (m_updateMode == QNmeaPositionInfoSource::RealTimeMode) {
- // skip over any buffered data - we only want the newest data
- if (m_device->bytesAvailable()) {
- if (m_device->isSequential())
- m_device->readAll();
- else
- m_device->seek(m_device->bytesAvailable());
- }
- }
-
- if (m_updateTimer)
- m_updateTimer->stop();
-
- if (m_source->updateInterval() > 0) {
- if (!m_updateTimer)
- m_updateTimer = new QBasicTimer;
- m_updateTimer->start(m_source->updateInterval(), this);
- }
-
- if (initialized)
- prepareSourceDevice();
-}
-
-void QNmeaPositionInfoSourcePrivate::stopUpdates()
-{
- m_invokedStart = false;
- if (m_updateTimer)
- m_updateTimer->stop();
- m_pendingUpdate = QGeoPositionInfo();
- m_noUpdateLastInterval = false;
-}
-
-void QNmeaPositionInfoSourcePrivate::requestUpdate(int msec)
-{
- if (m_requestTimer && m_requestTimer->isActive())
- return;
-
- if (msec <= 0 || msec < m_source->minimumUpdateInterval()) {
- emit m_source->updateTimeout();
- return;
- }
-
- if (!m_requestTimer) {
- m_requestTimer = new QTimer(this);
- connect(m_requestTimer, SIGNAL(timeout()), SLOT(updateRequestTimeout()));
- }
-
- bool initialized = initialize();
- if (!initialized) {
- emit m_source->updateTimeout();
- return;
- }
-
- m_requestTimer->start(msec);
-
- if (initialized)
- prepareSourceDevice();
-}
-
-void QNmeaPositionInfoSourcePrivate::updateRequestTimeout()
-{
- m_requestTimer->stop();
- emit m_source->updateTimeout();
-}
-
-void QNmeaPositionInfoSourcePrivate::notifyNewUpdate(QGeoPositionInfo *update, bool hasFix)
-{
- // include <QDebug> before uncommenting
- //qDebug() << "QNmeaPositionInfoSourcePrivate::notifyNewUpdate()" << update->timestamp() << hasFix << m_invokedStart << (m_requestTimer && m_requestTimer->isActive());
-
- QDate date = update->timestamp().date();
- if (date.isValid()) {
- m_currentDate = date;
- } else {
- // some sentence have time but no date
- QTime time = update->timestamp().time();
- if (time.isValid() && m_currentDate.isValid())
- update->setTimestamp(QDateTime(m_currentDate, time, Qt::UTC));
- }
-
- if (hasFix && update->isValid()) {
- if (m_requestTimer && m_requestTimer->isActive()) {
- m_requestTimer->stop();
- emitUpdated(*update);
- } else if (m_invokedStart) {
- if (m_updateTimer && m_updateTimer->isActive()) {
- // for periodic updates, only want the most recent update
- m_pendingUpdate = *update;
- if (m_noUpdateLastInterval) {
- emitPendingUpdate();
- m_noUpdateLastInterval = false;
- }
- } else {
- emitUpdated(*update);
- }
- }
- m_lastUpdate = *update;
- }
-}
-
-void QNmeaPositionInfoSourcePrivate::timerEvent(QTimerEvent *)
-{
- emitPendingUpdate();
-}
-
-void QNmeaPositionInfoSourcePrivate::emitPendingUpdate()
-{
- if (m_pendingUpdate.isValid()) {
- m_updateTimeoutSent = false;
- m_noUpdateLastInterval = false;
- emitUpdated(m_pendingUpdate);
- m_pendingUpdate = QGeoPositionInfo();
- } else {
- if (m_noUpdateLastInterval && !m_updateTimeoutSent) {
- m_updateTimeoutSent = true;
- m_pendingUpdate = QGeoPositionInfo();
- emit m_source->updateTimeout();
- }
- m_noUpdateLastInterval = true;
- }
-}
-
-void QNmeaPositionInfoSourcePrivate::emitUpdated(const QGeoPositionInfo &update)
-{
- m_lastUpdate = update;
- emit m_source->positionUpdated(update);
-}
-
-//=========================================================
-
-/*!
- \class QNmeaPositionInfoSource
- \inmodule QtLocation
- \ingroup QtLocation-positioning
- \since Qt Location 5.0
-
- \brief The QNmeaPositionInfoSource class provides positional information using a NMEA data source.
-
- NMEA is a commonly used protocol for the specification of one's global
- position at a certain point in time. The QNmeaPositionInfoSource class reads NMEA
- data and uses it to provide positional data in the form of
- QGeoPositionInfo objects.
-
- A QNmeaPositionInfoSource instance operates in either \l {RealTimeMode} or
- \l {SimulationMode}. These modes allow NMEA data to be read from either a
- live source of positional data, or replayed for simulation purposes from
- previously recorded NMEA data.
-
- The source of NMEA data is set with setDevice().
-
- Use startUpdates() to start receiving regular position updates and stopUpdates() to stop these
- updates. If you only require updates occasionally, you can call requestUpdate() to request a
- single update.
-
- In both cases the position information is received via the positionUpdated() signal and the
- last known position can be accessed with lastKnownPosition().
-*/
-
-
-/*!
- \enum QNmeaPositionInfoSource::UpdateMode
- Defines the available update modes.
-
- \value RealTimeMode Positional data is read and distributed from the data source as it becomes available. Use this mode if you are using a live source of positional data (for example, a GPS hardware device).
- \value SimulationMode The data and time information in the NMEA source data is used to provide positional updates at the rate at which the data was originally recorded. Use this mode if the data source contains previously recorded NMEA data and you want to replay the data for simulation purposes.
-*/
-
-
-/*!
- Constructs a QNmeaPositionInfoSource instance with the given \a parent
- and \a updateMode.
-*/
-QNmeaPositionInfoSource::QNmeaPositionInfoSource(UpdateMode updateMode, QObject *parent)
- : QGeoPositionInfoSource(parent),
- d(new QNmeaPositionInfoSourcePrivate(this, updateMode))
-{
-}
-
-/*!
- Destroys the position source.
-*/
-QNmeaPositionInfoSource::~QNmeaPositionInfoSource()
-{
- delete d;
-}
-
-/*!
- Parses an NMEA sentence string into a QGeoPositionInfo.
-
- The default implementation will parse standard NMEA sentences.
- This method should be reimplemented in a subclass whenever the need to deal with non-standard
- NMEA sentences arises.
-
- The parser reads \a size bytes from \a data and uses that information to setup \a posInfo and
- \a hasFix. If \a hasFix is set to false then \a posInfo may contain only the time or the date
- and the time.
-
- Returns true if the sentence was succsesfully parsed, otherwise returns false and should not
- modifiy \a posInfo or \a hasFix.
-*/
-bool QNmeaPositionInfoSource::parsePosInfoFromNmeaData(const char *data, int size,
- QGeoPositionInfo *posInfo, bool *hasFix)
-{
- return QLocationUtils::getPosInfoFromNmea(data, size, posInfo, hasFix);
-}
-
-/*!
- Returns the update mode.
-*/
-QNmeaPositionInfoSource::UpdateMode QNmeaPositionInfoSource::updateMode() const
-{
- return d->m_updateMode;
-}
-
-/*!
- Sets the NMEA data source to \a device. If the device is not open, it
- will be opened in QIODevice::ReadOnly mode.
-
- The source device can only be set once and must be set before calling
- startUpdates() or requestUpdate().
-
- \b {Note:} The \a device must emit QIODevice::readyRead() for the
- source to be notified when data is available for reading.
- QNmeaPositionInfoSource does not assume the ownership of the device,
- and hence does not deallocate it upon destruction.
-*/
-void QNmeaPositionInfoSource::setDevice(QIODevice *device)
-{
- if (device != d->m_device) {
- if (!d->m_device)
- d->m_device = device;
- else
- qWarning("QNmeaPositionInfoSource: source device has already been set");
- }
-}
-
-/*!
- Returns the NMEA data source.
-*/
-QIODevice *QNmeaPositionInfoSource::device() const
-{
- return d->m_device;
-}
-
-/*!
- \reimp
-*/
-void QNmeaPositionInfoSource::setUpdateInterval(int msec)
-{
- int interval = msec;
- if (interval != 0)
- interval = qMax(msec, minimumUpdateInterval());
- QGeoPositionInfoSource::setUpdateInterval(interval);
- if (d->m_invokedStart) {
- d->stopUpdates();
- d->startUpdates();
- }
-}
-
-/*!
- \reimp
-*/
-void QNmeaPositionInfoSource::startUpdates()
-{
- d->startUpdates();
-}
-
-/*!
- \reimp
-*/
-void QNmeaPositionInfoSource::stopUpdates()
-{
- d->stopUpdates();
-}
-
-/*!
- \reimp
-*/
-void QNmeaPositionInfoSource::requestUpdate(int msec)
-{
- d->requestUpdate(msec == 0 ? 60000 * 5 : msec);
-}
-
-/*!
- \reimp
-*/
-QGeoPositionInfo QNmeaPositionInfoSource::lastKnownPosition(bool) const
-{
- // the bool value does not matter since we only use satellite positioning
- return d->m_lastUpdate;
-}
-
-/*!
- \reimp
-*/
-QGeoPositionInfoSource::PositioningMethods QNmeaPositionInfoSource::supportedPositioningMethods() const
-{
- return SatellitePositioningMethods;
-}
-
-/*!
- \reimp
-*/
-int QNmeaPositionInfoSource::minimumUpdateInterval() const
-{
- return 100;
-}
-
-/*!
- \reimp
-*/
-QGeoPositionInfoSource::Error QNmeaPositionInfoSource::error() const
-{
- return d->m_positionError;
-}
-
-void QNmeaPositionInfoSource::setError(QGeoPositionInfoSource::Error positionError)
-{
- d->m_positionError = positionError;
- emit QGeoPositionInfoSource::error(positionError);
-}
-
-#include "moc_qnmeapositioninfosource.cpp"
-#include "moc_qnmeapositioninfosource_p.cpp"
-
-QT_END_NAMESPACE
diff --git a/src/location/qnmeapositioninfosource.h b/src/location/qnmeapositioninfosource.h
deleted file mode 100644
index fd1abd57..00000000
--- a/src/location/qnmeapositioninfosource.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QNMEAPOSITIONINFOSOURCE_H
-#define QNMEAPOSITIONINFOSOURCE_H
-
-#include <QtLocation/QGeoPositionInfoSource>
-
-QT_BEGIN_NAMESPACE
-
-class QIODevice;
-
-class QNmeaPositionInfoSourcePrivate;
-class Q_LOCATION_EXPORT QNmeaPositionInfoSource : public QGeoPositionInfoSource
-{
- Q_OBJECT
-public:
- enum UpdateMode {
- RealTimeMode = 1,
- SimulationMode
- };
-
- explicit QNmeaPositionInfoSource(UpdateMode updateMode, QObject *parent = 0);
- ~QNmeaPositionInfoSource();
-
- UpdateMode updateMode() const;
-
- void setDevice(QIODevice *source);
- QIODevice *device() const;
-
- void setUpdateInterval(int msec);
-
- QGeoPositionInfo lastKnownPosition(bool fromSatellitePositioningMethodsOnly = false) const;
- PositioningMethods supportedPositioningMethods() const;
- int minimumUpdateInterval() const;
- Error error() const;
-
-
-public Q_SLOTS:
- void startUpdates();
- void stopUpdates();
- void requestUpdate(int timeout = 0);
-
-protected:
- virtual bool parsePosInfoFromNmeaData(const char *data,
- int size,
- QGeoPositionInfo *posInfo,
- bool *hasFix);
-
-private:
- Q_DISABLE_COPY(QNmeaPositionInfoSource)
- friend class QNmeaPositionInfoSourcePrivate;
- QNmeaPositionInfoSourcePrivate *d;
- void setError(QGeoPositionInfoSource::Error positionError);
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/location/qnmeapositioninfosource_p.h b/src/location/qnmeapositioninfosource_p.h
deleted file mode 100644
index b231d72f..00000000
--- a/src/location/qnmeapositioninfosource_p.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtLocation module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, 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, Digia gives you certain additional
-** rights. These rights are described in the Digia 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.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QNMEAPOSITIONINFOSOURCE_P_H
-#define QNMEAPOSITIONINFOSOURCE_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qnmeapositioninfosource.h"
-#include "qgeopositioninfo.h"
-
-#include <QObject>
-#include <QQueue>
-#include <QPointer>
-
-QT_BEGIN_NAMESPACE
-
-class QBasicTimer;
-class QTimerEvent;
-class QTimer;
-
-class QNmeaReader;
-struct QPendingGeoPositionInfo
-{
- QGeoPositionInfo info;
- bool hasFix;
-};
-
-
-class QNmeaPositionInfoSourcePrivate : public QObject
-{
- Q_OBJECT
-public:
- QNmeaPositionInfoSourcePrivate(QNmeaPositionInfoSource *parent, QNmeaPositionInfoSource::UpdateMode updateMode);
- ~QNmeaPositionInfoSourcePrivate();
-
- void startUpdates();
- void stopUpdates();
- void requestUpdate(int msec);
-
- bool parsePosInfoFromNmeaData(const char *data,
- int size,
- QGeoPositionInfo *posInfo,
- bool *hasFix);
-
- void notifyNewUpdate(QGeoPositionInfo *update, bool fixStatus);
-
- QNmeaPositionInfoSource::UpdateMode m_updateMode;
- QPointer<QIODevice> m_device;
- QGeoPositionInfo m_lastUpdate;
- bool m_invokedStart;
- QGeoPositionInfoSource::Error m_positionError;
-
-public Q_SLOTS:
- void readyRead();
-
-protected:
- void timerEvent(QTimerEvent *event);
-
-private Q_SLOTS:
- void emitPendingUpdate();
- void sourceDataClosed();
- void updateRequestTimeout();
-
-private:
- bool openSourceDevice();
- bool initialize();
- void prepareSourceDevice();
- void emitUpdated(const QGeoPositionInfo &update);
-
- QNmeaPositionInfoSource *m_source;
- QNmeaReader *m_nmeaReader;
- QBasicTimer *m_updateTimer;
- QGeoPositionInfo m_pendingUpdate;
- QDate m_currentDate;
- QTimer *m_requestTimer;
- bool m_noUpdateLastInterval;
- bool m_updateTimeoutSent;
- bool m_connectedReadyRead;
-};
-
-
-class QNmeaReader
-{
-public:
- explicit QNmeaReader(QNmeaPositionInfoSourcePrivate *sourcePrivate)
- : m_proxy(sourcePrivate) {}
- virtual ~QNmeaReader() {}
-
- virtual void readAvailableData() = 0;
-
-protected:
- QNmeaPositionInfoSourcePrivate *m_proxy;
-};
-
-
-class QNmeaRealTimeReader : public QNmeaReader
-{
-public:
- explicit QNmeaRealTimeReader(QNmeaPositionInfoSourcePrivate *sourcePrivate);
- virtual void readAvailableData();
-};
-
-
-class QNmeaSimulatedReader : public QObject, public QNmeaReader
-{
- Q_OBJECT
-public:
- explicit QNmeaSimulatedReader(QNmeaPositionInfoSourcePrivate *sourcePrivate);
- ~QNmeaSimulatedReader();
- virtual void readAvailableData();
-
-protected:
- virtual void timerEvent(QTimerEvent *event);
-
-private Q_SLOTS:
- void simulatePendingUpdate();
-
-private:
- bool setFirstDateTime();
- void processNextSentence();
-
- QQueue<QPendingGeoPositionInfo> m_pendingUpdates;
- int m_currTimerId;
- bool m_hasValidDateTime;
-};
-
-QT_END_NAMESPACE
-
-#endif