2008-11-04 Anders Carlsson <andersca@apple.com>
[webkit/qt.git] / WebCore / dom / ProcessingInstruction.h
blobe16f7001b6e305d07caa229021e111e936305625
1 /*
2 * This file is part of the DOM implementation for KDE.
4 * Copyright (C) 2000 Peter Kelly (pmk@post.com)
5 * Copyright (C) 2006 Apple Computer, Inc.
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.
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.
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.
24 #ifndef ProcessingInstruction_h
25 #define ProcessingInstruction_h
27 #include "CachedResourceClient.h"
28 #include "CachedResourceHandle.h"
29 #include "ContainerNode.h"
31 namespace WebCore {
33 class StyleSheet;
34 class CSSStyleSheet;
36 class ProcessingInstruction : public ContainerNode, private CachedResourceClient
38 public:
39 ProcessingInstruction(Document*);
40 ProcessingInstruction(Document*, const String& target, const String& data);
41 virtual ~ProcessingInstruction();
43 // DOM methods & attributes for Notation
44 String target() const { return m_target; }
45 String data() const { return m_data; }
46 void setData(const String&, ExceptionCode&);
48 virtual String nodeName() const;
49 virtual NodeType nodeType() const;
50 virtual String nodeValue() const;
51 virtual void setNodeValue(const String&, ExceptionCode&);
52 virtual PassRefPtr<Node> cloneNode(bool deep);
53 virtual bool childTypeAllowed(NodeType);
54 virtual bool offsetInCharacters() const;
55 virtual int maxCharacterOffset() const;
57 virtual void insertedIntoDocument();
58 virtual void removedFromDocument();
59 void setCreatedByParser(bool createdByParser) { m_createdByParser = createdByParser; }
60 virtual void finishParsingChildren();
62 // Other methods (not part of DOM)
63 String localHref() const { return m_localHref; }
64 StyleSheet* sheet() const { return m_sheet.get(); }
65 void checkStyleSheet();
66 virtual void setCSSStyleSheet(const String& url, const String& charset, const CachedCSSStyleSheet*);
67 #if ENABLE(XSLT)
68 virtual void setXSLStyleSheet(const String& url, const String& sheet);
69 #endif
70 void setCSSStyleSheet(PassRefPtr<CSSStyleSheet>);
71 bool isLoading() const;
72 virtual bool sheetLoaded();
74 #if ENABLE(XSLT)
75 bool isXSL() const { return m_isXSL; }
76 #endif
78 virtual void getSubresourceAttributeStrings(Vector<String>&) const;
80 private:
81 void parseStyleSheet(const String& sheet);
83 String m_target;
84 String m_data;
85 String m_localHref;
86 String m_title;
87 String m_media;
88 CachedResourceHandle<CachedResource> m_cachedSheet;
89 RefPtr<StyleSheet> m_sheet;
90 bool m_loading;
91 bool m_alternate;
92 bool m_createdByParser;
93 #if ENABLE(XSLT)
94 bool m_isXSL;
95 #endif
98 } //namespace
100 #endif