initial import
[vuplus_webkit] / Source / WebCore / svg / SVGMaskElement.h
1 /*
2  * Copyright (C) 2005 Alexander Kellett <lypanov@kde.org>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public License
15  * along with this library; see the file COPYING.LIB.  If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19
20 #ifndef SVGMaskElement_h
21 #define SVGMaskElement_h
22
23 #if ENABLE(SVG)
24 #include "SVGAnimatedBoolean.h"
25 #include "SVGAnimatedEnumeration.h"
26 #include "SVGAnimatedLength.h"
27 #include "SVGExternalResourcesRequired.h"
28 #include "SVGLangSpace.h"
29 #include "SVGStyledLocatableElement.h"
30 #include "SVGTests.h"
31 #include "SVGUnitTypes.h"
32
33 namespace WebCore {
34
35 class SVGMaskElement : public SVGStyledLocatableElement,
36                        public SVGTests,
37                        public SVGLangSpace,
38                        public SVGExternalResourcesRequired {
39 public:
40     static PassRefPtr<SVGMaskElement> create(const QualifiedName&, Document*);
41
42     FloatRect maskBoundingBox(const FloatRect&) const;
43
44 private:
45     SVGMaskElement(const QualifiedName&, Document*);
46
47     virtual bool isValid() const { return SVGTests::isValid(); }
48     virtual bool needsPendingResourceHandling() const { return false; }
49
50     bool isSupportedAttribute(const QualifiedName&);
51     virtual void parseMappedAttribute(Attribute*);
52     virtual void svgAttributeChanged(const QualifiedName&);
53     virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
54
55     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
56
57     virtual bool selfHasRelativeLengths() const;
58
59     BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGMaskElement)
60         DECLARE_ANIMATED_ENUMERATION(MaskUnits, maskUnits, SVGUnitTypes::SVGUnitType)
61         DECLARE_ANIMATED_ENUMERATION(MaskContentUnits, maskContentUnits, SVGUnitTypes::SVGUnitType)
62         DECLARE_ANIMATED_LENGTH(X, x)
63         DECLARE_ANIMATED_LENGTH(Y, y)
64         DECLARE_ANIMATED_LENGTH(Width, width)
65         DECLARE_ANIMATED_LENGTH(Height, height)
66         DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
67     END_DECLARE_ANIMATED_PROPERTIES
68
69     // SVGTests
70     virtual void synchronizeRequiredFeatures() { SVGTests::synchronizeRequiredFeatures(this); }
71     virtual void synchronizeRequiredExtensions() { SVGTests::synchronizeRequiredExtensions(this); }
72     virtual void synchronizeSystemLanguage() { SVGTests::synchronizeSystemLanguage(this); }
73 };
74
75 }
76
77 #endif
78 #endif