1// Copyright (C) 2016 Canonical, Ltd
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3#ifndef QLIDSENSOR_H
4#define QLIDSENSOR_H
5
6#include <QtSensors/qsensor.h>
7
8QT_BEGIN_NAMESPACE
9
10class QLidReadingPrivate;
11
12class Q_SENSORS_EXPORT QLidReading : public QSensorReading
13{
14 Q_OBJECT
15 Q_PROPERTY(bool backLidClosed READ backLidClosed)
16 Q_PROPERTY(bool frontLidClosed READ frontLidClosed)
17 DECLARE_READING(QLidReading)
18public:
19
20 bool backLidClosed() const;
21 void setBackLidClosed(bool closed);
22
23 bool frontLidClosed() const;
24 void setFrontLidClosed(bool closed);
25
26Q_SIGNALS:
27 void backLidChanged(bool closed);
28 void frontLidChanged(bool closed);
29};
30
31class Q_SENSORS_EXPORT QLidFilter : public QSensorFilter
32{
33public:
34 virtual bool filter(QLidReading *reading) = 0;
35private:
36 bool filter(QSensorReading *reading) override;
37};
38
39class Q_SENSORS_EXPORT QLidSensor : public QSensor
40{
41 Q_OBJECT
42public:
43 explicit QLidSensor(QObject *parent = nullptr);
44 ~QLidSensor();
45 QLidReading *reading() const;
46 static char const * const sensorType;
47
48private:
49 Q_DISABLE_COPY(QLidSensor)
50};
51
52QT_END_NAMESPACE
53
54#endif
55

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