| 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 | |
| 4 | #ifndef QGYROSCOPE_H |
| 5 | #define QGYROSCOPE_H |
| 6 | |
| 7 | #include <QtSensors/qsensor.h> |
| 8 | |
| 9 | QT_BEGIN_NAMESPACE |
| 10 | |
| 11 | class QGyroscopeReadingPrivate; |
| 12 | |
| 13 | class Q_SENSORS_EXPORT QGyroscopeReading : public QSensorReading |
| 14 | { |
| 15 | Q_OBJECT |
| 16 | Q_PROPERTY(qreal x READ x) |
| 17 | Q_PROPERTY(qreal y READ y) |
| 18 | Q_PROPERTY(qreal z READ z) |
| 19 | DECLARE_READING(QGyroscopeReading) |
| 20 | public: |
| 21 | qreal x() const; |
| 22 | void setX(qreal x); |
| 23 | |
| 24 | qreal y() const; |
| 25 | void setY(qreal y); |
| 26 | |
| 27 | qreal z() const; |
| 28 | void setZ(qreal z); |
| 29 | }; |
| 30 | |
| 31 | class Q_SENSORS_EXPORT QGyroscopeFilter : public QSensorFilter |
| 32 | { |
| 33 | public: |
| 34 | virtual bool filter(QGyroscopeReading *reading) = 0; |
| 35 | private: |
| 36 | bool filter(QSensorReading *reading) override; |
| 37 | }; |
| 38 | |
| 39 | class Q_SENSORS_EXPORT QGyroscope : public QSensor |
| 40 | { |
| 41 | Q_OBJECT |
| 42 | public: |
| 43 | explicit QGyroscope(QObject *parent = nullptr); |
| 44 | virtual ~QGyroscope(); |
| 45 | QGyroscopeReading *reading() const; |
| 46 | static char const * const sensorType; |
| 47 | |
| 48 | private: |
| 49 | Q_DISABLE_COPY(QGyroscope) |
| 50 | }; |
| 51 | |
| 52 | QT_END_NAMESPACE |
| 53 | |
| 54 | #endif |
| 55 | |
| 56 |
