• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "SVGAnimatedBoolean.h"
28 #include "SVGAnimatedEnumeration.h"
29 #include "SVGAnimatedInteger.h"
30 #include "SVGAnimatedLength.h"
31 #include "SVGExternalResourcesRequired.h"
32 #include "SVGLangSpace.h"
33 #include "SVGStyledElement.h"
34 #include "SVGURIReference.h"
35 
36 namespace WebCore {
37 
38 class SVGFilterElement : public SVGStyledElement,
39                          public SVGURIReference,
40                          public SVGLangSpace,
41                          public SVGExternalResourcesRequired {
42 public:
43     static PassRefPtr<SVGFilterElement> create(const QualifiedName&, Document*);
44 
45     void setFilterRes(unsigned long filterResX, unsigned long filterResY);
46     FloatRect filterBoundingBox(const FloatRect&) const;
47 
48 private:
49     SVGFilterElement(const QualifiedName&, Document*);
50 
needsPendingResourceHandling()51     virtual bool needsPendingResourceHandling() const { return false; }
52 
53     virtual void parseMappedAttribute(Attribute*);
54     virtual void svgAttributeChanged(const QualifiedName&);
55     virtual void synchronizeProperty(const QualifiedName&);
56     virtual void fillAttributeToPropertyTypeMap();
57     virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
58     virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
59 
60     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
61 
62     virtual bool selfHasRelativeLengths() const;
63 
64     static const AtomicString& filterResXIdentifier();
65     static const AtomicString& filterResYIdentifier();
66 
67     // Animated property declarations
68     DECLARE_ANIMATED_ENUMERATION(FilterUnits, filterUnits)
69     DECLARE_ANIMATED_ENUMERATION(PrimitiveUnits, primitiveUnits)
70     DECLARE_ANIMATED_LENGTH(X, x)
71     DECLARE_ANIMATED_LENGTH(Y, y)
72     DECLARE_ANIMATED_LENGTH(Width, width)
73     DECLARE_ANIMATED_LENGTH(Height, height)
74     DECLARE_ANIMATED_INTEGER(FilterResX, filterResX)
75     DECLARE_ANIMATED_INTEGER(FilterResY, filterResY)
76 
77     // SVGURIReference
78     DECLARE_ANIMATED_STRING(Href, href)
79 
80     // SVGExternalResourcesRequired
81     DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
82 };
83 
84 }
85 
86 #endif
87 #endif
88