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 | |
24 | QT_BEGIN_NAMESPACE |
25 | |
26 | class QSvgTinyDocument; |
27 | class QSvgNode; |
28 | class QPainter; |
29 | class QSvgDefs; |
30 | |
31 | class Q_SVG_PRIVATE_EXPORT QSvgStructureNode : public QSvgNode |
32 | { |
33 | public: |
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; } |
41 | protected: |
42 | QList<QSvgNode*> m_renderers; |
43 | QHash<QString, QSvgNode*> m_scope; |
44 | QList<QSvgStructureNode*> m_linkedScopes; |
45 | mutable bool m_recursing = false; |
46 | }; |
47 | |
48 | class Q_SVG_PRIVATE_EXPORT QSvgG : public QSvgStructureNode |
49 | { |
50 | public: |
51 | QSvgG(QSvgNode *parent); |
52 | void draw(QPainter *p, QSvgExtraStates &states) override; |
53 | Type type() const override; |
54 | }; |
55 | |
56 | class Q_SVG_PRIVATE_EXPORT QSvgDefs : public QSvgStructureNode |
57 | { |
58 | public: |
59 | QSvgDefs(QSvgNode *parent); |
60 | void draw(QPainter *p, QSvgExtraStates &states) override; |
61 | Type type() const override; |
62 | }; |
63 | |
64 | class Q_SVG_PRIVATE_EXPORT QSvgSwitch : public QSvgStructureNode |
65 | { |
66 | public: |
67 | QSvgSwitch(QSvgNode *parent); |
68 | void draw(QPainter *p, QSvgExtraStates &states) override; |
69 | Type type() const override; |
70 | private: |
71 | void init(); |
72 | private: |
73 | QString m_systemLanguage; |
74 | QString m_systemLanguagePrefix; |
75 | }; |
76 | |
77 | QT_END_NAMESPACE |
78 | |
79 | #endif // QSVGSTRUCTURE_P_H |
80 |