1 /* 2 * This file is part of the DOM implementation for KDE. 3 * 4 * Copyright (C) 2000 Peter Kelly (pmk@post.com) 5 * Copyright (C) 2006 Apple Computer, Inc. 6 * 7 * This library is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Library General Public 9 * License as published by the Free Software Foundation; either 10 * version 2 of the License, or (at your option) any later version. 11 * 12 * This library is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * Library General Public License for more details. 16 * 17 * You should have received a copy of the GNU Library General Public License 18 * along with this library; see the file COPYING.LIB. If not, write to 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 * Boston, MA 02110-1301, USA. 21 * 22 */ 23 24 #ifndef ProcessingInstruction_h 25 #define ProcessingInstruction_h 26 27 #include "CachedResourceClient.h" 28 #include "CachedResourceHandle.h" 29 #include "ContainerNode.h" 30 31 namespace WebCore { 32 33 class StyleSheet; 34 class CSSStyleSheet; 35 36 class ProcessingInstruction : public ContainerNode, private CachedResourceClient { 37 public: 38 ProcessingInstruction(Document*); 39 ProcessingInstruction(Document*, const String& target, const String& data); 40 virtual ~ProcessingInstruction(); 41 42 // DOM methods & attributes for Notation target()43 String target() const { return m_target; } data()44 String data() const { return m_data; } 45 void setData(const String&, ExceptionCode&); 46 47 virtual String nodeName() const; 48 virtual NodeType nodeType() const; 49 virtual String nodeValue() const; 50 virtual void setNodeValue(const String&, ExceptionCode&); 51 virtual PassRefPtr<Node> cloneNode(bool deep); 52 virtual bool childTypeAllowed(NodeType); 53 virtual bool offsetInCharacters() const; 54 virtual int maxCharacterOffset() const; 55 56 virtual void insertedIntoDocument(); 57 virtual void removedFromDocument(); setCreatedByParser(bool createdByParser)58 void setCreatedByParser(bool createdByParser) { m_createdByParser = createdByParser; } 59 virtual void finishParsingChildren(); 60 61 // Other methods (not part of DOM) localHref()62 String localHref() const { return m_localHref; } sheet()63 StyleSheet* sheet() const { return m_sheet.get(); } 64 void checkStyleSheet(); 65 virtual void setCSSStyleSheet(const String& url, const String& charset, const CachedCSSStyleSheet*); 66 #if ENABLE(XSLT) 67 virtual void setXSLStyleSheet(const String& url, const String& sheet); 68 #endif 69 void setCSSStyleSheet(PassRefPtr<CSSStyleSheet>); 70 bool isLoading() const; 71 virtual bool sheetLoaded(); 72 73 #if ENABLE(XSLT) isXSL()74 bool isXSL() const { return m_isXSL; } 75 #endif 76 77 virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const; 78 79 private: 80 void parseStyleSheet(const String& sheet); 81 82 String m_target; 83 String m_data; 84 String m_localHref; 85 String m_title; 86 String m_media; 87 CachedResourceHandle<CachedResource> m_cachedSheet; 88 RefPtr<StyleSheet> m_sheet; 89 bool m_loading; 90 bool m_alternate; 91 bool m_createdByParser; 92 #if ENABLE(XSLT) 93 bool m_isXSL; 94 #endif 95 }; 96 97 } //namespace 98 99 #endif 100