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