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_QANIMATIONCLIPLOADER_H |
5 | #define QT3DANIMATION_QANIMATIONCLIPLOADER_H |
6 | |
7 | #include <Qt3DAnimation/qt3danimation_global.h> |
8 | #include <Qt3DAnimation/qabstractanimationclip.h> |
9 | #include <QtCore/qurl.h> |
10 | |
11 | QT_BEGIN_NAMESPACE |
12 | |
13 | namespace Qt3DAnimation { |
14 | |
15 | class QAnimationClipLoaderPrivate; |
16 | |
17 | class Q_3DANIMATIONSHARED_EXPORT QAnimationClipLoader : public QAbstractAnimationClip |
18 | { |
19 | Q_OBJECT |
20 | Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged) |
21 | Q_PROPERTY(Status status READ status NOTIFY statusChanged) |
22 | |
23 | public: |
24 | explicit QAnimationClipLoader(Qt3DCore::QNode *parent = nullptr); |
25 | explicit QAnimationClipLoader(const QUrl &source, |
26 | Qt3DCore::QNode *parent = nullptr); |
27 | ~QAnimationClipLoader(); |
28 | |
29 | enum Status { |
30 | NotReady = 0, |
31 | Ready, |
32 | Error |
33 | }; |
34 | Q_ENUM(Status) // LCOV_EXCL_LINE |
35 | |
36 | QUrl source() const; |
37 | Status status() const; |
38 | |
39 | public Q_SLOTS: |
40 | void setSource(const QUrl &source); |
41 | |
42 | Q_SIGNALS: |
43 | void sourceChanged(const QUrl &source); |
44 | void statusChanged(Status status); |
45 | |
46 | protected: |
47 | explicit QAnimationClipLoader(QAnimationClipLoaderPrivate &dd, Qt3DCore::QNode *parent = nullptr); |
48 | |
49 | private: |
50 | Q_DECLARE_PRIVATE(QAnimationClipLoader) |
51 | }; |
52 | |
53 | } // namespace Qt3DAnimation |
54 | |
55 | QT_END_NAMESPACE |
56 | |
57 | #endif // QT3DANIMATION_QANIMATIONCLIPLOADER_H |
58 | |