KHtml

SVGMaskElement.h
1 /*
2  Copyright (C) 2005 Alexander Kellett <[email protected]>
3 
4  This file is part of the KDE project
5 
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.
10 
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.
15 
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.
20 */
21 
22 #ifndef SVGMaskElement_h
23 #define SVGMaskElement_h
24 
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"
32 
33 namespace WebCore
34 {
35 
36 class SVGLength;
37 
38 class SVGMaskElement : public SVGStyledLocatableElement,
39  public SVGURIReference,
40  public SVGTests,
41  public SVGLangSpace,
42  public SVGExternalResourcesRequired
43 {
44 public:
45  SVGMaskElement(const QualifiedName &, Document *);
46  virtual ~SVGMaskElement();
47  virtual bool isValid() const
48  {
49  return SVGTests::isValid();
50  }
51 
52  virtual void parseMappedAttribute(MappedAttribute *);
53  virtual void svgAttributeChanged(const QualifiedName &);
54  virtual void childrenChanged(bool changedByParser = false, Node *beforeChange = 0, Node *afterChange = 0, int childCountDelta = 0);
55 
56  virtual RenderObject *createRenderer(RenderArena *, RenderStyle *);
57  virtual SVGResource *canvasResource();
58 
59  std::unique_ptr<ImageBuffer> drawMaskerContent(const FloatRect &targetRect, FloatRect &maskRect) const;
60 
61 protected:
62  ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGURIReference, String, Href, href)
63  ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGExternalResourcesRequired, bool, ExternalResourcesRequired, externalResourcesRequired)
64 
65  ANIMATED_PROPERTY_DECLARATIONS(SVGMaskElement, int, int, MaskUnits, maskUnits)
66  ANIMATED_PROPERTY_DECLARATIONS(SVGMaskElement, int, int, MaskContentUnits, maskContentUnits)
67 
68  ANIMATED_PROPERTY_DECLARATIONS(SVGMaskElement, SVGLength, SVGLength, X, x)
69  ANIMATED_PROPERTY_DECLARATIONS(SVGMaskElement, SVGLength, SVGLength, Y, y)
70  ANIMATED_PROPERTY_DECLARATIONS(SVGMaskElement, SVGLength, SVGLength, Width, width)
71  ANIMATED_PROPERTY_DECLARATIONS(SVGMaskElement, SVGLength, SVGLength, Height, height)
72 
73  virtual const SVGElement *contextElement() const
74  {
75  return this;
76  }
77 
78 private:
79  RefPtr<SVGResourceMasker> m_masker;
80 };
81 
82 } // namespace WebCore
83 
84 #endif // ENABLE(SVG)
85 #endif
bool isValid(QStringView ifopt)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Oct 26 2021 22:48:10 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.