1 /**************************************************************************** 2 ** 3 ** Copyright (C) 2018 The Qt Company Ltd. 4 ** Contact: http://www.qt.io/licensing/ 5 ** 6 ** This file is part of the QtLocation module of the Qt Toolkit. 7 ** 8 ** $QT_BEGIN_LICENSE:LGPL3$ 9 ** Commercial License Usage 10 ** Licensees holding valid commercial Qt licenses may use this file in 11 ** accordance with the commercial license agreement provided with the 12 ** Software or, alternatively, in accordance with the terms contained in 13 ** a written agreement between you and The Qt Company. For licensing terms 14 ** and conditions see http://www.qt.io/terms-conditions. For further 15 ** information use the contact form at http://www.qt.io/contact-us. 16 ** 17 ** GNU Lesser General Public License Usage 18 ** Alternatively, this file may be used under the terms of the GNU Lesser 19 ** General Public License version 3 as published by the Free Software 20 ** Foundation and appearing in the file LICENSE.LGPLv3 included in the 21 ** packaging of this file. Please review the following information to 22 ** ensure the GNU Lesser General Public License version 3 requirements 23 ** will be met: https://www.gnu.org/licenses/lgpl.html. 24 ** 25 ** GNU General Public License Usage 26 ** Alternatively, this file may be used under the terms of the GNU 27 ** General Public License version 2.0 or later as published by the Free 28 ** Software Foundation and appearing in the file LICENSE.GPL included in 29 ** the packaging of this file. Please review the following information to 30 ** ensure the GNU General Public License version 2.0 requirements will be 31 ** met: http://www.gnu.org/licenses/gpl-2.0.html. 32 ** 33 ** $QT_END_LICENSE$ 34 ** 35 ****************************************************************************/ 36 37 #include "qgeoroute.h" 38 #include "qnavigationmanagerengine_p.h" 39 40 QT_BEGIN_NAMESPACE 41 42 class QNavigationManagerEnginePrivate 43 { 44 public: 45 QString managerName; 46 int managerVersion; 47 QLocale locale; 48 QLocale::MeasurementSystem measurementSystem; 49 bool initialized = false; 50 }; 51 52 class QAbstractNavigatorPrivate 53 { 54 public: 55 QLocale locale; 56 QLocale::MeasurementSystem measurementSystem; 57 }; 58 QAbstractNavigator(QObject * parent)59QAbstractNavigator::QAbstractNavigator(QObject *parent) 60 : QObject(parent) 61 , d(new QAbstractNavigatorPrivate) 62 { 63 } 64 ~QAbstractNavigator()65QAbstractNavigator::~QAbstractNavigator() 66 { 67 } 68 setLocale(const QLocale & locale)69void QAbstractNavigator::setLocale(const QLocale &locale) 70 { 71 d->locale = locale; 72 } 73 locale() const74QLocale QAbstractNavigator::locale() const 75 { 76 return d->locale; 77 } 78 setMeasurementSystem(QLocale::MeasurementSystem system)79void QAbstractNavigator::setMeasurementSystem(QLocale::MeasurementSystem system) 80 { 81 d->measurementSystem = system; 82 } 83 measurementSystem() const84QLocale::MeasurementSystem QAbstractNavigator::measurementSystem() const 85 { 86 return d->measurementSystem; 87 } 88 nextManeuverIcon() const89QVariant QAbstractNavigator::nextManeuverIcon() const 90 { 91 return QVariant(); 92 } 93 distanceToNextManeuver() const94double QAbstractNavigator::distanceToNextManeuver() const 95 { 96 return qQNaN(); 97 } 98 timeToNextManeuver() const99int QAbstractNavigator::timeToNextManeuver() const 100 { 101 return -1; 102 } 103 remainingTravelTime() const104int QAbstractNavigator::remainingTravelTime() const 105 { 106 return -1; 107 } 108 remainingTravelDistance() const109double QAbstractNavigator::remainingTravelDistance() const 110 { 111 return qQNaN(); 112 } 113 remainingTravelTimeToNextWaypoint() const114int QAbstractNavigator::remainingTravelTimeToNextWaypoint() const 115 { 116 return -1; 117 } 118 remainingTravelDistanceToNextWaypoint() const119double QAbstractNavigator::remainingTravelDistanceToNextWaypoint() const 120 { 121 return qQNaN(); 122 } 123 traveledDistance() const124double QAbstractNavigator::traveledDistance() const 125 { 126 return 0; 127 } 128 traveledTime() const129int QAbstractNavigator::traveledTime() const 130 { 131 return 0; 132 } 133 currentRoute() const134QGeoRoute QAbstractNavigator::currentRoute() const 135 { 136 return QGeoRoute(); 137 } 138 currentRouteLeg() const139QGeoRouteLeg QAbstractNavigator::currentRouteLeg() const 140 { 141 return QGeoRouteLeg(); 142 } 143 alternativeRoutes() const144QList<QGeoRoute> QAbstractNavigator::alternativeRoutes() const 145 { 146 return QList<QGeoRoute>(); 147 } 148 currentSegment() const149int QAbstractNavigator::currentSegment() const 150 { 151 return 0; 152 } 153 QNavigationManagerEngine(const QVariantMap & parameters,QObject * parent)154QNavigationManagerEngine::QNavigationManagerEngine(const QVariantMap ¶meters, QObject *parent) 155 : QObject(parent) 156 , d(new QNavigationManagerEnginePrivate) 157 { 158 Q_UNUSED(parameters); 159 } 160 ~QNavigationManagerEngine()161QNavigationManagerEngine::~QNavigationManagerEngine() 162 { 163 } 164 setManagerName(const QString & name)165void QNavigationManagerEngine::setManagerName(const QString &name) 166 { 167 d->managerName = name; 168 } 169 managerName() const170QString QNavigationManagerEngine::managerName() const 171 { 172 return d->managerName; 173 } 174 setManagerVersion(int version)175void QNavigationManagerEngine::setManagerVersion(int version) 176 { 177 d->managerVersion = version; 178 } 179 managerVersion() const180int QNavigationManagerEngine::managerVersion() const 181 { 182 return d->managerVersion; 183 } 184 setLocale(const QLocale & locale)185void QNavigationManagerEngine::setLocale(const QLocale &locale) 186 { 187 d->locale = locale; 188 } 189 locale() const190QLocale QNavigationManagerEngine::locale() const 191 { 192 return d->locale; 193 } 194 setMeasurementSystem(QLocale::MeasurementSystem system)195void QNavigationManagerEngine::setMeasurementSystem(QLocale::MeasurementSystem system) 196 { 197 d->measurementSystem = system; 198 } 199 measurementSystem() const200QLocale::MeasurementSystem QNavigationManagerEngine::measurementSystem() const 201 { 202 return d->measurementSystem; 203 } 204 isInitialized() const205bool QNavigationManagerEngine::isInitialized() const 206 { 207 return d->initialized; 208 } 209 engineInitialized()210void QNavigationManagerEngine::engineInitialized() 211 { 212 d->initialized = true; 213 emit initialized(); 214 } 215 216 QT_END_NAMESPACE 217