• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

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         const AtomicString& contentScriptType() const;
00063         void setContentScriptType(const AtomicString& type);
00064 
00065         const AtomicString& contentStyleType() const;
00066         void setContentStyleType(const AtomicString& type);
00067 
00068         FloatRect viewport() const;
00069 
00070         void setContainerSize(const IntSize& containerSize) { m_containerSize = containerSize; m_hasSetContainerSize = true; }
00071         IntSize containerSize() const { return m_containerSize; }
00072         bool hasSetContainerSize() const { return m_hasSetContainerSize; }
00073         int relativeWidthValue() const;
00074         int relativeHeightValue() const;
00075 
00076         float pixelUnitToMillimeterX() const;
00077         float pixelUnitToMillimeterY() const;
00078         float screenPixelToMillimeterX() const;
00079         float screenPixelToMillimeterY() const;
00080 
00081         bool useCurrentView() const;
00082         void setUseCurrentView(bool currentView);
00083 
00084         SVGViewSpec* currentView() const;
00085 
00086         float currentScale() const;
00087         void setCurrentScale(float scale);
00088 
00089         FloatPoint currentTranslate() const;
00090         void setCurrentTranslate(const FloatPoint&);
00091         
00092         /*SMILTimeContainer* timeContainer() const { return m_timeContainer.get(); }*/
00093         
00094         void pauseAnimations();
00095         void unpauseAnimations();
00096         bool animationsPaused() const;
00097 
00098         float getCurrentTime() const;
00099         void setCurrentTime(float seconds);
00100 
00101         unsigned long suspendRedraw(unsigned long max_wait_milliseconds);
00102         void unsuspendRedraw(unsigned long suspend_handle_id, ExceptionCode&);
00103         void unsuspendRedrawAll();
00104         void forceRedraw();
00105 
00106         NodeList* getIntersectionList(const FloatRect&, SVGElement* referenceElement);
00107         NodeList* getEnclosureList(const FloatRect&, SVGElement* referenceElement);
00108         bool checkIntersection(SVGElement*, const FloatRect&);
00109         bool checkEnclosure(SVGElement*, const FloatRect&);
00110         void deselectAll();
00111 
00112         static float createSVGNumber();
00113         static SVGLength createSVGLength();
00114         static SVGAngle* createSVGAngle();
00115         static FloatPoint createSVGPoint();
00116         static AffineTransform createSVGMatrix();
00117         static FloatRect createSVGRect();
00118         static SVGTransform createSVGTransform();
00119         static SVGTransform createSVGTransformFromMatrix(const AffineTransform&);
00120 
00121         virtual void parseMappedAttribute(MappedAttribute*);
00122 
00123         // 'virtual SVGLocatable' functions
00124         virtual AffineTransform getCTM() const;
00125         virtual AffineTransform getScreenCTM() const;
00126 
00127         virtual bool rendererIsNeeded(RenderStyle* style) { return StyledElement::rendererIsNeeded(style); }
00128         virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
00129 
00130         virtual void insertedIntoDocument();
00131         virtual void removedFromDocument();
00132 
00133         virtual void svgAttributeChanged(const QualifiedName&);
00134 
00135         virtual AffineTransform viewBoxToViewTransform(float viewWidth, float viewHeight) const;
00136 
00137         //void inheritViewAttributes(SVGViewElement*);
00138 
00139         // KHTML ElementImpl pure virtual method
00140         virtual quint32 id() const;
00141         virtual DOMString tagName() const { return SVGNames::svgTag.tagName(); }
00142         //virtual void parseAttribute(Attribute*);
00143 
00144     protected:
00145         virtual const SVGElement* contextElement() const { return this; }
00146 
00147         friend class RenderSVGRoot;
00148         /*friend class RenderSVGViewportContainer;*/
00149 
00150         virtual bool hasRelativeValues() const;
00151         
00152         bool isOutermostSVG() const;
00153 
00154     private:
00155         void addSVGWindowEventListener(const AtomicString& eventType, const Attribute* attr);
00156 
00157         ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGExternalResourcesRequired, bool, ExternalResourcesRequired, externalResourcesRequired)
00158         ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGFitToViewBox, FloatRect, ViewBox, viewBox)
00159         ANIMATED_PROPERTY_FORWARD_DECLARATIONS(SVGFitToViewBox, SVGPreserveAspectRatio*, PreserveAspectRatio, preserveAspectRatio)
00160 
00161         ANIMATED_PROPERTY_DECLARATIONS(SVGSVGElement, SVGLength, SVGLength, X, x)
00162         ANIMATED_PROPERTY_DECLARATIONS(SVGSVGElement, SVGLength, SVGLength, Y, y)
00163         ANIMATED_PROPERTY_DECLARATIONS(SVGSVGElement, SVGLength, SVGLength, Width, width)
00164         ANIMATED_PROPERTY_DECLARATIONS(SVGSVGElement, SVGLength, SVGLength, Height, height)
00165         
00166         virtual void willSaveToCache();
00167         virtual void willRestoreFromCache();
00168 
00169         bool m_useCurrentView;
00170         /*RefPtr<SMILTimeContainer> m_timeContainer;*/
00171         FloatPoint m_translation;
00172         mutable OwnPtr<SVGViewSpec> m_viewSpec;
00173         IntSize m_containerSize;
00174         bool m_hasSetContainerSize;
00175     };
00176 
00177 } // namespace WebCore
00178 
00179 #endif // ENABLE(SVG)
00180 #endif
00181 
00182 // vim:ts=4:noet

KHTML

Skip menu "KHTML"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal