KHTML
dom_doc.cpp
Go to the documentation of this file.
00001 /* 00002 * This file is part of the DOM implementation for KDE. 00003 * 00004 * Copyright 1999 Lars Knoll (knoll@kde.org) 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Library General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Library General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Library General Public License 00017 * along with this library; see the file COPYING.LIB. If not, write to 00018 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 * 00021 */ 00022 00023 #include "dom/dom_exception.h" 00024 #include "dom/dom_xml.h" 00025 #include "dom/dom2_range.h" 00026 #include "dom/dom2_events.h" 00027 #include "dom/dom2_views.h" 00028 #include "dom/dom2_traversal.h" 00029 #include "dom/html_document.h" 00030 #include "html/html_documentimpl.h" 00031 00032 #include "xml/dom_docimpl.h" 00033 #include "xml/dom_elementimpl.h" 00034 00035 #include <kdebug.h> 00036 00037 namespace DOM { 00038 00039 DOMImplementation::DOMImplementation() 00040 { 00041 impl = 0; 00042 } 00043 00044 DOMImplementation::DOMImplementation(const DOMImplementation &other) 00045 { 00046 impl = other.impl; 00047 if (impl) impl->ref(); 00048 } 00049 00050 DOMImplementation::DOMImplementation(DOMImplementationImpl *i) 00051 { 00052 impl = i; 00053 if (impl) impl->ref(); 00054 } 00055 00056 DOMImplementation &DOMImplementation::operator = (const DOMImplementation &other) 00057 { 00058 if ( impl != other.impl ) { 00059 if (impl) impl->deref(); 00060 impl = other.impl; 00061 if (impl) impl->ref(); 00062 } 00063 return *this; 00064 } 00065 00066 DOMImplementation::~DOMImplementation() 00067 { 00068 if (impl) impl->deref(); 00069 } 00070 00071 bool DOMImplementation::hasFeature( const DOMString &feature, const DOMString &version ) 00072 { 00073 if (!impl) 00074 return false; // ### enable throw DOMException(DOMException::NOT_FOUND_ERR); 00075 00076 return impl->hasFeature(feature,version); 00077 } 00078 00079 DocumentType DOMImplementation::createDocumentType ( const DOMString &qualifiedName, 00080 const DOMString &publicId, 00081 const DOMString &systemId ) 00082 { 00083 if (!impl) 00084 throw DOMException(DOMException::NOT_FOUND_ERR); 00085 00086 int exceptioncode = 0; 00087 DocumentTypeImpl *r = impl->createDocumentType(qualifiedName, publicId, systemId, exceptioncode); 00088 if ( exceptioncode ) 00089 throw DOMException( exceptioncode ); 00090 return r; 00091 } 00092 00093 Document DOMImplementation::createDocument ( const DOMString &namespaceURI, 00094 const DOMString &qualifiedName, 00095 const DocumentType &doctype ) 00096 { 00097 if (!impl) 00098 throw DOMException(DOMException::NOT_FOUND_ERR); 00099 00100 int exceptioncode = 0; 00101 DocumentImpl *r = impl->createDocument(namespaceURI, qualifiedName, 00102 (DocumentTypeImpl*)doctype.handle(), 00103 0, exceptioncode ); 00104 if ( exceptioncode ) 00105 throw DOMException( exceptioncode ); 00106 return r; 00107 } 00108 00109 HTMLDocument DOMImplementation::createHTMLDocument( const DOMString& title ) 00110 { 00111 if (!impl) throw DOMException(DOMException::NOT_FOUND_ERR); 00112 return static_cast<DOMImplementationImpl*>(impl)->createHTMLDocument(title); 00113 } 00114 00115 DOMImplementation DOMImplementation::getInterface(const DOMString &feature) const 00116 { 00117 if (!impl) 00118 throw DOMException(DOMException::NOT_FOUND_ERR); 00119 00120 // This method is a no-op for us. 00121 return impl; 00122 } 00123 00124 CSSStyleSheet DOMImplementation::createCSSStyleSheet(const DOMString &title, const DOMString &media) 00125 { 00126 if (!impl) 00127 throw DOMException(DOMException::NOT_FOUND_ERR); 00128 00129 int exceptioncode = 0; 00130 CSSStyleSheetImpl *r = impl->createCSSStyleSheet(title.implementation(), media.implementation(), 00131 exceptioncode); 00132 if ( exceptioncode ) 00133 throw DOMException( exceptioncode ); 00134 return r; 00135 } 00136 00137 DOMImplementationImpl *DOMImplementation::handle() const 00138 { 00139 return impl; 00140 } 00141 00142 bool DOMImplementation::isNull() const 00143 { 00144 return (impl == 0); 00145 } 00146 00147 // ---------------------------------------------------------------------------- 00148 00149 Document::Document() 00150 : Node() 00151 { 00152 // we always want an implementation 00153 impl = DOMImplementationImpl::createDocument(); 00154 impl->ref(); 00155 } 00156 00157 Document::Document(bool create) 00158 : Node() 00159 { 00160 if(create) 00161 { 00162 impl = DOMImplementationImpl::createDocument(); 00163 impl->ref(); 00164 } 00165 else 00166 impl = 0; 00167 // kDebug(6090) << "Document::Document(bool)"; 00168 } 00169 00170 Document::Document(const Document &other) : Node(other) 00171 { 00172 // kDebug(6090) << "Document::Document(Document &)"; 00173 } 00174 00175 Document::Document(DocumentImpl *i) : Node(i) 00176 { 00177 // kDebug(6090) << "Document::Document(DocumentImpl)"; 00178 } 00179 00180 Document &Document::operator = (const Node &other) 00181 { 00182 NodeImpl* ohandle = other.handle(); 00183 if ( impl != ohandle ) { 00184 if (!ohandle || ohandle->nodeType() != DOCUMENT_NODE) { 00185 if ( impl ) impl->deref(); 00186 impl = 0; 00187 } else { 00188 Node::operator =(other); 00189 } 00190 } 00191 return *this; 00192 } 00193 00194 Document &Document::operator = (const Document &other) 00195 { 00196 Node::operator =(other); 00197 return *this; 00198 } 00199 00200 Document::~Document() 00201 { 00202 // kDebug(6090) << "Document::~Document\n"; 00203 } 00204 00205 DocumentType Document::doctype() const 00206 { 00207 if (impl) return ((DocumentImpl *)impl)->doctype(); 00208 return 0; 00209 } 00210 00211 DOMImplementation Document::implementation() const 00212 { 00213 if (impl) return ((DocumentImpl *)impl)->implementation(); 00214 return 0; 00215 } 00216 00217 Element Document::documentElement() const 00218 { 00219 if (impl) return ((DocumentImpl *)impl)->documentElement(); 00220 return 0; 00221 } 00222 00223 Element Document::createElement( const DOMString &tagName ) 00224 { 00225 if (!impl) 00226 throw DOMException(DOMException::NOT_FOUND_ERR); 00227 00228 int exceptioncode = 0; 00229 ElementImpl* r = ((DocumentImpl *)impl)->createElement(tagName, &exceptioncode); 00230 if ( exceptioncode ) 00231 throw DOMException( exceptioncode ); 00232 return r; 00233 } 00234 00235 Element Document::createElementNS( const DOMString &namespaceURI, const DOMString &qualifiedName ) 00236 { 00237 if (!impl) 00238 throw DOMException(DOMException::NOT_FOUND_ERR); 00239 00240 int exceptioncode = 0; 00241 ElementImpl* r = ((DocumentImpl *)impl)->createElementNS(namespaceURI,qualifiedName, &exceptioncode); 00242 if ( exceptioncode ) 00243 throw DOMException( exceptioncode ); 00244 return r; 00245 } 00246 00247 DocumentFragment Document::createDocumentFragment( ) 00248 { 00249 if (impl) return ((DocumentImpl *)impl)->createDocumentFragment(); 00250 return 0; 00251 } 00252 00253 Text Document::createTextNode( const DOMString &data ) 00254 { 00255 if (impl) return ((DocumentImpl *)impl)->createTextNode( data.implementation() ); 00256 return 0; 00257 } 00258 00259 Comment Document::createComment( const DOMString &data ) 00260 { 00261 if (impl) return ((DocumentImpl *)impl)->createComment( data.implementation() ); 00262 return 0; 00263 } 00264 00265 CDATASection Document::createCDATASection( const DOMString &data ) 00266 { 00267 // ### DOM1 spec says raise exception if html documents - what about XHTML documents? 00268 if (impl) return ((DocumentImpl *)impl)->createCDATASection( data.implementation() ); 00269 return 0; 00270 } 00271 00272 ProcessingInstruction Document::createProcessingInstruction( const DOMString &target, const DOMString &data ) 00273 { 00274 if (impl) return ((DocumentImpl *)impl)->createProcessingInstruction( target, data.implementation() ); 00275 return 0; 00276 } 00277 00278 Attr Document::createAttribute( const DOMString &name ) 00279 { 00280 if (!impl) throw DOMException(DOMException::NOT_FOUND_ERR); 00281 if (name.isNull()) throw DOMException(DOMException::NOT_FOUND_ERR); 00282 int exceptioncode = 0; 00283 AttrImpl* a = impl->document()->createAttribute(name, &exceptioncode); 00284 if ( exceptioncode ) 00285 throw DOMException( exceptioncode ); 00286 return a; 00287 } 00288 00289 Attr Document::createAttributeNS( const DOMString &namespaceURI, const DOMString &qualifiedName ) 00290 { 00291 if (!impl) throw DOMException(DOMException::NOT_FOUND_ERR); 00292 if (qualifiedName.isNull()) throw DOMException(DOMException::NAMESPACE_ERR); 00293 int exceptioncode = 0; 00294 AttrImpl* a = impl->document()->createAttributeNS(namespaceURI, qualifiedName, &exceptioncode); 00295 if ( exceptioncode ) 00296 throw DOMException( exceptioncode ); 00297 return a; 00298 } 00299 00300 EntityReference Document::createEntityReference( const DOMString &name ) 00301 { 00302 if (impl) return ((DocumentImpl *)impl)->createEntityReference( name ); 00303 return 0; 00304 } 00305 00306 Element Document::getElementById( const DOMString &elementId ) const 00307 { 00308 if(impl) return ((DocumentImpl *)impl)->getElementById( elementId ); 00309 return 0; 00310 } 00311 00312 NodeList Document::getElementsByTagName( const DOMString &tagName ) 00313 { 00314 if (!impl) return 0; 00315 return impl->getElementsByTagName( tagName ); 00316 } 00317 00318 NodeList Document::getElementsByTagNameNS( const DOMString &namespaceURI, const DOMString &localName ) 00319 { 00320 if (!impl) return 0; 00321 return impl->getElementsByTagNameNS( namespaceURI, localName ); 00322 } 00323 00324 NodeList Document::getElementsByClassName( const DOMString& className ) 00325 { 00326 if (!impl) return 0; 00327 return impl->getElementsByClassName( className ); 00328 } 00329 00330 Node Document::importNode( const Node & importedNode, bool deep ) 00331 { 00332 if (!impl) 00333 throw DOMException(DOMException::INVALID_STATE_ERR); 00334 00335 int exceptioncode = 0; 00336 NodeImpl *r = static_cast<DocumentImpl*>(impl)->importNode(importedNode.handle(), deep, exceptioncode); 00337 if (exceptioncode) 00338 throw DOMException(exceptioncode); 00339 return r; 00340 } 00341 00342 bool Document::isHTMLDocument() const 00343 { 00344 if (impl) return ((DocumentImpl *)impl)->isHTMLDocument(); 00345 return 0; 00346 } 00347 00348 Range Document::createRange() 00349 { 00350 if (impl) return ((DocumentImpl *)impl)->createRange(); 00351 return 0; 00352 } 00353 00354 NodeIterator Document::createNodeIterator(Node root, unsigned long whatToShow, 00355 NodeFilter filter, bool entityReferenceExpansion) 00356 { 00357 if (!impl) 00358 throw DOMException(DOMException::INVALID_STATE_ERR); 00359 00360 int exceptioncode = 0; 00361 NodeIteratorImpl *r = static_cast<DocumentImpl*>(impl)->createNodeIterator(root.handle(), 00362 whatToShow,filter.handle(),entityReferenceExpansion,exceptioncode); 00363 if (exceptioncode) 00364 throw DOMException(exceptioncode); 00365 return r; 00366 } 00367 00368 TreeWalker Document::createTreeWalker(Node root, unsigned long whatToShow, NodeFilter filter, 00369 bool entityReferenceExpansion) 00370 { 00371 if (!impl) 00372 throw DOMException(DOMException::INVALID_STATE_ERR); 00373 00374 int exceptioncode = 0; 00375 00376 TreeWalkerImpl *tw = static_cast<DocumentImpl *>(impl)->createTreeWalker( 00377 root.handle(), whatToShow, filter.handle(), entityReferenceExpansion, exceptioncode); 00378 if (exceptioncode) 00379 throw DOMException(exceptioncode); 00380 00381 return tw; 00382 } 00383 00384 Event Document::createEvent(const DOMString &eventType) 00385 { 00386 if (!impl) 00387 throw DOMException(DOMException::INVALID_STATE_ERR); 00388 00389 int exceptioncode = 0; 00390 EventImpl *r = ((DocumentImpl *)impl)->createEvent(eventType,exceptioncode); 00391 if (exceptioncode) 00392 throw DOMException(exceptioncode); 00393 return r; 00394 } 00395 00396 AbstractView Document::defaultView() const 00397 { 00398 if (!impl) 00399 throw DOMException(DOMException::INVALID_STATE_ERR); 00400 00401 return static_cast<DocumentImpl*>(impl)->defaultView(); 00402 } 00403 00404 StyleSheetList Document::styleSheets() const 00405 { 00406 if (!impl) 00407 throw DOMException(DOMException::INVALID_STATE_ERR); 00408 00409 return static_cast<DocumentImpl*>(impl)->styleSheets(); 00410 } 00411 00412 DOMString Document::preferredStylesheetSet() 00413 { 00414 if (!impl) 00415 throw DOMException(DOMException::INVALID_STATE_ERR); 00416 00417 return static_cast<DocumentImpl*>(impl)->preferredStylesheetSet(); 00418 } 00419 00420 DOMString Document::selectedStylesheetSet() 00421 { 00422 if (!impl) 00423 throw DOMException(DOMException::INVALID_STATE_ERR); 00424 00425 return static_cast<DocumentImpl*>(impl)->selectedStylesheetSet(); 00426 } 00427 00428 void Document::setSelectedStylesheetSet(const DOMString& s) 00429 { 00430 if (!impl) 00431 throw DOMException(DOMException::INVALID_STATE_ERR); 00432 00433 static_cast<DocumentImpl*>(impl)->setSelectedStylesheetSet(s); 00434 } 00435 00436 00437 KHTMLView *Document::view() const 00438 { 00439 if (!impl) return 0; 00440 00441 return static_cast<DocumentImpl*>(impl)->view(); 00442 } 00443 00444 CSSStyleDeclaration Document::getOverrideStyle(const Element &elt, const DOMString &pseudoElt) 00445 { 00446 if (!impl) 00447 throw DOMException(DOMException::INVALID_STATE_ERR); 00448 00449 CSSStyleDeclarationImpl *r = ((DocumentImpl *)impl)->getOverrideStyle(static_cast<ElementImpl*>(elt.handle()),pseudoElt.implementation()); 00450 return r; 00451 } 00452 00453 bool Document::execCommand(const DOMString &command, bool userInterface, const DOMString &value) 00454 { 00455 if (!impl) 00456 throw DOMException(DOMException::NOT_FOUND_ERR); 00457 00458 return static_cast<DocumentImpl*>(impl)->execCommand(command, userInterface, value); 00459 } 00460 00461 bool Document::queryCommandEnabled(const DOMString &command) 00462 { 00463 if (!impl) 00464 throw DOMException(DOMException::NOT_FOUND_ERR); 00465 00466 return static_cast<DocumentImpl*>(impl)->queryCommandEnabled(command); 00467 } 00468 00469 bool Document::queryCommandIndeterm(const DOMString &command) 00470 { 00471 if (!impl) 00472 throw DOMException(DOMException::NOT_FOUND_ERR); 00473 00474 return static_cast<DocumentImpl*>(impl)->queryCommandIndeterm(command); 00475 } 00476 00477 bool Document::queryCommandState(const DOMString &command) 00478 { 00479 if (!impl) 00480 throw DOMException(DOMException::NOT_FOUND_ERR); 00481 00482 return static_cast<DocumentImpl*>(impl)->queryCommandState(command); 00483 } 00484 00485 bool Document::queryCommandSupported(const DOMString &command) 00486 { 00487 if (!impl) 00488 throw DOMException(DOMException::NOT_FOUND_ERR); 00489 00490 return static_cast<DocumentImpl*>(impl)->queryCommandSupported(command); 00491 } 00492 00493 DOMString Document::queryCommandValue(const DOMString &command) 00494 { 00495 if (!impl) 00496 throw DOMException(DOMException::NOT_FOUND_ERR); 00497 00498 return static_cast<DocumentImpl*>(impl)->queryCommandValue(command); 00499 } 00500 00501 bool Document::async() const 00502 { 00503 if (!impl) 00504 throw DOMException(DOMException::INVALID_STATE_ERR); 00505 00506 return static_cast<DocumentImpl*>( impl )->async( ); 00507 } 00508 00509 void Document::setAsync( bool b ) 00510 { 00511 if (!impl) 00512 throw DOMException(DOMException::INVALID_STATE_ERR); 00513 00514 static_cast<DocumentImpl*>( impl )->setAsync( b ); 00515 } 00516 00517 void Document::abort() 00518 { 00519 if (!impl) 00520 throw DOMException(DOMException::INVALID_STATE_ERR); 00521 00522 00523 static_cast<DocumentImpl*>( impl )->abort( ); 00524 } 00525 00526 void Document::load( const DOMString &uri ) 00527 { 00528 if (!impl) 00529 throw DOMException(DOMException::INVALID_STATE_ERR); 00530 00531 static_cast<DocumentImpl*>( impl )->load( uri ); 00532 } 00533 00534 void Document::loadXML( const DOMString &source ) 00535 { 00536 if (!impl) 00537 throw DOMException(DOMException::INVALID_STATE_ERR); 00538 00539 00540 static_cast<DocumentImpl*>( impl )->loadXML( source ); 00541 } 00542 00543 Element Document::querySelector(const DOMString& query) const 00544 { 00545 int ec = 0; 00546 if (!impl) throw DOMException(DOMException::NOT_FOUND_ERR); 00547 Element res = impl->querySelector(query, ec).get(); 00548 if (ec) 00549 throw DOMException(ec); 00550 return res; 00551 } 00552 00553 NodeList Document::querySelectorAll(const DOMString& query) const 00554 { 00555 int ec = 0; 00556 if (!impl) throw DOMException(DOMException::NOT_FOUND_ERR); 00557 NodeList res = impl->querySelectorAll(query, ec).get(); 00558 if (ec) 00559 throw DOMException(ec); 00560 return res; 00561 } 00562 00563 bool Document::designMode() const { 00564 if (!impl) 00565 throw DOMException(DOMException::INVALID_STATE_ERR); 00566 00567 return static_cast<DocumentImpl*>( impl )->designMode(); 00568 } 00569 00570 void Document::setDesignMode(bool enable) { 00571 if (!impl) 00572 throw DOMException(DOMException::INVALID_STATE_ERR); 00573 00574 static_cast<DocumentImpl*>( impl )->setDesignMode( enable ); 00575 } 00576 00577 DOMString Document::completeURL(const DOMString& url) 00578 { 00579 if ( !impl ) return url; 00580 return static_cast<DocumentImpl*>( impl )->completeURL( url.string() ); 00581 } 00582 00583 DOMString Document::toString() const 00584 { 00585 if (!impl) 00586 throw DOMException(DOMException::NOT_FOUND_ERR); 00587 00588 return static_cast<DocumentImpl*>(impl)->toString(); 00589 } 00590 00591 void Document::updateRendering() 00592 { 00593 if ( !impl ) return; 00594 static_cast<DocumentImpl*>( impl )->updateRendering( ); 00595 } 00596 00597 void Document::addStyleSheet(const StyleSheet &sheet) 00598 { 00599 if (!impl || sheet.isNull()) 00600 throw DOMException(DOMException::INVALID_STATE_ERR); 00601 00602 int exceptioncode; 00603 static_cast<DocumentImpl*>( impl )->addStyleSheet( sheet.handle(), &exceptioncode ); 00604 if (exceptioncode) 00605 throw DOMException(exceptioncode); 00606 } 00607 00608 void Document::removeStyleSheet(const StyleSheet &sheet) 00609 { 00610 if (!impl || sheet.isNull()) 00611 throw DOMException(DOMException::INVALID_STATE_ERR); 00612 00613 int exceptioncode; 00614 static_cast<DocumentImpl*>( impl )->removeStyleSheet( sheet.handle(), &exceptioncode ); 00615 if (exceptioncode) 00616 throw DOMException(exceptioncode); 00617 } 00618 00619 // ---------------------------------------------------------------------------- 00620 00621 DocumentFragment::DocumentFragment() : Node() 00622 { 00623 } 00624 00625 DocumentFragment::DocumentFragment(const DocumentFragment &other) : Node(other) 00626 { 00627 } 00628 00629 DocumentFragment &DocumentFragment::operator = (const Node &other) 00630 { 00631 NodeImpl* ohandle = other.handle(); 00632 if ( impl != ohandle ) { 00633 if (!ohandle || ohandle->nodeType() != DOCUMENT_FRAGMENT_NODE) { 00634 if ( impl ) impl->deref(); 00635 impl = 0; 00636 } else { 00637 Node::operator =(other); 00638 } 00639 } 00640 return *this; 00641 } 00642 00643 DocumentFragment &DocumentFragment::operator = (const DocumentFragment &other) 00644 { 00645 Node::operator =(other); 00646 return *this; 00647 } 00648 00649 DocumentFragment::~DocumentFragment() 00650 { 00651 } 00652 00653 Element DocumentFragment::querySelector(const DOMString& query) const 00654 { 00655 int ec = 0; 00656 if (!impl) throw DOMException(DOMException::NOT_FOUND_ERR); 00657 Element res = impl->querySelector(query, ec).get(); 00658 if (ec) 00659 throw DOMException(ec); 00660 return res; 00661 } 00662 00663 NodeList DocumentFragment::querySelectorAll(const DOMString& query) const 00664 { 00665 int ec = 0; 00666 if (!impl) throw DOMException(DOMException::NOT_FOUND_ERR); 00667 NodeList res = impl->querySelectorAll(query, ec).get(); 00668 if (ec) 00669 throw DOMException(ec); 00670 return res; 00671 } 00672 00673 DocumentFragment::DocumentFragment(DocumentFragmentImpl *i) : Node(i) 00674 { 00675 } 00676 00677 // ---------------------------------------------------------------------------- 00678 00679 DocumentType::DocumentType() 00680 : Node() 00681 { 00682 } 00683 00684 DocumentType::DocumentType(const DocumentType &other) 00685 : Node(other) 00686 { 00687 } 00688 00689 DocumentType::DocumentType(DocumentTypeImpl *impl) : Node(impl) 00690 { 00691 } 00692 00693 DocumentType &DocumentType::operator = (const Node &other) 00694 { 00695 NodeImpl* ohandle = other.handle(); 00696 if ( impl != ohandle ) { 00697 if (!ohandle || ohandle->nodeType() != DOCUMENT_TYPE_NODE) { 00698 if ( impl ) impl->deref(); 00699 impl = 0; 00700 } else { 00701 Node::operator =(other); 00702 } 00703 } 00704 return *this; 00705 } 00706 00707 DocumentType &DocumentType::operator = (const DocumentType &other) 00708 { 00709 Node::operator =(other); 00710 return *this; 00711 } 00712 00713 DocumentType::~DocumentType() 00714 { 00715 } 00716 00717 DOMString DocumentType::name() const 00718 { 00719 if (!impl) 00720 return DOMString(); // ### enable throw DOMException(DOMException::NOT_FOUND_ERR); 00721 00722 return static_cast<DocumentTypeImpl*>(impl)->name(); 00723 } 00724 00725 NamedNodeMap DocumentType::entities() const 00726 { 00727 if (!impl) 00728 return 0; // ### enable throw DOMException(DOMException::NOT_FOUND_ERR); 00729 00730 return static_cast<DocumentTypeImpl*>(impl)->entities(); 00731 } 00732 00733 NamedNodeMap DocumentType::notations() const 00734 { 00735 if (!impl) 00736 return 0; // ### enable throw DOMException(DOMException::NOT_FOUND_ERR); 00737 00738 return static_cast<DocumentTypeImpl*>(impl)->notations(); 00739 } 00740 00741 DOMString DocumentType::publicId() const 00742 { 00743 if (!impl) 00744 throw DOMException(DOMException::NOT_FOUND_ERR); 00745 00746 return static_cast<DocumentTypeImpl*>(impl)->publicId(); 00747 } 00748 00749 DOMString DocumentType::systemId() const 00750 { 00751 if (!impl) 00752 throw DOMException(DOMException::NOT_FOUND_ERR); 00753 00754 return static_cast<DocumentTypeImpl*>(impl)->systemId(); 00755 } 00756 00757 DOMString DocumentType::internalSubset() const 00758 { 00759 if (!impl) 00760 throw DOMException(DOMException::NOT_FOUND_ERR); 00761 00762 return static_cast<DocumentTypeImpl*>(impl)->internalSubset(); 00763 } 00764 00765 } // namespace
KDE 4.6 API Reference