summaryrefslogtreecommitdiffstats
path: root/src/plugins/sensors/ios/iosproximitysensor.h
blob: 09d2265086d6a819e26059ef04aa662823eb9ba2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#ifndef IOSPROXIMITYSENSOR_H
#define IOSPROXIMITYSENSOR_H

#include <qsensorbackend.h>
#include <qproximitysensor.h>

@class ProximitySensorCallback;

QT_BEGIN_NAMESPACE

class IOSProximitySensor : public QSensorBackend
{
public:
    static char const * const id;

    explicit IOSProximitySensor(QSensor *sensor);
    ~IOSProximitySensor();

    void start() override;
    void stop() override;

    void proximityChanged(bool close);
    static bool available();

private:
    ProximitySensorCallback *m_proximitySensorCallback;
    QProximityReading m_reading;

    static int s_startCount;
};
QT_END_NAMESPACE

#endif // IOSPROXIMITYSENSOR_H