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