| 1 | // Copyright (C) 2020 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 QBASICKEYEVENTTRANSITION_P_H | 
| 5 | #define QBASICKEYEVENTTRANSITION_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 <QtGui/qevent.h> | 
| 19 | #include <QtStateMachine/qabstracttransition.h> | 
| 20 | #include <QtCore/private/qglobal_p.h> | 
| 21 |  | 
| 22 | QT_REQUIRE_CONFIG(qeventtransition); | 
| 23 |  | 
| 24 | QT_BEGIN_NAMESPACE | 
| 25 |  | 
| 26 | class QBasicKeyEventTransitionPrivate; | 
| 27 | class Q_AUTOTEST_EXPORT QBasicKeyEventTransition : public QAbstractTransition | 
| 28 | { | 
| 29 |     Q_OBJECT | 
| 30 | public: | 
| 31 |     QBasicKeyEventTransition(QState *sourceState = nullptr); | 
| 32 |     QBasicKeyEventTransition(QEvent::Type type, int key, QState *sourceState = nullptr); | 
| 33 |     QBasicKeyEventTransition(QEvent::Type type, int key, | 
| 34 |                              Qt::KeyboardModifiers modifierMask, | 
| 35 |                              QState *sourceState = nullptr); | 
| 36 |     ~QBasicKeyEventTransition(); | 
| 37 |  | 
| 38 |     QEvent::Type eventType() const; | 
| 39 |     void setEventType(QEvent::Type type); | 
| 40 |  | 
| 41 |     int key() const; | 
| 42 |     void setKey(int key); | 
| 43 |     QBindable<int> bindableKey(); | 
| 44 |  | 
| 45 |     Qt::KeyboardModifiers modifierMask() const; | 
| 46 |     void setModifierMask(Qt::KeyboardModifiers modifiers); | 
| 47 |     QBindable<Qt::KeyboardModifiers> bindableModifierMask(); | 
| 48 |  | 
| 49 | protected: | 
| 50 |     bool eventTest(QEvent *event) override; | 
| 51 |     void onTransition(QEvent *) override; | 
| 52 |  | 
| 53 | private: | 
| 54 |     Q_DISABLE_COPY_MOVE(QBasicKeyEventTransition) | 
| 55 |     Q_DECLARE_PRIVATE(QBasicKeyEventTransition) | 
| 56 | }; | 
| 57 |  | 
| 58 | QT_END_NAMESPACE | 
| 59 |  | 
| 60 | #endif | 
| 61 |  |