diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-01-12 17:16:39 +0100 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2018-01-24 12:45:18 +0000 |
commit | 5a6b1a0cff406a37faca940ae3b0e774c6d1c4d6 (patch) | |
tree | 5453dcf55adc58911f279a1b6859179f0be28b9e /src/location/maps | |
parent | 05f635b24a9a290beae8eac2ade5ab77ade45b38 (diff) | |
download | qtlocation-5a6b1a0cff406a37faca940ae3b0e774c6d1c4d6.tar.gz |
Add QNavigationManager/QNavigationManagerEngine
This patch introduces the abovementioned classes to be subclassed in
plugins.
These are currently private, and intended to be only used in QML through
appropriate wrappers.
Change-Id: I4a063031a983e4bd070f503e1458b62e44c6e340
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/location/maps')
-rw-r--r-- | src/location/maps/maps.pri | 4 | ||||
-rw-r--r-- | src/location/maps/qgeoserviceprovider.cpp | 43 | ||||
-rw-r--r-- | src/location/maps/qgeoserviceprovider.h | 15 | ||||
-rw-r--r-- | src/location/maps/qgeoserviceprovider_p.h | 3 | ||||
-rw-r--r-- | src/location/maps/qgeoserviceproviderfactory.cpp | 22 | ||||
-rw-r--r-- | src/location/maps/qgeoserviceproviderfactory.h | 3 | ||||
-rw-r--r-- | src/location/maps/qnavigationmanager.cpp | 115 | ||||
-rw-r--r-- | src/location/maps/qnavigationmanager_p.h | 93 | ||||
-rw-r--r-- | src/location/maps/qnavigationmanagerengine.cpp | 126 | ||||
-rw-r--r-- | src/location/maps/qnavigationmanagerengine_p.h | 104 |
10 files changed, 527 insertions, 1 deletions
diff --git a/src/location/maps/maps.pri b/src/location/maps/maps.pri index aaad5897..b5be4601 100644 --- a/src/location/maps/maps.pri +++ b/src/location/maps/maps.pri @@ -60,6 +60,8 @@ PRIVATE_HEADERS += \ maps/qgeorouteparserosrmv5_p.h \ maps/qgeorouteparserosrmv4_p.h \ maps/qgeoprojection_p.h \ + maps/qnavigationmanagerengine_p.h \ + maps/qnavigationmanager_p.h \ maps/qcache3q_p.h SOURCES += \ @@ -95,4 +97,6 @@ SOURCES += \ maps/qgeorouteparserosrmv5.cpp \ maps/qgeorouteparserosrmv4.cpp \ maps/qgeomapparameter.cpp \ + maps/qnavigationmanagerengine.cpp \ + maps/qnavigationmanager.cpp \ maps/qgeoprojection.cpp diff --git a/src/location/maps/qgeoserviceprovider.cpp b/src/location/maps/qgeoserviceprovider.cpp index 7e7b3c90..4c4b5a02 100644 --- a/src/location/maps/qgeoserviceprovider.cpp +++ b/src/location/maps/qgeoserviceprovider.cpp @@ -42,11 +42,13 @@ #include "qgeomappingmanager_p.h" #include "qgeoroutingmanager.h" #include "qplacemanager.h" +#include "qnavigationmanager_p.h" #include "qgeocodingmanagerengine.h" #include "qgeomappingmanagerengine_p.h" #include "qgeoroutingmanagerengine.h" #include "qplacemanagerengine.h" #include "qplacemanagerengine_p.h" +#include "qnavigationmanagerengine_p.h" #include <QList> #include <QString> @@ -202,6 +204,18 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, */ /*! + \enum QGeoServiceProvider::NavigationFeature + + Describes the navigation features supported by the geo service provider. + + \value NoNavigationFeatures No navigation features are supported. + \value OnlineNavigationFeature Online navigation is supported. + \value OfflineNavigationFeature Offline navigation is supported. + \value AnyNavigationFeatures Matches a geo service provider that provides any navigation + features. +*/ + +/*! Returns a list of names of the available service providers, for use with the QGeoServiceProvider constructors. */ @@ -310,6 +324,16 @@ QGeoServiceProvider::PlacesFeatures QGeoServiceProvider::placesFeatures() const return d_ptr->features<PlacesFeatures>("PlacesFeatures"); } +/*! + Returns the navigation features supported by the geo service provider. + + \since QtLocation 5.11 +*/ +QGeoServiceProvider::NavigationFeatures QGeoServiceProvider::navigationFeatures() const +{ + return d_ptr->features<NavigationFeatures>("NavigationFeatures"); +} + /* Sadly, these are necessary to figure out which of the factory->createX * methods we need to call. Ideally it would be nice to find a way to embed * these into the manager() template. */ @@ -334,6 +358,10 @@ template <> QPlaceManagerEngine *createEngine<QPlaceManagerEngine>(QGeoServicePr { return d_ptr->factory->createPlaceManagerEngine(d_ptr->cleanedParameterMap, &(d_ptr->placeError), &(d_ptr->placeErrorString)); } +template <> QNavigationManagerEngine *createEngine<QNavigationManagerEngine>(QGeoServiceProviderPrivate *d_ptr) +{ + return d_ptr->factory->createNavigationManagerEngine(d_ptr->cleanedParameterMap, &(d_ptr->placeError), &(d_ptr->placeErrorString)); +} /* Template for generating the code for each of the geocodingManager(), * mappingManager() etc methods */ @@ -493,7 +521,20 @@ QPlaceManager *QGeoServiceProvider::placeManager() const { return d_ptr->manager<QPlaceManager, QPlaceManagerEngine>( &(d_ptr->placeError), &(d_ptr->placeErrorString), - &(d_ptr->placeManager)); + &(d_ptr->placeManager)); +} + +/*! + Returns a new QNavigationManager made available by the service provider. + + After this function has been called, error() and errorString() will + report any errors which occurred during the construction of the QNavigationManagerEngine. +*/ +QNavigationManager *QGeoServiceProvider::navigationManager() const +{ + return d_ptr->manager<QNavigationManager, QNavigationManagerEngine>( + &(d_ptr->navigationError), &(d_ptr->navigationErrorString), + &(d_ptr->navigationManager)); } /*! diff --git a/src/location/maps/qgeoserviceprovider.h b/src/location/maps/qgeoserviceprovider.h index ea8c2b61..640e9843 100644 --- a/src/location/maps/qgeoserviceprovider.h +++ b/src/location/maps/qgeoserviceprovider.h @@ -50,10 +50,12 @@ class QGeoCodingManager; class QGeoMappingManager; class QGeoRoutingManager; class QPlaceManager; +class QNavigationManager; class QGeoCodingManagerEngine; class QGeoMappingManagerEngine; class QGeoRoutingManagerEngine; class QPlaceManagerEngine; +class QNavigationManagerEngine; class QGeoServiceProviderPrivate; class Q_LOCATION_EXPORT QGeoServiceProvider : public QObject @@ -113,6 +115,13 @@ public: AnyPlacesFeatures = ~(0) }; + enum NavigationFeature { + NoNavigationFeatures = 0, + OnlineNavigationFeature = (1<<0), + OfflineNavigationFeature = (1<<1), + AnyNavigationFeatures = ~(0) + }; + Q_DECLARE_FLAGS(RoutingFeatures, RoutingFeature) Q_FLAGS(RoutingFeatures) @@ -125,6 +134,9 @@ public: Q_DECLARE_FLAGS(PlacesFeatures, PlacesFeature) Q_FLAGS(PlacesFeatures) + Q_DECLARE_FLAGS(NavigationFeatures, NavigationFeature) + Q_FLAGS(NavigationFeatures) + static QStringList availableServiceProviders(); QGeoServiceProvider(const QString &providerName, const QVariantMap ¶meters = QVariantMap(), @@ -136,11 +148,13 @@ public: GeocodingFeatures geocodingFeatures() const; MappingFeatures mappingFeatures() const; PlacesFeatures placesFeatures() const; + NavigationFeatures navigationFeatures() const; QGeoCodingManager *geocodingManager() const; QGeoMappingManager *mappingManager() const; QGeoRoutingManager *routingManager() const; QPlaceManager *placeManager() const; + QNavigationManager *navigationManager() const; Error error() const; QString errorString() const; @@ -157,6 +171,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QGeoServiceProvider::RoutingFeatures) Q_DECLARE_OPERATORS_FOR_FLAGS(QGeoServiceProvider::GeocodingFeatures) Q_DECLARE_OPERATORS_FOR_FLAGS(QGeoServiceProvider::MappingFeatures) Q_DECLARE_OPERATORS_FOR_FLAGS(QGeoServiceProvider::PlacesFeatures) +Q_DECLARE_OPERATORS_FOR_FLAGS(QGeoServiceProvider::NavigationFeatures) QT_END_NAMESPACE diff --git a/src/location/maps/qgeoserviceprovider_p.h b/src/location/maps/qgeoserviceprovider_p.h index 6bfb9b26..6703bf67 100644 --- a/src/location/maps/qgeoserviceprovider_p.h +++ b/src/location/maps/qgeoserviceprovider_p.h @@ -93,16 +93,19 @@ public: QGeoRoutingManager *routingManager; QGeoMappingManager *mappingManager; QPlaceManager *placeManager; + QNavigationManager *navigationManager; QGeoServiceProvider::Error geocodeError; QGeoServiceProvider::Error routingError; QGeoServiceProvider::Error mappingError; QGeoServiceProvider::Error placeError; + QGeoServiceProvider::Error navigationError; QString geocodeErrorString; QString routingErrorString; QString mappingErrorString; QString placeErrorString; + QString navigationErrorString; QGeoServiceProvider::Error error; QString errorString; diff --git a/src/location/maps/qgeoserviceproviderfactory.cpp b/src/location/maps/qgeoserviceproviderfactory.cpp index 7efc8a9f..c8192a32 100644 --- a/src/location/maps/qgeoserviceproviderfactory.cpp +++ b/src/location/maps/qgeoserviceproviderfactory.cpp @@ -160,4 +160,26 @@ QPlaceManagerEngine *QGeoServiceProviderFactory::createPlaceManagerEngine(const return 0; } +/*! + Returns a new QNavigationManagerEngine instance, initialized with \a + parameters, which implements navigation functionality. + + If \a error is not nullptr, it should be set to QGeoServiceProvider::NoError on + success or an appropriate QGeoServiceProvider::Error on failure. + + If \a errorString is not nullptr, it should be set to a string describing any + error which occurred. + + The default implementation returns nullptr, which causes a + QGeoServiceProvider::NotSupportedError in QGeoServiceProvider. +*/ +QNavigationManagerEngine *QGeoServiceProviderFactory::createNavigationManagerEngine(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const +{ + Q_UNUSED(parameters) + Q_UNUSED(error) + Q_UNUSED(errorString) + + return 0; +} + QT_END_NAMESPACE diff --git a/src/location/maps/qgeoserviceproviderfactory.h b/src/location/maps/qgeoserviceproviderfactory.h index cc60cf7c..e1164189 100644 --- a/src/location/maps/qgeoserviceproviderfactory.h +++ b/src/location/maps/qgeoserviceproviderfactory.h @@ -62,6 +62,9 @@ public: virtual QPlaceManagerEngine *createPlaceManagerEngine(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const; + virtual QNavigationManagerEngine *createNavigationManagerEngine(const QVariantMap ¶meters, + QGeoServiceProvider::Error *error, + QString *errorString) const; }; Q_DECLARE_INTERFACE(QGeoServiceProviderFactory, diff --git a/src/location/maps/qnavigationmanager.cpp b/src/location/maps/qnavigationmanager.cpp new file mode 100644 index 00000000..1e83b2c9 --- /dev/null +++ b/src/location/maps/qnavigationmanager.cpp @@ -0,0 +1,115 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the QtLocation module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/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 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later 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 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qnavigationmanager_p.h" +#include "qnavigationmanagerengine_p.h" + +QT_BEGIN_NAMESPACE + +class QNavigationManagerPrivate +{ +public: + QNavigationManagerPrivate(); + ~QNavigationManagerPrivate(); + + QNavigationManagerEngine *engine = nullptr; + +private: + Q_DISABLE_COPY(QNavigationManagerPrivate) +}; + +QNavigationManagerPrivate::QNavigationManagerPrivate() +{ + +} + +QNavigationManagerPrivate::~QNavigationManagerPrivate() +{ + delete engine; + engine = nullptr; +} + +QNavigationManager::~QNavigationManager() +{ + delete d_ptr; +} + +QString QNavigationManager::managerName() const +{ + return d_ptr->engine->managerName(); +} + +int QNavigationManager::managerVersion() const +{ + return d_ptr->engine->managerVersion(); +} + +QNavigationManagerEngine *QNavigationManager::engine() +{ + return d_ptr->engine; +} + +bool QNavigationManager::isInitialized() const +{ + return d_ptr->engine->isInitialized(); +} + +void QNavigationManager::setLocale(const QLocale &locale) +{ + d_ptr->engine->setLocale(locale); +} + +QLocale QNavigationManager::locale() const +{ + return d_ptr->engine->locale(); +} + +QNavigationManager::QNavigationManager(QNavigationManagerEngine *engine, QObject *parent) : QObject(parent), + d_ptr(new QNavigationManagerPrivate) +{ + d_ptr->engine = engine; + if (!d_ptr->engine) { + qFatal("The navigation manager engine that was set for this mapping manager was NULL."); + } + + connect(d_ptr->engine, + SIGNAL(initialized()), + this, + SIGNAL(initialized()), + Qt::QueuedConnection); +} + +QT_END_NAMESPACE diff --git a/src/location/maps/qnavigationmanager_p.h b/src/location/maps/qnavigationmanager_p.h new file mode 100644 index 00000000..e461bcf1 --- /dev/null +++ b/src/location/maps/qnavigationmanager_p.h @@ -0,0 +1,93 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the QtLocation module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/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 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later 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 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QNAVIGATIONMANAGER_P_H +#define QNAVIGATIONMANAGER_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 <QObject> +#include <QSize> +#include <QPair> +#include <QtLocation/private/qlocationglobal_p.h> + +QT_BEGIN_NAMESPACE + +class QNavigationManagerEngine; +class QNavigationManagerPrivate; +class Q_LOCATION_PRIVATE_EXPORT QNavigationManager : public QObject +{ + Q_OBJECT + +public: + ~QNavigationManager(); + + QString managerName() const; + int managerVersion() const; + + QNavigationManagerEngine *engine(); + + bool isInitialized() const; + void setLocale(const QLocale &locale); + QLocale locale() const; + +Q_SIGNALS: + void initialized(); + +protected: + QNavigationManager(QNavigationManagerEngine *engine, QObject *parent = 0); + +private: + QNavigationManagerPrivate *d_ptr; + Q_DISABLE_COPY(QNavigationManager) + + friend class QGeoServiceProvider; + friend class QGeoServiceProviderPrivate; +}; + + +QT_END_NAMESPACE + +#endif // QNAVIGATIONMANAGER_P_H diff --git a/src/location/maps/qnavigationmanagerengine.cpp b/src/location/maps/qnavigationmanagerengine.cpp new file mode 100644 index 00000000..265237ee --- /dev/null +++ b/src/location/maps/qnavigationmanagerengine.cpp @@ -0,0 +1,126 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the QtLocation module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/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 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later 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 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qgeoroute.h" +#include "qnavigationmanagerengine_p.h" + +QT_BEGIN_NAMESPACE + +class QNavigationManagerEnginePrivate +{ +public: + QString managerName; + int managerVersion; + QLocale locale; + QLocale::MeasurementSystem measurementSystem; + bool initialized = false; +}; + +QNavigationManagerEngine::QNavigationManagerEngine(const QVariantMap ¶meters, QObject *parent) + : QObject(parent) + , d_ptr(new QNavigationManagerEnginePrivate) +{ + Q_UNUSED(parameters) +} + +QNavigationManagerEngine::~QNavigationManagerEngine() +{ +} + +void QNavigationManagerEngine::setManagerName(const QString &name) +{ + d_ptr->managerName = name; +} + +QString QNavigationManagerEngine::managerName() const +{ + return d_ptr->managerName; +} + +void QNavigationManagerEngine::setManagerVersion(int version) +{ + d_ptr->managerVersion = version; +} + +int QNavigationManagerEngine::managerVersion() const +{ + return d_ptr->managerVersion; +} + +void QNavigationManagerEngine::setLocale(const QLocale &locale) +{ + d_ptr->locale = locale; +} + +QLocale QNavigationManagerEngine::locale() const +{ + return d_ptr->locale; +} + +void QNavigationManagerEngine::setMeasurementSystem(QLocale::MeasurementSystem system) +{ + d_ptr->measurementSystem = system; +} + +QLocale::MeasurementSystem QNavigationManagerEngine::measurementSystem() const +{ + return d_ptr->measurementSystem; +} + +bool QNavigationManagerEngine::isInitialized() const +{ + return d_ptr->initialized; +} + +bool QNavigationManagerEngine::start(const QList<QGeoMapParameter*> &navigationParams, const QMapRouteObject &route) +{ + Q_UNUSED(navigationParams); + Q_UNUSED(route); + return false; +} + +bool QNavigationManagerEngine::stop() +{ + return false; +} + +void QNavigationManagerEngine::engineInitialized() +{ + d_ptr->initialized = true; + emit initialized(); +} + +QT_END_NAMESPACE diff --git a/src/location/maps/qnavigationmanagerengine_p.h b/src/location/maps/qnavigationmanagerengine_p.h new file mode 100644 index 00000000..5b8bd185 --- /dev/null +++ b/src/location/maps/qnavigationmanagerengine_p.h @@ -0,0 +1,104 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the QtLocation module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/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 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later 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 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QNAVIGATIONMANAGERENGINE_H +#define QNAVIGATIONMANAGERENGINE_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 <QtLocation/private/qlocationglobal_p.h> +#include <QObject> +#include <QLocale> +#include <QGeoCoordinate> + +QT_BEGIN_NAMESPACE + +class QGeoMap; +class QGeoMapParameter; +class QMapRouteObject; +class QNavigationManagerEnginePrivate; + +class Q_LOCATION_PRIVATE_EXPORT QNavigationManagerEngine : public QObject +{ + Q_OBJECT +public: + explicit QNavigationManagerEngine(const QVariantMap ¶meters, QObject *parent = Q_NULLPTR); + virtual ~QNavigationManagerEngine(); + + void setManagerName(const QString &name); + QString managerName() const; + void setManagerVersion(int version); + int managerVersion() const; + + virtual void setLocale(const QLocale &locale); + virtual QLocale locale() const; + virtual void setMeasurementSystem(QLocale::MeasurementSystem system); + virtual QLocale::MeasurementSystem measurementSystem() const; + bool isInitialized() const; + +signals: + void activeChanged(bool active); + void waypointReached(const QGeoCoordinate &pos); + void destinationReached(); + void initialized(); + +public slots: + virtual bool start(const QList<QGeoMapParameter*> &navigationParams, const QMapRouteObject &route); + virtual bool stop(); + +protected: + /*! + Marks the engine as initialized. Subclasses of QGeoMappingManagerEngine are to + call this method after performing implementation-specific initialization within + the constructor. + */ + void engineInitialized(); + + QScopedPointer<QNavigationManagerEnginePrivate> d_ptr; +}; + +QT_END_NAMESPACE + +#endif // QNAVIGATIONMANAGERENGINE_H |