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

KHTML

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