33 QML_NAMED_ELEMENT(SatelliteSource)
34 QML_ADDED_IN_VERSION(6, 5)
36 Q_PROPERTY(
bool active READ isActive WRITE setActive NOTIFY activeChanged)
37 Q_PROPERTY(
bool valid READ isValid NOTIFY validityChanged)
38 Q_PROPERTY(
int updateInterval READ updateInterval WRITE setUpdateInterval
39 NOTIFY updateIntervalChanged)
40 Q_PROPERTY(SourceError sourceError READ sourceError NOTIFY sourceErrorChanged)
41 Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
42 Q_PROPERTY(QQmlListProperty<QDeclarativePluginParameter> parameters READ parameters)
43 Q_PROPERTY(QList<QGeoSatelliteInfo> satellitesInUse READ satellitesInUse
44 NOTIFY satellitesInUseChanged)
45 Q_PROPERTY(QList<QGeoSatelliteInfo> satellitesInView READ satellitesInView
46 NOTIFY satellitesInViewChanged)
48 Q_CLASSINFO(
"DefaultProperty",
"parameters")
49 Q_INTERFACES(QQmlParserStatus)
53 AccessError = QGeoSatelliteInfoSource::AccessError,
54 ClosedError = QGeoSatelliteInfoSource::ClosedError,
55 NoError = QGeoSatelliteInfoSource::NoError,
56 UnknownSourceError = QGeoSatelliteInfoSource::UnknownSourceError,
57 UpdateTimeoutError = QGeoSatelliteInfoSource::UpdateTimeoutError,
61 QDeclarativeSatelliteSource();
62 ~QDeclarativeSatelliteSource();
64 bool isActive()
const;
66 int updateInterval()
const;
67 SourceError sourceError()
const;
69 QQmlListProperty<QDeclarativePluginParameter> parameters();
70 QList<QGeoSatelliteInfo> satellitesInUse()
const;
71 QList<QGeoSatelliteInfo> satellitesInView()
const;
73 void setUpdateInterval(
int updateInterval);
74 void setActive(
bool active);
75 void setName(
const QString &name);
78 void classBegin() override { }
79 void componentComplete() override;
81 Q_INVOKABLE
bool setBackendProperty(
const QString &name,
const QVariant &value);
82 Q_INVOKABLE QVariant backendProperty(
const QString &name)
const;
85 void update(
int timeout = 0);
91 void validityChanged();
92 void updateIntervalChanged();
93 void sourceErrorChanged();
95 void satellitesInUseChanged();
96 void satellitesInViewChanged();
99 void sourceErrorReceived(
const QGeoSatelliteInfoSource::Error error);
100 void onParameterInitialized();
101 void satellitesInViewUpdateReceived(
const QList<QGeoSatelliteInfo> &satellites);
102 void satellitesInUseUpdateReceived(
const QList<QGeoSatelliteInfo> &satellites);
105 QVariantMap parameterMap()
const;
106 void createSource(
const QString &newName);
107 void handleSingleUpdateReceived();
109 void executeSingleUpdate(
int timeout);
111 using PluginParameterProperty = QQmlListProperty<QDeclarativePluginParameter>;
112 static void parameter_append(PluginParameterProperty *prop,
113 QDeclarativePluginParameter *parameter);
114 static qsizetype parameter_count(PluginParameterProperty *prop);
115 static QDeclarativePluginParameter *parameter_at(PluginParameterProperty *prop,
117 static void parameter_clear(PluginParameterProperty *prop);
119 std::unique_ptr<QGeoSatelliteInfoSource> m_source;
120 QList<QDeclarativePluginParameter *> m_parameters;
122 int m_updateInterval = 0;
123 SourceError m_error = SourceError::NoError;
125 QList<QGeoSatelliteInfo> m_satellitesInView;
126 QList<QGeoSatelliteInfo> m_satellitesInUse;
128 int m_singleUpdateDesiredTimeout = 0;
131 quint8 m_componentComplete : 1;
132 quint8 m_parametersInitialized : 1;
133 quint8 m_startRequested : 1;
134 quint8 m_defaultSourceUsed : 1;
135 quint8 m_regularUpdates : 1;
136 quint8 m_singleUpdate : 1;
137 quint8 m_singleUpdateRequested : 1;