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

KHTML

  • khtml
  • dom
html_document.cpp
Go to the documentation of this file.
1 
22 // --------------------------------------------------------------------------
23 
24 #include "html_document.h"
25 #include "css/csshelper.h"
26 #include "dom/html_misc.h"
27 #include "dom/dom_exception.h"
28 #include "xml/dom_textimpl.h"
29 #include "html/html_documentimpl.h"
30 #include "html/html_miscimpl.h"
31 
32 using namespace DOM;
33 
34 HTMLDocument::HTMLDocument() : Document(false) // create the impl here
35 {
36  impl = DOMImplementationImpl::createHTMLDocument();
37  impl->ref();
38 
39 }
40 
41 HTMLDocument::HTMLDocument(KHTMLView *parent)
42  : Document(false) // create the impl here
43 {
44  impl = DOMImplementationImpl::createHTMLDocument(parent);
45  impl->ref();
46 }
47 
48 HTMLDocument::HTMLDocument(const HTMLDocument &other) : Document(other)
49 {
50 }
51 
52 HTMLDocument::HTMLDocument(HTMLDocumentImpl *impl) : Document(impl)
53 {
54 }
55 
56 HTMLDocument &HTMLDocument::operator = (const Node &other)
57 {
58  if(other.nodeType() != DOCUMENT_NODE) {
59  if ( impl ) impl->deref();
60  impl = 0;
61  } else {
62  DocumentImpl *d = static_cast<DocumentImpl *>(other.handle());
63  if(!d->isHTMLDocument()) {
64  if ( impl ) impl->deref();
65  impl = 0;
66  } else {
67  Node::operator =(other);
68  }
69  }
70  return *this;
71 }
72 
73 HTMLDocument &HTMLDocument::operator = (const HTMLDocument &other)
74 {
75  Document::operator =(other);
76  return *this;
77 }
78 
79 HTMLDocument::~HTMLDocument()
80 {
81 }
82 
83 DOMString HTMLDocument::title() const
84 {
85  if(!impl) return DOMString();
86  return static_cast<HTMLDocumentImpl *>(impl)->title();
87 }
88 
89 void HTMLDocument::setTitle( const DOMString &value )
90 {
91  if (impl)
92  static_cast<HTMLDocumentImpl *>(impl)->setTitle(value);
93 }
94 
95 DOMString HTMLDocument::referrer() const
96 {
97  if(!impl) return DOMString();
98  return ((HTMLDocumentImpl *)impl)->referrer();
99 }
100 
101 DOMString HTMLDocument::completeURL(const DOMString& str) const
102 {
103  if(!impl) return str;
104  DOMString parsed = khtml::parseURL(str);
105  return ((HTMLDocumentImpl *)impl)->completeURL(parsed.string());
106 }
107 
108 DOMString HTMLDocument::domain() const
109 {
110  if(!impl) return DOMString();
111  return ((HTMLDocumentImpl *)impl)->domain();
112 }
113 
114 DOMString HTMLDocument::lastModified() const
115 {
116  if(!impl) return DOMString();
117  return ((HTMLDocumentImpl *)impl)->lastModified();
118 }
119 
120 DOMString HTMLDocument::URL() const
121 {
122  if(!impl) return DOMString();
123  return ((HTMLDocumentImpl *)impl)->URL().url();
124 }
125 
126 HTMLElement HTMLDocument::body() const
127 {
128  if(!impl) return 0;
129  return ((HTMLDocumentImpl *)impl)->body();
130 }
131 
132 void HTMLDocument::setBody(const HTMLElement &_body)
133 {
134  if (!impl) return;
135  int exceptioncode = 0;
136  ((HTMLDocumentImpl *)impl)->setBody(static_cast<HTMLElementImpl *>(_body.handle()), exceptioncode);
137  if ( exceptioncode )
138  throw DOMException( exceptioncode );
139  return;
140 }
141 
142 HTMLCollection HTMLDocument::images() const
143 {
144  if(!impl) return HTMLCollection();
145  return ((HTMLDocumentImpl*)impl)->images();
146 }
147 
148 HTMLCollection HTMLDocument::applets() const
149 {
150  if(!impl) return HTMLCollection();
151  return ((HTMLDocumentImpl*)impl)->applets();
152 }
153 
154 HTMLCollection HTMLDocument::scripts() const
155 {
156  if(!impl) return HTMLCollection();
157  return ((HTMLDocumentImpl*)impl)->scripts();
158 }
159 
160 HTMLCollection HTMLDocument::links() const
161 {
162  if(!impl) return HTMLCollection();
163  return ((HTMLDocumentImpl*)impl)->links();
164 }
165 
166 HTMLCollection HTMLDocument::forms() const
167 {
168  if(!impl) return HTMLCollection();
169  return ((HTMLDocumentImpl*)impl)->forms();
170 }
171 
172 HTMLCollection HTMLDocument::layers() const
173 {
174  if(!impl) return HTMLCollection();
175  return ((HTMLDocumentImpl*)impl)->layers();
176 }
177 
178 HTMLCollection HTMLDocument::anchors() const
179 {
180  if(!impl) return HTMLCollection();
181  return ((HTMLDocumentImpl*)impl)->anchors();
182 }
183 
184 HTMLCollection HTMLDocument::all() const
185 {
186  if(!impl) return HTMLCollection();
187  return ((HTMLDocumentImpl*)impl)->all();
188 }
189 
190 DOMString HTMLDocument::cookie() const
191 {
192  if (!impl) return DOMString();
193  return ((HTMLDocumentImpl *)impl)->cookie();
194 }
195 
196 void HTMLDocument::setCookie( const DOMString & value )
197 {
198  if (impl)
199  ((HTMLDocumentImpl *)impl)->setCookie(value);
200 
201 }
202 
203 void HTMLDocument::open( )
204 {
205  if(impl)
206  ((HTMLDocumentImpl *)impl)->open( );
207 }
208 
209 void HTMLDocument::close( )
210 {
211  if(impl)
212  ((HTMLDocumentImpl *)impl)->close( );
213 }
214 
215 void HTMLDocument::write( const DOMString &text )
216 {
217  if(impl)
218  ((HTMLDocumentImpl *)impl)->write( text );
219 }
220 
221 void HTMLDocument::writeln( const DOMString &text )
222 {
223  if(impl)
224  ((HTMLDocumentImpl *)impl)->writeln( text );
225 }
226 
227 NodeList HTMLDocument::getElementsByName( const DOMString &elementName )
228 {
229  if(!impl) return 0;
230  return ((HTMLDocumentImpl *)impl)->getElementsByName(elementName);
231 }
232 
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jun 1 2013 12:11:03 by doxygen 1.8.1.1 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.10.4 API Reference

Skip menu "kdelibs-4.10.4 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