1/*
2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
4 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
5 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 * Library General Public License for more details.
16 *
17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB.  If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21 */
22
23#ifndef SVGFilterElement_h
24#define SVGFilterElement_h
25
26#if ENABLE(FILTERS)
27#include "SVGAnimatedBoolean.h"
28#include "SVGAnimatedEnumeration.h"
29#include "SVGAnimatedInteger.h"
30#include "SVGAnimatedLength.h"
31#include "SVGElement.h"
32#include "SVGExternalResourcesRequired.h"
33#include "SVGNames.h"
34#include "SVGURIReference.h"
35#include "SVGUnitTypes.h"
36
37namespace WebCore {
38
39class SVGFilterElement final : public SVGElement,
40                               public SVGURIReference,
41                               public SVGExternalResourcesRequired {
42public:
43    static PassRefPtr<SVGFilterElement> create(const QualifiedName&, Document&);
44
45    void setFilterRes(unsigned filterResX, unsigned filterResY);
46
47private:
48    SVGFilterElement(const QualifiedName&, Document&);
49
50    virtual bool needsPendingResourceHandling() const override { return false; }
51
52    bool isSupportedAttribute(const QualifiedName&);
53    virtual void parseAttribute(const QualifiedName&, const AtomicString&) override;
54    virtual void svgAttributeChanged(const QualifiedName&) override;
55    virtual void childrenChanged(const ChildChange&) override;
56
57    virtual RenderPtr<RenderElement> createElementRenderer(PassRef<RenderStyle>) override;
58    virtual bool childShouldCreateRenderer(const Node&) const override;
59
60    virtual bool selfHasRelativeLengths() const override;
61
62    static const AtomicString& filterResXIdentifier();
63    static const AtomicString& filterResYIdentifier();
64
65    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFilterElement)
66        DECLARE_ANIMATED_ENUMERATION(FilterUnits, filterUnits, SVGUnitTypes::SVGUnitType)
67        DECLARE_ANIMATED_ENUMERATION(PrimitiveUnits, primitiveUnits, SVGUnitTypes::SVGUnitType)
68        DECLARE_ANIMATED_LENGTH(X, x)
69        DECLARE_ANIMATED_LENGTH(Y, y)
70        DECLARE_ANIMATED_LENGTH(Width, width)
71        DECLARE_ANIMATED_LENGTH(Height, height)
72        DECLARE_ANIMATED_INTEGER(FilterResX, filterResX)
73        DECLARE_ANIMATED_INTEGER(FilterResY, filterResY)
74        DECLARE_ANIMATED_STRING(Href, href)
75        DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
76    END_DECLARE_ANIMATED_PROPERTIES
77};
78
79NODE_TYPE_CASTS(SVGFilterElement)
80
81}
82
83#endif
84#endif
85