Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qsvganimator_p.h
Go to the documentation of this file.
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// Qt-Security score:significant reason:default
4
5
6#ifndef QSVGANIMATOR_P_H
7#define QSVGANIMATOR_P_H
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version to
15// version without notice, or even be removed.
16//
17// We mean it.
18//
19
20#include <QtSvg/private/qtsvgglobal_p.h>
21#include <QtSvg/private/qsvgnode_p.h>
23
24#include <QtCore/qhash.h>
25#include <QtCore/qlist.h>
26
28
29class Q_SVG_EXPORT QSvgAbstractAnimator
30{
31 Q_DISABLE_COPY_MOVE(QSvgAbstractAnimator)
32public:
33 QSvgAbstractAnimator();
34 virtual ~QSvgAbstractAnimator();
35
36 void appendAnimation(const QSvgNode *node, QSvgAbstractAnimation *anim);
37 QList<QSvgAbstractAnimation *> animationsForNode(const QSvgNode *node) const;
38
39 void advanceAnimations();
40 virtual void restartAnimation() = 0;
41 virtual qint64 currentElapsed() = 0;
42 virtual void setAnimatorTime(qint64 time) = 0;
43
44 void setAnimationDuration(qint64 dur);
46
47protected:
48 qint64 m_time;
50
51private:
52 QList<QSvgAbstractAnimation *> combinedAnimationsForNode(const QSvgNode *node) const;
53
54private:
55 QHash<const QSvgNode *, QList<QSvgAbstractAnimation *>> m_animationsSMIL;
56 QHash<const QSvgNode *, QList<QSvgAbstractAnimation *>> m_animationsCSS;
57};
58
59class Q_SVG_EXPORT QSvgAnimator : public QSvgAbstractAnimator
60{
61public:
62 QSvgAnimator();
63 ~QSvgAnimator();
64
65 virtual void restartAnimation() override;
66 virtual qint64 currentElapsed() override;
67 virtual void setAnimatorTime(qint64 time) override;
68};
69
70class Q_SVG_EXPORT QSvgAnimationController : public QSvgAbstractAnimator
71{
72public:
73 QSvgAnimationController();
74 ~QSvgAnimationController();
75
76 virtual void restartAnimation() override;
77 virtual qint64 currentElapsed() override;
78 virtual void setAnimatorTime(qint64 time) override;
79};
80
81
82QT_END_NAMESPACE
83
84#endif // QSVGANIMATOR_P_H
void setAnimationDuration(qint64 dur)
virtual void setAnimatorTime(qint64 time)=0
virtual qint64 currentElapsed()=0
void appendAnimation(const QSvgNode *node, QSvgAbstractAnimation *anim)
virtual void restartAnimation()=0
QList< QSvgAbstractAnimation * > animationsForNode(const QSvgNode *node) const
qint64 animationDuration() const
Combined button and popup list for selecting options.