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