Upstream version 5.34.92.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / 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 #include "SVGNames.h"
24 #include "core/svg/SVGAnimatedBoolean.h"
25 #include "core/svg/SVGAnimatedEnumeration.h"
26 #include "core/svg/SVGAnimatedLength.h"
27 #include "core/svg/SVGElement.h"
28 #include "core/svg/SVGTests.h"
29 #include "core/svg/SVGUnitTypes.h"
30
31 namespace WebCore {
32
33 class SVGMaskElement FINAL : public SVGElement,
34                              public SVGTests {
35 public:
36     static PassRefPtr<SVGMaskElement> create(Document&);
37
38     SVGAnimatedLength* x() const { return m_x.get(); }
39     SVGAnimatedLength* y() const { return m_y.get(); }
40     SVGAnimatedLength* width() const { return m_width.get(); }
41     SVGAnimatedLength* height() const { return m_height.get(); }
42
43 private:
44     explicit SVGMaskElement(Document&);
45
46     virtual bool isValid() const OVERRIDE { return SVGTests::isValid(); }
47     virtual bool needsPendingResourceHandling() const OVERRIDE { return false; }
48
49     bool isSupportedAttribute(const QualifiedName&);
50     virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
51     virtual void svgAttributeChanged(const QualifiedName&) OVERRIDE;
52     virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0) OVERRIDE;
53
54     virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE;
55
56     virtual bool selfHasRelativeLengths() const OVERRIDE;
57
58     RefPtr<SVGAnimatedLength> m_x;
59     RefPtr<SVGAnimatedLength> m_y;
60     RefPtr<SVGAnimatedLength> m_width;
61     RefPtr<SVGAnimatedLength> m_height;
62     BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGMaskElement)
63         DECLARE_ANIMATED_ENUMERATION(MaskUnits, maskUnits, SVGUnitTypes::SVGUnitType)
64         DECLARE_ANIMATED_ENUMERATION(MaskContentUnits, maskContentUnits, SVGUnitTypes::SVGUnitType)
65     END_DECLARE_ANIMATED_PROPERTIES
66
67     // SVGTests
68     virtual void synchronizeRequiredFeatures() OVERRIDE { SVGTests::synchronizeRequiredFeatures(this); }
69     virtual void synchronizeRequiredExtensions() OVERRIDE { SVGTests::synchronizeRequiredExtensions(this); }
70     virtual void synchronizeSystemLanguage() OVERRIDE { SVGTests::synchronizeSystemLanguage(this); }
71 };
72
73 DEFINE_NODE_TYPE_CASTS(SVGMaskElement, hasTagName(SVGNames::maskTag));
74
75 }
76
77 #endif