1 /* 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann (at) kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis (at) kde.org> 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Library General Public 7 * License as published by the Free Software Foundation; either 8 * version 2 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Library General Public License for more details. 14 * 15 * You should have received a copy of the GNU Library General Public License 16 * along with this library; see the file COPYING.LIB. If not, write to 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 * Boston, MA 02110-1301, USA. 19 */ 20 21 #ifndef SVGPatternElement_h 22 #define SVGPatternElement_h 23 24 #include "core/SVGNames.h" 25 #include "core/svg/SVGAnimatedBoolean.h" 26 #include "core/svg/SVGAnimatedEnumeration.h" 27 #include "core/svg/SVGAnimatedLength.h" 28 #include "core/svg/SVGAnimatedTransformList.h" 29 #include "core/svg/SVGElement.h" 30 #include "core/svg/SVGFitToViewBox.h" 31 #include "core/svg/SVGTests.h" 32 #include "core/svg/SVGURIReference.h" 33 #include "core/svg/SVGUnitTypes.h" 34 35 namespace blink { 36 37 struct PatternAttributes; 38 39 class SVGPatternElement FINAL : public SVGElement, 40 public SVGURIReference, 41 public SVGTests, 42 public SVGFitToViewBox { 43 DEFINE_WRAPPERTYPEINFO(); 44 public: 45 DECLARE_NODE_FACTORY(SVGPatternElement); 46 47 void collectPatternAttributes(PatternAttributes&) const; 48 49 virtual AffineTransform localCoordinateSpaceTransform(SVGElement::CTMScope) const OVERRIDE; 50 51 SVGAnimatedLength* x() const { return m_x.get(); } 52 SVGAnimatedLength* y() const { return m_y.get(); } 53 SVGAnimatedLength* width() const { return m_width.get(); } 54 SVGAnimatedLength* height() const { return m_height.get(); } 55 SVGAnimatedTransformList* patternTransform() { return m_patternTransform.get(); } 56 const SVGAnimatedTransformList* patternTransform() const { return m_patternTransform.get(); } 57 SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>* patternUnits() { return m_patternUnits.get(); } 58 SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>* patternContentUnits() { return m_patternContentUnits.get(); } 59 const SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>* patternUnits() const { return m_patternUnits.get(); } 60 const SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType>* patternContentUnits() const { return m_patternContentUnits.get(); } 61 62 private: 63 explicit SVGPatternElement(Document&); 64 65 virtual bool isValid() const OVERRIDE { return SVGTests::isValid(); } 66 virtual bool needsPendingResourceHandling() const OVERRIDE { return false; } 67 68 bool isSupportedAttribute(const QualifiedName&); 69 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE; 70 virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE; 71 virtual void childrenChanged(const ChildrenChange&) OVERRIDE; 72 73 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; 74 75 virtual bool selfHasRelativeLengths() const OVERRIDE; 76 77 RefPtr<SVGAnimatedLength> m_x; 78 RefPtr<SVGAnimatedLength> m_y; 79 RefPtr<SVGAnimatedLength> m_width; 80 RefPtr<SVGAnimatedLength> m_height; 81 RefPtr<SVGAnimatedTransformList> m_patternTransform; 82 RefPtr<SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType> > m_patternUnits; 83 RefPtr<SVGAnimatedEnumeration<SVGUnitTypes::SVGUnitType> > m_patternContentUnits; 84 }; 85 86 } // namespace blink 87 88 #endif // SVGPatternElement_h 89