OSDN Git Service

Merge WebKit at r73109: Initial merge by git.
[android-x86/external-webkit.git] / WebCore / svg / SVGFilterElement.h
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(SVG) && ENABLE(FILTERS)
27 #include "SVGAnimatedLength.h"
28 #include "SVGAnimatedPropertyMacros.h"
29 #include "RenderObject.h"
30 #include "SVGExternalResourcesRequired.h"
31 #include "SVGLangSpace.h"
32 #include "SVGStyledElement.h"
33 #include "SVGURIReference.h"
34
35 namespace WebCore {
36
37 class SVGFilterElement : public SVGStyledElement,
38                          public SVGURIReference,
39                          public SVGLangSpace,
40                          public SVGExternalResourcesRequired {
41 public:
42     static PassRefPtr<SVGFilterElement> create(const QualifiedName&, Document*);
43
44     void setFilterRes(unsigned long filterResX, unsigned long filterResY);
45     FloatRect filterBoundingBox(const FloatRect&) const;
46
47 private:
48     SVGFilterElement(const QualifiedName&, Document*);
49
50     virtual bool needsPendingResourceHandling() const { return false; }
51
52     virtual void parseMappedAttribute(Attribute*);
53     virtual void svgAttributeChanged(const QualifiedName&);
54     virtual void synchronizeProperty(const QualifiedName&);
55     virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
56
57     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
58
59     virtual bool selfHasRelativeLengths() const;
60
61     static const AtomicString& filterResXIdentifier();
62     static const AtomicString& filterResYIdentifier();
63
64     // Animated property declarations
65     DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFilterElement, SVGNames::filterUnitsAttr, int, FilterUnits, filterUnits)
66     DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFilterElement, SVGNames::primitiveUnitsAttr, int, PrimitiveUnits, primitiveUnits)
67     DECLARE_ANIMATED_LENGTH(X, x)
68     DECLARE_ANIMATED_LENGTH(Y, y)
69     DECLARE_ANIMATED_LENGTH(Width, width)
70     DECLARE_ANIMATED_LENGTH(Height, height)
71
72     DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFilterElement, SVGNames::filterResAttr, filterResXIdentifier(), long, FilterResX, filterResX)
73     DECLARE_ANIMATED_STATIC_PROPERTY_MULTIPLE_WRAPPERS_NEW(SVGFilterElement, SVGNames::filterResAttr, filterResYIdentifier(), long, FilterResY, filterResY)
74
75     // SVGURIReference
76     DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFilterElement, XLinkNames::hrefAttr, String, Href, href)
77
78     // SVGExternalResourcesRequired
79     DECLARE_ANIMATED_STATIC_PROPERTY_NEW(SVGFilterElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired)
80 };
81
82 }
83
84 #endif
85 #endif