| 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 GENERICALSSENSOR_H | 
| 5 | #define GENERICALSSENSOR_H | 
| 6 |  | 
| 7 | #include <QtSensors/qsensorbackend.h> | 
| 8 | #include <QtSensors/qlightsensor.h> | 
| 9 | #include <QtSensors/qambientlightsensor.h> | 
| 10 |  | 
| 11 | class genericalssensor : public QSensorBackend, public QLightFilter | 
| 12 | { | 
| 13 | public: | 
| 14 |     static char const * const id; | 
| 15 |  | 
| 16 |     genericalssensor(QSensor *sensor); | 
| 17 |  | 
| 18 |     void start() override; | 
| 19 |     void stop() override; | 
| 20 |  | 
| 21 |     bool filter(QLightReading *reading) override; | 
| 22 |  | 
| 23 | private: | 
| 24 |     QAmbientLightReading m_reading; | 
| 25 |     QLightSensor *lightSensor; | 
| 26 | }; | 
| 27 |  | 
| 28 | #endif | 
| 29 |  | 
| 30 |  |