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 QMLSENSORRANGE_P_H |
5 | #define QMLSENSORRANGE_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 <QtQml/qqml.h> |
19 | #include <QObject> |
20 | #include "qsensorsquickglobal_p.h" |
21 | |
22 | QT_BEGIN_NAMESPACE |
23 | |
24 | class Q_SENSORSQUICK_PRIVATE_EXPORT QmlSensorRange : public QObject |
25 | { |
26 | Q_OBJECT |
27 | Q_PROPERTY(int minimum READ minimum) |
28 | Q_PROPERTY(int maximum READ maximum) |
29 | QML_NAMED_ELEMENT(Range) |
30 | QML_UNCREATABLE("Cannot create Range" ) |
31 | QML_ADDED_IN_VERSION(5,0) |
32 | public: |
33 | explicit QmlSensorRange(QObject *parent = 0); |
34 | ~QmlSensorRange(); |
35 | |
36 | int minimum() const; |
37 | void setMinumum(int mini) { min = mini; } |
38 | |
39 | int maximum() const; |
40 | void setMaximum(int maxi) { max = maxi; } |
41 | |
42 | private: |
43 | |
44 | int min; |
45 | int max; |
46 | }; |
47 | |
48 | class Q_SENSORSQUICK_PRIVATE_EXPORT QmlSensorOutputRange : public QObject |
49 | { |
50 | Q_OBJECT |
51 | Q_PROPERTY(qreal minimum READ minimum) |
52 | Q_PROPERTY(qreal maximum READ maximum) |
53 | Q_PROPERTY(qreal accuracy READ accuracy) |
54 | QML_NAMED_ELEMENT(OutputRange) |
55 | QML_UNCREATABLE("Cannot create OutputRange" ) |
56 | QML_ADDED_IN_VERSION(5,0) |
57 | public: |
58 | explicit QmlSensorOutputRange(QObject *parent = 0); |
59 | ~QmlSensorOutputRange(); |
60 | |
61 | qreal minimum() const; |
62 | void setMinimum(int mini) { min = mini; } |
63 | |
64 | qreal maximum() const; |
65 | void setMaximum(int maxi) { max = maxi; } |
66 | |
67 | qreal accuracy() const; |
68 | void setAccuracy(int accu) { acc = accu; } |
69 | |
70 | private: |
71 | qreal min; |
72 | qreal max; |
73 | qreal acc; |
74 | }; |
75 | |
76 | QT_END_NAMESPACE |
77 | #endif |
78 | |