html_block.cpp
00001
00022
00023
00024
00025 #include "dom/html_block.h"
00026 #include "html/html_blockimpl.h"
00027
00028 using namespace DOM;
00029
00030 #include "misc/htmlhashes.h"
00031
00032 HTMLBlockquoteElement::HTMLBlockquoteElement()
00033 : HTMLElement()
00034 {
00035 }
00036
00037 HTMLBlockquoteElement::HTMLBlockquoteElement(const HTMLBlockquoteElement &other)
00038 : HTMLElement(other)
00039 {
00040 }
00041
00042 HTMLBlockquoteElement::HTMLBlockquoteElement(HTMLElementImpl *impl)
00043 : HTMLElement(impl)
00044 {
00045 }
00046
00047 HTMLBlockquoteElement &HTMLBlockquoteElement::operator = (const Node &other)
00048 {
00049 assignOther( other, ID_BLOCKQUOTE );
00050 return *this;
00051 }
00052
00053 HTMLBlockquoteElement &HTMLBlockquoteElement::operator = (const HTMLBlockquoteElement &other)
00054 {
00055 HTMLElement::operator = (other);
00056 return *this;
00057 }
00058
00059 HTMLBlockquoteElement::~HTMLBlockquoteElement()
00060 {
00061 }
00062
00063 DOMString HTMLBlockquoteElement::cite() const
00064 {
00065 if(!impl) return DOMString();
00066 return ((ElementImpl *)impl)->getAttribute(ATTR_CITE);
00067 }
00068
00069 void HTMLBlockquoteElement::setCite( const DOMString &value )
00070 {
00071 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CITE, value);
00072 }
00073
00074
00075
00076 HTMLDivElement::HTMLDivElement()
00077 : HTMLElement()
00078 {
00079 }
00080
00081 HTMLDivElement::HTMLDivElement(const HTMLDivElement &other)
00082 : HTMLElement(other)
00083 {
00084 }
00085
00086 HTMLDivElement::HTMLDivElement(HTMLDivElementImpl *impl)
00087 : HTMLElement(impl)
00088 {
00089 }
00090
00091 HTMLDivElement &HTMLDivElement::operator = (const Node &other)
00092 {
00093 assignOther( other, ID_DIV );
00094 return *this;
00095 }
00096
00097 HTMLDivElement &HTMLDivElement::operator = (const HTMLDivElement &other)
00098 {
00099 HTMLElement::operator = (other);
00100 return *this;
00101 }
00102
00103 HTMLDivElement::~HTMLDivElement()
00104 {
00105 }
00106
00107 DOMString HTMLDivElement::align() const
00108 {
00109 if(!impl) return DOMString();
00110 return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
00111 }
00112
00113 void HTMLDivElement::setAlign( const DOMString &value )
00114 {
00115 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
00116 }
00117
00118
00119
00120 HTMLHRElement::HTMLHRElement()
00121 : HTMLElement()
00122 {
00123 }
00124
00125 HTMLHRElement::HTMLHRElement(const HTMLHRElement &other)
00126 : HTMLElement(other)
00127 {
00128 }
00129
00130 HTMLHRElement::HTMLHRElement(HTMLHRElementImpl *impl)
00131 : HTMLElement(impl)
00132 {
00133 }
00134
00135 HTMLHRElement &HTMLHRElement::operator = (const Node &other)
00136 {
00137 assignOther( other, ID_HR );
00138 return *this;
00139 }
00140
00141 HTMLHRElement &HTMLHRElement::operator = (const HTMLHRElement &other)
00142 {
00143 HTMLElement::operator = (other);
00144 return *this;
00145 }
00146
00147 HTMLHRElement::~HTMLHRElement()
00148 {
00149 }
00150
00151 DOMString HTMLHRElement::align() const
00152 {
00153 if(!impl) return DOMString();
00154 return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
00155 }
00156
00157 void HTMLHRElement::setAlign( const DOMString &value )
00158 {
00159 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
00160 }
00161
00162 bool HTMLHRElement::noShade() const
00163 {
00164 if(!impl) return false;
00165 return !((ElementImpl *)impl)->getAttribute(ATTR_NOSHADE).isNull();
00166 }
00167
00168 void HTMLHRElement::setNoShade( bool _noShade )
00169 {
00170 if(impl)
00171 {
00172 DOMString str;
00173 if( _noShade )
00174 str = "";
00175 ((ElementImpl *)impl)->setAttribute(ATTR_NOSHADE, str);
00176 }
00177 }
00178
00179 DOMString HTMLHRElement::size() const
00180 {
00181 if(!impl) return DOMString();
00182 return ((ElementImpl *)impl)->getAttribute(ATTR_SIZE);
00183 }
00184
00185 void HTMLHRElement::setSize( const DOMString &value )
00186 {
00187 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SIZE, value);
00188 }
00189
00190 DOMString HTMLHRElement::width() const
00191 {
00192 if(!impl) return DOMString();
00193 return ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH);
00194 }
00195
00196 void HTMLHRElement::setWidth( const DOMString &value )
00197 {
00198 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value);
00199 }
00200
00201
00202
00203 HTMLHeadingElement::HTMLHeadingElement()
00204 : HTMLElement()
00205 {
00206 }
00207
00208 HTMLHeadingElement::HTMLHeadingElement(const HTMLHeadingElement &other)
00209 : HTMLElement(other)
00210 {
00211 }
00212
00213 HTMLHeadingElement::HTMLHeadingElement(HTMLElementImpl *impl)
00214 : HTMLElement(impl)
00215 {
00216 }
00217
00218 HTMLHeadingElement &HTMLHeadingElement::operator = (const Node &other)
00219 {
00220 if(other.elementId() != ID_H1 &&
00221 other.elementId() != ID_H2 &&
00222 other.elementId() != ID_H3 &&
00223 other.elementId() != ID_H4 &&
00224 other.elementId() != ID_H5 &&
00225 other.elementId() != ID_H6 )
00226 {
00227 if ( impl ) impl->deref();
00228 impl = 0;
00229 } else {
00230 Node::operator = (other);
00231 }
00232 return *this;
00233 }
00234
00235 HTMLHeadingElement &HTMLHeadingElement::operator = (const HTMLHeadingElement &other)
00236 {
00237 HTMLElement::operator = (other);
00238 return *this;
00239 }
00240
00241 HTMLHeadingElement::~HTMLHeadingElement()
00242 {
00243 }
00244
00245 DOMString HTMLHeadingElement::align() const
00246 {
00247 if(!impl) return DOMString();
00248 return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
00249 }
00250
00251 void HTMLHeadingElement::setAlign( const DOMString &value )
00252 {
00253 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
00254 }
00255
00256
00257
00258 HTMLParagraphElement::HTMLParagraphElement() : HTMLElement()
00259 {
00260 }
00261
00262 HTMLParagraphElement::HTMLParagraphElement(const HTMLParagraphElement &other)
00263 : HTMLElement(other)
00264 {
00265 }
00266
00267 HTMLParagraphElement::HTMLParagraphElement(HTMLElementImpl *impl)
00268 : HTMLElement(impl)
00269 {
00270 }
00271
00272 HTMLParagraphElement &HTMLParagraphElement::operator = (const Node &other)
00273 {
00274 assignOther( other, ID_P );
00275 return *this;
00276 }
00277
00278 HTMLParagraphElement &HTMLParagraphElement::operator = (const HTMLParagraphElement &other)
00279 {
00280 HTMLElement::operator = (other);
00281 return *this;
00282 }
00283
00284 HTMLParagraphElement::~HTMLParagraphElement()
00285 {
00286 }
00287
00288 DOMString HTMLParagraphElement::align() const
00289 {
00290 if(!impl) return DOMString();
00291 return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
00292 }
00293
00294 void HTMLParagraphElement::setAlign( const DOMString &value )
00295 {
00296 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
00297 }
00298
00299
00300
00301 HTMLPreElement::HTMLPreElement() : HTMLElement()
00302 {
00303 }
00304
00305 HTMLPreElement::HTMLPreElement(const HTMLPreElement &other)
00306 : HTMLElement(other)
00307 {
00308 }
00309
00310 HTMLPreElement::HTMLPreElement(HTMLPreElementImpl *impl)
00311 : HTMLElement(impl)
00312 {
00313 }
00314
00315 HTMLPreElement &HTMLPreElement::operator = (const Node &other)
00316 {
00317 assignOther( other, ID_PRE );
00318 return *this;
00319 }
00320
00321 HTMLPreElement &HTMLPreElement::operator = (const HTMLPreElement &other)
00322 {
00323 HTMLElement::operator = (other);
00324 return *this;
00325 }
00326
00327 HTMLPreElement::~HTMLPreElement()
00328 {
00329 }
00330
00331 long HTMLPreElement::width() const
00332 {
00333 if(!impl) return 0;
00334 DOMString w = ((ElementImpl *)impl)->getAttribute(ATTR_WIDTH);
00335 return w.toInt();
00336 }
00337
00338 void HTMLPreElement::setWidth( long _width )
00339 {
00340 if(!impl) return;
00341
00342 QString aStr;
00343 aStr.sprintf("%ld", _width);
00344 DOMString value(aStr);
00345 ((ElementImpl *)impl)->setAttribute(ATTR_WIDTH, value);
00346 }
00347
This file is part of the documentation for khtml Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Apr 21 18:45:02 2004 by
doxygen 1.3.6-20040222 written by
Dimitri van Heesch, © 1997-2003