23 #ifndef SVGSVGElement_h
24 #define SVGSVGElement_h
46 class SVGSVGElement :
public SVGStyledLocatableElement,
49 public SVGExternalResourcesRequired,
50 public SVGFitToViewBox,
54 SVGSVGElement(
const QualifiedName&, Document*);
55 virtual ~SVGSVGElement();
57 virtual bool isSVG()
const {
return true; }
59 virtual bool isValid()
const {
return SVGTests::isValid(); }
62 DOMString contentScriptType()
const;
63 void setContentScriptType(
const DOMString& type);
65 DOMString contentStyleType()
const;
66 void setContentStyleType(
const DOMString& type);
68 FloatRect viewport()
const;
70 IntSize containerSize()
const;
71 bool hasSetContainerSize()
const;
72 int relativeWidthValue()
const;
73 int relativeHeightValue()
const;
75 float pixelUnitToMillimeterX()
const;
76 float pixelUnitToMillimeterY()
const;
77 float screenPixelToMillimeterX()
const;
78 float screenPixelToMillimeterY()
const;
80 bool useCurrentView()
const;
81 void setUseCurrentView(
bool currentView);
83 SVGViewSpec* currentView()
const;
85 float currentScale()
const;
86 void setCurrentScale(
float scale);
88 FloatPoint currentTranslate()
const;
89 void setCurrentTranslate(
const FloatPoint&);
93 void pauseAnimations();
94 void unpauseAnimations();
95 bool animationsPaused()
const;
97 float getCurrentTime()
const;
98 void setCurrentTime(
float seconds);
100 unsigned long suspendRedraw(
unsigned long max_wait_milliseconds);
101 void unsuspendRedraw(
unsigned long suspend_handle_id, ExceptionCode&);
102 void unsuspendRedrawAll();
105 DOM::NodeListImpl* getIntersectionList(
const FloatRect&, SVGElement* referenceElement);
106 DOM::NodeListImpl* getEnclosureList(
const FloatRect&, SVGElement* referenceElement);
107 bool checkIntersection(SVGElement*,
const FloatRect&);
108 bool checkEnclosure(SVGElement*,
const FloatRect&);
111 static float createSVGNumber();
112 static SVGLength createSVGLength();
113 static SVGAngle* createSVGAngle();
114 static FloatPoint createSVGPoint();
115 static AffineTransform createSVGMatrix();
116 static FloatRect createSVGRect();
117 static SVGTransform createSVGTransform();
118 static SVGTransform createSVGTransformFromMatrix(
const AffineTransform&);
120 virtual void parseMappedAttribute(MappedAttribute*);
123 virtual AffineTransform getCTM()
const;
124 virtual AffineTransform getScreenCTM()
const;
126 virtual bool rendererIsNeeded(RenderStyle* style) {
return StyledElement::rendererIsNeeded(style); }
127 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
129 virtual void insertedIntoDocument();
130 virtual void removedFromDocument();
132 virtual void svgAttributeChanged(
const QualifiedName&);
134 virtual AffineTransform viewBoxToViewTransform(
float viewWidth,
float viewHeight)
const;
141 virtual const SVGElement* contextElement()
const {
return this; }
143 friend class RenderSVGRoot;
146 virtual bool hasRelativeValues()
const;
148 bool isOutermostSVG()
const;
151 void addSVGWindowEventListener(
const AtomicString& eventType,
const Attribute* attr);
153 ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGExternalResourcesRequired,
bool, ExternalResourcesRequired, externalResourcesRequired)
154 ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGFitToViewBox, FloatRect, ViewBox, viewBox)
155 ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGFitToViewBox, SVGPreserveAspectRatio*, PreserveAspectRatio, preserveAspectRatio)
157 ANIMATED_PROPERTY_DECLARATIONS(SVGSVGElement, SVGLength, SVGLength, X, x)
158 ANIMATED_PROPERTY_DECLARATIONS(SVGSVGElement, SVGLength, SVGLength, Y, y)
159 ANIMATED_PROPERTY_DECLARATIONS(SVGSVGElement, SVGLength, SVGLength, Width, width)
160 ANIMATED_PROPERTY_DECLARATIONS(SVGSVGElement, SVGLength, SVGLength, Height, height)
162 virtual
void willSaveToCache();
163 virtual
void willRestoreFromCache();
165 bool m_useCurrentView;
167 FloatPoint m_translation;
168 mutable OwnPtr<SVGViewSpec> m_viewSpec;
173 #endif // ENABLE(SVG)