1// Copyright (C) 2016 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 QSVGSTRUCTURE_P_H
5#define QSVGSTRUCTURE_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 "qsvgnode_p.h"
19#include "qtsvgglobal_p.h"
20
21#include "QtCore/qlist.h"
22#include "QtCore/qhash.h"
23
24QT_BEGIN_NAMESPACE
25
26class QSvgTinyDocument;
27class QSvgNode;
28class QPainter;
29class QSvgDefs;
30
31class Q_SVG_PRIVATE_EXPORT QSvgStructureNode : public QSvgNode
32{
33public:
34 QSvgStructureNode(QSvgNode *parent);
35 ~QSvgStructureNode();
36 QSvgNode *scopeNode(const QString &id) const;
37 void addChild(QSvgNode *child, const QString &id);
38 QRectF bounds(QPainter *p, QSvgExtraStates &states) const override;
39 QSvgNode *previousSiblingNode(QSvgNode *n) const;
40 QList<QSvgNode*> renderers() const { return m_renderers; }
41protected:
42 QList<QSvgNode*> m_renderers;
43 QHash<QString, QSvgNode*> m_scope;
44 QList<QSvgStructureNode*> m_linkedScopes;
45 mutable bool m_recursing = false;
46};
47
48class Q_SVG_PRIVATE_EXPORT QSvgG : public QSvgStructureNode
49{
50public:
51 QSvgG(QSvgNode *parent);
52 void draw(QPainter *p, QSvgExtraStates &states) override;
53 Type type() const override;
54};
55
56class Q_SVG_PRIVATE_EXPORT QSvgDefs : public QSvgStructureNode
57{
58public:
59 QSvgDefs(QSvgNode *parent);
60 void draw(QPainter *p, QSvgExtraStates &states) override;
61 Type type() const override;
62};
63
64class Q_SVG_PRIVATE_EXPORT QSvgSwitch : public QSvgStructureNode
65{
66public:
67 QSvgSwitch(QSvgNode *parent);
68 void draw(QPainter *p, QSvgExtraStates &states) override;
69 Type type() const override;
70private:
71 void init();
72private:
73 QString m_systemLanguage;
74 QString m_systemLanguagePrefix;
75};
76
77QT_END_NAMESPACE
78
79#endif // QSVGSTRUCTURE_P_H
80

source code of qtsvg/src/svg/qsvgstructure_p.h