fix logic
[personal-kdelibs.git] / khtml / svg / SVGMaskElement.h
blobcd44baffd8dbf7110b3e9df99255ea6cfed3bfda
1 /*
2 Copyright (C) 2005 Alexander Kellett <lypanov@kde.org>
4 This file is part of the KDE project
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
22 #ifndef SVGMaskElement_h
23 #define SVGMaskElement_h
25 #if ENABLE(SVG)
26 #include "SVGResourceMasker.h"
27 #include "SVGExternalResourcesRequired.h"
28 #include "SVGLangSpace.h"
29 #include "SVGStyledLocatableElement.h"
30 #include "SVGTests.h"
31 #include "SVGURIReference.h"
33 namespace WebCore {
35 class SVGLength;
37 class SVGMaskElement : public SVGStyledLocatableElement,
38 public SVGURIReference,
39 public SVGTests,
40 public SVGLangSpace,
41 public SVGExternalResourcesRequired {
42 public:
43 SVGMaskElement(const QualifiedName&, Document*);
44 virtual ~SVGMaskElement();
45 virtual bool isValid() const { return SVGTests::isValid(); }
47 virtual void parseMappedAttribute(MappedAttribute*);
48 virtual void svgAttributeChanged(const QualifiedName&);
49 virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
51 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
52 virtual SVGResource* canvasResource();
54 std::auto_ptr<ImageBuffer> drawMaskerContent(const FloatRect& targetRect, FloatRect& maskRect) const;
56 protected:
57 ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGURIReference, String, Href, href)
58 ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGExternalResourcesRequired, bool, ExternalResourcesRequired, externalResourcesRequired)
60 ANIMATED_PROPERTY_DECLARATIONS(SVGMaskElement, int, int, MaskUnits, maskUnits)
61 ANIMATED_PROPERTY_DECLARATIONS(SVGMaskElement, int, int, MaskContentUnits, maskContentUnits)
63 ANIMATED_PROPERTY_DECLARATIONS(SVGMaskElement, SVGLength, SVGLength, X, x)
64 ANIMATED_PROPERTY_DECLARATIONS(SVGMaskElement, SVGLength, SVGLength, Y, y)
65 ANIMATED_PROPERTY_DECLARATIONS(SVGMaskElement, SVGLength, SVGLength, Width, width)
66 ANIMATED_PROPERTY_DECLARATIONS(SVGMaskElement, SVGLength, SVGLength, Height, height)
68 virtual const SVGElement* contextElement() const { return this; }
70 private:
71 RefPtr<SVGResourceMasker> m_masker;
74 } // namespace WebCore
76 #endif // ENABLE(SVG)
77 #endif