| 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 QMLSENSORGLOBAL_P_H |
| 5 | #define QMLSENSORGLOBAL_P_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include "qsensorsquickglobal_p.h" |
| 19 | #include <QtQml/qqml.h> |
| 20 | #include <QObject> |
| 21 | #include <QStringList> |
| 22 | |
| 23 | QT_BEGIN_NAMESPACE |
| 24 | |
| 25 | class QSensor; |
| 26 | |
| 27 | class Q_SENSORSQUICK_EXPORT QmlSensorGlobal : public QObject |
| 28 | { |
| 29 | Q_OBJECT |
| 30 | public: |
| 31 | explicit QmlSensorGlobal(QObject *parent = 0); |
| 32 | ~QmlSensorGlobal(); |
| 33 | |
| 34 | Q_INVOKABLE QStringList sensorTypes() const; |
| 35 | Q_INVOKABLE QStringList sensorsForType(const QString &type) const; |
| 36 | Q_INVOKABLE QString defaultSensorForType(const QString &type) const; |
| 37 | QML_NAMED_ELEMENT(QmlSensors) |
| 38 | QML_SINGLETON |
| 39 | QML_ADDED_IN_VERSION(5,0) |
| 40 | |
| 41 | Q_SIGNALS: |
| 42 | void availableSensorsChanged(); |
| 43 | |
| 44 | private: |
| 45 | QSensor *m_sensor; |
| 46 | }; |
| 47 | |
| 48 | QT_END_NAMESPACE |
| 49 | |
| 50 | #endif |
| 51 |
