don't discard iframe children.
[kdelibs.git] / khtml / svg / PatternAttributes.h
blobe6a347ce77133e342aa3c139dd6bb592d7c7deda
1 /*
2 Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
4 This file is part of the KDE project
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
22 #ifndef PatternAttributes_h
23 #define PatternAttributes_h
25 #if ENABLE(SVG)
27 namespace WebCore
29 struct PatternAttributes {
30 PatternAttributes()
31 : m_x()
32 , m_y()
33 , m_width()
34 , m_height()
35 , m_boundingBoxMode(true)
36 , m_boundingBoxModeContent(false)
37 , m_patternContentElement(0)
38 , m_xSet(false)
39 , m_ySet(false)
40 , m_widthSet(false)
41 , m_heightSet(false)
42 , m_boundingBoxModeSet(false)
43 , m_boundingBoxModeContentSet(false)
44 , m_patternTransformSet(false)
45 , m_patternContentElementSet(false)
49 SVGLength x() const { return m_x; }
50 SVGLength y() const { return m_y; }
51 SVGLength width() const { return m_width; }
52 SVGLength height() const { return m_height; }
53 bool boundingBoxMode() const { return m_boundingBoxMode; }
54 bool boundingBoxModeContent() const { return m_boundingBoxModeContent; }
55 AffineTransform patternTransform() const { return m_patternTransform; }
56 const SVGPatternElement* patternContentElement() const { return m_patternContentElement; }
58 void setX(const SVGLength& value) { m_x = value; m_xSet = true; }
59 void setY(const SVGLength& value) { m_y = value; m_ySet = true; }
60 void setWidth(const SVGLength& value) { m_width = value; m_widthSet = true; }
61 void setHeight(const SVGLength& value) { m_height = value; m_heightSet = true; }
62 void setBoundingBoxMode(bool value) { m_boundingBoxMode = value; m_boundingBoxModeSet = true; }
63 void setBoundingBoxModeContent(bool value) { m_boundingBoxModeContent = value; m_boundingBoxModeContentSet = true; }
64 void setPatternTransform(const AffineTransform& value) { m_patternTransform = value; m_patternTransformSet = true; }
65 void setPatternContentElement(const SVGPatternElement* value) { m_patternContentElement = value; m_patternContentElementSet = true; }
67 bool hasX() const { return m_xSet; }
68 bool hasY() const { return m_ySet; }
69 bool hasWidth() const { return m_widthSet; }
70 bool hasHeight() const { return m_heightSet; }
71 bool hasBoundingBoxMode() const { return m_boundingBoxModeSet; }
72 bool hasBoundingBoxModeContent() const { return m_boundingBoxModeContentSet; }
73 bool hasPatternTransform() const { return m_patternTransformSet; }
74 bool hasPatternContentElement() const { return m_patternContentElementSet; }
76 private:
77 // Properties
78 SVGLength m_x;
79 SVGLength m_y;
80 SVGLength m_width;
81 SVGLength m_height;
82 bool m_boundingBoxMode;
83 bool m_boundingBoxModeContent;
84 AffineTransform m_patternTransform;
85 const SVGPatternElement* m_patternContentElement;
87 // Property states
88 bool m_xSet : 1;
89 bool m_ySet : 1;
90 bool m_widthSet : 1;
91 bool m_heightSet : 1;
92 bool m_boundingBoxModeSet : 1;
93 bool m_boundingBoxModeContentSet : 1;
94 bool m_patternTransformSet : 1;
95 bool m_patternContentElementSet : 1;
98 } // namespace WebCore
100 #endif // ENABLE(SVG)
101 #endif
103 // vim:ts=4:noet