File indexing completed on 2024-04-28 15:24:32

0001 /*
0002     Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
0003     Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
0004     Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
0005 
0006     This file is part of the KDE project
0007 
0008     This library is free software; you can redistribute it and/or
0009     modify it under the terms of the GNU Library General Public
0010     License as published by the Free Software Foundation; either
0011     version 2 of the License, or (at your option) any later version.
0012 
0013     This library is distributed in the hope that it will be useful,
0014     but WITHOUT ANY WARRANTY; without even the implied warranty of
0015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0016     Library General Public License for more details.
0017 
0018     You should have received a copy of the GNU Library General Public License
0019     along with this library; see the file COPYING.LIB.  If not, write to
0020     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0021     Boston, MA 02110-1301, USA.
0022 */
0023 
0024 #ifndef SVGFilterElement_h
0025 #define SVGFilterElement_h
0026 
0027 #if ENABLE(SVG) && ENABLE(SVG_FILTERS)
0028 #include "SVGResourceFilter.h"
0029 #include "SVGExternalResourcesRequired.h"
0030 #include "SVGLangSpace.h"
0031 #include "SVGStyledElement.h"
0032 #include "SVGURIReference.h"
0033 
0034 namespace WebCore
0035 {
0036 class SVGLength;
0037 
0038 class SVGFilterElement : public SVGStyledElement,
0039     public SVGURIReference,
0040     public SVGLangSpace,
0041     public SVGExternalResourcesRequired
0042 {
0043 public:
0044     SVGFilterElement(const QualifiedName &, Document *);
0045     virtual ~SVGFilterElement();
0046 
0047     virtual SVGResource *canvasResource();
0048 
0049     void setFilterRes(unsigned long filterResX, unsigned long filterResY) const;
0050 
0051     virtual void parseMappedAttribute(MappedAttribute *);
0052     virtual bool rendererIsNeeded(RenderStyle *)
0053     {
0054         return false;
0055     }
0056 
0057 protected:
0058     virtual const SVGElement *contextElement() const
0059     {
0060         return this;
0061     }
0062 
0063 private:
0064     ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGURIReference, String, Href, href)
0065     ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGExternalResourcesRequired, bool, ExternalResourcesRequired, externalResourcesRequired)
0066 
0067     ANIMATED_PROPERTY_DECLARATIONS(SVGFilterElement, int, int, FilterUnits, filterUnits)
0068     ANIMATED_PROPERTY_DECLARATIONS(SVGFilterElement, int, int, PrimitiveUnits, primitiveUnits)
0069     ANIMATED_PROPERTY_DECLARATIONS(SVGFilterElement, SVGLength, SVGLength, X, x)
0070     ANIMATED_PROPERTY_DECLARATIONS(SVGFilterElement, SVGLength, SVGLength, Y, y)
0071     ANIMATED_PROPERTY_DECLARATIONS(SVGFilterElement, SVGLength, SVGLength, Width, width)
0072     ANIMATED_PROPERTY_DECLARATIONS(SVGFilterElement, SVGLength, SVGLength, Height, height)
0073     ANIMATED_PROPERTY_DECLARATIONS(SVGFilterElement, long, long, FilterResX, filterResX)
0074     ANIMATED_PROPERTY_DECLARATIONS(SVGFilterElement, long, long, FilterResY, filterResY)
0075 
0076     RefPtr<SVGResourceFilter> m_filter;
0077 };
0078 
0079 } // namespace WebCore
0080 
0081 #endif // ENABLE(SVG)
0082 #endif
0083