1/* 2 * This file is part of the XSL implementation. 3 * 4 * Copyright (C) 2009 Jakub Wieczorek <faw217@gmail.com> 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Library General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Library General Public License for more details. 15 * 16 * You should have received a copy of the GNU Library General Public License 17 * along with this library; see the file COPYING.LIB. If not, write to 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * Boston, MA 02110-1301, USA. 20 */ 21 22#include "config.h" 23#include "XSLStyleSheet.h" 24 25#if ENABLE(XSLT) 26 27#include "DOMWindow.h" 28#include "Document.h" 29#include "Node.h" 30#include "NotImplemented.h" 31#include "XSLTProcessor.h" 32 33namespace WebCore { 34 35XSLStyleSheet::XSLStyleSheet(Node* parentNode, const String& originalURL, const KURL& finalURL, bool embedded) 36 : StyleSheet(parentNode, originalURL, finalURL) 37 , m_embedded(embedded) 38{ 39} 40 41XSLStyleSheet::~XSLStyleSheet() 42{ 43} 44 45bool XSLStyleSheet::isLoading() 46{ 47 notImplemented(); 48 return false; 49} 50 51void XSLStyleSheet::checkLoaded() 52{ 53 if (ownerNode()) 54 ownerNode()->sheetLoaded(); 55} 56 57void XSLStyleSheet::clearDocuments() 58{ 59 notImplemented(); 60} 61 62CachedResourceLoader* XSLStyleSheet::cachedResourceLoader() 63{ 64 Document* document = ownerDocument(); 65 if (!document) 66 return 0; 67 return document->cachedResourceLoader(); 68} 69 70bool XSLStyleSheet::parseString(const String& string, bool) 71{ 72 // FIXME: Fix QXmlQuery so that it allows compiling the stylesheet before setting the document 73 // to be transformed. This way we could not only check if the stylesheet is correct before using it 74 // but also turn XSLStyleSheet::sheetString() into XSLStyleSheet::query() that returns a QXmlQuery. 75 76 m_sheetString = string; 77 return !m_sheetString.isEmpty(); 78} 79 80void XSLStyleSheet::loadChildSheets() 81{ 82 notImplemented(); 83} 84 85void XSLStyleSheet::loadChildSheet(const String&) 86{ 87 notImplemented(); 88} 89 90Document* XSLStyleSheet::ownerDocument() 91{ 92 Node* node = ownerNode(); 93 return node ? node->document() : 0; 94} 95 96void XSLStyleSheet::setParentStyleSheet(XSLStyleSheet*) 97{ 98 notImplemented(); 99} 100 101void XSLStyleSheet::markAsProcessed() 102{ 103 notImplemented(); 104} 105 106} // namespace WebCore 107 108#endif // ENABLE(XSLT) 109