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
8QT_BEGIN_NAMESPACE
9
10class QAmbientTemperatureReadingPrivate;
11
12class Q_SENSORS_EXPORT QAmbientTemperatureReading : public QSensorReading
13{
14 Q_OBJECT
15 Q_PROPERTY(qreal temperature READ temperature)
16 DECLARE_READING(QAmbientTemperatureReading)
17public:
18 qreal temperature() const;
19 void setTemperature(qreal temperature);
20};
21
22class Q_SENSORS_EXPORT QAmbientTemperatureFilter : public QSensorFilter
23{
24public:
25 virtual bool filter(QAmbientTemperatureReading *reading) = 0;
26private:
27 bool filter(QSensorReading *reading) override;
28};
29
30class Q_SENSORS_EXPORT QAmbientTemperatureSensor : public QSensor
31{
32 Q_OBJECT
33public:
34 explicit QAmbientTemperatureSensor(QObject *parent = nullptr);
35 ~QAmbientTemperatureSensor();
36 QAmbientTemperatureReading *reading() const;
37 static char const * const sensorType;
38
39private:
40 Q_DISABLE_COPY(QAmbientTemperatureSensor)
41};
42
43QT_END_NAMESPACE
44
45#endif
46

source code of qtsensors/src/sensors/qambienttemperaturesensor.h