1// Copyright (C) 2024 The Qt Company Ltd.
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 QSVGABSTRACTANIMATION_P_H
5#define QSVGABSTRACTANIMATION_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 <QtSvg/private/qtsvgglobal_p.h>
19#include "qsvganimatedproperty_p.h"
20#include <QtCore/qlist.h>
21
22QT_BEGIN_NAMESPACE
23
24class Q_SVG_EXPORT QSvgAbstractAnimation
25{
26public:
27 enum AnimationType
28 {
29 CSS,
30 SMIL,
31 };
32
33 QSvgAbstractAnimation();
34 virtual ~QSvgAbstractAnimation();
35
36 virtual AnimationType animationType() const = 0;
37 void evaluateAnimation(qreal elapsedTime);
38
39 void setRunningTime(int startMs, int durationMs);
40 int start() const;
41 int duration() const;
42
43 void setIterationCount(int count);
44 int iterationCount() const;
45
46 virtual void appendProperty(QSvgAbstractAnimatedProperty *property);
47 QList<QSvgAbstractAnimatedProperty *> properties() const;
48
49 bool finished() const;
50 virtual bool isActive() const;
51
52protected:
53 int m_start;
54 int m_duration;
55 bool m_finished;
56 int m_iterationCount;
57 QList<QSvgAbstractAnimatedProperty *> m_properties;
58};
59
60QT_END_NAMESPACE
61
62#endif // QSVGABSTRACTANIMATION_P_H
63

source code of qtsvg/src/svg/animation/qsvgabstractanimation_p.h