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

KHTML

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

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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