1/****************************************************************************
2**
3** Copyright (C) 2017 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the documentation of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:FDL$
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 https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** GNU Free Documentation License Usage
18** Alternatively, this file may be used under the terms of the GNU Free
19** Documentation License version 1.3 as published by the Free Software
20** Foundation and appearing in the file included in the packaging of
21** this file. Please review the following information to ensure
22** the GNU Free Documentation License version 1.3 requirements
23** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
24** $QT_END_LICENSE$
25**
26****************************************************************************/
27
28/*!
29\example logfilepositionsource
30\title Log File Position Source (C++)
31\ingroup qtpositioning-examples
32
33\brief The Logfile Position Source shows how to create and work with a custom NMEA position source,
34       for platforms without GPS.
35
36The data is read from a file which has positional data in NMEA format. The resulting time and
37position information is then displayed to the screen as simple text in date/time and
38latitude/longitude format.
39
40This example class reads position data from a text file, \e log.txt. The file specifies position
41data using a simple text format: it contains one position update per line, where each line contains
42a date/time, a latitude and a longitude, separated by spaces. The date/time is in ISO 8601 format
43and the latitude and longitude are in degrees decimal format. Here is an excerpt from \e log.txt:
44
45\code
462009-08-24T22:25:01 -27.576082 153.092415
472009-08-24T22:25:02 -27.576223 153.092530
482009-08-24T22:25:03 -27.576364 153.092648
49\endcode
50
51The class reads this data and distributes it via the
52\l{QGeoPositionInfoSource::positionUpdated()}{positionUpdated()} signal.
53
54Here is the definition of the \c LogFilePositionSource class:
55
56\quotefromfile logfilepositionsource/logfilepositionsource.h
57\skipto class LogFilePositionSource
58\printuntil };
59
60The main methods overrided by the subclass are:
61
62\list
63    \li \l{QGeoPositionInfoSource::startUpdates()}{startUpdates()}: called by client applications
64        to start regular position updates.
65    \li \l{QGeoPositionInfoSource::stopUpdates()}{stopUpdates()}: called by client applications to
66        stop regular position updates.
67    \li \l{QGeoPositionInfoSource::requestUpdate()}{requestUpdate()}: called by client applications
68        to request a single update, with a specified timeout.
69\endlist
70
71When a position update is available, the subclass emits the
72\l{QGeoPositionInfoSource::positionUpdated()}{positionUpdated()} signal.
73
74Here are the key methods in the class implementation:
75
76\quotefromfile logfilepositionsource/logfilepositionsource.cpp
77\skipto LogFilePositionSource::LogFilePositionSource
78\printuntil /^\}/
79\skipto LogFilePositionSource::startUpdates
80\printuntil /^\}/
81\skipto LogFilePositionSource::stopUpdates
82\printuntil /^\}/
83\skipto LogFilePositionSource::requestUpdate
84\printuntil /^\}/
85\printuntil LogFilePositionSource::readNextPosition
86\printuntil /^\}/
87*/
88