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
11QT_BEGIN_NAMESPACE
12
13namespace Qt3DAnimation {
14
15class QCallbackMappingPrivate;
16
17class Q_3DANIMATIONSHARED_EXPORT QCallbackMapping : public QAbstractChannelMapping
18{
19 Q_OBJECT
20 Q_PROPERTY(QString channelName READ channelName WRITE setChannelName NOTIFY channelNameChanged)
21
22public:
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
31public Q_SLOTS:
32 void setChannelName(const QString &channelName);
33
34Q_SIGNALS:
35 void channelNameChanged(QString channelName);
36
37protected:
38 explicit QCallbackMapping(QCallbackMappingPrivate &dd, Qt3DCore::QNode *parent = nullptr);
39
40private:
41 Q_DECLARE_PRIVATE(QCallbackMapping)
42};
43
44} // namespace Qt3DAnimation
45
46QT_END_NAMESPACE
47
48#endif // QT3DANIMATION_QCALLBACKMAPPING_H
49

source code of qt3d/src/animation/frontend/qcallbackmapping.h