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

tdehtml

  • tdehtml
  • dom
html_block.cpp
1 
23 // --------------------------------------------------------------------------
24 
25 
26 #include "dom/html_block.h"
27 #include "dom/html_misc.h"
28 #include "html/html_blockimpl.h"
29 #include "html/html_miscimpl.h"
30 
31 using namespace DOM;
32 
33 #include "misc/htmlhashes.h"
34 
35 HTMLBlockquoteElement::HTMLBlockquoteElement()
36  : HTMLElement()
37 {
38 }
39 
40 HTMLBlockquoteElement::HTMLBlockquoteElement(const HTMLBlockquoteElement &other)
41  : HTMLElement(other)
42 {
43 }
44 
45 HTMLBlockquoteElement::HTMLBlockquoteElement(HTMLElementImpl *impl)
46  : HTMLElement(impl)
47 {
48 }
49 
50 HTMLBlockquoteElement &HTMLBlockquoteElement::operator = (const Node &other)
51 {
52  assignOther( other, ID_BLOCKQUOTE );
53  return *this;
54 }
55 
56 HTMLBlockquoteElement &HTMLBlockquoteElement::operator = (const HTMLBlockquoteElement &other)
57 {
58  HTMLElement::operator = (other);
59  return *this;
60 }
61 
62 HTMLBlockquoteElement::~HTMLBlockquoteElement()
63 {
64 }
65 
66 DOMString HTMLBlockquoteElement::cite() const
67 {
68  if(!impl) return DOMString();
69  return ((ElementImpl *)impl)->getAttribute(ATTR_CITE);
70 }
71 
72 void HTMLBlockquoteElement::setCite( const DOMString &value )
73 {
74  if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CITE, value);
75 }
76 
77 // --------------------------------------------------------------------------
78 
79 HTMLDivElement::HTMLDivElement()
80  : HTMLElement()
81 {
82 }
83 
84 HTMLDivElement::HTMLDivElement(const HTMLDivElement &other)
85  : HTMLElement(other)
86 {
87 }
88 
89 HTMLDivElement::HTMLDivElement(HTMLDivElementImpl *impl)
90  : HTMLElement(impl)
91 {
92 }
93 
94 HTMLDivElement &HTMLDivElement::operator = (const Node &other)
95 {
96  assignOther( other, ID_DIV );
97  return *this;
98 }
99 
100 HTMLDivElement &HTMLDivElement::operator = (const HTMLDivElement &other)
101 {
102  HTMLElement::operator = (other);
103  return *this;
104 }
105 
106 HTMLDivElement::~HTMLDivElement()
107 {
108 }
109 
110 DOMString HTMLDivElement::align() const
111 {
112  if(!impl) return DOMString();
113  return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
114 }
115 
116 void HTMLDivElement::setAlign( const DOMString &value )
117 {
118  if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
119 }
120 
121 // --------------------------------------------------------------------------
122 
123 HTMLHRElement::HTMLHRElement()
124  : HTMLElement()
125 {
126 }
127 
128 HTMLHRElement::HTMLHRElement(const HTMLHRElement &other)
129  : HTMLElement(other)
130 {
131 }
132 
133 HTMLHRElement::HTMLHRElement(HTMLHRElementImpl *impl)
134  : HTMLElement(impl)
135 {
136 }
137 
138 HTMLHRElement &HTMLHRElement::operator = (const Node &other)
139 {
140  assignOther( other, ID_HR );
141  return *this;
142 }
143 
144 HTMLHRElement &HTMLHRElement::operator = (const HTMLHRElement &other)
145 {
146  HTMLElement::operator = (other);
147  return *this;
148 }
149 
150 HTMLHRElement::~HTMLHRElement()
151 {
152 }
153 
154 DOMString HTMLHRElement::align() const
155 {
156  if(!impl) return DOMString();
157  return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
158 }
159 
160 void HTMLHRElement::setAlign( const DOMString &value )
161 {
162  if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
163 }
164 
165 bool HTMLHRElement::noShade() const
166 {
167  if(!impl) return false;
168  return !((ElementImpl *)impl)->getAttribute(ATTR_NOSHADE).isNull();
169 }
170 
171 void HTMLHRElement::setNoShade( bool _noShade )
172 {
173  if(impl)
174  {
175  DOMString str;
176  if( _noShade )
177  str = "";
178  ((ElementImpl *)impl)->setAttribute(ATTR_NOSHADE, str);
179  }
180 }
181 
182 DOMString HTMLHRElement::size() const
183 {
184  if(!impl) return DOMString();
185  return ((ElementImpl *)impl)->getAttribute(ATTR_SIZE);
186 }
187 
188 void HTMLHRElement::setSize( const DOMString &value )
189 {
190  if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SIZE, value);
191 }
192 
193 DOMString HTMLHRElement::width() const
194 {
195  if(!impl) return DOMString();
196  return ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH);
197 }
198 
199 void HTMLHRElement::setWidth( const DOMString &value )
200 {
201  if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value);
202 }
203 
204 // --------------------------------------------------------------------------
205 
206 HTMLHeadingElement::HTMLHeadingElement()
207  : HTMLElement()
208 {
209 }
210 
211 HTMLHeadingElement::HTMLHeadingElement(const HTMLHeadingElement &other)
212  : HTMLElement(other)
213 {
214 }
215 
216 HTMLHeadingElement::HTMLHeadingElement(HTMLElementImpl *impl)
217  : HTMLElement(impl)
218 {
219 }
220 
221 HTMLHeadingElement &HTMLHeadingElement::operator = (const Node &other)
222 {
223  if(other.elementId() != ID_H1 &&
224  other.elementId() != ID_H2 &&
225  other.elementId() != ID_H3 &&
226  other.elementId() != ID_H4 &&
227  other.elementId() != ID_H5 &&
228  other.elementId() != ID_H6 )
229  {
230  if ( impl ) impl->deref();
231  impl = 0;
232  } else {
233  Node::operator = (other);
234  }
235  return *this;
236 }
237 
238 HTMLHeadingElement &HTMLHeadingElement::operator = (const HTMLHeadingElement &other)
239 {
240  HTMLElement::operator = (other);
241  return *this;
242 }
243 
244 HTMLHeadingElement::~HTMLHeadingElement()
245 {
246 }
247 
248 DOMString HTMLHeadingElement::align() const
249 {
250  if(!impl) return DOMString();
251  return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
252 }
253 
254 void HTMLHeadingElement::setAlign( const DOMString &value )
255 {
256  if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
257 }
258 
259 // --------------------------------------------------------------------------
260 
261 HTMLParagraphElement::HTMLParagraphElement() : HTMLElement()
262 {
263 }
264 
265 HTMLParagraphElement::HTMLParagraphElement(const HTMLParagraphElement &other)
266  : HTMLElement(other)
267 {
268 }
269 
270 HTMLParagraphElement::HTMLParagraphElement(HTMLElementImpl *impl)
271  : HTMLElement(impl)
272 {
273 }
274 
275 HTMLParagraphElement &HTMLParagraphElement::operator = (const Node &other)
276 {
277  assignOther( other, ID_P );
278  return *this;
279 }
280 
281 HTMLParagraphElement &HTMLParagraphElement::operator = (const HTMLParagraphElement &other)
282 {
283  HTMLElement::operator = (other);
284  return *this;
285 }
286 
287 HTMLParagraphElement::~HTMLParagraphElement()
288 {
289 }
290 
291 DOMString HTMLParagraphElement::align() const
292 {
293  if(!impl) return DOMString();
294  return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
295 }
296 
297 void HTMLParagraphElement::setAlign( const DOMString &value )
298 {
299  if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
300 }
301 
302 // --------------------------------------------------------------------------
303 
304 HTMLPreElement::HTMLPreElement() : HTMLElement()
305 {
306 }
307 
308 HTMLPreElement::HTMLPreElement(const HTMLPreElement &other)
309  : HTMLElement(other)
310 {
311 }
312 
313 HTMLPreElement::HTMLPreElement(HTMLPreElementImpl *impl)
314  : HTMLElement(impl)
315 {
316 }
317 
318 HTMLPreElement &HTMLPreElement::operator = (const Node &other)
319 {
320  assignOther( other, ID_PRE );
321  return *this;
322 }
323 
324 HTMLPreElement &HTMLPreElement::operator = (const HTMLPreElement &other)
325 {
326  HTMLElement::operator = (other);
327  return *this;
328 }
329 
330 HTMLPreElement::~HTMLPreElement()
331 {
332 }
333 
334 long HTMLPreElement::width() const
335 {
336  if(!impl) return 0;
337  DOMString w = ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH);
338  return w.toInt();
339 }
340 
341 void HTMLPreElement::setWidth( long _width )
342 {
343  if(!impl) return;
344 
345  TQString aStr;
346  aStr.sprintf("%ld", _width);
347  DOMString value(aStr);
348  ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value);
349 }
350 
351 // --------------------------------------------------------------------------
352 
353 HTMLLayerElement::HTMLLayerElement() : HTMLElement()
354 {
355 }
356 
357 HTMLLayerElement::HTMLLayerElement(const HTMLLayerElement &other)
358  : HTMLElement(other)
359 {
360 }
361 
362 HTMLLayerElement::HTMLLayerElement(HTMLLayerElementImpl *impl)
363  : HTMLElement(impl)
364 {
365 }
366 
367 HTMLLayerElement &HTMLLayerElement::operator = (const Node &other)
368 {
369  assignOther( other, ID_LAYER );
370  return *this;
371 }
372 
373 HTMLLayerElement &HTMLLayerElement::operator = (const HTMLLayerElement &other)
374 {
375  HTMLElement::operator = (other);
376  return *this;
377 }
378 
379 HTMLLayerElement::~HTMLLayerElement()
380 {
381 }
382 
383 long HTMLLayerElement::top() const
384 {
385  if(!impl) return 0;
386  DOMString t = ((ElementImpl *)impl)->getAttribute(ATTR_TOP);
387  return t.toInt();
388 }
389 
390 void HTMLLayerElement::setTop( long _top )
391 {
392  if(!impl) return;
393 
394  TQString aStr;
395  aStr.sprintf("%ld", _top);
396  DOMString value(aStr);
397  ((ElementImpl *)impl)->setAttribute(ATTR_TOP, value);
398 }
399 
400 long HTMLLayerElement::left() const
401 {
402  if(!impl) return 0;
403  DOMString l = ((ElementImpl *)impl)->getAttribute(ATTR_LEFT);
404  return l.toInt();
405 }
406 
407 void HTMLLayerElement::setLeft( long _left )
408 {
409  if(!impl) return;
410 
411  TQString aStr;
412  aStr.sprintf("%ld", _left);
413  DOMString value(aStr);
414  ((ElementImpl *)impl)->setAttribute(ATTR_LEFT, value);
415 }
416 
417 DOMString HTMLLayerElement::visibility() const
418 {
419  if(!impl) return DOMString();
420  return ((ElementImpl *)impl)->getAttribute(ATTR_VISIBILITY);
421 }
422 
423 void HTMLLayerElement::setVisibility( const DOMString &value )
424 {
425  if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VISIBILITY, value);
426 }
427 
428 DOMString HTMLLayerElement::bgColor() const
429 {
430  if(!impl) return DOMString();
431  return ((ElementImpl *)impl)->getAttribute(ATTR_BGCOLOR);
432 }
433 
434 void HTMLLayerElement::setBgColor( const DOMString &value )
435 {
436  if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_BGCOLOR, value);
437 }
438 
439 HTMLCollection HTMLLayerElement::layers() const
440 {
441  if(!impl) return HTMLCollection();
442  return HTMLCollection(impl, HTMLCollectionImpl::DOC_LAYERS);
443 }
DOM::HTMLLayerElement::top
long top() const
The absolute position of the layer from the top.
Definition: html_block.cpp:383
DOM::Node
The Node interface is the primary datatype for the entire Document Object Model.
Definition: dom_node.h:274
DOM::HTMLLayerElement
Layer container for Netscape 4.x compatability.
Definition: html_block.h:337
DOM::HTMLLayerElement::left
long left() const
The absolute position of the layer from the left.
Definition: html_block.cpp:400
DOM::HTMLParagraphElement::setAlign
void setAlign(const DOMString &)
see align
Definition: html_block.cpp:297
DOM::HTMLPreElement::width
long width() const
Fixed width for content.
Definition: html_block.cpp:334
DOM::HTMLLayerElement::bgColor
DOMString bgColor() const
The background color of the layer.
Definition: html_block.cpp:428
DOM::HTMLLayerElement::setBgColor
void setBgColor(const DOMString &)
see bgColor
Definition: html_block.cpp:434
DOM::HTMLHRElement::width
DOMString width() const
The width of the rule.
Definition: html_block.cpp:193
DOM::HTMLCollection
An HTMLCollection is a list of nodes.
Definition: html_misc.h:126
DOM::HTMLLayerElement::setTop
void setTop(long)
see top
Definition: html_block.cpp:390
DOM::HTMLBlockquoteElement::cite
DOMString cite() const
A URI designating a document that describes the reason for the change.
Definition: html_block.cpp:66
DOM::HTMLHeadingElement::align
DOMString align() const
Horizontal text alignment.
Definition: html_block.cpp:248
DOM::HTMLLayerElement::layers
HTMLCollection layers() const
The collection of sub-layers.
Definition: html_block.cpp:439
DOM::HTMLDivElement::setAlign
void setAlign(const DOMString &)
see align
Definition: html_block.cpp:116
DOM::HTMLParagraphElement
Paragraphs.
Definition: html_block.h:258
DOM::HTMLHRElement::noShade
bool noShade() const
Indicates to the user agent that there should be no shading in the rendering of this element...
Definition: html_block.cpp:165
DOM::DOMString
This class implements the basic string we use in the DOM.
Definition: dom_string.h:43
DOM::HTMLHeadingElement
For the H1 to H6 elements.
Definition: html_block.h:217
DOM::HTMLHRElement::setNoShade
void setNoShade(bool)
see noShade
Definition: html_block.cpp:171
DOM::HTMLHRElement::size
DOMString size() const
The height of the rule.
Definition: html_block.cpp:182
DOM::HTMLLayerElement::setLeft
void setLeft(long)
see left
Definition: html_block.cpp:407
DOM::HTMLHRElement::align
DOMString align() const
Align the rule on the page.
Definition: html_block.cpp:154
DOM::HTMLDivElement::align
DOMString align() const
Horizontal text alignment.
Definition: html_block.cpp:110
DOM::HTMLBlockquoteElement
??? See the BLOCKQUOTE element definition in HTML 4.0.
Definition: html_block.h:50
DOM::HTMLPreElement
Preformatted text.
Definition: html_block.h:299
DOM
The Document Object Model (DOM) is divided into two parts, the COREDOM core DOM, specifying some core...
Definition: design.h:56
DOM::HTMLHRElement::setWidth
void setWidth(const DOMString &)
see width
Definition: html_block.cpp:199
DOM::HTMLDivElement
Generic block container.
Definition: html_block.h:91
DOM::HTMLParagraphElement::align
DOMString align() const
Horizontal text alignment.
Definition: html_block.cpp:291
DOM::HTMLHeadingElement::setAlign
void setAlign(const DOMString &)
see align
Definition: html_block.cpp:254
DOM::HTMLPreElement::setWidth
void setWidth(long)
see width
Definition: html_block.cpp:341
DOM::HTMLLayerElement::setVisibility
void setVisibility(const DOMString &)
see visibility
Definition: html_block.cpp:423
DOM::HTMLHRElement::setAlign
void setAlign(const DOMString &)
see align
Definition: html_block.cpp:160
DOM::HTMLBlockquoteElement::setCite
void setCite(const DOMString &)
see cite
Definition: html_block.cpp:72
DOM::HTMLElement
All HTML element interfaces derive from this class.
Definition: html_element.h:69
DOM::HTMLHRElement::setSize
void setSize(const DOMString &)
see size
Definition: html_block.cpp:188
DOM::HTMLLayerElement::visibility
DOMString visibility() const
The visibility of layers is either "show" or "hide".
Definition: html_block.cpp:417
DOM::HTMLHRElement
Create a horizontal rule.
Definition: html_block.h:133

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
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdehtml by doxygen 1.8.8
This website is maintained by Timothy Pearson.