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

tdehtml

  • tdehtml
  • dom
html_inline.cpp
1 
23 // --------------------------------------------------------------------------
24 
25 #include "dom/dom_doc.h"
26 #include "dom/html_inline.h"
27 #include "html/html_inlineimpl.h"
28 #include "html/html_baseimpl.h"
29 #include "xml/dom_docimpl.h"
30 #include "misc/htmlhashes.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->getDocument()->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(TQString::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 && impl->getDocument()->focusNode()==impl)
201  impl->getDocument()->setFocusNode(0);
202 }
203 
204 void HTMLAnchorElement::focus( )
205 {
206  if(impl)
207  impl->getDocument()->setFocusNode(static_cast<ElementImpl*>(impl));
208 }
209 
210 void HTMLAnchorElement::click( )
211 {
212  if(impl) ((HTMLAnchorElement *)impl)->click();
213 }
214 
215 
216 // --------------------------------------------------------------------------
217 
218 HTMLBRElement::HTMLBRElement() : HTMLElement()
219 {
220 }
221 
222 HTMLBRElement::HTMLBRElement(const HTMLBRElement &other) : HTMLElement(other)
223 {
224 }
225 
226 HTMLBRElement::HTMLBRElement(HTMLBRElementImpl *impl) : HTMLElement(impl)
227 {
228 }
229 
230 HTMLBRElement &HTMLBRElement::operator = (const Node &other)
231 {
232  assignOther( other, ID_BR );
233  return *this;
234 }
235 
236 HTMLBRElement &HTMLBRElement::operator = (const HTMLBRElement &other)
237 {
238  HTMLElement::operator = (other);
239  return *this;
240 }
241 
242 HTMLBRElement::~HTMLBRElement()
243 {
244 }
245 
246 DOMString HTMLBRElement::clear() const
247 {
248  if(!impl) return DOMString();
249  return ((ElementImpl *)impl)->getAttribute(ATTR_CLEAR);
250 }
251 
252 void HTMLBRElement::setClear( const DOMString &value )
253 {
254  if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CLEAR, value);
255 }
256 
257 // --------------------------------------------------------------------------
258 
259 HTMLFontElement::HTMLFontElement() : HTMLElement()
260 {
261 }
262 
263 HTMLFontElement::HTMLFontElement(const HTMLFontElement &other) : HTMLElement(other)
264 {
265 }
266 
267 HTMLFontElement::HTMLFontElement(HTMLFontElementImpl *impl) : HTMLElement(impl)
268 {
269 }
270 
271 HTMLFontElement &HTMLFontElement::operator = (const Node &other)
272 {
273  assignOther( other, ID_FONT );
274  return *this;
275 }
276 
277 HTMLFontElement &HTMLFontElement::operator = (const HTMLFontElement &other)
278 {
279  HTMLElement::operator = (other);
280  return *this;
281 }
282 
283 HTMLFontElement::~HTMLFontElement()
284 {
285 }
286 
287 DOMString HTMLFontElement::color() const
288 {
289  if(!impl) return DOMString();
290  return ((ElementImpl *)impl)->getAttribute(ATTR_COLOR);
291 }
292 
293 void HTMLFontElement::setColor( const DOMString &value )
294 {
295  if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_COLOR, value);
296 }
297 
298 DOMString HTMLFontElement::face() const
299 {
300  if(!impl) return DOMString();
301  return ((ElementImpl *)impl)->getAttribute(ATTR_FACE);
302 }
303 
304 void HTMLFontElement::setFace( const DOMString &value )
305 {
306  if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_FACE, value);
307 }
308 
309 DOMString HTMLFontElement::size() const
310 {
311  if(!impl) return DOMString();
312  return ((ElementImpl *)impl)->getAttribute(ATTR_SIZE);
313 }
314 
315 void HTMLFontElement::setSize( const DOMString &value )
316 {
317  if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SIZE, value);
318 }
319 
320 
321 // --------------------------------------------------------------------------
322 
323 HTMLModElement::HTMLModElement() : HTMLElement()
324 {
325 }
326 
327 HTMLModElement::HTMLModElement(const HTMLModElement &other) : HTMLElement(other)
328 {
329 }
330 
331 HTMLModElement::HTMLModElement(HTMLElementImpl *_impl)
332  : HTMLElement()
333 {
334  if (_impl && (_impl->id() == ID_INS || _impl->id() == ID_DEL))
335  impl = _impl;
336  else
337  impl = 0;
338  if ( impl ) impl->ref();
339 }
340 
341 HTMLModElement &HTMLModElement::operator = (const Node &other)
342 {
343  if (other.handle() != handle()) {
344  if( other.elementId() != ID_INS &&
345  other.elementId() != ID_DEL )
346  {
347  if ( impl ) impl->deref();
348  impl = 0;
349  } else {
350  Node::operator = (other);
351  }
352  }
353  return *this;
354 }
355 
356 HTMLModElement &HTMLModElement::operator = (const HTMLModElement &other)
357 {
358  HTMLElement::operator = (other);
359  return *this;
360 }
361 
362 HTMLModElement::~HTMLModElement()
363 {
364 }
365 
366 DOMString HTMLModElement::cite() const
367 {
368  if(!impl) return DOMString();
369  return ((ElementImpl *)impl)->getAttribute(ATTR_CITE);
370 }
371 
372 void HTMLModElement::setCite( const DOMString &value )
373 {
374  if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CITE, value);
375 }
376 
377 DOMString HTMLModElement::dateTime() const
378 {
379  if(!impl) return DOMString();
380  return ((ElementImpl *)impl)->getAttribute(ATTR_DATETIME);
381 }
382 
383 void HTMLModElement::setDateTime( const DOMString &value )
384 {
385  if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_DATETIME, value);
386 }
387 
388 // --------------------------------------------------------------------------
389 
390 HTMLQuoteElement::HTMLQuoteElement() : HTMLElement()
391 {
392 }
393 
394 HTMLQuoteElement::HTMLQuoteElement(const HTMLQuoteElement &other) : HTMLElement(other)
395 {
396 }
397 
398 HTMLQuoteElement::HTMLQuoteElement(HTMLGenericElementImpl *_impl)
399  : HTMLElement()
400 {
401  if (_impl && _impl->id() == ID_Q)
402  impl = _impl;
403  else
404  impl = 0;
405  if ( impl ) impl->ref();
406 }
407 
408 HTMLQuoteElement &HTMLQuoteElement::operator = (const Node &other)
409 {
410  assignOther( other, ID_Q );
411  return *this;
412 }
413 
414 HTMLQuoteElement &HTMLQuoteElement::operator = (const HTMLQuoteElement &other)
415 {
416  HTMLElement::operator = (other);
417  return *this;
418 }
419 
420 HTMLQuoteElement::~HTMLQuoteElement()
421 {
422 }
423 
424 DOMString HTMLQuoteElement::cite() const
425 {
426  if(!impl) return DOMString();
427  return ((ElementImpl *)impl)->getAttribute(ATTR_CITE);
428 }
429 
430 void HTMLQuoteElement::setCite( const DOMString &value )
431 {
432  if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CITE, value);
433 }
434 
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::HTMLAnchorElement
The anchor element.
Definition: html_inline.h:48
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:204
DOM::HTMLAnchorElement::click
void click()
Simulate a mouse-click.
Definition: html_inline.cpp:210
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::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::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::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:260
DOM::HTMLBRElement::setClear
void setClear(const DOMString &)
see clear
Definition: html_inline.cpp:252
DOM::HTMLBRElement::clear
DOMString clear() const
Control flow of text around floats.
Definition: html_inline.cpp:246
DOM::HTMLElement
All HTML element interfaces derive from this class.
Definition: html_element.h:70
DOM::HTMLFontElement
Local change to font.
Definition: html_inline.h:303
DOM::HTMLFontElement::face
DOMString face() const
Font face identifier.
Definition: html_inline.cpp:298
DOM::HTMLFontElement::size
DOMString size() const
Font size.
Definition: html_inline.cpp:309
DOM::HTMLFontElement::setFace
void setFace(const DOMString &)
see face
Definition: html_inline.cpp:304
DOM::HTMLFontElement::setColor
void setColor(const DOMString &)
see color
Definition: html_inline.cpp:293
DOM::HTMLFontElement::color
DOMString color() const
Font color.
Definition: html_inline.cpp:287
DOM::HTMLFontElement::setSize
void setSize(const DOMString &)
see size
Definition: html_inline.cpp:315
DOM::HTMLModElement
Notice of modification to part of a document.
Definition: html_inline.h:373
DOM::HTMLModElement::setDateTime
void setDateTime(const DOMString &)
see dateTime
Definition: html_inline.cpp:383
DOM::HTMLModElement::setCite
void setCite(const DOMString &)
see cite
Definition: html_inline.cpp:372
DOM::HTMLModElement::cite
DOMString cite() const
A URI designating a document that describes the reason for the change.
Definition: html_inline.cpp:366
DOM::HTMLModElement::dateTime
DOMString dateTime() const
The date and time of the change.
Definition: html_inline.cpp:377
DOM::HTMLQuoteElement
For the Q and BLOCKQUOTE elements.
Definition: html_inline.h:431
DOM::HTMLQuoteElement::setCite
void setCite(const DOMString &)
see cite
Definition: html_inline.cpp:430
DOM::HTMLQuoteElement::cite
DOMString cite() const
A URI designating a document that designates a source document or message.
Definition: html_inline.cpp:424
DOM::Node
The Node interface is the primary datatype for the entire Document Object Model.
Definition: dom_node.h:275
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.1
This website is maintained by Timothy Pearson.