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 QPRESSURESENSOR_H |
4 | #define QPRESSURESENSOR_H |
5 | |
6 | #include <QtSensors/qsensor.h> |
7 | |
8 | QT_BEGIN_NAMESPACE |
9 | |
10 | class QPressureReadingPrivate; |
11 | |
12 | class Q_SENSORS_EXPORT QPressureReading : public QSensorReading |
13 | { |
14 | Q_OBJECT |
15 | Q_PROPERTY(qreal pressure READ pressure) |
16 | Q_PROPERTY(qreal temperature READ temperature) |
17 | DECLARE_READING(QPressureReading) |
18 | public: |
19 | qreal pressure() const; |
20 | void setPressure(qreal pressure); |
21 | |
22 | qreal temperature() const; |
23 | void setTemperature(qreal temperature); |
24 | }; |
25 | |
26 | class Q_SENSORS_EXPORT QPressureFilter : public QSensorFilter |
27 | { |
28 | public: |
29 | virtual bool filter(QPressureReading *reading) = 0; |
30 | private: |
31 | bool filter(QSensorReading *reading) override; |
32 | }; |
33 | |
34 | class Q_SENSORS_EXPORT QPressureSensor : public QSensor |
35 | { |
36 | Q_OBJECT |
37 | public: |
38 | explicit QPressureSensor(QObject *parent = nullptr); |
39 | ~QPressureSensor(); |
40 | QPressureReading *reading() const; |
41 | static char const * const sensorType; |
42 | |
43 | private: |
44 | Q_DISABLE_COPY(QPressureSensor) |
45 | }; |
46 | |
47 | QT_END_NAMESPACE |
48 | |
49 | #endif |
50 |