2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
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.
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.
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.
21 #ifndef SVGPatternElement_h
22 #define SVGPatternElement_h
25 #include "SVGAnimatedBoolean.h"
26 #include "SVGAnimatedEnumeration.h"
27 #include "SVGAnimatedLength.h"
28 #include "SVGAnimatedPreserveAspectRatio.h"
29 #include "SVGAnimatedRect.h"
30 #include "SVGAnimatedTransformList.h"
31 #include "SVGElement.h"
32 #include "SVGExternalResourcesRequired.h"
33 #include "SVGFitToViewBox.h"
36 #include "SVGURIReference.h"
37 #include "SVGUnitTypes.h"
41 struct PatternAttributes;
43 class SVGPatternElement FINAL : public SVGElement,
44 public SVGURIReference,
46 public SVGExternalResourcesRequired,
47 public SVGFitToViewBox {
49 static PassRefPtr<SVGPatternElement> create(const QualifiedName&, Document&);
51 void collectPatternAttributes(PatternAttributes&) const;
53 virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope) const;
56 SVGPatternElement(const QualifiedName&, Document&);
58 virtual bool isValid() const { return SVGTests::isValid(); }
59 virtual bool needsPendingResourceHandling() const { return false; }
61 bool isSupportedAttribute(const QualifiedName&);
62 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
63 virtual void svgAttributeChanged(const QualifiedName&);
64 virtual void childrenChanged(const ChildChange&) OVERRIDE;
66 virtual RenderElement* createRenderer(RenderArena&, RenderStyle&);
68 virtual bool selfHasRelativeLengths() const;
70 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGPatternElement)
71 DECLARE_ANIMATED_LENGTH(X, x)
72 DECLARE_ANIMATED_LENGTH(Y, y)
73 DECLARE_ANIMATED_LENGTH(Width, width)
74 DECLARE_ANIMATED_LENGTH(Height, height)
75 DECLARE_ANIMATED_ENUMERATION(PatternUnits, patternUnits, SVGUnitTypes::SVGUnitType)
76 DECLARE_ANIMATED_ENUMERATION(PatternContentUnits, patternContentUnits, SVGUnitTypes::SVGUnitType)
77 DECLARE_ANIMATED_TRANSFORM_LIST(PatternTransform, patternTransform)
78 DECLARE_ANIMATED_STRING(Href, href)
79 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
80 DECLARE_ANIMATED_RECT(ViewBox, viewBox)
81 DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
82 END_DECLARE_ANIMATED_PROPERTIES
85 virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
86 virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
87 virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
90 NODE_TYPE_CASTS(SVGPatternElement)
92 } // namespace WebCore