diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2015-11-25 14:56:11 +0100 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2015-11-28 08:14:12 +0000 |
commit | 4519e46f38df25dd61eb566ab2080896e775a531 (patch) | |
tree | ea2c714f4d7341ecdc293380ff179f6995b9d795 /src/input/frontend/qactioninput.h | |
parent | c6d56b613164e506562b6a537aef499ffb4fb649 (diff) |
Reorganize Input aspect sources into backend/frontend
Change-Id: I7cb9137a6f108d557e3028dc0b72a0053d3f01d4
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/input/frontend/qactioninput.h')
-rw-r--r-- | src/input/frontend/qactioninput.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/src/input/frontend/qactioninput.h b/src/input/frontend/qactioninput.h new file mode 100644 index 000000000..faa44d448 --- /dev/null +++ b/src/input/frontend/qactioninput.h @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt3D module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QT3DINPUT_QACTIONINPUT_H +#define QT3DINPUT_QACTIONINPUT_H + +#include <Qt3DInput/qt3dinput_global.h> +#include <Qt3DCore/qnode.h> + +QT_BEGIN_NAMESPACE + +namespace Qt3DInput { + +class QAbstractInputDevice; +class QActionInputPrivate; + +class QT3DINPUTSHARED_EXPORT QActionInput : public Qt3DCore::QNode +{ + Q_OBJECT + Q_PROPERTY(Qt3DInput::QAbstractInputDevice *sourceDevice READ sourceDevice WRITE setSourceDevice NOTIFY sourceDeviceChanged) + +public: + explicit QActionInput(Qt3DCore::QNode *parent = Q_NULLPTR); + ~QActionInput(); + + void addKey(int key); + void removeKey(int key); + QVector<int> keys() const; + QBitArray keysBitArray() const; + + void setSourceDevice(QAbstractInputDevice *sourceDevice); + QAbstractInputDevice *sourceDevice() const; + +Q_SIGNALS: + void sourceDeviceChanged(); + +protected: + void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE; + +private: + Q_DECLARE_PRIVATE(QActionInput) + QT3D_CLONEABLE(QActionInput) +}; + +} // Qt3DInput + +QT_END_NAMESPACE + +#endif // QACTIONINPUT_H |