~ubuntu-branches/ubuntu/quantal/qtmobility/quantal

« back to all changes in this revision

Viewing changes to src/location/maps/qgeoroutingmanagerengine.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-11-16 16:18:07 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20101116161807-k2dzt2nyse975r3l
Tags: 1.1.0-0ubuntu1
* New upstream release
* Syncronise with Debian, no remaining changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
**
9
9
** $QT_BEGIN_LICENSE:LGPL$
10
10
** Commercial Usage
11
 
** Licensees holding valid Qt Commercial licenses may use this file in
12
 
** accordance with the Qt Solutions Commercial License Agreement provided
13
 
** with the Software or, alternatively, in accordance with the terms
 
11
** Licensees holding valid Qt Commercial licenses may use this file in 
 
12
** accordance with the Qt Commercial License Agreement provided with
 
13
** the Software or, alternatively, in accordance with the terms
14
14
** contained in a written agreement between you and Nokia.
15
15
**
16
16
** GNU Lesser General Public License Usage
33
33
** ensure the GNU General Public License version 3.0 requirements will be
34
34
** met: http://www.gnu.org/copyleft/gpl.html.
35
35
**
36
 
** Please note Third Party Software included with Qt Solutions may impose
37
 
** additional restrictions and it is the user's responsibility to ensure
38
 
** that they have met the licensing requirements of the GPL, LGPL, or Qt
39
 
** Solutions Commercial license and the relevant license of the Third
40
 
** Party Software they are using.
41
 
**
42
36
** If you are unsure which license is appropriate for your use, please
43
37
** contact the sales department at qt-sales@nokia.com.
44
38
** $QT_END_LICENSE$
96
90
    to pass any implementation specific data to the engine.
97
91
*/
98
92
QGeoRoutingManagerEngine::QGeoRoutingManagerEngine(const QMap<QString, QVariant> &parameters, QObject *parent)
99
 
        : QObject(parent),
100
 
        d_ptr(new QGeoRoutingManagerEnginePrivate()) {}
 
93
    : QObject(parent),
 
94
      d_ptr(new QGeoRoutingManagerEnginePrivate())
 
95
{
 
96
    Q_UNUSED(parameters)
 
97
}
101
98
 
102
99
/*!
103
100
    Destroys this engine.
293
290
}
294
291
 
295
292
/*!
296
 
    Sets the types of features that this engine can avoid during route planning to \a avoidFeatureTypes.
297
 
 
298
 
    It is important that subclasses use this method to ensure that the engine
299
 
    reports its capabilities correctly.  If this function is not used the
300
 
    engine will report that it does not support avoiding features.
301
 
*/
302
 
void QGeoRoutingManagerEngine::setSupportedAvoidFeatureTypes(QGeoRouteRequest::AvoidFeatureTypes avoidFeatureTypes)
303
 
{
304
 
    d_ptr->supportedAvoidFeatureTypes = avoidFeatureTypes;
305
 
}
306
 
 
307
 
/*!
308
 
    Returns the types of features that this engine can avoid during route planning.
309
 
*/
310
 
QGeoRouteRequest::AvoidFeatureTypes QGeoRoutingManagerEngine::supportedAvoidFeatureTypes() const
311
 
{
312
 
    return d_ptr->supportedAvoidFeatureTypes;
 
293
    Sets the types of features that this engine can take into account
 
294
    during route planning to \a featureTypes.
 
295
 
 
296
    It is important that subclasses use this method to ensure that the engine
 
297
    reports its capabilities correctly.  If this function is not used the
 
298
    engine will report that it supports no feature types at all.
 
299
*/
 
300
void QGeoRoutingManagerEngine::setSupportedFeatureTypes(QGeoRouteRequest::FeatureTypes featureTypes)
 
301
{
 
302
    d_ptr->supportedFeatureTypes = featureTypes;
 
303
}
 
304
 
 
305
/*!
 
306
    Returns the types of features that this engine can take into account
 
307
    during route planning.
 
308
*/
 
309
QGeoRouteRequest::FeatureTypes QGeoRoutingManagerEngine::supportedFeatureTypes() const
 
310
{
 
311
    return d_ptr->supportedFeatureTypes;
 
312
}
 
313
 
 
314
/*!
 
315
    Sets the weightings which this engine can apply to different features
 
316
    during route planning to \a featureWeights.
 
317
 
 
318
    It is important that subclasses use this method to ensure that the engine
 
319
    reports its capabilities correctly.  If this function is not used the
 
320
    engine will report that it supports no feaure weights at all.
 
321
*/
 
322
void QGeoRoutingManagerEngine::setSupportedFeatureWeights(QGeoRouteRequest::FeatureWeights featureWeights)
 
323
{
 
324
    d_ptr->supportedFeatureWeights = featureWeights;
 
325
    d_ptr->supportedFeatureWeights |= QGeoRouteRequest::NeutralFeatureWeight;
 
326
}
 
327
 
 
328
/*!
 
329
    Returns the weightings which this engine can apply to different features
 
330
    during route planning.
 
331
*/
 
332
QGeoRouteRequest::FeatureWeights QGeoRoutingManagerEngine::supportedFeatureWeights() const
 
333
{
 
334
    return d_ptr->supportedFeatureWeights;
313
335
}
314
336
 
315
337
/*!
355
377
}
356
378
 
357
379
/*!
358
 
    Sets the levels of detail for navigation instructions which can be
359
 
    requested by this engine to \a instructionDetails.
 
380
    Sets the levels of detail for navigation manuevers which can be
 
381
    requested by this engine to \a maneuverDetails.
360
382
 
361
383
    It is important that subclasses use this method to ensure that the engine
362
384
    reports its capabilities correctly.  If this function is not used the
363
 
    engine will report that it supports no instruction detail at all.
 
385
    engine will report that it supports no maneuver details at all.
364
386
*/
365
 
void QGeoRoutingManagerEngine::setSupportedInstructionDetails(QGeoRouteRequest::InstructionDetails instructionDetails)
 
387
void QGeoRoutingManagerEngine::setSupportedManeuverDetails(QGeoRouteRequest::ManeuverDetails maneuverDetails)
366
388
{
367
 
    d_ptr->supportedInstructionDetails = instructionDetails;
 
389
    d_ptr->supportedManeuverDetails = maneuverDetails;
368
390
}
369
391
 
370
392
/*!
371
 
    Returns the levels of detail for navigation instructions which can be
 
393
    Returns the levels of detail for navigation maneuvers which can be
372
394
    requested by this engine.
373
395
*/
374
 
QGeoRouteRequest::InstructionDetails QGeoRoutingManagerEngine::supportedInstructionDetails() const
 
396
QGeoRouteRequest::ManeuverDetails QGeoRoutingManagerEngine::supportedManeuverDetails() const
375
397
{
376
 
    return d_ptr->supportedInstructionDetails;
 
398
    return d_ptr->supportedManeuverDetails;
377
399
}
378
400
 
379
401
/*!
431
453
*******************************************************************************/
432
454
 
433
455
QGeoRoutingManagerEnginePrivate::QGeoRoutingManagerEnginePrivate()
434
 
        : managerVersion(-1),
435
 
        supportsRouteUpdates(false),
436
 
        supportsAlternativeRoutes(false),
437
 
        supportsExcludeAreas(false) {}
 
456
    : managerVersion(-1),
 
457
      supportsRouteUpdates(false),
 
458
      supportsAlternativeRoutes(false),
 
459
      supportsExcludeAreas(false)
 
460
{
 
461
}
438
462
 
439
463
QGeoRoutingManagerEnginePrivate::~QGeoRoutingManagerEnginePrivate() {}
440
464