• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KHTML

  • khtml
  • dom
dom_doc.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the DOM implementation for KDE.
3 *
4 * Copyright 1999 Lars Knoll (knoll@kde.org)
5 *
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.
10 *
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.
15 *
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.
20 *
21 */
22
23#include "dom/dom_exception.h"
24#include "dom/dom_xml.h"
25#include "dom/dom2_range.h"
26#include "dom/dom2_events.h"
27#include "dom/dom2_views.h"
28#include "dom/dom2_traversal.h"
29#include "dom/html_document.h"
30#include "html/html_documentimpl.h"
31
32#include "xml/dom_docimpl.h"
33#include "xml/dom_elementimpl.h"
34
35#include <kdebug.h>
36
37namespace DOM {
38
39DOMImplementation::DOMImplementation()
40{
41 impl = 0;
42}
43
44DOMImplementation::DOMImplementation(const DOMImplementation &other)
45{
46 impl = other.impl;
47 if (impl) impl->ref();
48}
49
50DOMImplementation::DOMImplementation(DOMImplementationImpl *i)
51{
52 impl = i;
53 if (impl) impl->ref();
54}
55
56DOMImplementation &DOMImplementation::operator = (const DOMImplementation &other)
57{
58 if ( impl != other.impl ) {
59 if (impl) impl->deref();
60 impl = other.impl;
61 if (impl) impl->ref();
62 }
63 return *this;
64}
65
66DOMImplementation::~DOMImplementation()
67{
68 if (impl) impl->deref();
69}
70
71bool DOMImplementation::hasFeature( const DOMString &feature, const DOMString &version )
72{
73 if (!impl)
74 return false; // ### enable throw DOMException(DOMException::NOT_FOUND_ERR);
75
76 return impl->hasFeature(feature,version);
77}
78
79DocumentType DOMImplementation::createDocumentType ( const DOMString &qualifiedName,
80 const DOMString &publicId,
81 const DOMString &systemId )
82{
83 if (!impl)
84 throw DOMException(DOMException::NOT_FOUND_ERR);
85
86 int exceptioncode = 0;
87 DocumentTypeImpl *r = impl->createDocumentType(qualifiedName, publicId, systemId, exceptioncode);
88 if ( exceptioncode )
89 throw DOMException( exceptioncode );
90 return r;
91}
92
93Document DOMImplementation::createDocument ( const DOMString &namespaceURI,
94 const DOMString &qualifiedName,
95 const DocumentType &doctype )
96{
97 if (!impl)
98 throw DOMException(DOMException::NOT_FOUND_ERR);
99
100 int exceptioncode = 0;
101 DocumentImpl *r = impl->createDocument(namespaceURI, qualifiedName,
102 (DocumentTypeImpl*)doctype.handle(),
103 0, exceptioncode );
104 if ( exceptioncode )
105 throw DOMException( exceptioncode );
106 return r;
107}
108
109HTMLDocument DOMImplementation::createHTMLDocument( const DOMString& title )
110{
111 if (!impl) throw DOMException(DOMException::NOT_FOUND_ERR);
112 return static_cast<DOMImplementationImpl*>(impl)->createHTMLDocument(title);
113}
114
115DOMImplementation DOMImplementation::getInterface(const DOMString &/*feature*/) const
116{
117 if (!impl)
118 throw DOMException(DOMException::NOT_FOUND_ERR);
119
120 // This method is a no-op for us.
121 return impl;
122}
123
124CSSStyleSheet DOMImplementation::createCSSStyleSheet(const DOMString &title, const DOMString &media)
125{
126 if (!impl)
127 throw DOMException(DOMException::NOT_FOUND_ERR);
128
129 int exceptioncode = 0;
130 CSSStyleSheetImpl *r = impl->createCSSStyleSheet(title.implementation(), media.implementation(),
131 exceptioncode);
132 if ( exceptioncode )
133 throw DOMException( exceptioncode );
134 return r;
135}
136
137DOMImplementationImpl *DOMImplementation::handle() const
138{
139 return impl;
140}
141
142bool DOMImplementation::isNull() const
143{
144 return (impl == 0);
145}
146
147// ----------------------------------------------------------------------------
148
149Document::Document()
150 : Node()
151{
152 // we always want an implementation
153 impl = DOMImplementationImpl::createDocument();
154 impl->ref();
155}
156
157Document::Document(bool create)
158 : Node()
159{
160 if(create)
161 {
162 impl = DOMImplementationImpl::createDocument();
163 impl->ref();
164 }
165 else
166 impl = 0;
167// kDebug(6090) << "Document::Document(bool)";
168}
169
170Document::Document(const Document &other) : Node(other)
171{
172// kDebug(6090) << "Document::Document(Document &)";
173}
174
175Document::Document(DocumentImpl *i) : Node(i)
176{
177// kDebug(6090) << "Document::Document(DocumentImpl)";
178}
179
180Document &Document::operator = (const Node &other)
181{
182 NodeImpl* ohandle = other.handle();
183 if ( impl != ohandle ) {
184 if (!ohandle || ohandle->nodeType() != DOCUMENT_NODE) {
185 if ( impl ) impl->deref();
186 impl = 0;
187 } else {
188 Node::operator =(other);
189 }
190 }
191 return *this;
192}
193
194Document &Document::operator = (const Document &other)
195{
196 Node::operator =(other);
197 return *this;
198}
199
200Document::~Document()
201{
202// kDebug(6090) << "Document::~Document\n";
203}
204
205DocumentType Document::doctype() const
206{
207 if (impl) return ((DocumentImpl *)impl)->doctype();
208 return 0;
209}
210
211DOMImplementation Document::implementation() const
212{
213 if (impl) return ((DocumentImpl *)impl)->implementation();
214 return 0;
215}
216
217Element Document::documentElement() const
218{
219 if (impl) return ((DocumentImpl *)impl)->documentElement();
220 return 0;
221}
222
223Element Document::createElement( const DOMString &tagName )
224{
225 if (!impl)
226 throw DOMException(DOMException::NOT_FOUND_ERR);
227
228 int exceptioncode = 0;
229 ElementImpl* r = ((DocumentImpl *)impl)->createElement(tagName, &exceptioncode);
230 if ( exceptioncode )
231 throw DOMException( exceptioncode );
232 return r;
233}
234
235Element Document::createElementNS( const DOMString &namespaceURI, const DOMString &qualifiedName )
236{
237 if (!impl)
238 throw DOMException(DOMException::NOT_FOUND_ERR);
239
240 int exceptioncode = 0;
241 ElementImpl* r = ((DocumentImpl *)impl)->createElementNS(namespaceURI,qualifiedName, &exceptioncode);
242 if ( exceptioncode )
243 throw DOMException( exceptioncode );
244 return r;
245}
246
247DocumentFragment Document::createDocumentFragment( )
248{
249 if (impl) return ((DocumentImpl *)impl)->createDocumentFragment();
250 return 0;
251}
252
253Text Document::createTextNode( const DOMString &data )
254{
255 if (impl) return ((DocumentImpl *)impl)->createTextNode( data.implementation() );
256 return 0;
257}
258
259Comment Document::createComment( const DOMString &data )
260{
261 if (impl) return ((DocumentImpl *)impl)->createComment( data.implementation() );
262 return 0;
263}
264
265CDATASection Document::createCDATASection( const DOMString &data )
266{
267 if (!impl) {
268 return 0;
269 }
270 int exceptioncode = 0;
271 CDATASectionImpl *d = ((DocumentImpl *)impl)->createCDATASection(data.implementation(), exceptioncode);
272 if (exceptioncode) {
273 throw DOMException(exceptioncode);
274 }
275 return d;
276}
277
278ProcessingInstruction Document::createProcessingInstruction( const DOMString &target, const DOMString &data )
279{
280 if (impl) return ((DocumentImpl *)impl)->createProcessingInstruction( target, data.implementation() );
281 return 0;
282}
283
284Attr Document::createAttribute( const DOMString &name )
285{
286 if (!impl) throw DOMException(DOMException::NOT_FOUND_ERR);
287 if (name.isNull()) throw DOMException(DOMException::NOT_FOUND_ERR);
288 int exceptioncode = 0;
289 AttrImpl* a = impl->document()->createAttribute(name, &exceptioncode);
290 if ( exceptioncode )
291 throw DOMException( exceptioncode );
292 return a;
293}
294
295Attr Document::createAttributeNS( const DOMString &namespaceURI, const DOMString &qualifiedName )
296{
297 if (!impl) throw DOMException(DOMException::NOT_FOUND_ERR);
298 if (qualifiedName.isNull()) throw DOMException(DOMException::NAMESPACE_ERR);
299 int exceptioncode = 0;
300 AttrImpl* a = impl->document()->createAttributeNS(namespaceURI, qualifiedName, &exceptioncode);
301 if ( exceptioncode )
302 throw DOMException( exceptioncode );
303 return a;
304}
305
306EntityReference Document::createEntityReference( const DOMString &name )
307{
308 if (!impl) {
309 return 0;
310 }
311 int exceptioncode = 0;
312 EntityReferenceImpl *er = ((DocumentImpl *)impl)->createEntityReference(name, exceptioncode);
313 if (exceptioncode) {
314 throw DOMException(exceptioncode);
315 }
316 return er;
317}
318
319Element Document::getElementById( const DOMString &elementId ) const
320{
321 if(impl) return ((DocumentImpl *)impl)->getElementById( elementId );
322 return 0;
323}
324
325NodeList Document::getElementsByTagName( const DOMString &tagName )
326{
327 if (!impl) return 0;
328 return impl->getElementsByTagName( tagName );
329}
330
331NodeList Document::getElementsByTagNameNS( const DOMString &namespaceURI, const DOMString &localName )
332{
333 if (!impl) return 0;
334 return impl->getElementsByTagNameNS( namespaceURI, localName );
335}
336
337NodeList Document::getElementsByClassName( const DOMString& className )
338{
339 if (!impl) return 0;
340 return impl->getElementsByClassName( className );
341}
342
343Node Document::importNode( const Node & importedNode, bool deep )
344{
345 if (!impl)
346 throw DOMException(DOMException::INVALID_STATE_ERR);
347
348 int exceptioncode = 0;
349 NodeImpl *r = static_cast<DocumentImpl*>(impl)->importNode(importedNode.handle(), deep, exceptioncode);
350 if (exceptioncode)
351 throw DOMException(exceptioncode);
352 return r;
353}
354
355bool Document::isHTMLDocument() const
356{
357 if (impl) return ((DocumentImpl *)impl)->isHTMLDocument();
358 return 0;
359}
360
361Range Document::createRange()
362{
363 if (impl) return ((DocumentImpl *)impl)->createRange();
364 return 0;
365}
366
367NodeIterator Document::createNodeIterator(Node root, unsigned long whatToShow,
368 NodeFilter filter, bool entityReferenceExpansion)
369{
370 if (!impl)
371 throw DOMException(DOMException::INVALID_STATE_ERR);
372
373 int exceptioncode = 0;
374 NodeIteratorImpl *r = static_cast<DocumentImpl*>(impl)->createNodeIterator(root.handle(),
375 whatToShow,filter.handle(),entityReferenceExpansion,exceptioncode);
376 if (exceptioncode)
377 throw DOMException(exceptioncode);
378 return r;
379}
380
381TreeWalker Document::createTreeWalker(Node root, unsigned long whatToShow, NodeFilter filter,
382 bool entityReferenceExpansion)
383{
384 if (!impl)
385 throw DOMException(DOMException::INVALID_STATE_ERR);
386
387 int exceptioncode = 0;
388
389 TreeWalkerImpl *tw = static_cast<DocumentImpl *>(impl)->createTreeWalker(
390 root.handle(), whatToShow, filter.handle(), entityReferenceExpansion, exceptioncode);
391 if (exceptioncode)
392 throw DOMException(exceptioncode);
393
394 return tw;
395}
396
397Event Document::createEvent(const DOMString &eventType)
398{
399 if (!impl)
400 throw DOMException(DOMException::INVALID_STATE_ERR);
401
402 int exceptioncode = 0;
403 EventImpl *r = ((DocumentImpl *)impl)->createEvent(eventType,exceptioncode);
404 if (exceptioncode)
405 throw DOMException(exceptioncode);
406 return r;
407}
408
409AbstractView Document::defaultView() const
410{
411 if (!impl)
412 throw DOMException(DOMException::INVALID_STATE_ERR);
413
414 return static_cast<DocumentImpl*>(impl)->defaultView();
415}
416
417StyleSheetList Document::styleSheets() const
418{
419 if (!impl)
420 throw DOMException(DOMException::INVALID_STATE_ERR);
421
422 return static_cast<DocumentImpl*>(impl)->styleSheets();
423}
424
425DOMString Document::preferredStylesheetSet()
426{
427 if (!impl)
428 throw DOMException(DOMException::INVALID_STATE_ERR);
429
430 return static_cast<DocumentImpl*>(impl)->preferredStylesheetSet();
431}
432
433DOMString Document::selectedStylesheetSet()
434{
435 if (!impl)
436 throw DOMException(DOMException::INVALID_STATE_ERR);
437
438 return static_cast<DocumentImpl*>(impl)->selectedStylesheetSet();
439}
440
441void Document::setSelectedStylesheetSet(const DOMString& s)
442{
443 if (!impl)
444 throw DOMException(DOMException::INVALID_STATE_ERR);
445
446 static_cast<DocumentImpl*>(impl)->setSelectedStylesheetSet(s);
447}
448
449
450KHTMLView *Document::view() const
451{
452 if (!impl) return 0;
453
454 return static_cast<DocumentImpl*>(impl)->view();
455}
456
457CSSStyleDeclaration Document::getOverrideStyle(const Element &elt, const DOMString &pseudoElt)
458{
459 if (!impl)
460 throw DOMException(DOMException::INVALID_STATE_ERR);
461
462 CSSStyleDeclarationImpl *r = ((DocumentImpl *)impl)->getOverrideStyle(static_cast<ElementImpl*>(elt.handle()),pseudoElt.implementation());
463 return r;
464}
465
466bool Document::execCommand(const DOMString &command, bool userInterface, const DOMString &value)
467{
468 if (!impl)
469 throw DOMException(DOMException::NOT_FOUND_ERR);
470
471 return static_cast<DocumentImpl*>(impl)->execCommand(command, userInterface, value);
472}
473
474bool Document::queryCommandEnabled(const DOMString &command)
475{
476 if (!impl)
477 throw DOMException(DOMException::NOT_FOUND_ERR);
478
479 return static_cast<DocumentImpl*>(impl)->queryCommandEnabled(command);
480}
481
482bool Document::queryCommandIndeterm(const DOMString &command)
483{
484 if (!impl)
485 throw DOMException(DOMException::NOT_FOUND_ERR);
486
487 return static_cast<DocumentImpl*>(impl)->queryCommandIndeterm(command);
488}
489
490bool Document::queryCommandState(const DOMString &command)
491{
492 if (!impl)
493 throw DOMException(DOMException::NOT_FOUND_ERR);
494
495 return static_cast<DocumentImpl*>(impl)->queryCommandState(command);
496}
497
498bool Document::queryCommandSupported(const DOMString &command)
499{
500 if (!impl)
501 throw DOMException(DOMException::NOT_FOUND_ERR);
502
503 return static_cast<DocumentImpl*>(impl)->queryCommandSupported(command);
504}
505
506DOMString Document::queryCommandValue(const DOMString &command)
507{
508 if (!impl)
509 throw DOMException(DOMException::NOT_FOUND_ERR);
510
511 return static_cast<DocumentImpl*>(impl)->queryCommandValue(command);
512}
513
514bool Document::async() const
515{
516 if (!impl)
517 throw DOMException(DOMException::INVALID_STATE_ERR);
518
519 return static_cast<DocumentImpl*>( impl )->async( );
520}
521
522void Document::setAsync( bool b )
523{
524 if (!impl)
525 throw DOMException(DOMException::INVALID_STATE_ERR);
526
527 static_cast<DocumentImpl*>( impl )->setAsync( b );
528}
529
530void Document::abort()
531{
532 if (!impl)
533 throw DOMException(DOMException::INVALID_STATE_ERR);
534
535
536 static_cast<DocumentImpl*>( impl )->abort( );
537}
538
539void Document::load( const DOMString &uri )
540{
541 if (!impl)
542 throw DOMException(DOMException::INVALID_STATE_ERR);
543
544 static_cast<DocumentImpl*>( impl )->load( uri );
545}
546
547void Document::loadXML( const DOMString &source )
548{
549 if (!impl)
550 throw DOMException(DOMException::INVALID_STATE_ERR);
551
552
553 static_cast<DocumentImpl*>( impl )->loadXML( source );
554}
555
556Element Document::querySelector(const DOMString& query) const
557{
558 int ec = 0;
559 if (!impl) throw DOMException(DOMException::NOT_FOUND_ERR);
560 Element res = impl->querySelector(query, ec).get();
561 if (ec)
562 throw DOMException(ec);
563 return res;
564}
565
566NodeList Document::querySelectorAll(const DOMString& query) const
567{
568 int ec = 0;
569 if (!impl) throw DOMException(DOMException::NOT_FOUND_ERR);
570 NodeList res = impl->querySelectorAll(query, ec).get();
571 if (ec)
572 throw DOMException(ec);
573 return res;
574}
575
576bool Document::designMode() const {
577 if (!impl)
578 throw DOMException(DOMException::INVALID_STATE_ERR);
579
580 return static_cast<DocumentImpl*>( impl )->designMode();
581}
582
583void Document::setDesignMode(bool enable) {
584 if (!impl)
585 throw DOMException(DOMException::INVALID_STATE_ERR);
586
587 static_cast<DocumentImpl*>( impl )->setDesignMode( enable );
588}
589
590DOMString Document::completeURL(const DOMString& url)
591{
592 if ( !impl ) return url;
593 return static_cast<DocumentImpl*>( impl )->completeURL( url.string() );
594}
595
596DOMString Document::toString() const
597{
598 if (!impl)
599 throw DOMException(DOMException::NOT_FOUND_ERR);
600
601 return static_cast<DocumentImpl*>(impl)->toString();
602}
603
604void Document::updateRendering()
605{
606 if ( !impl ) return;
607 static_cast<DocumentImpl*>( impl )->updateRendering( );
608}
609
610void Document::addStyleSheet(const StyleSheet &sheet)
611{
612 if (!impl || sheet.isNull())
613 throw DOMException(DOMException::INVALID_STATE_ERR);
614
615 int exceptioncode;
616 static_cast<DocumentImpl*>( impl )->addStyleSheet( sheet.handle(), &exceptioncode );
617 if (exceptioncode)
618 throw DOMException(exceptioncode);
619}
620
621void Document::removeStyleSheet(const StyleSheet &sheet)
622{
623 if (!impl || sheet.isNull())
624 throw DOMException(DOMException::INVALID_STATE_ERR);
625
626 int exceptioncode;
627 static_cast<DocumentImpl*>( impl )->removeStyleSheet( sheet.handle(), &exceptioncode );
628 if (exceptioncode)
629 throw DOMException(exceptioncode);
630}
631
632// ----------------------------------------------------------------------------
633
634DocumentFragment::DocumentFragment() : Node()
635{
636}
637
638DocumentFragment::DocumentFragment(const DocumentFragment &other) : Node(other)
639{
640}
641
642DocumentFragment &DocumentFragment::operator = (const Node &other)
643{
644 NodeImpl* ohandle = other.handle();
645 if ( impl != ohandle ) {
646 if (!ohandle || ohandle->nodeType() != DOCUMENT_FRAGMENT_NODE) {
647 if ( impl ) impl->deref();
648 impl = 0;
649 } else {
650 Node::operator =(other);
651 }
652 }
653 return *this;
654}
655
656DocumentFragment &DocumentFragment::operator = (const DocumentFragment &other)
657{
658 Node::operator =(other);
659 return *this;
660}
661
662DocumentFragment::~DocumentFragment()
663{
664}
665
666Element DocumentFragment::querySelector(const DOMString& query) const
667{
668 int ec = 0;
669 if (!impl) throw DOMException(DOMException::NOT_FOUND_ERR);
670 Element res = impl->querySelector(query, ec).get();
671 if (ec)
672 throw DOMException(ec);
673 return res;
674}
675
676NodeList DocumentFragment::querySelectorAll(const DOMString& query) const
677{
678 int ec = 0;
679 if (!impl) throw DOMException(DOMException::NOT_FOUND_ERR);
680 NodeList res = impl->querySelectorAll(query, ec).get();
681 if (ec)
682 throw DOMException(ec);
683 return res;
684}
685
686DocumentFragment::DocumentFragment(DocumentFragmentImpl *i) : Node(i)
687{
688}
689
690// ----------------------------------------------------------------------------
691
692DocumentType::DocumentType()
693 : Node()
694{
695}
696
697DocumentType::DocumentType(const DocumentType &other)
698 : Node(other)
699{
700}
701
702DocumentType::DocumentType(DocumentTypeImpl *impl) : Node(impl)
703{
704}
705
706DocumentType &DocumentType::operator = (const Node &other)
707{
708 NodeImpl* ohandle = other.handle();
709 if ( impl != ohandle ) {
710 if (!ohandle || ohandle->nodeType() != DOCUMENT_TYPE_NODE) {
711 if ( impl ) impl->deref();
712 impl = 0;
713 } else {
714 Node::operator =(other);
715 }
716 }
717 return *this;
718}
719
720DocumentType &DocumentType::operator = (const DocumentType &other)
721{
722 Node::operator =(other);
723 return *this;
724}
725
726DocumentType::~DocumentType()
727{
728}
729
730DOMString DocumentType::name() const
731{
732 if (!impl)
733 return DOMString(); // ### enable throw DOMException(DOMException::NOT_FOUND_ERR);
734
735 return static_cast<DocumentTypeImpl*>(impl)->name();
736}
737
738NamedNodeMap DocumentType::entities() const
739{
740 if (!impl)
741 return 0; // ### enable throw DOMException(DOMException::NOT_FOUND_ERR);
742
743 return static_cast<DocumentTypeImpl*>(impl)->entities();
744}
745
746NamedNodeMap DocumentType::notations() const
747{
748 if (!impl)
749 return 0; // ### enable throw DOMException(DOMException::NOT_FOUND_ERR);
750
751 return static_cast<DocumentTypeImpl*>(impl)->notations();
752}
753
754DOMString DocumentType::publicId() const
755{
756 if (!impl)
757 throw DOMException(DOMException::NOT_FOUND_ERR);
758
759 return static_cast<DocumentTypeImpl*>(impl)->publicId();
760}
761
762DOMString DocumentType::systemId() const
763{
764 if (!impl)
765 throw DOMException(DOMException::NOT_FOUND_ERR);
766
767 return static_cast<DocumentTypeImpl*>(impl)->systemId();
768}
769
770DOMString DocumentType::internalSubset() const
771{
772 if (!impl)
773 throw DOMException(DOMException::NOT_FOUND_ERR);
774
775 return static_cast<DocumentTypeImpl*>(impl)->internalSubset();
776}
777
778} // namespace
DOM::AbstractView
Introduced in DOM Level 2.
Definition: dom2_views.h:41
DOM::Attr
The Attr interface represents an attribute in an Element object.
Definition: dom_element.h:89
DOM::CDATASection
CDATA sections are used to escape blocks of text containing characters that would otherwise be regard...
Definition: dom_xml.h:67
DOM::CSSStyleDeclaration
The CSSStyleDeclaration interface represents a single CSS declaration block .
Definition: css_value.h:61
DOM::CSSStyleSheet
The CSSStyleSheet interface is a concrete interface used to represent a CSS style sheet i....
Definition: css_stylesheet.h:219
DOM::Comment
This represents the content of a comment, i.e., all the characters between the starting ' <!...
Definition: dom_text.h:224
DOM::DOMException
DOM operations only raise exceptions in "exceptional" circumstances, i.e., when an operation is impos...
Definition: dom_exception.h:59
DOM::DOMException::NAMESPACE_ERR
@ NAMESPACE_ERR
Definition: dom_exception.h:86
DOM::DOMException::NOT_FOUND_ERR
@ NOT_FOUND_ERR
Definition: dom_exception.h:80
DOM::DOMException::INVALID_STATE_ERR
@ INVALID_STATE_ERR
Definition: dom_exception.h:83
DOM::DOMImplementation
The DOMImplementation interface provides a number of methods for performing operations that are indep...
Definition: dom_doc.h:78
DOM::DOMImplementation::operator=
DOMImplementation & operator=(const DOMImplementation &other)
Definition: dom_doc.cpp:56
DOM::DOMImplementation::createCSSStyleSheet
CSSStyleSheet createCSSStyleSheet(const DOMString &title, const DOMString &media)
Introduced in DOM Level 2 This method is from the DOMImplementationCSS interface.
Definition: dom_doc.cpp:124
DOM::DOMImplementation::~DOMImplementation
~DOMImplementation()
Definition: dom_doc.cpp:66
DOM::DOMImplementation::DOMImplementation
DOMImplementation()
Definition: dom_doc.cpp:39
DOM::DOMImplementation::createDocumentType
DocumentType createDocumentType(const DOMString &qualifiedName, const DOMString &publicId, const DOMString &systemId)
Introduced in DOM Level 2.
Definition: dom_doc.cpp:79
DOM::DOMImplementation::impl
DOMImplementationImpl * impl
Definition: dom_doc.h:228
DOM::DOMImplementation::isNull
bool isNull() const
Definition: dom_doc.cpp:142
DOM::DOMImplementation::hasFeature
bool hasFeature(const DOMString &feature, const DOMString &version)
Test if the DOM implementation implements a specific feature.
Definition: dom_doc.cpp:71
DOM::DOMImplementation::getInterface
DOMImplementation getInterface(const DOMString &feature) const
Introduced in DOM Level 3 This method makes available a DOMImplementation's specialized interface.
Definition: dom_doc.cpp:115
DOM::DOMImplementation::createHTMLDocument
HTMLDocument createHTMLDocument(const DOMString &title)
Introduced in DOM Level 2 This method is from the HTMLDOMImplementation interface.
Definition: dom_doc.cpp:109
DOM::DOMImplementation::handle
DOMImplementationImpl * handle() const
Definition: dom_doc.cpp:137
DOM::DOMImplementation::createDocument
Document createDocument(const DOMString &namespaceURI, const DOMString &qualifiedName, const DocumentType &doctype)
Introduced in DOM Level 2.
Definition: dom_doc.cpp:93
DOM::DOMString
This class implements the basic string we use in the DOM.
Definition: dom_string.h:44
DOM::DOMString::isNull
bool isNull() const
Definition: dom_string.h:121
DOM::DOMString::implementation
DOMStringImpl * implementation() const
Definition: dom_string.h:147
DOM::DOMString::string
QString string() const
Definition: dom_string.cpp:236
DOM::DocumentFragment
DocumentFragment is a "lightweight" or "minimal" Document object.
Definition: dom_doc.h:1042
DOM::DocumentFragment::DocumentFragment
DocumentFragment()
Definition: dom_doc.cpp:634
DOM::DocumentFragment::~DocumentFragment
~DocumentFragment()
Definition: dom_doc.cpp:662
DOM::DocumentFragment::operator=
DocumentFragment & operator=(const Node &other)
Definition: dom_doc.cpp:642
DOM::DocumentFragment::querySelectorAll
NodeList querySelectorAll(const DOMString &query) const
Introduced in Selectors Level 1.
Definition: dom_doc.cpp:676
DOM::DocumentFragment::querySelector
Element querySelector(const DOMString &query) const
Introduced in Selectors Level 1.
Definition: dom_doc.cpp:666
DOM::DocumentType
Each Document has a doctype attribute whose value is either null or a DocumentType object.
Definition: dom_doc.h:1100
DOM::DocumentType::systemId
DOMString systemId() const
Introduced in DOM Level 2.
Definition: dom_doc.cpp:762
DOM::DocumentType::notations
NamedNodeMap notations() const
A NamedNodeMap containing the notations declared in the DTD.
Definition: dom_doc.cpp:746
DOM::DocumentType::publicId
DOMString publicId() const
Introduced in DOM Level 2.
Definition: dom_doc.cpp:754
DOM::DocumentType::operator=
DocumentType & operator=(const Node &other)
Definition: dom_doc.cpp:706
DOM::DocumentType::internalSubset
DOMString internalSubset() const
Introduced in DOM Level 2.
Definition: dom_doc.cpp:770
DOM::DocumentType::entities
NamedNodeMap entities() const
A NamedNodeMap containing the general entities, both external and internal, declared in the DTD.
Definition: dom_doc.cpp:738
DOM::DocumentType::name
DOMString name() const
The name of DTD; i.e., the name immediately following the DOCTYPE keyword.
Definition: dom_doc.cpp:730
DOM::DocumentType::DocumentType
DocumentType()
Definition: dom_doc.cpp:692
DOM::DocumentType::~DocumentType
~DocumentType()
Definition: dom_doc.cpp:726
DOM::Document
The Document interface represents the entire HTML or XML document.
Definition: dom_doc.h:246
DOM::Document::createTreeWalker
TreeWalker createTreeWalker(Node root, unsigned long whatToShow, NodeFilter filter, bool entityReferenceExpansion)
Introduced in DOM Level 2 This method is from the DocumentTraversal interface.
Definition: dom_doc.cpp:381
DOM::Document::getElementById
Element getElementById(const DOMString &elementId) const
Moved from HTMLDocument in DOM Level 2 Returns the Element whose id is given by elementId.
Definition: dom_doc.cpp:319
DOM::Document::createComment
Comment createComment(const DOMString &data)
Creates a Comment node given the specified string.
Definition: dom_doc.cpp:259
DOM::Document::updateRendering
void updateRendering()
not part of the DOM
Definition: dom_doc.cpp:604
DOM::Document::createEntityReference
EntityReference createEntityReference(const DOMString &name)
Creates an EntityReference object.
Definition: dom_doc.cpp:306
DOM::Document::getElementsByClassName
NodeList getElementsByClassName(const DOMString &className)
Introduced in HTML 5.
Definition: dom_doc.cpp:337
DOM::Document::createDocumentFragment
DocumentFragment createDocumentFragment()
Creates an empty DocumentFragment object.
Definition: dom_doc.cpp:247
DOM::Document::getOverrideStyle
CSSStyleDeclaration getOverrideStyle(const Element &elt, const DOMString &pseudoElt)
Introduced in DOM Level 2 This method is from the DocumentCSS interface.
Definition: dom_doc.cpp:457
DOM::Document::createTextNode
Text createTextNode(const DOMString &data)
Creates a Text node given the specified string.
Definition: dom_doc.cpp:253
DOM::Document::createElementNS
Element createElementNS(const DOMString &namespaceURI, const DOMString &qualifiedName)
Introduced in DOM Level 2 Creates an element of the given qualified name and namespace URI.
Definition: dom_doc.cpp:235
DOM::Document::styleSheets
StyleSheetList styleSheets() const
Introduced in DOM Level 2 This method is from the DocumentStyle interface.
Definition: dom_doc.cpp:417
DOM::Document::setSelectedStylesheetSet
void setSelectedStylesheetSet(const DOMString &aString)
Definition: dom_doc.cpp:441
DOM::Document::load
void load(const DOMString &uri)
Introduced in DOM Level 3 This method is from the DocumentLS interface.
Definition: dom_doc.cpp:539
DOM::Document::queryCommandIndeterm
bool queryCommandIndeterm(const DOMString &command)
Definition: dom_doc.cpp:482
DOM::Document::queryCommandState
bool queryCommandState(const DOMString &command)
Definition: dom_doc.cpp:490
DOM::Document::getElementsByTagName
NodeList getElementsByTagName(const DOMString &tagname)
No Exceptions.
Definition: dom_doc.cpp:325
DOM::Document::isHTMLDocument
bool isHTMLDocument() const
Definition: dom_doc.cpp:355
DOM::Document::designMode
bool designMode() const
not part of the official DOM
Definition: dom_doc.cpp:576
DOM::Document::~Document
~Document()
Definition: dom_doc.cpp:200
DOM::Document::preferredStylesheetSet
DOMString preferredStylesheetSet()
CSS3 mechanism for selecting alternate stylesheets using the DOM.
Definition: dom_doc.cpp:425
DOM::Document::doctype
DocumentType doctype() const
The Document Type Declaration (see DocumentType ) associated with this document.
Definition: dom_doc.cpp:205
DOM::Document::createProcessingInstruction
ProcessingInstruction createProcessingInstruction(const DOMString &target, const DOMString &data)
Creates a ProcessingInstruction node given the specified name and data strings.
Definition: dom_doc.cpp:278
DOM::Document::getElementsByTagNameNS
NodeList getElementsByTagNameNS(const DOMString &namespaceURI, const DOMString &localName)
Introduced in DOM Level 2 No Exceptions.
Definition: dom_doc.cpp:331
DOM::Document::createEvent
Event createEvent(const DOMString &eventType)
Introduced in DOM Level 2 This method is from the DocumentEvent interface.
Definition: dom_doc.cpp:397
DOM::Document::defaultView
AbstractView defaultView() const
Introduced in DOM Level 2 This method is from the DocumentView interface.
Definition: dom_doc.cpp:409
DOM::Document::querySelectorAll
NodeList querySelectorAll(const DOMString &query) const
Introduced in Selectors Level 1.
Definition: dom_doc.cpp:566
DOM::Document::loadXML
void loadXML(const DOMString &source)
Introduced in DOM Level 3 This method is from the DocumentLS interface.
Definition: dom_doc.cpp:547
DOM::Document::implementation
DOMImplementation implementation() const
The DOMImplementation object that handles this document.
Definition: dom_doc.cpp:211
DOM::Document::setDesignMode
void setDesignMode(bool enable)
not part of the official DOM
Definition: dom_doc.cpp:583
DOM::Document::documentElement
Element documentElement() const
This is a convenience attribute that allows direct access to the child node that is the root element ...
Definition: dom_doc.cpp:217
DOM::Document::abort
void abort()
Introduced in DOM Level 3 This method is from the DocumentLS interface.
Definition: dom_doc.cpp:530
DOM::Document::createAttributeNS
Attr createAttributeNS(const DOMString &namespaceURI, const DOMString &qualifiedName)
Introduced in DOM Level 2 Creates an attribute of the given qualified name and namespace URI.
Definition: dom_doc.cpp:295
DOM::Document::completeURL
DOMString completeURL(const DOMString &url)
not part of the DOM
Definition: dom_doc.cpp:590
DOM::Document::createRange
Range createRange()
Introduced in DOM Level 2 This method is from the DocumentRange interface.
Definition: dom_doc.cpp:361
DOM::Document::querySelector
Element querySelector(const DOMString &query) const
Introduced in Selectors Level 1.
Definition: dom_doc.cpp:556
DOM::Document::createCDATASection
CDATASection createCDATASection(const DOMString &data)
Creates a CDATASection node whose value is the specified string.
Definition: dom_doc.cpp:265
DOM::Document::queryCommandSupported
bool queryCommandSupported(const DOMString &command)
Definition: dom_doc.cpp:498
DOM::Document::createAttribute
Attr createAttribute(const DOMString &name)
Creates an Attr of the given name.
Definition: dom_doc.cpp:284
DOM::Document::setAsync
void setAsync(bool)
Introduced in DOM Level 3 This method is from the DocumentLS interface.
Definition: dom_doc.cpp:522
DOM::Document::Document
Document()
Definition: dom_doc.cpp:149
DOM::Document::view
KHTMLView * view() const
Definition: dom_doc.cpp:450
DOM::Document::async
bool async() const
Introduced in DOM Level 3 This method is from the DocumentLS interface.
Definition: dom_doc.cpp:514
DOM::Document::addStyleSheet
void addStyleSheet(const StyleSheet &sheet)
Adds a new style sheet to the list of style sheets.
Definition: dom_doc.cpp:610
DOM::Document::importNode
Node importNode(const Node &importedNode, bool deep)
Introduced in DOM Level 2.
Definition: dom_doc.cpp:343
DOM::Document::queryCommandValue
DOMString queryCommandValue(const DOMString &command)
Definition: dom_doc.cpp:506
DOM::Document::createNodeIterator
NodeIterator createNodeIterator(Node root, unsigned long whatToShow, NodeFilter filter, bool entityReferenceExpansion)
Introduced in DOM Level 2 This method is from the DocumentTraversal interface.
Definition: dom_doc.cpp:367
DOM::Document::toString
DOMString toString() const
Definition: dom_doc.cpp:596
DOM::Document::removeStyleSheet
void removeStyleSheet(const StyleSheet &sheet)
Removes a style sheet to the list of style sheets.
Definition: dom_doc.cpp:621
DOM::Document::selectedStylesheetSet
DOMString selectedStylesheetSet()
Definition: dom_doc.cpp:433
DOM::Document::execCommand
bool execCommand(const DOMString &command, bool userInterface, const DOMString &value)
not part of the DOM
Definition: dom_doc.cpp:466
DOM::Document::createElement
Element createElement(const DOMString &tagName)
Creates an element of the type specified.
Definition: dom_doc.cpp:223
DOM::Document::queryCommandEnabled
bool queryCommandEnabled(const DOMString &command)
Definition: dom_doc.cpp:474
DOM::Document::operator=
Document & operator=(const Node &other)
Definition: dom_doc.cpp:180
DOM::Element
By far the vast majority of objects (apart from text) that authors encounter when traversing a docume...
Definition: dom_element.h:210
DOM::EntityReference
EntityReference objects may be inserted into the structure model when an entity reference is in the s...
Definition: dom_xml.h:189
DOM::Event
Introduced in DOM Level 2.
Definition: dom2_events.h:117
DOM::HTMLDocument
An HTMLDocument is the root of the HTML hierarchy and holds the entire content.
Definition: html_document.h:74
DOM::NamedNodeMap
Objects implementing the NamedNodeMap interface are used to represent collections of nodes that can b...
Definition: dom_node.h:63
DOM::NodeFilter
Filters are objects that know how to "filter out" nodes.
Definition: dom2_traversal.h:184
DOM::NodeFilter::handle
virtual NodeFilterImpl * handle() const
Definition: dom2_traversal.cpp:187
DOM::NodeIterator
NodeIterators are used to step through a set of nodes, e.g.
Definition: dom2_traversal.h:60
DOM::NodeList
The NodeList interface provides the abstraction of an ordered collection of nodes,...
Definition: dom_node.h:964
DOM::Node
The Node interface is the primary datatype for the entire Document Object Model.
Definition: dom_node.h:271
DOM::Node::handle
NodeImpl * handle() const
Definition: dom_node.h:925
DOM::Node::localName
DOMString localName() const
Introduced in DOM Level 2.
Definition: dom_node.cpp:340
DOM::Node::operator=
Node & operator=(const Node &other)
Definition: dom_node.cpp:145
DOM::Node::DOCUMENT_TYPE_NODE
@ DOCUMENT_TYPE_NODE
Definition: dom_node.h:391
DOM::Node::DOCUMENT_FRAGMENT_NODE
@ DOCUMENT_FRAGMENT_NODE
Definition: dom_node.h:392
DOM::Node::DOCUMENT_NODE
@ DOCUMENT_NODE
Definition: dom_node.h:390
DOM::Node::impl
NodeImpl * impl
Definition: dom_node.h:948
DOM::Node::namespaceURI
DOMString namespaceURI() const
Introduced in DOM Level 2.
Definition: dom_node.cpp:319
DOM::Node::elementId
quint32 elementId() const
Definition: dom_node.cpp:400
DOM::ProcessingInstruction
The ProcessingInstruction interface represents a "processing instruction", used in XML as a way to ke...
Definition: dom_xml.h:260
DOM::Range
Definition: dom2_range.h:80
DOM::StyleSheetList
The StyleSheetList interface provides the abstraction of an ordered collection of style sheets.
Definition: css_stylesheet.h:324
DOM::StyleSheet
The StyleSheet interface is the abstract base interface for any type of style sheet.
Definition: css_stylesheet.h:59
DOM::StyleSheet::isNull
bool isNull() const
Definition: css_stylesheet.h:164
DOM::StyleSheet::handle
StyleSheetImpl * handle() const
Definition: css_stylesheet.h:163
DOM::Text
The Text interface represents the textual content (termed character data in XML) of an Element or At...
Definition: dom_text.h:270
DOM::TreeWalker
TreeWalker objects are used to navigate a document tree or subtree using the view of the document def...
Definition: dom2_traversal.h:339
KHTMLView
Renders and displays HTML in a QScrollArea.
Definition: khtmlview.h:93
dom2_events.h
dom2_range.h
dom2_traversal.h
dom2_views.h
dom_exception.h
dom_xml.h
html_document.h
kdebug.h
d
#define d
Definition: khtmlfind.cpp:42
DOM
This library provides a full-featured HTML parser and widget.
Definition: design.h:55
name
const char * name(StandardAction id)
create
KAction * create(StandardAction id, const QObject *recvr, const char *slot, QObject *parent)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KHTML

Skip menu "KHTML"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal