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
40QT_BEGIN_NAMESPACE
41
42class QNavigationManagerEnginePrivate
43{
44public:
45 QString managerName;
46 int managerVersion;
47 QLocale locale;
48 QLocale::MeasurementSystem measurementSystem;
49 bool initialized = false;
50};
51
52class QAbstractNavigatorPrivate
53{
54public:
55 QLocale locale;
56 QLocale::MeasurementSystem measurementSystem;
57};
58
59QAbstractNavigator::QAbstractNavigator(QObject *parent)
60 : QObject(parent)
61 , d(new QAbstractNavigatorPrivate)
62{
63}
64
65QAbstractNavigator::~QAbstractNavigator()
66{
67}
68
69void QAbstractNavigator::setLocale(const QLocale &locale)
70{
71 d->locale = locale;
72}
73
74QLocale QAbstractNavigator::locale() const
75{
76 return d->locale;
77}
78
79void QAbstractNavigator::setMeasurementSystem(QLocale::MeasurementSystem system)
80{
81 d->measurementSystem = system;
82}
83
84QLocale::MeasurementSystem QAbstractNavigator::measurementSystem() const
85{
86 return d->measurementSystem;
87}
88
89QVariant QAbstractNavigator::nextManeuverIcon() const
90{
91 return QVariant();
92}
93
94double QAbstractNavigator::distanceToNextManeuver() const
95{
96 return qQNaN();
97}
98
99int QAbstractNavigator::timeToNextManeuver() const
100{
101 return -1;
102}
103
104int QAbstractNavigator::remainingTravelTime() const
105{
106 return -1;
107}
108
109double QAbstractNavigator::remainingTravelDistance() const
110{
111 return qQNaN();
112}
113
114int QAbstractNavigator::remainingTravelTimeToNextWaypoint() const
115{
116 return -1;
117}
118
119double QAbstractNavigator::remainingTravelDistanceToNextWaypoint() const
120{
121 return qQNaN();
122}
123
124double QAbstractNavigator::traveledDistance() const
125{
126 return 0;
127}
128
129int QAbstractNavigator::traveledTime() const
130{
131 return 0;
132}
133
134QGeoRoute QAbstractNavigator::currentRoute() const
135{
136 return QGeoRoute();
137}
138
139QGeoRouteLeg QAbstractNavigator::currentRouteLeg() const
140{
141 return QGeoRouteLeg();
142}
143
144QList<QGeoRoute> QAbstractNavigator::alternativeRoutes() const
145{
146 return QList<QGeoRoute>();
147}
148
149int QAbstractNavigator::currentSegment() const
150{
151 return 0;
152}
153
154QNavigationManagerEngine::QNavigationManagerEngine(const QVariantMap &parameters, QObject *parent)
155 : QObject(parent)
156 , d(new QNavigationManagerEnginePrivate)
157{
158 Q_UNUSED(parameters);
159}
160
161QNavigationManagerEngine::~QNavigationManagerEngine()
162{
163}
164
165void QNavigationManagerEngine::setManagerName(const QString &name)
166{
167 d->managerName = name;
168}
169
170QString QNavigationManagerEngine::managerName() const
171{
172 return d->managerName;
173}
174
175void QNavigationManagerEngine::setManagerVersion(int version)
176{
177 d->managerVersion = version;
178}
179
180int QNavigationManagerEngine::managerVersion() const
181{
182 return d->managerVersion;
183}
184
185void QNavigationManagerEngine::setLocale(const QLocale &locale)
186{
187 d->locale = locale;
188}
189
190QLocale QNavigationManagerEngine::locale() const
191{
192 return d->locale;
193}
194
195void QNavigationManagerEngine::setMeasurementSystem(QLocale::MeasurementSystem system)
196{
197 d->measurementSystem = system;
198}
199
200QLocale::MeasurementSystem QNavigationManagerEngine::measurementSystem() const
201{
202 return d->measurementSystem;
203}
204
205bool QNavigationManagerEngine::isInitialized() const
206{
207 return d->initialized;
208}
209
210void QNavigationManagerEngine::engineInitialized()
211{
212 d->initialized = true;
213 emit initialized();
214}
215
216QT_END_NAMESPACE
217

source code of qtlocation/src/location/maps/qnavigationmanagerengine.cpp