Home | History | Annotate | Download | only in svg
      1 /*
      2  * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann (at) kde.org>
      3  * Copyright (C) 2004, 2005, 2006 Rob Buis <buis (at) 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 SVGImageElement_h
     22 #define SVGImageElement_h
     23 
     24 #if ENABLE(SVG)
     25 #include "SVGAnimatedBoolean.h"
     26 #include "SVGAnimatedLength.h"
     27 #include "SVGAnimatedPreserveAspectRatio.h"
     28 #include "SVGExternalResourcesRequired.h"
     29 #include "SVGImageLoader.h"
     30 #include "SVGLangSpace.h"
     31 #include "SVGStyledTransformableElement.h"
     32 #include "SVGTests.h"
     33 #include "SVGURIReference.h"
     34 
     35 namespace WebCore {
     36 
     37 class SVGImageElement : public SVGStyledTransformableElement,
     38                         public SVGTests,
     39                         public SVGLangSpace,
     40                         public SVGExternalResourcesRequired,
     41                         public SVGURIReference {
     42 public:
     43     static PassRefPtr<SVGImageElement> create(const QualifiedName&, Document*);
     44 
     45 private:
     46     SVGImageElement(const QualifiedName&, Document*);
     47 
     48     virtual bool isValid() const { return SVGTests::isValid(); }
     49 
     50     virtual void parseMappedAttribute(Attribute*);
     51     virtual void svgAttributeChanged(const QualifiedName&);
     52     virtual void synchronizeProperty(const QualifiedName&);
     53     virtual void fillAttributeToPropertyTypeMap();
     54     virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();
     55 
     56     virtual void attach();
     57     virtual void insertedIntoDocument();
     58 
     59     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
     60 
     61     virtual const QualifiedName& imageSourceAttributeName() const;
     62     virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
     63 
     64     virtual bool haveLoadedRequiredResources();
     65 
     66     virtual bool selfHasRelativeLengths() const;
     67     virtual void willMoveToNewOwnerDocument();
     68 
     69     // Animated property declarations
     70     DECLARE_ANIMATED_LENGTH(X, x)
     71     DECLARE_ANIMATED_LENGTH(Y, y)
     72     DECLARE_ANIMATED_LENGTH(Width, width)
     73     DECLARE_ANIMATED_LENGTH(Height, height)
     74     DECLARE_ANIMATED_PRESERVEASPECTRATIO(PreserveAspectRatio, preserveAspectRatio)
     75 
     76     // SVGURIReference
     77     DECLARE_ANIMATED_STRING(Href, href)
     78 
     79     // SVGExternalResourcesRequired
     80     DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesRequired)
     81 
     82     SVGImageLoader m_imageLoader;
     83 };
     84 
     85 } // namespace WebCore
     86 
     87 #endif // ENABLE(SVG)
     88 #endif
     89