• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdehtml
 

tdehtml

  • tdehtml
  • dom
html_head.cpp
1
22// --------------------------------------------------------------------------
23
24#include "dom/html_head.h"
25#include "html/html_headimpl.h"
26#include "misc/htmlhashes.h"
27#include "xml/dom_docimpl.h"
28
29using namespace DOM;
30
31HTMLBaseElement::HTMLBaseElement() : HTMLElement()
32{
33}
34
35HTMLBaseElement::HTMLBaseElement(const HTMLBaseElement &other) : HTMLElement(other)
36{
37}
38
39HTMLBaseElement::HTMLBaseElement(HTMLBaseElementImpl *impl) : HTMLElement(impl)
40{
41}
42
43HTMLBaseElement &HTMLBaseElement::operator = (const Node &other)
44{
45 assignOther( other, ID_BASE );
46 return *this;
47}
48
49HTMLBaseElement &HTMLBaseElement::operator = (const HTMLBaseElement &other)
50{
51 HTMLElement::operator = (other);
52 return *this;
53}
54
55HTMLBaseElement::~HTMLBaseElement()
56{
57}
58
59DOMString HTMLBaseElement::href() const
60{
61 if(!impl) return DOMString();
62 DOMString href = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_HREF);
63 return !href.isNull() ? impl->getDocument()->completeURL(href.string()) : href;
64}
65
66void HTMLBaseElement::setHref( const DOMString &value )
67{
68 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HREF, value);
69}
70
71DOMString HTMLBaseElement::target() const
72{
73 if(!impl) return DOMString();
74 return ((ElementImpl *)impl)->getAttribute(ATTR_TARGET);
75}
76
77void HTMLBaseElement::setTarget( const DOMString &value )
78{
79 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TARGET, value);
80}
81
82// --------------------------------------------------------------------------
83
84HTMLLinkElement::HTMLLinkElement() : HTMLElement()
85{
86}
87
88HTMLLinkElement::HTMLLinkElement(const HTMLLinkElement &other) : HTMLElement(other)
89{
90}
91
92HTMLLinkElement::HTMLLinkElement(HTMLLinkElementImpl *impl) : HTMLElement(impl)
93{
94}
95
96HTMLLinkElement &HTMLLinkElement::operator = (const Node &other)
97{
98 assignOther( other, ID_LINK );
99 return *this;
100}
101
102HTMLLinkElement &HTMLLinkElement::operator = (const HTMLLinkElement &other)
103{
104 HTMLElement::operator = (other);
105 return *this;
106}
107
108HTMLLinkElement::~HTMLLinkElement()
109{
110}
111
112bool HTMLLinkElement::disabled() const
113{
114 if(!impl) return 0;
115 return !((ElementImpl *)impl)->getAttribute(ATTR_DISABLED).isNull();
116}
117
118void HTMLLinkElement::setDisabled( bool _disabled )
119{
120 if(impl)
121 ((ElementImpl *)impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
122}
123
124DOMString HTMLLinkElement::charset() const
125{
126 if(!impl) return DOMString();
127 return ((ElementImpl *)impl)->getAttribute(ATTR_CHARSET);
128}
129
130void HTMLLinkElement::setCharset( const DOMString &value )
131{
132 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHARSET, value);
133}
134
135DOMString HTMLLinkElement::href() const
136{
137 if(!impl) return DOMString();
138 DOMString href = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_HREF);
139 return !href.isNull() ? impl->getDocument()->completeURL(href.string()) : href;
140}
141
142void HTMLLinkElement::setHref( const DOMString &value )
143{
144 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HREF, value);
145}
146
147DOMString HTMLLinkElement::hreflang() const
148{
149 if(!impl) return DOMString();
150 return ((ElementImpl *)impl)->getAttribute(ATTR_HREFLANG);
151}
152
153void HTMLLinkElement::setHreflang( const DOMString &value )
154{
155 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HREFLANG, value);
156}
157
158DOMString HTMLLinkElement::media() const
159{
160 if(!impl) return DOMString();
161 return ((ElementImpl *)impl)->getAttribute(ATTR_MEDIA);
162}
163
164void HTMLLinkElement::setMedia( const DOMString &value )
165{
166 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_MEDIA, value);
167}
168
169DOMString HTMLLinkElement::rel() const
170{
171 if(!impl) return DOMString();
172 return ((ElementImpl *)impl)->getAttribute(ATTR_REL);
173}
174
175void HTMLLinkElement::setRel( const DOMString &value )
176{
177 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_REL, value);
178}
179
180DOMString HTMLLinkElement::rev() const
181{
182 if(!impl) return DOMString();
183 return ((ElementImpl *)impl)->getAttribute(ATTR_REV);
184}
185
186void HTMLLinkElement::setRev( const DOMString &value )
187{
188 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_REV, value);
189}
190
191DOMString HTMLLinkElement::target() const
192{
193 if(!impl) return DOMString();
194 return ((ElementImpl *)impl)->getAttribute(ATTR_TARGET);
195}
196
197void HTMLLinkElement::setTarget( const DOMString &value )
198{
199 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TARGET, value);
200}
201
202DOMString HTMLLinkElement::type() const
203{
204 if(!impl) return DOMString();
205 return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE);
206}
207
208void HTMLLinkElement::setType( const DOMString &value )
209{
210 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value);
211}
212
213StyleSheet HTMLLinkElement::sheet() const
214{
215 if(!impl) return 0;
216 return ((HTMLLinkElementImpl *)impl)->sheet();
217}
218
219// --------------------------------------------------------------------------
220
221HTMLMetaElement::HTMLMetaElement() : HTMLElement()
222{
223}
224
225HTMLMetaElement::HTMLMetaElement(const HTMLMetaElement &other) : HTMLElement(other)
226{
227}
228
229HTMLMetaElement::HTMLMetaElement(HTMLMetaElementImpl *impl) : HTMLElement(impl)
230{
231}
232
233HTMLMetaElement &HTMLMetaElement::operator = (const Node &other)
234{
235 assignOther( other, ID_META );
236 return *this;
237}
238
239HTMLMetaElement &HTMLMetaElement::operator = (const HTMLMetaElement &other)
240{
241 HTMLElement::operator = (other);
242 return *this;
243}
244
245HTMLMetaElement::~HTMLMetaElement()
246{
247}
248
249DOMString HTMLMetaElement::content() const
250{
251 if(!impl) return DOMString();
252 return ((ElementImpl *)impl)->getAttribute(ATTR_CONTENT);
253}
254
255void HTMLMetaElement::setContent( const DOMString &value )
256{
257 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CONTENT, value);
258}
259
260DOMString HTMLMetaElement::httpEquiv() const
261{
262 if(!impl) return DOMString();
263 return ((ElementImpl *)impl)->getAttribute(ATTR_HTTP_EQUIV);
264}
265
266void HTMLMetaElement::setHttpEquiv( const DOMString &value )
267{
268 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HTTP_EQUIV, value);
269}
270
271DOMString HTMLMetaElement::name() const
272{
273 if(!impl) return DOMString();
274 return ((ElementImpl *)impl)->getAttribute(ATTR_NAME);
275}
276
277void HTMLMetaElement::setName( const DOMString &value )
278{
279 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_NAME, value);
280}
281
282DOMString HTMLMetaElement::scheme() const
283{
284 if(!impl) return DOMString();
285 return ((ElementImpl *)impl)->getAttribute(ATTR_SCHEME);
286}
287
288void HTMLMetaElement::setScheme( const DOMString &value )
289{
290 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SCHEME, value);
291}
292
293// --------------------------------------------------------------------------
294
295HTMLScriptElement::HTMLScriptElement() : HTMLElement()
296{
297}
298
299HTMLScriptElement::HTMLScriptElement(const HTMLScriptElement &other) : HTMLElement(other)
300{
301}
302
303HTMLScriptElement::HTMLScriptElement(HTMLScriptElementImpl *impl) : HTMLElement(impl)
304{
305}
306
307HTMLScriptElement &HTMLScriptElement::operator = (const Node &other)
308{
309 assignOther( other, ID_SCRIPT );
310 return *this;
311}
312
313HTMLScriptElement &HTMLScriptElement::operator = (const HTMLScriptElement &other)
314{
315 HTMLElement::operator = (other);
316 return *this;
317}
318
319HTMLScriptElement::~HTMLScriptElement()
320{
321}
322
323DOMString HTMLScriptElement::text() const
324{
325 if(!impl) return DOMString();
326 return ((HTMLScriptElementImpl *)impl)->text();
327}
328
329void HTMLScriptElement::setText( const DOMString &value )
330{
331 if(impl) ((HTMLScriptElementImpl *)impl)->setText(value);
332}
333
334DOMString HTMLScriptElement::htmlFor() const
335{
336 // DOM Level 1 says: reserved for future use...
337 return DOMString();
338}
339
340void HTMLScriptElement::setHtmlFor( const DOMString &/*value*/ )
341{
342 // DOM Level 1 says: reserved for future use...
343}
344
345DOMString HTMLScriptElement::event() const
346{
347 // DOM Level 1 says: reserved for future use...
348 return DOMString();
349}
350
351void HTMLScriptElement::setEvent( const DOMString &/*value*/ )
352{
353 // DOM Level 1 says: reserved for future use...
354}
355
356DOMString HTMLScriptElement::charset() const
357{
358 if(!impl) return DOMString();
359 return ((ElementImpl *)impl)->getAttribute(ATTR_CHARSET);
360}
361
362void HTMLScriptElement::setCharset( const DOMString &value )
363{
364 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHARSET, value);
365}
366
367bool HTMLScriptElement::defer() const
368{
369 if(!impl) return 0;
370 return !((ElementImpl *)impl)->getAttribute(ATTR_DEFER).isNull();
371}
372
373void HTMLScriptElement::setDefer( bool _defer )
374{
375
376 if(impl)
377 ((ElementImpl *)impl)->setAttribute(ATTR_DEFER,_defer ? "" : 0);
378}
379
380DOMString HTMLScriptElement::src() const
381{
382 if(!impl) return DOMString();
383 DOMString s = ((ElementImpl *)impl)->getAttribute(ATTR_SRC);
384 return !s.isNull() ? impl->getDocument()->completeURL(s.string()) : s;
385}
386
387void HTMLScriptElement::setSrc( const DOMString &value )
388{
389 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SRC, value);
390}
391
392DOMString HTMLScriptElement::type() const
393{
394 if(!impl) return DOMString();
395 return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE);
396}
397
398void HTMLScriptElement::setType( const DOMString &value )
399{
400 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value);
401}
402
403// --------------------------------------------------------------------------
404
405HTMLStyleElement::HTMLStyleElement() : HTMLElement()
406{
407}
408
409HTMLStyleElement::HTMLStyleElement(const HTMLStyleElement &other) : HTMLElement(other)
410{
411}
412
413HTMLStyleElement::HTMLStyleElement(HTMLStyleElementImpl *impl) : HTMLElement(impl)
414{
415}
416
417HTMLStyleElement &HTMLStyleElement::operator = (const Node &other)
418{
419 assignOther( other, ID_STYLE );
420 return *this;
421}
422
423HTMLStyleElement &HTMLStyleElement::operator = (const HTMLStyleElement &other)
424{
425 HTMLElement::operator = (other);
426 return *this;
427}
428
429HTMLStyleElement::~HTMLStyleElement()
430{
431}
432
433bool HTMLStyleElement::disabled() const
434{
435 if(!impl) return 0;
436 return !((HTMLStyleElementImpl *)impl)->getAttribute(ATTR_DISABLED).isNull();
437}
438
439void HTMLStyleElement::setDisabled( bool _disabled )
440{
441
442 if(impl)
443 ((ElementImpl *)impl)->setAttribute(ATTR_DISABLED,_disabled ? "" : 0);
444}
445
446DOMString HTMLStyleElement::media() const
447{
448 if(!impl) return DOMString();
449 return ((ElementImpl *)impl)->getAttribute(ATTR_MEDIA);
450}
451
452void HTMLStyleElement::setMedia( const DOMString &value )
453{
454 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_MEDIA, value);
455}
456
457DOMString HTMLStyleElement::type() const
458{
459 if(!impl) return DOMString();
460 return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE);
461}
462
463void HTMLStyleElement::setType( const DOMString &value )
464{
465 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value);
466}
467
468StyleSheet HTMLStyleElement::sheet() const
469{
470 if(!impl) return 0;
471 return ((HTMLStyleElementImpl *)impl)->sheet();
472}
473
474
475// --------------------------------------------------------------------------
476
477HTMLTitleElement::HTMLTitleElement() : HTMLElement()
478{
479}
480
481HTMLTitleElement::HTMLTitleElement(const HTMLTitleElement &other) : HTMLElement(other)
482{
483}
484
485HTMLTitleElement::HTMLTitleElement(HTMLTitleElementImpl *impl) : HTMLElement(impl)
486{
487}
488
489HTMLTitleElement &HTMLTitleElement::operator = (const Node &other)
490{
491 assignOther( other, ID_TITLE );
492 return *this;
493}
494
495HTMLTitleElement &HTMLTitleElement::operator = (const HTMLTitleElement &other)
496{
497 HTMLElement::operator = (other);
498 return *this;
499}
500
501HTMLTitleElement::~HTMLTitleElement()
502{
503}
504
505DOMString HTMLTitleElement::text() const
506{
507 if(!impl) return DOMString();
508 return ((HTMLTitleElementImpl *)impl)->text();
509}
510
511void HTMLTitleElement::setText( const DOMString &value )
512{
513 if(impl) ((HTMLTitleElementImpl *)impl)->setText(value);
514}
515
DOM::DOMString
This class implements the basic string we use in the DOM.
Definition: dom_string.h:44
DOM::Element::getAttribute
DOMString getAttribute(const DOMString &name)
Retrieves an attribute value by name.
Definition: dom_element.cpp:147
DOM::HTMLBaseElement
Document base URI.
Definition: html_head.h:47
DOM::HTMLBaseElement::setHref
void setHref(const DOMString &)
see href
Definition: html_head.cpp:66
DOM::HTMLBaseElement::href
DOMString href() const
The base URI See the href attribute definition in HTML 4.0.
Definition: html_head.cpp:59
DOM::HTMLBaseElement::target
DOMString target() const
The default target frame.
Definition: html_head.cpp:71
DOM::HTMLBaseElement::setTarget
void setTarget(const DOMString &)
see target
Definition: html_head.cpp:77
DOM::HTMLElement
All HTML element interfaces derive from this class.
Definition: html_element.h:70
DOM::HTMLLinkElement
The LINK element specifies a link to an external resource, and defines this document's relationship t...
Definition: html_head.h:102
DOM::HTMLLinkElement::setHref
void setHref(const DOMString &)
see href
Definition: html_head.cpp:142
DOM::HTMLLinkElement::sheet
StyleSheet sheet() const
Introduced in DOM Level 2 This method is from the LinkStyle interface.
Definition: html_head.cpp:213
DOM::HTMLLinkElement::disabled
bool disabled() const
Enables/disables the link.
Definition: html_head.cpp:112
DOM::HTMLLinkElement::charset
DOMString charset() const
The character encoding of the resource being linked to.
Definition: html_head.cpp:124
DOM::HTMLLinkElement::setTarget
void setTarget(const DOMString &)
see target
Definition: html_head.cpp:197
DOM::HTMLLinkElement::setType
void setType(const DOMString &)
see type
Definition: html_head.cpp:208
DOM::HTMLLinkElement::setRel
void setRel(const DOMString &)
see rel
Definition: html_head.cpp:175
DOM::HTMLLinkElement::type
DOMString type() const
Advisory content type.
Definition: html_head.cpp:202
DOM::HTMLLinkElement::hreflang
DOMString hreflang() const
Language code of the linked resource.
Definition: html_head.cpp:147
DOM::HTMLLinkElement::media
DOMString media() const
Designed for use with one or more target media.
Definition: html_head.cpp:158
DOM::HTMLLinkElement::target
DOMString target() const
Frame to render the resource in.
Definition: html_head.cpp:191
DOM::HTMLLinkElement::setHreflang
void setHreflang(const DOMString &)
see hreflang
Definition: html_head.cpp:153
DOM::HTMLLinkElement::setCharset
void setCharset(const DOMString &)
see charset
Definition: html_head.cpp:130
DOM::HTMLLinkElement::setMedia
void setMedia(const DOMString &)
see media
Definition: html_head.cpp:164
DOM::HTMLLinkElement::rev
DOMString rev() const
Reverse link type.
Definition: html_head.cpp:180
DOM::HTMLLinkElement::setRev
void setRev(const DOMString &)
see rev
Definition: html_head.cpp:186
DOM::HTMLLinkElement::rel
DOMString rel() const
Forward link type.
Definition: html_head.cpp:169
DOM::HTMLLinkElement::setDisabled
void setDisabled(bool)
see disabled
Definition: html_head.cpp:118
DOM::HTMLLinkElement::href
DOMString href() const
The URI of the linked resource.
Definition: html_head.cpp:135
DOM::HTMLMetaElement
This contains generic meta-information about the document.
Definition: html_head.h:257
DOM::HTMLMetaElement::setScheme
void setScheme(const DOMString &)
see scheme
Definition: html_head.cpp:288
DOM::HTMLMetaElement::name
DOMString name() const
Meta information name.
Definition: html_head.cpp:271
DOM::HTMLMetaElement::httpEquiv
DOMString httpEquiv() const
HTTP response header name.
Definition: html_head.cpp:260
DOM::HTMLMetaElement::setName
void setName(const DOMString &)
see name
Definition: html_head.cpp:277
DOM::HTMLMetaElement::setHttpEquiv
void setHttpEquiv(const DOMString &)
see httpEquiv
Definition: html_head.cpp:266
DOM::HTMLMetaElement::setContent
void setContent(const DOMString &)
see content
Definition: html_head.cpp:255
DOM::HTMLMetaElement::scheme
DOMString scheme() const
Select form of content.
Definition: html_head.cpp:282
DOM::HTMLMetaElement::content
DOMString content() const
Associated information.
Definition: html_head.cpp:249
DOM::HTMLScriptElement
Script statements.
Definition: html_head.h:336
DOM::HTMLScriptElement::htmlFor
DOMString htmlFor() const
Reserved for future use.
Definition: html_head.cpp:334
DOM::HTMLScriptElement::setDefer
void setDefer(bool)
see defer
Definition: html_head.cpp:373
DOM::HTMLScriptElement::text
DOMString text() const
The script content of the element.
Definition: html_head.cpp:323
DOM::HTMLScriptElement::event
DOMString event() const
Reserved for future use.
Definition: html_head.cpp:345
DOM::HTMLScriptElement::setSrc
void setSrc(const DOMString &)
see src
Definition: html_head.cpp:387
DOM::HTMLScriptElement::defer
bool defer() const
Indicates that the user agent can defer processing of the script.
Definition: html_head.cpp:367
DOM::HTMLScriptElement::setType
void setType(const DOMString &)
see type
Definition: html_head.cpp:398
DOM::HTMLScriptElement::src
DOMString src() const
URI designating an external script.
Definition: html_head.cpp:380
DOM::HTMLScriptElement::type
DOMString type() const
The content type of the script language.
Definition: html_head.cpp:392
DOM::HTMLScriptElement::setText
void setText(const DOMString &)
see text
Definition: html_head.cpp:329
DOM::HTMLScriptElement::setEvent
void setEvent(const DOMString &)
see event
Definition: html_head.cpp:351
DOM::HTMLScriptElement::setCharset
void setCharset(const DOMString &)
see charset
Definition: html_head.cpp:362
DOM::HTMLScriptElement::charset
DOMString charset() const
The character encoding of the linked resource.
Definition: html_head.cpp:356
DOM::HTMLScriptElement::setHtmlFor
void setHtmlFor(const DOMString &)
see htmlFor
Definition: html_head.cpp:340
DOM::HTMLStyleElement
Style information.
Definition: html_head.h:450
DOM::HTMLStyleElement::setType
void setType(const DOMString &)
see type
Definition: html_head.cpp:463
DOM::HTMLStyleElement::sheet
StyleSheet sheet() const
Introduced in DOM Level 2 This method is from the LinkStyle interface.
Definition: html_head.cpp:468
DOM::HTMLStyleElement::setMedia
void setMedia(const DOMString &)
see media
Definition: html_head.cpp:452
DOM::HTMLStyleElement::disabled
bool disabled() const
Enables/disables the style sheet.
Definition: html_head.cpp:433
DOM::HTMLStyleElement::media
DOMString media() const
Designed for use with one or more target media.
Definition: html_head.cpp:446
DOM::HTMLStyleElement::setDisabled
void setDisabled(bool)
see disabled
Definition: html_head.cpp:439
DOM::HTMLStyleElement::type
DOMString type() const
The style sheet language (Internet media type).
Definition: html_head.cpp:457
DOM::HTMLTitleElement
The document title.
Definition: html_head.h:523
DOM::HTMLTitleElement::setText
void setText(const DOMString &)
see text
Definition: html_head.cpp:511
DOM::HTMLTitleElement::text
DOMString text() const
The specified title as a string.
Definition: html_head.cpp:505
DOM::Node
The Node interface is the primary datatype for the entire Document Object Model.
Definition: dom_node.h:275
DOM::StyleSheet
The StyleSheet interface is the abstract base interface for any type of style sheet.
Definition: css_stylesheet.h:59
DOM
The Document Object Model (DOM) is divided into two parts, the COREDOM core DOM, specifying some core...
Definition: design.h:57

tdehtml

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

tdehtml

Skip menu "tdehtml"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdehtml by doxygen 1.9.4
This website is maintained by Timothy Pearson.