📄 dom_doc.cpp
字号:
}bool Document::isHTMLDocument() const{ if (impl) return ((DocumentImpl *)impl)->isHTMLDocument(); return 0;}Range Document::createRange(){ if (impl) return ((DocumentImpl *)impl)->createRange(); return 0;}NodeIterator Document::createNodeIterator(Node root, unsigned long whatToShow, NodeFilter filter, bool entityReferenceExpansion){ if (!impl) throw DOMException(DOMException::INVALID_STATE_ERR); int exceptioncode = 0; NodeIteratorImpl *r = static_cast<DocumentImpl*>(impl)->createNodeIterator(root.handle(), whatToShow,filter,entityReferenceExpansion,exceptioncode); if (exceptioncode) throw DOMException(exceptioncode); return r;}TreeWalker Document::createTreeWalker(Node root, unsigned long whatToShow, NodeFilter filter, bool entityReferenceExpansion){ if (!impl) throw DOMException(DOMException::INVALID_STATE_ERR); int exceptioncode = 0; TreeWalkerImpl *tw = static_cast<DocumentImpl *>(impl)->createTreeWalker( root.handle(), whatToShow, filter.handle(), entityReferenceExpansion, exceptioncode); if (exceptioncode) throw DOMException(exceptioncode); return tw;}Event Document::createEvent(const DOMString &eventType){ if (!impl) throw DOMException(DOMException::INVALID_STATE_ERR); int exceptioncode = 0; EventImpl *r = ((DocumentImpl *)impl)->createEvent(eventType,exceptioncode); if (exceptioncode) throw DOMException(exceptioncode); return r;}AbstractView Document::defaultView() const{ if (!impl) throw DOMException(DOMException::INVALID_STATE_ERR); return static_cast<DocumentImpl*>(impl)->defaultView();}StyleSheetList Document::styleSheets() const{ if (!impl) throw DOMException(DOMException::INVALID_STATE_ERR); return static_cast<DocumentImpl*>(impl)->styleSheets();}DOMString Document::preferredStylesheetSet(){ if (!impl) throw DOMException(DOMException::INVALID_STATE_ERR); return static_cast<DocumentImpl*>(impl)->preferredStylesheetSet();}DOMString Document::selectedStylesheetSet(){ if (!impl) throw DOMException(DOMException::INVALID_STATE_ERR); return static_cast<DocumentImpl*>(impl)->selectedStylesheetSet();}void Document::setSelectedStylesheetSet(const DOMString& s){ if (!impl) throw DOMException(DOMException::INVALID_STATE_ERR); static_cast<DocumentImpl*>(impl)->setSelectedStylesheetSet(s);}KHTMLView *Document::view() const{ if (!impl) return 0; return static_cast<DocumentImpl*>(impl)->view();}CSSStyleDeclaration Document::getOverrideStyle(const Element &elt, const DOMString &pseudoElt){ if (!impl) throw DOMException(DOMException::INVALID_STATE_ERR); int exceptioncode = 0; CSSStyleDeclarationImpl *r = ((DocumentImpl *)impl)->getOverrideStyle(static_cast<ElementImpl*>(elt.handle()),pseudoElt.implementation()); if (exceptioncode) throw DOMException(exceptioncode); return r;}bool Document::async() const{ if (!impl) throw DOMException(DOMException::INVALID_STATE_ERR); return static_cast<DocumentImpl*>( impl )->async( );}void Document::setAsync( bool b ){ if (!impl) throw DOMException(DOMException::INVALID_STATE_ERR); static_cast<DocumentImpl*>( impl )->setAsync( b );}void Document::abort(){ if (!impl) throw DOMException(DOMException::INVALID_STATE_ERR); static_cast<DocumentImpl*>( impl )->abort( );}void Document::load( const DOMString &uri ){ if (!impl) throw DOMException(DOMException::INVALID_STATE_ERR); static_cast<DocumentImpl*>( impl )->load( uri );}void Document::loadXML( const DOMString &source ){ if (!impl) throw DOMException(DOMException::INVALID_STATE_ERR); static_cast<DocumentImpl*>( impl )->loadXML( source );}bool Document::designMode() const { if (!impl) throw DOMException(DOMException::INVALID_STATE_ERR); return static_cast<DocumentImpl*>( impl )->designMode();}void Document::setDesignMode(bool enable) { if (!impl) throw DOMException(DOMException::INVALID_STATE_ERR); static_cast<DocumentImpl*>( impl )->setDesignMode( enable );}DOMString Document::completeURL(const DOMString& url){ if ( !impl ) return url; return static_cast<DocumentImpl*>( impl )->completeURL( url.string() );}DOMString Document::toString() const{ if (!impl) throw DOMException(DOMException::NOT_FOUND_ERR); return static_cast<DocumentImpl*>(impl)->toString();}void Document::updateRendering(){ if ( !impl ) return; static_cast<DocumentImpl*>( impl )->updateRendering( );}void Document::addStyleSheet(const StyleSheet &sheet){ if (!impl || sheet.isNull()) throw DOMException(DOMException::INVALID_STATE_ERR); int exceptioncode; static_cast<DocumentImpl*>( impl )->addStyleSheet( sheet.handle(), &exceptioncode ); if (exceptioncode) throw DOMException(exceptioncode);}void Document::removeStyleSheet(const StyleSheet &sheet){ if (!impl || sheet.isNull()) throw DOMException(DOMException::INVALID_STATE_ERR); int exceptioncode; static_cast<DocumentImpl*>( impl )->removeStyleSheet( sheet.handle(), &exceptioncode ); if (exceptioncode) throw DOMException(exceptioncode);}// ----------------------------------------------------------------------------DocumentFragment::DocumentFragment() : Node(){}DocumentFragment::DocumentFragment(const DocumentFragment &other) : Node(other){}DocumentFragment &DocumentFragment::operator = (const Node &other){ NodeImpl* ohandle = other.handle(); if ( impl != ohandle ) { if (!ohandle || ohandle->nodeType() != DOCUMENT_FRAGMENT_NODE) { if ( impl ) impl->deref(); impl = 0; } else { Node::operator =(other); } } return *this;}DocumentFragment &DocumentFragment::operator = (const DocumentFragment &other){ Node::operator =(other); return *this;}DocumentFragment::~DocumentFragment(){}DocumentFragment::DocumentFragment(DocumentFragmentImpl *i) : Node(i){}// ----------------------------------------------------------------------------DocumentType::DocumentType() : Node(){}DocumentType::DocumentType(const DocumentType &other) : Node(other){}DocumentType::DocumentType(DocumentTypeImpl *impl) : Node(impl){}DocumentType &DocumentType::operator = (const Node &other){ NodeImpl* ohandle = other.handle(); if ( impl != ohandle ) { if (!ohandle || ohandle->nodeType() != DOCUMENT_TYPE_NODE) { if ( impl ) impl->deref(); impl = 0; } else { Node::operator =(other); } } return *this;}DocumentType &DocumentType::operator = (const DocumentType &other){ Node::operator =(other); return *this;}DocumentType::~DocumentType(){}DOMString DocumentType::name() const{ if (!impl) return DOMString(); // ### enable throw DOMException(DOMException::NOT_FOUND_ERR); return static_cast<DocumentTypeImpl*>(impl)->name();}NamedNodeMap DocumentType::entities() const{ if (!impl) return 0; // ### enable throw DOMException(DOMException::NOT_FOUND_ERR); return static_cast<DocumentTypeImpl*>(impl)->entities();}NamedNodeMap DocumentType::notations() const{ if (!impl) return 0; // ### enable throw DOMException(DOMException::NOT_FOUND_ERR); return static_cast<DocumentTypeImpl*>(impl)->notations();}DOMString DocumentType::publicId() const{ if (!impl) throw DOMException(DOMException::NOT_FOUND_ERR); return static_cast<DocumentTypeImpl*>(impl)->publicId();}DOMString DocumentType::systemId() const{ if (!impl) throw DOMException(DOMException::NOT_FOUND_ERR); return static_cast<DocumentTypeImpl*>(impl)->systemId();}DOMString DocumentType::internalSubset() const{ if (!impl) throw DOMException(DOMException::NOT_FOUND_ERR); return static_cast<DocumentTypeImpl*>(impl)->internalSubset();}} // namespace
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -