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

KHTML

SVGStyleElement.cpp

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
00003                   2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
00004     Copyright (C) 2006 Apple Computer, Inc.
00005 
00006     This file is part of the KDE project
00007 
00008     This library is free software; you can redistribute it and/or
00009     modify it under the terms of the GNU Library General Public
00010     License as published by the Free Software Foundation; either
00011     version 2 of the License, or (at your option) any later version.
00012 
00013     This library is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016     Library General Public License for more details.
00017 
00018     You should have received a copy of the GNU Library General Public License
00019     along with this library; see the file COPYING.LIB.  If not, write to
00020     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00021     Boston, MA 02110-1301, USA.
00022 */
00023 
00024 #include "config.h"
00025 #include "wtf/Platform.h"
00026 #if ENABLE(SVG)
00027 #include "SVGStyleElement.h"
00028 
00029 //#include "CSSStyleSheet.h"
00030 #include "Document.h"
00031 #include "ExceptionCode.h"
00032 //#include "HTMLNames.h"
00033 //#include "XMLNames.h"
00034 
00035 namespace WebCore {
00036 
00037 //using namespace HTMLNames;
00038 
00039 SVGStyleElement::SVGStyleElement(const QualifiedName& tagName, Document* doc)
00040      : SVGElement(tagName, doc)
00041      , m_createdByParser(false)
00042 {
00043 }
00044 
00045 const AtomicString& SVGStyleElement::xmlspace() const
00046 {
00047     return "";//return getAttribute(XMLNames::spaceAttr);
00048 }
00049 
00050 void SVGStyleElement::setXmlspace(const AtomicString&, ExceptionCode& ec)
00051 {
00052     ec = DOMException::NO_MODIFICATION_ALLOWED_ERR;
00053 }
00054 
00055 const AtomicString& SVGStyleElement::type() const
00056 {
00057     static const AtomicString defaultValue("text/css");
00058     const AtomicString& n = getAttribute(ATTR_TYPE/*typeAttr*/);
00059     return n.isNull() ? defaultValue : n;
00060 }
00061 
00062 void SVGStyleElement::setType(const AtomicString&, ExceptionCode& ec)
00063 {
00064     ec = DOMException::NO_MODIFICATION_ALLOWED_ERR;
00065 }
00066 
00067 const AtomicString& SVGStyleElement::media() const
00068 {
00069     static const AtomicString defaultValue("all");
00070     const AtomicString& n = getAttribute(ATTR_MEDIA/*mediaAttr*/);
00071     return n.isNull() ? defaultValue : n;
00072 }
00073 
00074 void SVGStyleElement::setMedia(const AtomicString&, ExceptionCode& ec)
00075 {
00076     ec = DOMException::NO_MODIFICATION_ALLOWED_ERR;
00077 }
00078 
00079 String SVGStyleElement::title() const
00080 {
00081     return getAttribute(ATTR_TITLE/*titleAttr*/);
00082 }
00083 
00084 void SVGStyleElement::setTitle(const AtomicString&, ExceptionCode& ec)
00085 {
00086     ec = DOMException::NO_MODIFICATION_ALLOWED_ERR;
00087 }
00088 
00089 void SVGStyleElement::parseMappedAttribute(MappedAttribute* attr)
00090 {
00091     kDebug() << "parse: " << attr->id() << attr->localName() << attr->value() << endl;
00092     if (/*attr->name() == titleAttr*/attr->id() == ATTR_TITLE && m_sheet)
00093         ;//FIXME m_sheet->setTitle(attr->value());
00094     else
00095         SVGElement::parseMappedAttribute(attr);
00096 }
00097 
00098 void SVGStyleElement::finishParsingChildren()
00099 {
00100     //StyleElement::sheet(this);
00101     m_createdByParser = false;
00102     SVGElement::finishParsingChildren();
00103 }
00104 
00105 void SVGStyleElement::insertedIntoDocument()
00106 {
00107     SVGElement::insertedIntoDocument();
00108 
00109     /*if (!m_createdByParser)
00110         StyleElement::insertedIntoDocument(document(), this);*/
00111     // Copy implementation from HTMLStyleElementImpl for KHTML
00112     kDebug() << "not implemented" << endl;
00113 }
00114 
00115 void SVGStyleElement::removedFromDocument()
00116 {
00117     SVGElement::removedFromDocument();
00118     /*StyleElement::removedFromDocument(document());*/
00119     // Copy implementation from HTMLStyleElementImpl for KHTML
00120     kDebug() << "not implemented" << endl;
00121 }
00122 
00123 void SVGStyleElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
00124 {
00125     //SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
00126     SVGElement::childrenChanged();
00127     /*StyleElement::process(this);*/
00128     // Copy implementation from HTMLStyleElementImpl for KHTML
00129     kDebug() << "not implemented" << endl;
00130 }
00131 
00132 StyleSheet* SVGStyleElement::sheet()
00133 {
00134     //return StyleElement::sheet(this);
00135     return m_sheet;
00136 }
00137 
00138 bool SVGStyleElement::sheetLoaded()
00139 {
00140     //document()->removePendingSheet();
00141     document()->styleSheetLoaded();
00142     return true;
00143 }
00144 
00145 // khtml compatibility methods:
00146 quint32 SVGStyleElement::id() const
00147 {
00148     return SVGNames::styleTag.id();
00149 }
00150 
00151 }
00152 
00153 // vim:ts=4
00154 #endif // ENABLE(SVG)

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
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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