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