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

KHTML

  • khtml
  • dom
html_inline.cpp
Go to the documentation of this file.
1
23// --------------------------------------------------------------------------
24
25#include "html_inline.h"
26#include "dom_doc.h"
27
28#include <html/html_inlineimpl.h>
29#include <html/html_baseimpl.h>
30#include <xml/dom_docimpl.h>
31
32using namespace DOM;
33
34HTMLAnchorElement::HTMLAnchorElement() : HTMLElement()
35{
36}
37
38HTMLAnchorElement::HTMLAnchorElement(const HTMLAnchorElement &other) : HTMLElement(other)
39{
40}
41
42HTMLAnchorElement::HTMLAnchorElement(HTMLAnchorElementImpl *impl) : HTMLElement(impl)
43{
44}
45
46HTMLAnchorElement &HTMLAnchorElement::operator = (const Node &other)
47{
48 assignOther( other, ID_A );
49 return *this;
50}
51
52HTMLAnchorElement &HTMLAnchorElement::operator = (const HTMLAnchorElement &other)
53{
54 HTMLElement::operator = (other);
55 return *this;
56}
57
58HTMLAnchorElement::~HTMLAnchorElement()
59{
60}
61
62DOMString HTMLAnchorElement::accessKey() const
63{
64 if(!impl) return DOMString();
65 return ((ElementImpl *)impl)->getAttribute(ATTR_ACCESSKEY);
66}
67
68void HTMLAnchorElement::setAccessKey( const DOMString &value )
69{
70 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ACCESSKEY, value);
71}
72
73DOMString HTMLAnchorElement::charset() const
74{
75 if(!impl) return DOMString();
76 return ((ElementImpl *)impl)->getAttribute(ATTR_CHARSET);
77}
78
79void HTMLAnchorElement::setCharset( const DOMString &value )
80{
81 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHARSET, value);
82}
83
84DOMString HTMLAnchorElement::coords() const
85{
86 if(!impl) return DOMString();
87 return ((ElementImpl *)impl)->getAttribute(ATTR_COORDS);
88}
89
90void HTMLAnchorElement::setCoords( const DOMString &value )
91{
92 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_COORDS, value);
93}
94
95DOMString HTMLAnchorElement::href() const
96{
97 if(!impl) return DOMString();
98 const DOMString href = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_HREF).parsedUrl();
99 return !href.isNull() ? impl->document()->completeURL(href.string()) : href;
100}
101
102void HTMLAnchorElement::setHref( const DOMString &value )
103{
104 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HREF, value);
105}
106
107DOMString HTMLAnchorElement::hreflang() const
108{
109 if(!impl) return DOMString();
110 return ((ElementImpl *)impl)->getAttribute(ATTR_HREFLANG);
111}
112
113void HTMLAnchorElement::setHreflang( const DOMString &value )
114{
115 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HREFLANG, value);
116}
117
118DOMString HTMLAnchorElement::name() const
119{
120 if(!impl) return DOMString();
121 return ((ElementImpl *)impl)->getAttribute(ATTR_NAME);
122}
123
124void HTMLAnchorElement::setName( const DOMString &value )
125{
126 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_NAME, value);
127}
128
129DOMString HTMLAnchorElement::rel() const
130{
131 if(!impl) return DOMString();
132 return ((ElementImpl *)impl)->getAttribute(ATTR_REL);
133}
134
135void HTMLAnchorElement::setRel( const DOMString &value )
136{
137 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_REL, value);
138}
139
140DOMString HTMLAnchorElement::rev() const
141{
142 if(!impl) return DOMString();
143 return ((ElementImpl *)impl)->getAttribute(ATTR_REV);
144}
145
146void HTMLAnchorElement::setRev( const DOMString &value )
147{
148 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_REV, value);
149}
150
151DOMString HTMLAnchorElement::shape() const
152{
153 if(!impl) return DOMString();
154 return ((ElementImpl *)impl)->getAttribute(ATTR_SHAPE);
155}
156
157void HTMLAnchorElement::setShape( const DOMString &value )
158{
159 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SHAPE, value);
160}
161
162long HTMLAnchorElement::tabIndex() const
163{
164 if(!impl) return 0;
165 return ((ElementImpl *)impl)->getAttribute(ATTR_TABINDEX).toInt();
166}
167
168void HTMLAnchorElement::setTabIndex( long _tabIndex )
169{
170 if(impl) {
171 DOMString value(QString::number(_tabIndex));
172 ((ElementImpl *)impl)->setAttribute(ATTR_TABINDEX,value);
173 }
174}
175
176DOMString HTMLAnchorElement::target() const
177{
178 if(!impl) return DOMString();
179 return ((ElementImpl *)impl)->getAttribute(ATTR_TARGET);
180}
181
182void HTMLAnchorElement::setTarget( const DOMString &value )
183{
184 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TARGET, value);
185}
186
187DOMString HTMLAnchorElement::type() const
188{
189 if(!impl) return DOMString();
190 return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE);
191}
192
193void HTMLAnchorElement::setType( const DOMString &value )
194{
195 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value);
196}
197
198void HTMLAnchorElement::blur( )
199{
200 if (impl) ((HTMLAnchorElementImpl*)impl)->blur();
201}
202
203void HTMLAnchorElement::focus( )
204{
205 if (impl) ((HTMLAnchorElementImpl*)impl)->focus();
206}
207
208// --------------------------------------------------------------------------
209
210HTMLBRElement::HTMLBRElement() : HTMLElement()
211{
212}
213
214HTMLBRElement::HTMLBRElement(const HTMLBRElement &other) : HTMLElement(other)
215{
216}
217
218HTMLBRElement::HTMLBRElement(HTMLBRElementImpl *impl) : HTMLElement(impl)
219{
220}
221
222HTMLBRElement &HTMLBRElement::operator = (const Node &other)
223{
224 assignOther( other, ID_BR );
225 return *this;
226}
227
228HTMLBRElement &HTMLBRElement::operator = (const HTMLBRElement &other)
229{
230 HTMLElement::operator = (other);
231 return *this;
232}
233
234HTMLBRElement::~HTMLBRElement()
235{
236}
237
238DOMString HTMLBRElement::clear() const
239{
240 if(!impl) return DOMString();
241 return ((ElementImpl *)impl)->getAttribute(ATTR_CLEAR);
242}
243
244void HTMLBRElement::setClear( const DOMString &value )
245{
246 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CLEAR, value);
247}
248
249// --------------------------------------------------------------------------
250
251HTMLFontElement::HTMLFontElement() : HTMLElement()
252{
253}
254
255HTMLFontElement::HTMLFontElement(const HTMLFontElement &other) : HTMLElement(other)
256{
257}
258
259HTMLFontElement::HTMLFontElement(HTMLFontElementImpl *impl) : HTMLElement(impl)
260{
261}
262
263HTMLFontElement &HTMLFontElement::operator = (const Node &other)
264{
265 assignOther( other, ID_FONT );
266 return *this;
267}
268
269HTMLFontElement &HTMLFontElement::operator = (const HTMLFontElement &other)
270{
271 HTMLElement::operator = (other);
272 return *this;
273}
274
275HTMLFontElement::~HTMLFontElement()
276{
277}
278
279DOMString HTMLFontElement::color() const
280{
281 if(!impl) return DOMString();
282 return ((ElementImpl *)impl)->getAttribute(ATTR_COLOR);
283}
284
285void HTMLFontElement::setColor( const DOMString &value )
286{
287 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_COLOR, value);
288}
289
290DOMString HTMLFontElement::face() const
291{
292 if(!impl) return DOMString();
293 return ((ElementImpl *)impl)->getAttribute(ATTR_FACE);
294}
295
296void HTMLFontElement::setFace( const DOMString &value )
297{
298 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_FACE, value);
299}
300
301DOMString HTMLFontElement::size() const
302{
303 if(!impl) return DOMString();
304 return ((ElementImpl *)impl)->getAttribute(ATTR_SIZE);
305}
306
307void HTMLFontElement::setSize( const DOMString &value )
308{
309 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SIZE, value);
310}
311
312
313// --------------------------------------------------------------------------
314
315HTMLModElement::HTMLModElement() : HTMLElement()
316{
317}
318
319HTMLModElement::HTMLModElement(const HTMLModElement &other) : HTMLElement(other)
320{
321}
322
323HTMLModElement::HTMLModElement(HTMLElementImpl *_impl)
324 : HTMLElement()
325{
326 if (_impl && (_impl->id() == ID_INS || _impl->id() == ID_DEL))
327 impl = _impl;
328 else
329 impl = 0;
330 if ( impl ) impl->ref();
331}
332
333HTMLModElement &HTMLModElement::operator = (const Node &other)
334{
335 if (other.handle() != handle()) {
336 if( other.elementId() != ID_INS &&
337 other.elementId() != ID_DEL )
338 {
339 if ( impl ) impl->deref();
340 impl = 0;
341 } else {
342 Node::operator = (other);
343 }
344 }
345 return *this;
346}
347
348HTMLModElement &HTMLModElement::operator = (const HTMLModElement &other)
349{
350 HTMLElement::operator = (other);
351 return *this;
352}
353
354HTMLModElement::~HTMLModElement()
355{
356}
357
358DOMString HTMLModElement::cite() const
359{
360 if(!impl) return DOMString();
361 return ((ElementImpl *)impl)->getAttribute(ATTR_CITE);
362}
363
364void HTMLModElement::setCite( const DOMString &value )
365{
366 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CITE, value);
367}
368
369DOMString HTMLModElement::dateTime() const
370{
371 if(!impl) return DOMString();
372 return ((ElementImpl *)impl)->getAttribute(ATTR_DATETIME);
373}
374
375void HTMLModElement::setDateTime( const DOMString &value )
376{
377 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_DATETIME, value);
378}
379
380// --------------------------------------------------------------------------
381
382HTMLQuoteElement::HTMLQuoteElement() : HTMLElement()
383{
384}
385
386HTMLQuoteElement::HTMLQuoteElement(const HTMLQuoteElement &other) : HTMLElement(other)
387{
388}
389
390HTMLQuoteElement::HTMLQuoteElement(HTMLGenericElementImpl *_impl)
391 : HTMLElement()
392{
393 if (_impl && _impl->id() == ID_Q)
394 impl = _impl;
395 else
396 impl = 0;
397 if ( impl ) impl->ref();
398}
399
400HTMLQuoteElement &HTMLQuoteElement::operator = (const Node &other)
401{
402 assignOther( other, ID_Q );
403 return *this;
404}
405
406HTMLQuoteElement &HTMLQuoteElement::operator = (const HTMLQuoteElement &other)
407{
408 HTMLElement::operator = (other);
409 return *this;
410}
411
412HTMLQuoteElement::~HTMLQuoteElement()
413{
414}
415
416DOMString HTMLQuoteElement::cite() const
417{
418 if(!impl) return DOMString();
419 return ((ElementImpl *)impl)->getAttribute(ATTR_CITE);
420}
421
422void HTMLQuoteElement::setCite( const DOMString &value )
423{
424 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CITE, value);
425}
426
DOM::DOMString
This class implements the basic string we use in the DOM.
Definition: dom_string.h:44
DOM::DOMString::parsedUrl
DOMString parsedUrl() const
Return a parsed url.
Definition: dom_string.cpp:300
DOM::DOMString::isNull
bool isNull() const
Definition: dom_string.h:121
DOM::DOMString::string
QString string() const
Definition: dom_string.cpp:236
DOM::Element::getAttribute
DOMString getAttribute(const DOMString &name)
Retrieves an attribute value by name.
Definition: dom_element.cpp:147
DOM::HTMLAnchorElement
The anchor element.
Definition: html_inline.h:47
DOM::HTMLAnchorElement::setAccessKey
void setAccessKey(const DOMString &)
see accessKey
Definition: html_inline.cpp:68
DOM::HTMLAnchorElement::rev
DOMString rev() const
Reverse link type.
Definition: html_inline.cpp:140
DOM::HTMLAnchorElement::focus
void focus()
Gives keyboard focus to this element.
Definition: html_inline.cpp:203
DOM::HTMLAnchorElement::setHref
void setHref(const DOMString &)
see href
Definition: html_inline.cpp:102
DOM::HTMLAnchorElement::hreflang
DOMString hreflang() const
Language code of the linked resource.
Definition: html_inline.cpp:107
DOM::HTMLAnchorElement::coords
DOMString coords() const
Comma-separated list of lengths, defining an active region geometry.
Definition: html_inline.cpp:84
DOM::HTMLAnchorElement::type
DOMString type() const
Advisory content type.
Definition: html_inline.cpp:187
DOM::HTMLAnchorElement::operator=
HTMLAnchorElement & operator=(const HTMLAnchorElement &other)
Definition: html_inline.cpp:52
DOM::HTMLAnchorElement::tabIndex
long tabIndex() const
Index that represents the element's position in the tabbing order.
Definition: html_inline.cpp:162
DOM::HTMLAnchorElement::setCharset
void setCharset(const DOMString &)
see charset
Definition: html_inline.cpp:79
DOM::HTMLAnchorElement::setName
void setName(const DOMString &)
see name
Definition: html_inline.cpp:124
DOM::HTMLAnchorElement::setRev
void setRev(const DOMString &)
see rev
Definition: html_inline.cpp:146
DOM::HTMLAnchorElement::~HTMLAnchorElement
~HTMLAnchorElement()
Definition: html_inline.cpp:58
DOM::HTMLAnchorElement::setShape
void setShape(const DOMString &)
see shape
Definition: html_inline.cpp:157
DOM::HTMLAnchorElement::shape
DOMString shape() const
The shape of the active area.
Definition: html_inline.cpp:151
DOM::HTMLAnchorElement::setRel
void setRel(const DOMString &)
see rel
Definition: html_inline.cpp:135
DOM::HTMLAnchorElement::setHreflang
void setHreflang(const DOMString &)
see hreflang
Definition: html_inline.cpp:113
DOM::HTMLAnchorElement::setTarget
void setTarget(const DOMString &)
see target
Definition: html_inline.cpp:182
DOM::HTMLAnchorElement::href
DOMString href() const
The URI of the linked resource.
Definition: html_inline.cpp:95
DOM::HTMLAnchorElement::blur
void blur()
Removes keyboard focus from this element.
Definition: html_inline.cpp:198
DOM::HTMLAnchorElement::HTMLAnchorElement
HTMLAnchorElement()
Definition: html_inline.cpp:34
DOM::HTMLAnchorElement::accessKey
DOMString accessKey() const
A single character access key to give access to the form control.
Definition: html_inline.cpp:62
DOM::HTMLAnchorElement::name
DOMString name() const
Anchor name.
Definition: html_inline.cpp:118
DOM::HTMLAnchorElement::setType
void setType(const DOMString &)
see type
Definition: html_inline.cpp:193
DOM::HTMLAnchorElement::setCoords
void setCoords(const DOMString &)
see coords
Definition: html_inline.cpp:90
DOM::HTMLAnchorElement::setTabIndex
void setTabIndex(long)
see tabIndex
Definition: html_inline.cpp:168
DOM::HTMLAnchorElement::target
DOMString target() const
Frame to render the resource in.
Definition: html_inline.cpp:176
DOM::HTMLAnchorElement::charset
DOMString charset() const
The character encoding of the linked resource.
Definition: html_inline.cpp:73
DOM::HTMLAnchorElement::rel
DOMString rel() const
Forward link type.
Definition: html_inline.cpp:129
DOM::HTMLBRElement
Force a line break.
Definition: html_inline.h:251
DOM::HTMLBRElement::setClear
void setClear(const DOMString &)
see clear
Definition: html_inline.cpp:244
DOM::HTMLBRElement::~HTMLBRElement
~HTMLBRElement()
Definition: html_inline.cpp:234
DOM::HTMLBRElement::HTMLBRElement
HTMLBRElement()
Definition: html_inline.cpp:210
DOM::HTMLBRElement::clear
DOMString clear() const
Control flow of text around floats.
Definition: html_inline.cpp:238
DOM::HTMLBRElement::operator=
HTMLBRElement & operator=(const HTMLBRElement &other)
Definition: html_inline.cpp:228
DOM::HTMLElement
All HTML element interfaces derive from this class.
Definition: html_element.h:70
DOM::HTMLElement::assignOther
void assignOther(const Node &other, int elementId)
Definition: html_element.cpp:176
DOM::HTMLElement::operator=
HTMLElement & operator=(const HTMLElement &other)
Definition: html_element.cpp:41
DOM::HTMLFontElement
Local change to font.
Definition: html_inline.h:294
DOM::HTMLFontElement::operator=
HTMLFontElement & operator=(const HTMLFontElement &other)
Definition: html_inline.cpp:269
DOM::HTMLFontElement::face
DOMString face() const
Font face identifier.
Definition: html_inline.cpp:290
DOM::HTMLFontElement::~HTMLFontElement
~HTMLFontElement()
Definition: html_inline.cpp:275
DOM::HTMLFontElement::size
DOMString size() const
Font size.
Definition: html_inline.cpp:301
DOM::HTMLFontElement::setFace
void setFace(const DOMString &)
see face
Definition: html_inline.cpp:296
DOM::HTMLFontElement::HTMLFontElement
HTMLFontElement()
Definition: html_inline.cpp:251
DOM::HTMLFontElement::setColor
void setColor(const DOMString &)
see color
Definition: html_inline.cpp:285
DOM::HTMLFontElement::color
DOMString color() const
Font color.
Definition: html_inline.cpp:279
DOM::HTMLFontElement::setSize
void setSize(const DOMString &)
see size
Definition: html_inline.cpp:307
DOM::HTMLModElement
Notice of modification to part of a document.
Definition: html_inline.h:363
DOM::HTMLModElement::operator=
HTMLModElement & operator=(const HTMLModElement &other)
Definition: html_inline.cpp:348
DOM::HTMLModElement::HTMLModElement
HTMLModElement()
Definition: html_inline.cpp:315
DOM::HTMLModElement::setDateTime
void setDateTime(const DOMString &)
see dateTime
Definition: html_inline.cpp:375
DOM::HTMLModElement::setCite
void setCite(const DOMString &)
see cite
Definition: html_inline.cpp:364
DOM::HTMLModElement::cite
DOMString cite() const
A URI designating a document that describes the reason for the change.
Definition: html_inline.cpp:358
DOM::HTMLModElement::~HTMLModElement
~HTMLModElement()
Definition: html_inline.cpp:354
DOM::HTMLModElement::dateTime
DOMString dateTime() const
The date and time of the change.
Definition: html_inline.cpp:369
DOM::HTMLQuoteElement
For the Q and BLOCKQUOTE elements.
Definition: html_inline.h:420
DOM::HTMLQuoteElement::setCite
void setCite(const DOMString &)
see cite
Definition: html_inline.cpp:422
DOM::HTMLQuoteElement::~HTMLQuoteElement
~HTMLQuoteElement()
Definition: html_inline.cpp:412
DOM::HTMLQuoteElement::HTMLQuoteElement
HTMLQuoteElement()
Definition: html_inline.cpp:382
DOM::HTMLQuoteElement::cite
DOMString cite() const
A URI designating a document that designates a source document or message.
Definition: html_inline.cpp:416
DOM::HTMLQuoteElement::operator=
HTMLQuoteElement & operator=(const HTMLQuoteElement &other)
Definition: html_inline.cpp:406
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::operator=
Node & operator=(const Node &other)
Definition: dom_node.cpp:145
DOM::Node::impl
NodeImpl * impl
Definition: dom_node.h:948
DOM::Node::elementId
quint32 elementId() const
Definition: dom_node.cpp:400
dom_doc.h
html_inline.h
DOM
This library provides a full-featured HTML parser and widget.
Definition: design.h:55
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