Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qnmeasatelliteinfosource.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3#ifndef QNMEASATELLITEINFOSOURCE_H
4#define QNMEASATELLITEINFOSOURCE_H
5
6#include <QtPositioning/QGeoSatelliteInfoSource>
7
8QT_BEGIN_NAMESPACE
9
10class QIODevice;
11
13class Q_POSITIONING_EXPORT QNmeaSatelliteInfoSource : public QGeoSatelliteInfoSource
14{
15 Q_OBJECT
16public:
17 enum class UpdateMode {
18 RealTimeMode = 1,
19 SimulationMode
20 };
21
22 static QString SimulationUpdateInterval;
23
24 explicit QNmeaSatelliteInfoSource(UpdateMode mode, QObject *parent = nullptr);
25 ~QNmeaSatelliteInfoSource() override;
26
27 UpdateMode updateMode() const;
28
29 void setDevice(QIODevice *source);
30 QIODevice *device() const;
31
32 void setUpdateInterval(int msec) override;
33 int minimumUpdateInterval() const override;
34 Error error() const override;
35
36 bool setBackendProperty(const QString &name, const QVariant &value) override;
37 QVariant backendProperty(const QString &name) const override;
38
39public Q_SLOTS:
40 void startUpdates() override;
41 void stopUpdates() override;
42 void requestUpdate(int timeout = 0) override;
43
44protected:
45#if QT_DEPRECATED_SINCE(7, 0)
46 QT6_ONLY(virtual)
47 QGeoSatelliteInfo::SatelliteSystem
48 parseSatellitesInUseFromNmea(const char *data, int size, QList<int> &pnrsInUse);
49#endif
50 QT7_ONLY(virtual)
51 QGeoSatelliteInfo::SatelliteSystem
52 parseSatellitesInUseFromNmea(QByteArrayView data, QList<int> &pnrsInUse);
53 enum SatelliteInfoParseStatus {
54 NotParsed = 0,
55 PartiallyParsed,
56 FullyParsed
57 };
58#if QT_DEPRECATED_SINCE(7, 0)
59 QT6_ONLY(virtual)
60 SatelliteInfoParseStatus parseSatelliteInfoFromNmea(const char *data, int size,
61 QList<QGeoSatelliteInfo> &infos,
62 QGeoSatelliteInfo::SatelliteSystem &system);
63#endif
64 QT7_ONLY(virtual)
65 SatelliteInfoParseStatus parseSatelliteInfoFromNmea(QByteArrayView data,
66 QList<QGeoSatelliteInfo> &infos,
67 QGeoSatelliteInfo::SatelliteSystem &system);
68
69 QNmeaSatelliteInfoSourcePrivate *d;
70 void setError(QGeoSatelliteInfoSource::Error satelliteError);
71
72 friend class QNmeaSatelliteInfoSourcePrivate;
73 Q_DISABLE_COPY(QNmeaSatelliteInfoSource)
74
75 // for using the SatelliteInfoParseStatus enum
76 friend class QLocationUtils;
77};
78
79QT_END_NAMESPACE
80
81#endif // QNMEASATELLITEINFOSOURCE_H