summaryrefslogtreecommitdiffstats
path: root/src/input/frontend/qbuttonaxisinput.h
blob: e7380753e4dcc01d78059fa24d75244da7ada80e (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#ifndef QT3DINPUT_QBUTTONAXISINPUT_H
#define QT3DINPUT_QBUTTONAXISINPUT_H

#include <Qt3DInput/qt3dinput_global.h>
#include <Qt3DInput/QAbstractAxisInput>

QT_BEGIN_NAMESPACE

namespace Qt3DInput {

class QButtonAxisInputPrivate;

class Q_3DINPUTSHARED_EXPORT QButtonAxisInput : public QAbstractAxisInput
{
    Q_OBJECT
    Q_PROPERTY(float scale READ scale WRITE setScale NOTIFY scaleChanged)
    Q_PROPERTY(QList<int> buttons READ buttons WRITE setButtons NOTIFY buttonsChanged)
    Q_PROPERTY(float acceleration READ acceleration WRITE setAcceleration NOTIFY accelerationChanged)
    Q_PROPERTY(float deceleration READ deceleration WRITE setDeceleration NOTIFY decelerationChanged)

public:
    explicit QButtonAxisInput(Qt3DCore::QNode *parent = nullptr);
    ~QButtonAxisInput();

    float scale() const;
    QList<int> buttons() const;

    float acceleration() const;
    float deceleration() const;

public Q_SLOTS:
    void setScale(float scale);
    void setButtons(const QList<int> &buttons);

    void setAcceleration(float acceleration);
    void setDeceleration(float deceleration);

Q_SIGNALS:
    void scaleChanged(float scale);
    void buttonsChanged(const QList<int> &buttons);

    void accelerationChanged(float acceleration);
    void decelerationChanged(float deceleration);

private:
    Q_DECLARE_PRIVATE(QButtonAxisInput)
};

} // Qt3DInput

QT_END_NAMESPACE

#endif // QT3DINPUT_QBUTTONAXISINPUT_H