| 1 | // Copyright (C) 2016 Research In Motion |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | #ifndef QAMBIENTTEMPERATURESENSOR_H |
| 4 | #define QAMBIENTTEMPERATURESENSOR_H |
| 5 | |
| 6 | #include <QtSensors/qsensor.h> |
| 7 | |
| 8 | QT_BEGIN_NAMESPACE |
| 9 | |
| 10 | class QAmbientTemperatureReadingPrivate; |
| 11 | |
| 12 | class Q_SENSORS_EXPORT QAmbientTemperatureReading : public QSensorReading |
| 13 | { |
| 14 | Q_OBJECT |
| 15 | Q_PROPERTY(qreal temperature READ temperature) |
| 16 | DECLARE_READING(QAmbientTemperatureReading) |
| 17 | public: |
| 18 | qreal temperature() const; |
| 19 | void setTemperature(qreal temperature); |
| 20 | }; |
| 21 | |
| 22 | class Q_SENSORS_EXPORT QAmbientTemperatureFilter : public QSensorFilter |
| 23 | { |
| 24 | public: |
| 25 | virtual bool filter(QAmbientTemperatureReading *reading) = 0; |
| 26 | private: |
| 27 | bool filter(QSensorReading *reading) override; |
| 28 | }; |
| 29 | |
| 30 | class Q_SENSORS_EXPORT QAmbientTemperatureSensor : public QSensor |
| 31 | { |
| 32 | Q_OBJECT |
| 33 | public: |
| 34 | explicit QAmbientTemperatureSensor(QObject *parent = nullptr); |
| 35 | ~QAmbientTemperatureSensor(); |
| 36 | QAmbientTemperatureReading *reading() const; |
| 37 | static char const * const sensorType; |
| 38 | |
| 39 | private: |
| 40 | Q_DISABLE_COPY(QAmbientTemperatureSensor) |
| 41 | }; |
| 42 | |
| 43 | QT_END_NAMESPACE |
| 44 | |
| 45 | #endif |
| 46 |
