html_head.cpp
00001
00023
00024
00025 #include "dom/html_head.h"
00026 #include "html/html_headimpl.h"
00027 #include "misc/htmlhashes.h"
00028 #include "xml/dom_docimpl.h"
00029
00030 using namespace DOM;
00031
00032 HTMLBaseElement::HTMLBaseElement() : HTMLElement()
00033 {
00034 }
00035
00036 HTMLBaseElement::HTMLBaseElement(const HTMLBaseElement &other) : HTMLElement(other)
00037 {
00038 }
00039
00040 HTMLBaseElement::HTMLBaseElement(HTMLBaseElementImpl *impl) : HTMLElement(impl)
00041 {
00042 }
00043
00044 HTMLBaseElement &HTMLBaseElement::operator = (const Node &other)
00045 {
00046 assignOther( other, ID_BASE );
00047 return *this;
00048 }
00049
00050 HTMLBaseElement &HTMLBaseElement::operator = (const HTMLBaseElement &other)
00051 {
00052 HTMLElement::operator = (other);
00053 return *this;
00054 }
00055
00056 HTMLBaseElement::~HTMLBaseElement()
00057 {
00058 }
00059
00060 DOMString HTMLBaseElement::href() const
00061 {
00062 if(!impl) return DOMString();
00063 DOMString href = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_HREF);
00064 return href.length() ? impl->getDocument()->completeURL(href.string()) : href;
00065 }
00066
00067 void HTMLBaseElement::setHref( const DOMString &value )
00068 {
00069 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HREF, value);
00070 }
00071
00072 DOMString HTMLBaseElement::target() const
00073 {
00074 if(!impl) return DOMString();
00075 return ((ElementImpl *)impl)->getAttribute(ATTR_TARGET);
00076 }
00077
00078 void HTMLBaseElement::setTarget( const DOMString &value )
00079 {
00080 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TARGET, value);
00081 }
00082
00083
00084
00085 HTMLLinkElement::HTMLLinkElement() : HTMLElement()
00086 {
00087 }
00088
00089 HTMLLinkElement::HTMLLinkElement(const HTMLLinkElement &other) : HTMLElement(other)
00090 {
00091 }
00092
00093 HTMLLinkElement::HTMLLinkElement(HTMLLinkElementImpl *impl) : HTMLElement(impl)
00094 {
00095 }
00096
00097 HTMLLinkElement &HTMLLinkElement::operator = (const Node &other)
00098 {
00099 assignOther( other, ID_LINK );
00100 return *this;
00101 }
00102
00103 HTMLLinkElement &HTMLLinkElement::operator = (const HTMLLinkElement &other)
00104 {
00105 HTMLElement::operator = (other);
00106 return *this;
00107 }
00108
00109 HTMLLinkElement::~HTMLLinkElement()
00110 {
00111 }
00112
00113 bool HTMLLinkElement::disabled() const
00114 {
00115 if(!impl) return 0;
00116 return !((ElementImpl *)impl)->getAttribute(ATTR_DISABLED).isNull();
00117 }
00118
00119 void HTMLLinkElement::setDisabled( bool _disabled )
00120 {
00121 if(impl)
00122 ((ElementImpl *)impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
00123 }
00124
00125 DOMString HTMLLinkElement::charset() const
00126 {
00127 if(!impl) return DOMString();
00128 return ((ElementImpl *)impl)->getAttribute(ATTR_CHARSET);
00129 }
00130
00131 void HTMLLinkElement::setCharset( const DOMString &value )
00132 {
00133 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHARSET, value);
00134 }
00135
00136 DOMString HTMLLinkElement::href() const
00137 {
00138 if(!impl) return DOMString();
00139 DOMString href = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_HREF);
00140 return href.length() ? impl->getDocument()->completeURL(href.string()) : href;
00141 }
00142
00143 void HTMLLinkElement::setHref( const DOMString &value )
00144 {
00145 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HREF, value);
00146 }
00147
00148 DOMString HTMLLinkElement::hreflang() const
00149 {
00150 if(!impl) return DOMString();
00151 return ((ElementImpl *)impl)->getAttribute(ATTR_HREFLANG);
00152 }
00153
00154 void HTMLLinkElement::setHreflang( const DOMString &value )
00155 {
00156 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HREFLANG, value);
00157 }
00158
00159 DOMString HTMLLinkElement::media() const
00160 {
00161 if(!impl) return DOMString();
00162 return ((ElementImpl *)impl)->getAttribute(ATTR_MEDIA);
00163 }
00164
00165 void HTMLLinkElement::setMedia( const DOMString &value )
00166 {
00167 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_MEDIA, value);
00168 }
00169
00170 DOMString HTMLLinkElement::rel() const
00171 {
00172 if(!impl) return DOMString();
00173 return ((ElementImpl *)impl)->getAttribute(ATTR_REL);
00174 }
00175
00176 void HTMLLinkElement::setRel( const DOMString &value )
00177 {
00178 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_REL, value);
00179 }
00180
00181 DOMString HTMLLinkElement::rev() const
00182 {
00183 if(!impl) return DOMString();
00184 return ((ElementImpl *)impl)->getAttribute(ATTR_REV);
00185 }
00186
00187 void HTMLLinkElement::setRev( const DOMString &value )
00188 {
00189 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_REV, value);
00190 }
00191
00192 DOMString HTMLLinkElement::target() const
00193 {
00194 if(!impl) return DOMString();
00195 return ((ElementImpl *)impl)->getAttribute(ATTR_TARGET);
00196 }
00197
00198 void HTMLLinkElement::setTarget( const DOMString &value )
00199 {
00200 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TARGET, value);
00201 }
00202
00203 DOMString HTMLLinkElement::type() const
00204 {
00205 if(!impl) return DOMString();
00206 return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE);
00207 }
00208
00209 void HTMLLinkElement::setType( const DOMString &value )
00210 {
00211 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value);
00212 }
00213
00214 StyleSheet HTMLLinkElement::sheet() const
00215 {
00216 if(!impl) return 0;
00217 return ((HTMLLinkElementImpl *)impl)->sheet();
00218 }
00219
00220
00221
00222 HTMLMetaElement::HTMLMetaElement() : HTMLElement()
00223 {
00224 }
00225
00226 HTMLMetaElement::HTMLMetaElement(const HTMLMetaElement &other) : HTMLElement(other)
00227 {
00228 }
00229
00230 HTMLMetaElement::HTMLMetaElement(HTMLMetaElementImpl *impl) : HTMLElement(impl)
00231 {
00232 }
00233
00234 HTMLMetaElement &HTMLMetaElement::operator = (const Node &other)
00235 {
00236 assignOther( other, ID_META );
00237 return *this;
00238 }
00239
00240 HTMLMetaElement &HTMLMetaElement::operator = (const HTMLMetaElement &other)
00241 {
00242 HTMLElement::operator = (other);
00243 return *this;
00244 }
00245
00246 HTMLMetaElement::~HTMLMetaElement()
00247 {
00248 }
00249
00250 DOMString HTMLMetaElement::content() const
00251 {
00252 if(!impl) return DOMString();
00253 return ((ElementImpl *)impl)->getAttribute(ATTR_CONTENT);
00254 }
00255
00256 void HTMLMetaElement::setContent( const DOMString &value )
00257 {
00258 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CONTENT, value);
00259 }
00260
00261 DOMString HTMLMetaElement::httpEquiv() const
00262 {
00263 if(!impl) return DOMString();
00264 return ((ElementImpl *)impl)->getAttribute(ATTR_HTTP_EQUIV);
00265 }
00266
00267 void HTMLMetaElement::setHttpEquiv( const DOMString &value )
00268 {
00269 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HTTP_EQUIV, value);
00270 }
00271
00272 DOMString HTMLMetaElement::name() const
00273 {
00274 if(!impl) return DOMString();
00275 return ((ElementImpl *)impl)->getAttribute(ATTR_NAME);
00276 }
00277
00278 void HTMLMetaElement::setName( const DOMString &value )
00279 {
00280 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_NAME, value);
00281 }
00282
00283 DOMString HTMLMetaElement::scheme() const
00284 {
00285 if(!impl) return DOMString();
00286 return ((ElementImpl *)impl)->getAttribute(ATTR_SCHEME);
00287 }
00288
00289 void HTMLMetaElement::setScheme( const DOMString &value )
00290 {
00291 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SCHEME, value);
00292 }
00293
00294
00295
00296 HTMLScriptElement::HTMLScriptElement() : HTMLElement()
00297 {
00298 }
00299
00300 HTMLScriptElement::HTMLScriptElement(const HTMLScriptElement &other) : HTMLElement(other)
00301 {
00302 }
00303
00304 HTMLScriptElement::HTMLScriptElement(HTMLScriptElementImpl *impl) : HTMLElement(impl)
00305 {
00306 }
00307
00308 HTMLScriptElement &HTMLScriptElement::operator = (const Node &other)
00309 {
00310 assignOther( other, ID_SCRIPT );
00311 return *this;
00312 }
00313
00314 HTMLScriptElement &HTMLScriptElement::operator = (const HTMLScriptElement &other)
00315 {
00316 HTMLElement::operator = (other);
00317 return *this;
00318 }
00319
00320 HTMLScriptElement::~HTMLScriptElement()
00321 {
00322 }
00323
00324 DOMString HTMLScriptElement::text() const
00325 {
00326 if(!impl) return DOMString();
00327 return ((HTMLScriptElementImpl *)impl)->text();
00328 }
00329
00330 void HTMLScriptElement::setText( const DOMString &value )
00331 {
00332 if(impl) ((HTMLScriptElementImpl *)impl)->setText(value);
00333 }
00334
00335 DOMString HTMLScriptElement::htmlFor() const
00336 {
00337
00338 return DOMString();
00339 }
00340
00341 void HTMLScriptElement::setHtmlFor( const DOMString & )
00342 {
00343
00344 }
00345
00346 DOMString HTMLScriptElement::event() const
00347 {
00348
00349 return DOMString();
00350 }
00351
00352 void HTMLScriptElement::setEvent( const DOMString & )
00353 {
00354
00355 }
00356
00357 DOMString HTMLScriptElement::charset() const
00358 {
00359 if(!impl) return DOMString();
00360 return ((ElementImpl *)impl)->getAttribute(ATTR_CHARSET);
00361 }
00362
00363 void HTMLScriptElement::setCharset( const DOMString &value )
00364 {
00365 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHARSET, value);
00366 }
00367
00368 bool HTMLScriptElement::defer() const
00369 {
00370 if(!impl) return 0;
00371 return !((ElementImpl *)impl)->getAttribute(ATTR_DEFER).isNull();
00372 }
00373
00374 void HTMLScriptElement::setDefer( bool _defer )
00375 {
00376
00377 if(impl)
00378 ((ElementImpl *)impl)->setAttribute(ATTR_DEFER,_defer ? "" : 0);
00379 }
00380
00381 DOMString HTMLScriptElement::src() const
00382 {
00383 if(!impl) return DOMString();
00384 return ((ElementImpl *)impl)->getAttribute(ATTR_SRC);
00385 }
00386
00387 void HTMLScriptElement::setSrc( const DOMString &value )
00388 {
00389 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SRC, value);
00390 }
00391
00392 DOMString HTMLScriptElement::type() const
00393 {
00394 if(!impl) return DOMString();
00395 return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE);
00396 }
00397
00398 void HTMLScriptElement::setType( const DOMString &value )
00399 {
00400 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value);
00401 }
00402
00403
00404
00405 HTMLStyleElement::HTMLStyleElement() : HTMLElement()
00406 {
00407 }
00408
00409 HTMLStyleElement::HTMLStyleElement(const HTMLStyleElement &other) : HTMLElement(other)
00410 {
00411 }
00412
00413 HTMLStyleElement::HTMLStyleElement(HTMLStyleElementImpl *impl) : HTMLElement(impl)
00414 {
00415 }
00416
00417 HTMLStyleElement &HTMLStyleElement::operator = (const Node &other)
00418 {
00419 assignOther( other, ID_STYLE );
00420 return *this;
00421 }
00422
00423 HTMLStyleElement &HTMLStyleElement::operator = (const HTMLStyleElement &other)
00424 {
00425 HTMLElement::operator = (other);
00426 return *this;
00427 }
00428
00429 HTMLStyleElement::~HTMLStyleElement()
00430 {
00431 }
00432
00433 bool HTMLStyleElement::disabled() const
00434 {
00435 if(!impl) return 0;
00436 return !((HTMLStyleElementImpl *)impl)->getAttribute(ATTR_DISABLED).isNull();
00437 }
00438
00439 void HTMLStyleElement::setDisabled( bool _disabled )
00440 {
00441
00442 if(impl)
00443 ((ElementImpl *)impl)->setAttribute(ATTR_DISABLED,_disabled ? "" : 0);
00444 }
00445
00446 DOMString HTMLStyleElement::media() const
00447 {
00448 if(!impl) return DOMString();
00449 return ((ElementImpl *)impl)->getAttribute(ATTR_MEDIA);
00450 }
00451
00452 void HTMLStyleElement::setMedia( const DOMString &value )
00453 {
00454 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_MEDIA, value);
00455 }
00456
00457 DOMString HTMLStyleElement::type() const
00458 {
00459 if(!impl) return DOMString();
00460 return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE);
00461 }
00462
00463 void HTMLStyleElement::setType( const DOMString &value )
00464 {
00465 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value);
00466 }
00467
00468 StyleSheet HTMLStyleElement::sheet() const
00469 {
00470 if(!impl) return 0;
00471 return ((HTMLStyleElementImpl *)impl)->sheet();
00472 }
00473
00474
00475
00476
00477 HTMLTitleElement::HTMLTitleElement() : HTMLElement()
00478 {
00479 }
00480
00481 HTMLTitleElement::HTMLTitleElement(const HTMLTitleElement &other) : HTMLElement(other)
00482 {
00483 }
00484
00485 HTMLTitleElement::HTMLTitleElement(HTMLTitleElementImpl *impl) : HTMLElement(impl)
00486 {
00487 }
00488
00489 HTMLTitleElement &HTMLTitleElement::operator = (const Node &other)
00490 {
00491 assignOther( other, ID_TITLE );
00492 return *this;
00493 }
00494
00495 HTMLTitleElement &HTMLTitleElement::operator = (const HTMLTitleElement &other)
00496 {
00497 HTMLElement::operator = (other);
00498 return *this;
00499 }
00500
00501 HTMLTitleElement::~HTMLTitleElement()
00502 {
00503 }
00504
00505 DOMString HTMLTitleElement::text() const
00506 {
00507 if(!impl) return DOMString();
00508 return ((HTMLTitleElementImpl *)impl)->text();
00509 }
00510
00511 void HTMLTitleElement::setText( const DOMString &value )
00512 {
00513 if(impl) ((HTMLTitleElementImpl *)impl)->setText(value);
00514 }
00515
This file is part of the documentation for kdelibs Version 3.1.4.