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
qgeosatelliteinfo.h
Go to the documentation of this file.
1// Copyright (C) 2016 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 QGEOSATELLITEINFO_H
4#define QGEOSATELLITEINFO_H
5
6#include <QtPositioning/qpositioningglobal.h>
7#include <QtCore/QSharedData>
8#include <QtCore/QMetaType>
9#include <QtCore/QDebug>
10
12
13class QDebug;
14class QDataStream;
15
16class QGeoSatelliteInfo;
17Q_POSITIONING_EXPORT size_t qHash(const QGeoSatelliteInfo &key, size_t seed = 0) noexcept;
18namespace QTest
19{
20
21Q_POSITIONING_EXPORT char *toString(const QGeoSatelliteInfo &info);
22
23} // namespace QTest
24
25class QGeoSatelliteInfoPrivate;
26QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(QGeoSatelliteInfoPrivate, Q_POSITIONING_EXPORT)
27
28class Q_POSITIONING_EXPORT QGeoSatelliteInfo
29{
30 Q_GADGET
31 Q_PROPERTY(SatelliteSystem satelliteSystem READ satelliteSystem FINAL)
32 Q_PROPERTY(int satelliteIdentifier READ satelliteIdentifier FINAL)
33 Q_PROPERTY(qreal signalStrength READ signalStrength FINAL)
34
35public:
36 enum Attribute {
37 Elevation,
38 Azimuth
39 };
40 Q_ENUM(Attribute)
41
42 enum SatelliteSystem {
43 Undefined = 0x00,
44 GPS = 0x01,
45 GLONASS = 0x02,
46 GALILEO = 0x03,
47 BEIDOU = 0x04,
48 QZSS = 0x05,
49 Multiple = 0xFF,
50 CustomType = 0x100
51 };
52 Q_ENUM(SatelliteSystem)
53
54 QGeoSatelliteInfo();
55 QGeoSatelliteInfo(const QGeoSatelliteInfo &other);
56 QGeoSatelliteInfo(QGeoSatelliteInfoPrivate &dd);
57 QGeoSatelliteInfo(QGeoSatelliteInfo &&other) noexcept = default;
58 ~QGeoSatelliteInfo();
59
60 QGeoSatelliteInfo &operator=(const QGeoSatelliteInfo &other);
61 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QGeoSatelliteInfo)
62
63 void swap(QGeoSatelliteInfo &other) noexcept { d.swap(other.d); }
64
65 friend bool operator==(const QGeoSatelliteInfo &lhs, const QGeoSatelliteInfo &rhs)
66 {
67 return equals(lhs, rhs);
68 }
69 friend bool operator!=(const QGeoSatelliteInfo &lhs, const QGeoSatelliteInfo &rhs)
70 {
71 return !equals(lhs, rhs);
72 }
73
74 void setSatelliteSystem(SatelliteSystem system);
75 SatelliteSystem satelliteSystem() const;
76
77 void setSatelliteIdentifier(int satId);
78 int satelliteIdentifier() const;
79
80 void setSignalStrength(int signalStrength);
81 int signalStrength() const;
82
83 void setAttribute(Attribute attribute, qreal value);
84 Q_INVOKABLE qreal attribute(Attribute attribute) const;
85 void removeAttribute(Attribute attribute);
86
87 Q_INVOKABLE bool hasAttribute(Attribute attribute) const;
88
89 void detach();
90
91private:
92 static bool equals(const QGeoSatelliteInfo &lhs, const QGeoSatelliteInfo &rhs);
93#ifndef QT_NO_DEBUG_STREAM
94 friend QDebug operator<<(QDebug dbg, const QGeoSatelliteInfo &info)
95 {
96 return debugStreaming(dbg, info);
97 }
98 static QDebug debugStreaming(QDebug dbg, const QGeoSatelliteInfo &info);
99#endif
100#ifndef QT_NO_DATASTREAM
101 friend QDataStream &operator<<(QDataStream &stream, const QGeoSatelliteInfo &info)
102 {
103 return dataStreamOut(stream, info);
104 }
105 friend QDataStream &operator>>(QDataStream &stream, QGeoSatelliteInfo &info)
106 {
107 return dataStreamIn(stream, info);
108 }
109 static QDataStream &dataStreamOut(QDataStream &stream, const QGeoSatelliteInfo &info);
110 static QDataStream &dataStreamIn(QDataStream &stream, QGeoSatelliteInfo &info);
111#endif
112 QExplicitlySharedDataPointer<QGeoSatelliteInfoPrivate> d;
113 friend class QGeoSatelliteInfoPrivate;
114
115 friend Q_POSITIONING_EXPORT size_t qHash(const QGeoSatelliteInfo &key, size_t seed) noexcept;
116 friend Q_POSITIONING_EXPORT char *QTest::toString(const QGeoSatelliteInfo &info);
117};
118
120
121QT_END_NAMESPACE
122
123QT_DECL_METATYPE_EXTERN(QGeoSatelliteInfo, Q_POSITIONING_EXPORT)
124
125#endif
\inmodule QtPositioning
void satellitesChanged(GypsySatellite *satellite, GPtrArray *satellites)
void requestUpdate(int timeout=5000) override
int init(const QVariantMap parameters)
Error error() const override
Returns the last error that occurred.
\inmodule QtPositioning
\inmodule QtPositioning
Combined button and popup list for selecting options.
char * toString(const QGeoSatelliteInfo &info)
Q_DECLARE_INTERFACE(QNetworkAccessBackendFactory, QNetworkAccessBackendFactory_iid)