1 /* 2 Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 3 2004, 2005 Rob Buis <buis@kde.org> 4 5 This library is free software; you can redistribute it and/or 6 modify it under the terms of the GNU Library General Public 7 License as published by the Free Software Foundation; either 8 version 2 of the License, or (at your option) any later version. 9 10 This library is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 Library General Public License for more details. 14 15 You should have received a copy of the GNU Library General Public License 16 along with this library; see the file COPYING.LIB. If not, write to 17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 Boston, MA 02110-1301, USA. 19 */ 20 21 #ifndef SVGFEImageElement_h 22 #define SVGFEImageElement_h 23 24 #if ENABLE(SVG) && ENABLE(FILTERS) 25 #include "CachedResourceHandle.h" 26 #include "ImageBuffer.h" 27 #include "SVGExternalResourcesRequired.h" 28 #include "SVGFEImage.h" 29 #include "SVGFilterPrimitiveStandardAttributes.h" 30 #include "SVGLangSpace.h" 31 #include "SVGPreserveAspectRatio.h" 32 #include "SVGURIReference.h" 33 34 namespace WebCore { 35 36 class SVGFEImageElement : public SVGFilterPrimitiveStandardAttributes, 37 public SVGURIReference, 38 public SVGLangSpace, 39 public SVGExternalResourcesRequired, 40 public CachedResourceClient { 41 public: 42 SVGFEImageElement(const QualifiedName&, Document*); 43 virtual ~SVGFEImageElement(); 44 45 virtual void parseMappedAttribute(MappedAttribute*); 46 virtual void synchronizeProperty(const QualifiedName&); 47 virtual void notifyFinished(CachedResource*); 48 49 virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const; 50 virtual bool build(SVGResourceFilter*); 51 52 private: 53 void requestImageResource(); 54 55 DECLARE_ANIMATED_PROPERTY(SVGFEImageElement, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio, PreserveAspectRatio, preserveAspectRatio) 56 57 // SVGURIReference 58 DECLARE_ANIMATED_PROPERTY(SVGFEImageElement, XLinkNames::hrefAttr, String, Href, href) 59 60 // SVGExternalResourcesRequired 61 DECLARE_ANIMATED_PROPERTY(SVGFEImageElement, SVGNames::externalResourcesRequiredAttr, bool, ExternalResourcesRequired, externalResourcesRequired) 62 63 CachedResourceHandle<CachedImage> m_cachedImage; 64 OwnPtr<ImageBuffer> m_targetImage; 65 }; 66 67 } // namespace WebCore 68 69 #endif // ENABLE(SVG) 70 #endif 71