1 | // Copyright (C) 2016 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_QANIMATIONCLIPDATA_H |
5 | #define QT3DANIMATION_QANIMATIONCLIPDATA_H |
6 | |
7 | #include <QtCore/qmetatype.h> |
8 | #include <QtCore/qscopedpointer.h> |
9 | #include <QtCore/qstring.h> |
10 | #include <Qt3DAnimation/qt3danimation_global.h> |
11 | #include <Qt3DAnimation/qchannel.h> |
12 | |
13 | QT_BEGIN_NAMESPACE |
14 | |
15 | namespace Qt3DAnimation { |
16 | |
17 | class QAnimationClipDataPrivate; |
18 | class QAnimationClipData; |
19 | |
20 | bool Q_3DANIMATIONSHARED_EXPORT operator==(const QAnimationClipData &lhs, const QAnimationClipData &rhs) noexcept; |
21 | bool Q_3DANIMATIONSHARED_EXPORT operator!=(const QAnimationClipData &lhs, const QAnimationClipData &rhs) noexcept; |
22 | |
23 | class Q_3DANIMATIONSHARED_EXPORT QAnimationClipData |
24 | { |
25 | public: |
26 | QAnimationClipData(); |
27 | QAnimationClipData(const QAnimationClipData &); |
28 | QAnimationClipData &operator=(const QAnimationClipData &); |
29 | ~QAnimationClipData(); |
30 | |
31 | void setName(const QString &name); |
32 | QString name() const; |
33 | |
34 | int channelCount() const; |
35 | void appendChannel(const QChannel &c); |
36 | void insertChannel(int index, const QChannel &c); |
37 | void removeChannel(int index); |
38 | void clearChannels(); |
39 | |
40 | bool isValid() const noexcept; |
41 | |
42 | // Iterator API |
43 | typedef const QChannel *const_iterator; |
44 | typedef std::reverse_iterator<const_iterator> const_reverse_iterator; |
45 | |
46 | const_iterator begin() const noexcept; |
47 | const_iterator cbegin() const noexcept { return begin(); } |
48 | const_iterator end() const noexcept; |
49 | const_iterator cend() const noexcept { return end(); } |
50 | const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); } |
51 | const_reverse_iterator crbegin() const noexcept { return rbegin(); } |
52 | const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); } |
53 | const_reverse_iterator crend() const noexcept { return rend(); } |
54 | |
55 | friend bool Q_3DANIMATIONSHARED_EXPORT operator==(const QAnimationClipData &, |
56 | const QAnimationClipData &) noexcept; |
57 | friend bool Q_3DANIMATIONSHARED_EXPORT operator!=(const QAnimationClipData &, |
58 | const QAnimationClipData &) noexcept; |
59 | |
60 | private: |
61 | QScopedPointer<QAnimationClipDataPrivate> d; |
62 | }; |
63 | |
64 | } // namespace Qt3DAnimation |
65 | |
66 | QT_END_NAMESPACE |
67 | |
68 | Q_DECLARE_METATYPE(Qt3DAnimation::QAnimationClipData) |
69 | |
70 | #endif // QT3DANIMATION_QANIMATIONCLIPDATA_H |
71 |