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

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