KHTML
SVGSVGElement.h
Go to the documentation of this file.
00001 /* 00002 Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 00003 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 00004 00005 This file is part of the KDE project 00006 00007 This library is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU Library General Public 00009 License as published by the Free Software Foundation; either 00010 version 2 of the License, or (at your option) any later version. 00011 00012 This library is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 Library General Public License for more details. 00016 00017 You should have received a copy of the GNU Library General Public License 00018 along with this library; see the file COPYING.LIB. If not, write to 00019 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00020 Boston, MA 02110-1301, USA. 00021 */ 00022 00023 #ifndef SVGSVGElement_h 00024 #define SVGSVGElement_h 00025 00026 #if ENABLE(SVG) 00027 00028 #include "FloatRect.h" 00029 00030 #include "IntSize.h" 00031 #include "SVGExternalResourcesRequired.h" 00032 #include "SVGFitToViewBox.h" 00033 #include "SVGLangSpace.h" 00034 #include "SVGStyledLocatableElement.h" 00035 #include "SVGTests.h" 00036 #include "SVGZoomAndPan.h" 00037 00038 namespace WebCore 00039 { 00040 class SVGAngle; 00041 class SVGLength; 00042 class SVGTransform; 00043 class SVGViewSpec; 00044 /*class SVGViewElement; 00045 class SMILTimeContainer;*/ 00046 class SVGSVGElement : public SVGStyledLocatableElement, 00047 public SVGTests, 00048 public SVGLangSpace, 00049 public SVGExternalResourcesRequired, 00050 public SVGFitToViewBox, 00051 public SVGZoomAndPan 00052 { 00053 public: 00054 SVGSVGElement(const QualifiedName&, Document*); 00055 virtual ~SVGSVGElement(); 00056 00057 virtual bool isSVG() const { return true; } 00058 00059 virtual bool isValid() const { return SVGTests::isValid(); } 00060 00061 // 'SVGSVGElement' functions 00062 DOMString contentScriptType() const; 00063 void setContentScriptType(const DOMString& type); 00064 00065 DOMString contentStyleType() const; 00066 void setContentStyleType(const DOMString& type); 00067 00068 FloatRect viewport() const; 00069 00070 IntSize containerSize() const; 00071 bool hasSetContainerSize() const; 00072 int relativeWidthValue() const; 00073 int relativeHeightValue() const; 00074 00075 float pixelUnitToMillimeterX() const; 00076 float pixelUnitToMillimeterY() const; 00077 float screenPixelToMillimeterX() const; 00078 float screenPixelToMillimeterY() const; 00079 00080 bool useCurrentView() const; 00081 void setUseCurrentView(bool currentView); 00082 00083 SVGViewSpec* currentView() const; 00084 00085 float currentScale() const; 00086 void setCurrentScale(float scale); 00087 00088 FloatPoint currentTranslate() const; 00089 void setCurrentTranslate(const FloatPoint&); 00090 00091 /*SMILTimeContainer* timeContainer() const { return m_timeContainer.get(); }*/ 00092 00093 void pauseAnimations(); 00094 void unpauseAnimations(); 00095 bool animationsPaused() const; 00096 00097 float getCurrentTime() const; 00098 void setCurrentTime(float seconds); 00099 00100 unsigned long suspendRedraw(unsigned long max_wait_milliseconds); 00101 void unsuspendRedraw(unsigned long suspend_handle_id, ExceptionCode&); 00102 void unsuspendRedrawAll(); 00103 void forceRedraw(); 00104 00105 DOM::NodeListImpl* getIntersectionList(const FloatRect&, SVGElement* referenceElement); 00106 DOM::NodeListImpl* getEnclosureList(const FloatRect&, SVGElement* referenceElement); 00107 bool checkIntersection(SVGElement*, const FloatRect&); 00108 bool checkEnclosure(SVGElement*, const FloatRect&); 00109 void deselectAll(); 00110 00111 static float createSVGNumber(); 00112 static SVGLength createSVGLength(); 00113 static SVGAngle* createSVGAngle(); 00114 static FloatPoint createSVGPoint(); 00115 static AffineTransform createSVGMatrix(); 00116 static FloatRect createSVGRect(); 00117 static SVGTransform createSVGTransform(); 00118 static SVGTransform createSVGTransformFromMatrix(const AffineTransform&); 00119 00120 virtual void parseMappedAttribute(MappedAttribute*); 00121 00122 // 'virtual SVGLocatable' functions 00123 virtual AffineTransform getCTM() const; 00124 virtual AffineTransform getScreenCTM() const; 00125 00126 virtual bool rendererIsNeeded(RenderStyle* style) { return StyledElement::rendererIsNeeded(style); } 00127 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*); 00128 00129 virtual void insertedIntoDocument(); 00130 virtual void removedFromDocument(); 00131 00132 virtual void svgAttributeChanged(const QualifiedName&); 00133 00134 virtual AffineTransform viewBoxToViewTransform(float viewWidth, float viewHeight) const; 00135 00136 //void inheritViewAttributes(SVGViewElement*); 00137 00138 // KHTML ElementImpl pure virtual method 00139 virtual quint32 id() const; 00140 protected: 00141 virtual const SVGElement* contextElement() const { return this; } 00142 00143 friend class RenderSVGRoot; 00144 /*friend class RenderSVGViewportContainer;*/ 00145 00146 virtual bool hasRelativeValues() const; 00147 00148 bool isOutermostSVG() const; 00149 00150 private: 00151 void addSVGWindowEventListener(const AtomicString& eventType, const Attribute* attr); 00152 00153 ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGExternalResourcesRequired, bool, ExternalResourcesRequired, externalResourcesRequired) 00154 ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGFitToViewBox, FloatRect, ViewBox, viewBox) 00155 ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGFitToViewBox, SVGPreserveAspectRatio*, PreserveAspectRatio, preserveAspectRatio) 00156 00157 ANIMATED_PROPERTY_DECLARATIONS(SVGSVGElement, SVGLength, SVGLength, X, x) 00158 ANIMATED_PROPERTY_DECLARATIONS(SVGSVGElement, SVGLength, SVGLength, Y, y) 00159 ANIMATED_PROPERTY_DECLARATIONS(SVGSVGElement, SVGLength, SVGLength, Width, width) 00160 ANIMATED_PROPERTY_DECLARATIONS(SVGSVGElement, SVGLength, SVGLength, Height, height) 00161 00162 virtual void willSaveToCache(); 00163 virtual void willRestoreFromCache(); 00164 00165 bool m_useCurrentView; 00166 /*RefPtr<SMILTimeContainer> m_timeContainer;*/ 00167 FloatPoint m_translation; 00168 mutable OwnPtr<SVGViewSpec> m_viewSpec; 00169 }; 00170 00171 } // namespace WebCore 00172 00173 #endif // ENABLE(SVG) 00174 #endif 00175 00176 // vim:ts=4:noet
KDE 4.6 API Reference