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