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 QSENSORMANAGER_H
5#define QSENSORMANAGER_H
6
7#include <QtSensors/qsensor.h>
8
9QT_BEGIN_NAMESPACE
10
11class QSensorBackend;
12class QSensorBackendFactory;
13class QSensorPluginInterface;
14
15class Q_SENSORS_EXPORT QSensorManager
16{
17public:
18 // Register a backend (call this from a plugin)
19 static void registerBackend(const QByteArray &type, const QByteArray &identifier, QSensorBackendFactory *factory);
20 static void unregisterBackend(const QByteArray &type, const QByteArray &identifier);
21
22 static bool isBackendRegistered(const QByteArray &type, const QByteArray &identifier);
23
24 // Create a backend (uses the type and identifier set in the sensor)
25 static QSensorBackend *createBackend(QSensor *sensor);
26
27 static void setDefaultBackend(const QByteArray &type, const QByteArray &identifier);
28};
29
30class Q_SENSORS_EXPORT QSensorBackendFactory
31{
32public:
33 virtual QSensorBackend *createBackend(QSensor *sensor) = 0;
34protected:
35 virtual ~QSensorBackendFactory();
36};
37
38QT_END_NAMESPACE
39
40#endif
41
42

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