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

KHTML

SVGTests.cpp

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2004, 2005, 2008 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 #include "config.h"
00024 #include "wtf/Platform.h"
00025 
00026 #if ENABLE(SVG)
00027 #include "SVGTests.h"
00028 
00029 //#include "DOMImplementation.h"
00030 //#include "Language.h"
00031 #include "SVGElement.h"
00032 #include "SVGNames.h"
00033 #include "SVGStringList.h"
00034 
00035 namespace WebCore {
00036 
00037 SVGTests::SVGTests()
00038 {
00039 }
00040 
00041 SVGTests::~SVGTests()
00042 {
00043 }
00044 
00045 SVGStringList* SVGTests::requiredFeatures() const
00046 {
00047     if (!m_features)
00048         m_features = SVGStringList::create(SVGNames::requiredFeaturesAttr);
00049 
00050     return m_features.get();
00051 }
00052 
00053 SVGStringList* SVGTests::requiredExtensions() const
00054 {
00055     if (!m_extensions)
00056         m_extensions = SVGStringList::create(SVGNames::requiredExtensionsAttr);
00057 
00058     return m_extensions.get();
00059 }
00060 
00061 SVGStringList* SVGTests::systemLanguage() const
00062 {
00063     if (!m_systemLanguage)
00064         m_systemLanguage = SVGStringList::create(SVGNames::systemLanguageAttr);
00065 
00066     return m_systemLanguage.get();
00067 }
00068 
00069 bool SVGTests::hasExtension(const String&) const
00070 {
00071     return false;
00072 }
00073 
00074 bool SVGTests::isValid() const
00075 {
00076     ExceptionCode ec = 0;
00077 
00078     if (m_features) {
00079         for (unsigned long i = 0; i < m_features->numberOfItems(); i++) {
00080             String value = m_features->getItem(i, ec);
00081             if (value.isEmpty() || !DOMImplementation::instance()->hasFeature(value, String()))
00082                 return false;
00083         }
00084     }
00085 
00086     /*if (m_systemLanguage) {
00087         for (unsigned long i = 0; i < m_systemLanguage->numberOfItems(); i++)
00088             if (m_systemLanguage->getItem(i, ec) != defaultLanguage().substring(0, 2))
00089                 return false;
00090     }*/
00091 
00092     if (m_extensions && m_extensions->numberOfItems() > 0)
00093         return false;
00094 
00095     return true;
00096 }
00097 
00098 bool SVGTests::parseMappedAttribute(MappedAttribute* attr)
00099 {
00100     if (attr->name() == SVGNames::requiredFeaturesAttr) {
00101         requiredFeatures()->reset(attr->value());
00102         return true;
00103     } else if (attr->name() == SVGNames::requiredExtensionsAttr) {
00104         requiredExtensions()->reset(attr->value());
00105         return true;
00106     } else if (attr->name() == SVGNames::systemLanguageAttr) {
00107         systemLanguage()->reset(attr->value());
00108         return true;
00109     }
00110     
00111     return false;
00112 }
00113 
00114 bool SVGTests::isKnownAttribute(const QualifiedName& attrName)
00115 {
00116     return (attrName == SVGNames::requiredFeaturesAttr ||
00117             attrName == SVGNames::requiredExtensionsAttr ||
00118             attrName == SVGNames::systemLanguageAttr);
00119 }
00120 
00121 }
00122 
00123 #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