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

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