Generate Element casting helper functions
[WebKit.git] / Source / WebCore / svg / SVGPatternElement.h
index e581308..492cd68 100644 (file)
 #ifndef SVGPatternElement_h
 #define SVGPatternElement_h
 
-#if ENABLE(SVG)
 #include "SVGAnimatedBoolean.h"
 #include "SVGAnimatedEnumeration.h"
 #include "SVGAnimatedLength.h"
 #include "SVGAnimatedPreserveAspectRatio.h"
 #include "SVGAnimatedRect.h"
 #include "SVGAnimatedTransformList.h"
+#include "SVGElement.h"
 #include "SVGExternalResourcesRequired.h"
 #include "SVGFitToViewBox.h"
-#include "SVGLangSpace.h"
-#include "SVGStyledElement.h"
+#include "SVGNames.h"
 #include "SVGTests.h"
 #include "SVGURIReference.h"
+#include "SVGUnitTypes.h"
 
 namespace WebCore {
 
 struct PatternAttributes;
  
-class SVGPatternElement : public SVGStyledElement,
-                          public SVGURIReference,
-                          public SVGTests,
-                          public SVGLangSpace,
-                          public SVGExternalResourcesRequired,
-                          public SVGFitToViewBox {
+class SVGPatternElement final : public SVGElement,
+                                public SVGURIReference,
+                                public SVGTests,
+                                public SVGExternalResourcesRequired,
+                                public SVGFitToViewBox {
 public:
-    static PassRefPtr<SVGPatternElement> create(const QualifiedName&, Document*);
+    static PassRefPtr<SVGPatternElement> create(const QualifiedName&, Document&);
 
     void collectPatternAttributes(PatternAttributes&) const;
 
+    virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope) const override;
+
 private:
-    SVGPatternElement(const QualifiedName&, Document*);
+    SVGPatternElement(const QualifiedName&, Document&);
     
-    virtual bool isValid() const { return SVGTests::isValid(); }
-    virtual bool needsPendingResourceHandling() const { return false; }
-
-    virtual void parseMappedAttribute(Attribute*);
-    virtual void svgAttributeChanged(const QualifiedName&);
-    virtual void synchronizeProperty(const QualifiedName&);
-    virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
-
-    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
+    virtual bool isValid() const override { return SVGTests::isValid(); }
+    virtual bool needsPendingResourceHandling() const override { return false; }
 
-    virtual bool selfHasRelativeLengths() const;
+    bool isSupportedAttribute(const QualifiedName&);
+    virtual void parseAttribute(const QualifiedName&, const AtomicString&) override;
+    virtual void svgAttributeChanged(const QualifiedName&) override;
+    virtual void childrenChanged(const ChildChange&) override;
 
-    // Animated property declarations
-    DECLARE_ANIMATED_LENGTH(X, x)
-    DECLARE_ANIMATED_LENGTH(Y, y)
-    DECLARE_ANIMATED_LENGTH(Width, width)
-    DECLARE_ANIMATED_LENGTH(Height, height)
-    DECLARE_ANIMATED_ENUMERATION(PatternUnits, patternUnits)
-    DECLARE_ANIMATED_ENUMERATION(PatternContentUnits, patternContentUnits)
-    DECLARE_ANIMATED_TRANSFORM_LIST(PatternTransform, patternTransform)
+    virtual RenderPtr<RenderElement> createElementRenderer(PassRef<RenderStyle>) override;
 
-    // SVGURIReference
-    DECLARE_ANIMATED_STRING(Href, href)
+    virtual bool selfHasRelativeLengths() const override { return true; }
 
-    // SVGExternalResourcesRequired
-    DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGPatternElement)
+        DECLARE_ANIMATED_LENGTH(X, x)
+        DECLARE_ANIMATED_LENGTH(Y, y)
+        DECLARE_ANIMATED_LENGTH(Width, width)
+        DECLARE_ANIMATED_LENGTH(Height, height)
+        DECLARE_ANIMATED_ENUMERATION(PatternUnits, patternUnits, SVGUnitTypes::SVGUnitType)
+        DECLARE_ANIMATED_ENUMERATION(PatternContentUnits, patternContentUnits, SVGUnitTypes::SVGUnitType)
+        DECLARE_ANIMATED_TRANSFORM_LIST(PatternTransform, patternTransform)
+        DECLARE_ANIMATED_STRING(Href, href)
+        DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
+        DECLARE_ANIMATED_RECT(ViewBox, viewBox)
+        DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio) 
+    END_DECLARE_ANIMATED_PROPERTIES
 
-    // SVGPatternElement
-    DECLARE_ANIMATED_RECT(ViewBox, viewBox)
-    DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio) 
+    // SVGTests
+    virtual void synchronizeRequiredFeatures() override { SVGTests::synchronizeRequiredFeatures(this); }
+    virtual void synchronizeRequiredExtensions() override { SVGTests::synchronizeRequiredExtensions(this); }
+    virtual void synchronizeSystemLanguage() override { SVGTests::synchronizeSystemLanguage(this); }
 };
 
 } // namespace WebCore
 
-#endif // ENABLE(SVG)
 #endif