1 | // Copyright (C) 2019 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | #ifndef QQUICKTIMELINE_P_H |
5 | #define QQUICKTIMELINE_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 "qquickkeyframe_p.h" |
19 | #include "qquicktimelineanimation_p.h" |
20 | #include "qtquicktimelineglobal_p.h" |
21 | |
22 | #include <QtQml/qqml.h> |
23 | |
24 | QT_BEGIN_NAMESPACE |
25 | |
26 | class QQuickTimelinePrivate; |
27 | |
28 | class Q_QUICKTIMELINE_PRIVATE_EXPORT QQuickTimeline : public QObject, public QQmlParserStatus |
29 | { |
30 | Q_OBJECT |
31 | Q_DECLARE_PRIVATE(QQuickTimeline) |
32 | |
33 | Q_INTERFACES(QQmlParserStatus) |
34 | |
35 | Q_PROPERTY(qreal startFrame READ startFrame WRITE setStartFrame NOTIFY startFrameChanged) |
36 | Q_PROPERTY(qreal endFrame READ endFrame WRITE setEndFrame NOTIFY endFrameChanged) |
37 | Q_PROPERTY(qreal currentFrame READ currentFrame WRITE setCurrentFrame NOTIFY currentFrameChanged) |
38 | Q_PROPERTY(QQmlListProperty<QQuickKeyframeGroup> keyframeGroups READ keyframeGroups) |
39 | Q_PROPERTY(QQmlListProperty<QQuickTimelineAnimation> animations READ animations) |
40 | Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged) |
41 | |
42 | QML_NAMED_ELEMENT(Timeline) |
43 | QML_ADDED_IN_VERSION(1, 0) |
44 | |
45 | Q_CLASSINFO("DefaultProperty" , "keyframeGroups" ) |
46 | |
47 | public: |
48 | explicit QQuickTimeline(QObject *parent = nullptr); |
49 | |
50 | QQmlListProperty<QQuickKeyframeGroup> keyframeGroups(); |
51 | QQmlListProperty<QQuickTimelineAnimation> animations(); |
52 | |
53 | bool enabled() const; |
54 | void setEnabled(bool enabled); |
55 | |
56 | qreal startFrame() const; |
57 | void setStartFrame(qreal); |
58 | |
59 | qreal endFrame() const; |
60 | void setEndFrame(qreal); |
61 | |
62 | qreal currentFrame() const; |
63 | void setCurrentFrame(qreal); |
64 | |
65 | void reevaluate(); |
66 | |
67 | void init(); |
68 | void reset(); |
69 | |
70 | QList<QQuickTimelineAnimation*> getAnimations() const; |
71 | |
72 | protected: |
73 | void classBegin() override; |
74 | void componentComplete() override; |
75 | |
76 | Q_SIGNALS: |
77 | void enabledChanged(); |
78 | void startFrameChanged(); |
79 | void endFrameChanged(); |
80 | void currentFrameChanged(); |
81 | }; |
82 | |
83 | QT_END_NAMESPACE |
84 | |
85 | #endif // QQUICKTIMELINE_P_H |
86 | |