1 | // Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). |
---|---|
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 QT3DANIMATION_QCALLBACKMAPPING_H |
5 | #define QT3DANIMATION_QCALLBACKMAPPING_H |
6 | |
7 | #include <Qt3DAnimation/qt3danimation_global.h> |
8 | #include <Qt3DAnimation/qanimationcallback.h> |
9 | #include <Qt3DAnimation/qabstractchannelmapping.h> |
10 | |
11 | QT_BEGIN_NAMESPACE |
12 | |
13 | namespace Qt3DAnimation { |
14 | |
15 | class QCallbackMappingPrivate; |
16 | |
17 | class Q_3DANIMATIONSHARED_EXPORT QCallbackMapping : public QAbstractChannelMapping |
18 | { |
19 | Q_OBJECT |
20 | Q_PROPERTY(QString channelName READ channelName WRITE setChannelName NOTIFY channelNameChanged) |
21 | |
22 | public: |
23 | explicit QCallbackMapping(Qt3DCore::QNode *parent = nullptr); |
24 | ~QCallbackMapping(); |
25 | |
26 | QString channelName() const; |
27 | QAnimationCallback *callback() const; |
28 | |
29 | void setCallback(int type, QAnimationCallback *callback, QAnimationCallback::Flags flags = QAnimationCallback::OnOwningThread); |
30 | |
31 | public Q_SLOTS: |
32 | void setChannelName(const QString &channelName); |
33 | |
34 | Q_SIGNALS: |
35 | void channelNameChanged(QString channelName); |
36 | |
37 | protected: |
38 | explicit QCallbackMapping(QCallbackMappingPrivate &dd, Qt3DCore::QNode *parent = nullptr); |
39 | |
40 | private: |
41 | Q_DECLARE_PRIVATE(QCallbackMapping) |
42 | }; |
43 | |
44 | } // namespace Qt3DAnimation |
45 | |
46 | QT_END_NAMESPACE |
47 | |
48 | #endif // QT3DANIMATION_QCALLBACKMAPPING_H |
49 |