| 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 QBASICMOUSEEVENTTRANSITION_P_H |
| 5 | #define QBASICMOUSEEVENTTRANSITION_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 | #include <private/qstatemachineglobal_p.h> |
| 22 | |
| 23 | QT_REQUIRE_CONFIG(qeventtransition); |
| 24 | |
| 25 | QT_BEGIN_NAMESPACE |
| 26 | |
| 27 | class QPainterPath; |
| 28 | |
| 29 | class QBasicMouseEventTransitionPrivate; |
| 30 | class Q_AUTOTEST_EXPORT QBasicMouseEventTransition : public QAbstractTransition |
| 31 | { |
| 32 | Q_OBJECT |
| 33 | public: |
| 34 | QBasicMouseEventTransition(QState *sourceState = nullptr); |
| 35 | QBasicMouseEventTransition(QEvent::Type type, Qt::MouseButton button, |
| 36 | QState *sourceState = nullptr); |
| 37 | ~QBasicMouseEventTransition(); |
| 38 | |
| 39 | QEvent::Type eventType() const; |
| 40 | void setEventType(QEvent::Type type); |
| 41 | |
| 42 | Qt::MouseButton button() const; |
| 43 | void setButton(Qt::MouseButton button); |
| 44 | QBindable<Qt::MouseButton> bindableButton(); |
| 45 | |
| 46 | Qt::KeyboardModifiers modifierMask() const; |
| 47 | void setModifierMask(Qt::KeyboardModifiers modifiers); |
| 48 | QBindable<Qt::KeyboardModifiers> bindableModifierMask(); |
| 49 | |
| 50 | QPainterPath hitTestPath() const; |
| 51 | void setHitTestPath(const QPainterPath &path); |
| 52 | |
| 53 | protected: |
| 54 | bool eventTest(QEvent *event) override; |
| 55 | void onTransition(QEvent *) override; |
| 56 | |
| 57 | private: |
| 58 | Q_DISABLE_COPY_MOVE(QBasicMouseEventTransition) |
| 59 | Q_DECLARE_PRIVATE(QBasicMouseEventTransition) |
| 60 | }; |
| 61 | |
| 62 | QT_END_NAMESPACE |
| 63 | |
| 64 | #endif |
| 65 |
