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