2 * This file is part of the DOM implementation for KDE.
4 * Copyright 1999 Lars Knoll (knoll@kde.org)
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.
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.
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.
24 #include "dom/dom_xml.h"
25 #include "dom/dom_exception.h"
26 #include "xml/dom_textimpl.h"
27 #include "xml/dom_xmlimpl.h"
31 CDATASection::CDATASection()
35 CDATASection::CDATASection(const CDATASection
&) : Text()
39 CDATASection
&CDATASection::operator = (const Node
&other
)
41 NodeImpl
* ohandle
= other
.handle();
42 if ( impl
!= ohandle
) {
43 if (!ohandle
|| ohandle
->nodeType() != CDATA_SECTION_NODE
) {
44 if ( impl
) impl
->deref();
47 Node::operator =(other
);
53 CDATASection
&CDATASection::operator = (const CDATASection
&other
)
55 Node::operator =(other
);
59 CDATASection::~CDATASection()
63 CDATASection::CDATASection(CDATASectionImpl
*i
) : Text(i
)
67 // ----------------------------------------------------------------------------
72 Entity::Entity(const Entity
&) : Node()
76 Entity
&Entity::operator = (const Node
&other
)
78 NodeImpl
* ohandle
= other
.handle();
79 if ( impl
!= ohandle
) {
80 if (!ohandle
|| ohandle
->nodeType() != ENTITY_NODE
) {
81 if ( impl
) impl
->deref();
84 Node::operator =(other
);
90 Entity
&Entity::operator = (const Entity
&other
)
92 Node::operator =(other
);
100 DOMString
Entity::publicId() const
103 return DOMString(); // ### enable throw DOMException(DOMException::NOT_FOUND_ERR);
105 return ((EntityImpl
*)impl
)->publicId();
108 DOMString
Entity::systemId() const
111 return DOMString(); // ### enable throw DOMException(DOMException::NOT_FOUND_ERR);
113 return ((EntityImpl
*)impl
)->systemId();
116 DOMString
Entity::notationName() const
119 return DOMString(); // ### enable throw DOMException(DOMException::NOT_FOUND_ERR);
121 return ((EntityImpl
*)impl
)->notationName();
124 Entity::Entity(EntityImpl
*i
) : Node(i
)
128 // ----------------------------------------------------------------------------
130 EntityReference::EntityReference()
134 EntityReference::EntityReference(const EntityReference
&) : Node()
138 EntityReference
&EntityReference::operator = (const Node
&other
)
140 NodeImpl
* ohandle
= other
.handle();
141 if ( impl
!= ohandle
) {
142 if (!ohandle
|| ohandle
->nodeType() != ENTITY_REFERENCE_NODE
) {
143 if ( impl
) impl
->deref();
146 Node::operator =(other
);
152 EntityReference
&EntityReference::operator = (const EntityReference
&other
)
154 Node::operator =(other
);
158 EntityReference::~EntityReference()
162 EntityReference::EntityReference(EntityReferenceImpl
*i
) : Node(i
)
166 // ----------------------------------------------------------------------------
172 Notation::Notation(const Notation
&) : Node()
176 Notation
&Notation::operator = (const Node
&other
)
178 NodeImpl
* ohandle
= other
.handle();
179 if ( impl
!= ohandle
) {
180 if (!ohandle
|| ohandle
->nodeType() != NOTATION_NODE
) {
181 if ( impl
) impl
->deref();
184 Node::operator =(other
);
190 Notation
&Notation::operator = (const Notation
&other
)
192 Node::operator =(other
);
196 Notation::~Notation()
200 DOMString
Notation::publicId() const
203 return DOMString(); // ### enable throw DOMException(DOMException::NOT_FOUND_ERR);
205 return ((NotationImpl
*)impl
)->publicId();
208 DOMString
Notation::systemId() const
211 return DOMString(); // ### enable throw DOMException(DOMException::NOT_FOUND_ERR);
213 return ((NotationImpl
*)impl
)->systemId();
216 Notation::Notation(NotationImpl
*i
) : Node(i
)
221 // ----------------------------------------------------------------------------
223 ProcessingInstruction::ProcessingInstruction()
227 ProcessingInstruction::ProcessingInstruction(const ProcessingInstruction
&)
232 ProcessingInstruction
&ProcessingInstruction::operator = (const Node
&other
)
234 NodeImpl
* ohandle
= other
.handle();
235 if ( impl
!= ohandle
) {
236 if (!ohandle
|| ohandle
->nodeType() != PROCESSING_INSTRUCTION_NODE
) {
237 if ( impl
) impl
->deref();
240 Node::operator =(other
);
246 ProcessingInstruction
&ProcessingInstruction::operator = (const ProcessingInstruction
&other
)
248 Node::operator =(other
);
252 ProcessingInstruction::~ProcessingInstruction()
256 DOMString
ProcessingInstruction::target() const
259 return DOMString(); // ### enable throw DOMException(DOMException::NOT_FOUND_ERR);
261 return ((ProcessingInstructionImpl
*)impl
)->target();
264 DOMString
ProcessingInstruction::data() const
267 return DOMString(); // ### enable throw DOMException(DOMException::NOT_FOUND_ERR);
269 return ((ProcessingInstructionImpl
*)impl
)->data();
272 void ProcessingInstruction::setData( const DOMString
&_data
)
275 return; // ### enable throw DOMException(DOMException::NOT_FOUND_ERR);
277 int exceptioncode
= 0;
278 ((ProcessingInstructionImpl
*)impl
)->setData(_data
, exceptioncode
);
280 throw DOMException(exceptioncode
);
283 ProcessingInstruction::ProcessingInstruction(ProcessingInstructionImpl
*i
) : Node(i
)
287 StyleSheet
ProcessingInstruction::sheet() const
289 if (impl
) return ((ProcessingInstructionImpl
*)impl
)->sheet();