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
29 struct PatternAttributes
{
35 , m_boundingBoxMode(true)
36 , m_boundingBoxModeContent(false)
37 , m_patternContentElement(0)
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
; }
82 bool m_boundingBoxMode
;
83 bool m_boundingBoxModeContent
;
84 AffineTransform m_patternTransform
;
85 const SVGPatternElement
* m_patternContentElement
;
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)