html_form.cpp

00001 
00022 // --------------------------------------------------------------------------
00023 
00024 #include "dom/html_form.h"
00025 #include "dom/dom_exception.h"
00026 #include "dom/dom_doc.h"
00027 
00028 #include "html/html_formimpl.h"
00029 #include "html/html_miscimpl.h"
00030 
00031 #include "xml/dom_docimpl.h"
00032 #include "misc/htmlhashes.h"
00033 
00034 using namespace DOM;
00035 
00036 HTMLButtonElement::HTMLButtonElement() : HTMLElement()
00037 {
00038 }
00039 
00040 HTMLButtonElement::HTMLButtonElement(const HTMLButtonElement &other) : HTMLElement(other)
00041 {
00042 }
00043 
00044 HTMLButtonElement::HTMLButtonElement(HTMLButtonElementImpl *impl) : HTMLElement(impl)
00045 {
00046 }
00047 
00048 HTMLButtonElement &HTMLButtonElement::operator = (const Node &other)
00049 {
00050     assignOther( other, ID_BUTTON );
00051     return *this;
00052 }
00053 
00054 HTMLButtonElement &HTMLButtonElement::operator = (const HTMLButtonElement &other)
00055 {
00056     HTMLElement::operator = (other);
00057     return *this;
00058 }
00059 
00060 HTMLButtonElement::~HTMLButtonElement()
00061 {
00062 }
00063 
00064 HTMLFormElement HTMLButtonElement::form() const
00065 {
00066     return Element::form();
00067 }
00068 
00069 DOMString HTMLButtonElement::accessKey() const
00070 {
00071     if(!impl) return DOMString();
00072     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ACCESSKEY);
00073 }
00074 
00075 void HTMLButtonElement::setAccessKey( const DOMString &value )
00076 {
00077     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ACCESSKEY, value);
00078 }
00079 
00080 bool HTMLButtonElement::disabled() const
00081 {
00082     if(!impl) return 0;
00083     return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_DISABLED).isNull();
00084 }
00085 
00086 void HTMLButtonElement::setDisabled( bool _disabled )
00087 {
00088     if (impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
00089 }
00090 
00091 DOMString HTMLButtonElement::name() const
00092 {
00093     if(!impl) return DOMString();
00094     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_NAME);
00095 }
00096 
00097 void HTMLButtonElement::setName( const DOMString &value )
00098 {
00099     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_NAME, value);
00100 }
00101 
00102 void HTMLButtonElement::focus(  )
00103 {
00104     if(impl)
00105         static_cast<HTMLButtonElementImpl*>(impl)->focus();
00106 }
00107 
00108 void HTMLButtonElement::blur(  )
00109 {
00110     if(impl)
00111         static_cast<HTMLButtonElementImpl*>(impl)->blur();
00112 }
00113 
00114 long HTMLButtonElement::tabIndex() const
00115 {
00116     if(!impl) return 0;
00117     return static_cast<ElementImpl*>(impl)->tabIndex();
00118 }
00119 
00120 void HTMLButtonElement::setTabIndex( long _tabIndex )
00121 {
00122     if (!impl) return;
00123     static_cast<ElementImpl*>(impl)->setTabIndex(_tabIndex);
00124 }
00125 
00126 DOMString HTMLButtonElement::type() const
00127 {
00128     if(!impl) return DOMString();
00129     return static_cast<HTMLButtonElementImpl*>(impl)->type();
00130 }
00131 
00132 DOMString HTMLButtonElement::value() const
00133 {
00134     if(!impl) return DOMString();
00135     DOMString s = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_VALUE);
00136     if (s.isNull()) return DOMString("");
00137     return s;
00138 }
00139 
00140 void HTMLButtonElement::setValue( const DOMString &value )
00141 {
00142     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_VALUE, value);
00143 }
00144 
00145 // --------------------------------------------------------------------------
00146 
00147 HTMLFieldSetElement::HTMLFieldSetElement() : HTMLElement()
00148 {
00149 }
00150 
00151 HTMLFieldSetElement::HTMLFieldSetElement(const HTMLFieldSetElement &other) : HTMLElement(other)
00152 {
00153 }
00154 
00155 HTMLFieldSetElement::HTMLFieldSetElement(HTMLFieldSetElementImpl *impl) : HTMLElement(impl)
00156 {
00157 }
00158 
00159 HTMLFieldSetElement &HTMLFieldSetElement::operator = (const Node &other)
00160 {
00161     assignOther( other, ID_FIELDSET );
00162     return *this;
00163 }
00164 
00165 HTMLFieldSetElement &HTMLFieldSetElement::operator = (const HTMLFieldSetElement &other)
00166 {
00167     HTMLElement::operator = (other);
00168     return *this;
00169 }
00170 
00171 HTMLFieldSetElement::~HTMLFieldSetElement()
00172 {
00173 }
00174 
00175 HTMLFormElement HTMLFieldSetElement::form() const
00176 {
00177     return Element::form();
00178 }
00179 
00180 // --------------------------------------------------------------------------
00181 
00182 HTMLFormElement::HTMLFormElement() : HTMLElement()
00183 {
00184 }
00185 
00186 HTMLFormElement::HTMLFormElement(const HTMLFormElement &other) : HTMLElement(other)
00187 {
00188 }
00189 
00190 HTMLFormElement::HTMLFormElement(HTMLFormElementImpl *impl) : HTMLElement(impl)
00191 {
00192 }
00193 
00194 HTMLFormElement &HTMLFormElement::operator = (const Node &other)
00195 {
00196     assignOther( other, ID_FORM );
00197     return *this;
00198 }
00199 
00200 HTMLFormElement &HTMLFormElement::operator = (const HTMLFormElement &other)
00201 {
00202     HTMLElement::operator = (other);
00203     return *this;
00204 }
00205 
00206 HTMLFormElement::~HTMLFormElement()
00207 {
00208 }
00209 
00210 HTMLCollection HTMLFormElement::elements() const
00211 {
00212     if(!impl) return HTMLCollection();
00213     return HTMLFormCollection(impl);
00214 }
00215 
00216 long HTMLFormElement::length() const
00217 {
00218     if(!impl) return 0;
00219     return static_cast<HTMLFormElementImpl*>(impl)->length();
00220 }
00221 
00222 DOMString HTMLFormElement::name() const
00223 {
00224     if(!impl) return DOMString();
00225     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_NAME);
00226 }
00227 
00228 void HTMLFormElement::setName( const DOMString &value )
00229 {
00230     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_NAME, value);
00231 }
00232 
00233 DOMString HTMLFormElement::acceptCharset() const
00234 {
00235     if(!impl) return DOMString();
00236     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ACCEPT_CHARSET);
00237 }
00238 
00239 void HTMLFormElement::setAcceptCharset( const DOMString &value )
00240 {
00241     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ACCEPT_CHARSET, value);
00242 }
00243 
00244 DOMString HTMLFormElement::action() const
00245 {
00246     if(!impl) return DOMString();
00247     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ACTION);
00248 }
00249 
00250 void HTMLFormElement::setAction( const DOMString &value )
00251 {
00252     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ACTION, value);
00253 }
00254 
00255 DOMString HTMLFormElement::enctype() const
00256 {
00257     if(!impl) return DOMString();
00258     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ENCTYPE);
00259 }
00260 
00261 void HTMLFormElement::setEnctype( const DOMString &value )
00262 {
00263     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ENCTYPE, value);
00264 }
00265 
00266 DOMString HTMLFormElement::method() const
00267 {
00268     if(!impl) return DOMString();
00269     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_METHOD);
00270 }
00271 
00272 void HTMLFormElement::setMethod( const DOMString &value )
00273 {
00274     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_METHOD, value);
00275 }
00276 
00277 DOMString HTMLFormElement::target() const
00278 {
00279     if(!impl) return DOMString();
00280     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_TARGET);
00281 }
00282 
00283 void HTMLFormElement::setTarget( const DOMString &value )
00284 {
00285     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_TARGET, value);
00286 }
00287 
00288 void HTMLFormElement::submit(  )
00289 {
00290     if(impl) static_cast<HTMLFormElementImpl*>(impl)->submit(  );
00291 }
00292 
00293 void HTMLFormElement::reset(  )
00294 {
00295     if(impl) static_cast<HTMLFormElementImpl*>(impl)->reset(  );
00296 }
00297 
00298 // --------------------------------------------------------------------------
00299 
00300 HTMLInputElement::HTMLInputElement() : HTMLElement()
00301 {
00302 }
00303 
00304 HTMLInputElement::HTMLInputElement(const HTMLInputElement &other) : HTMLElement(other)
00305 {
00306 }
00307 
00308 HTMLInputElement::HTMLInputElement(HTMLInputElementImpl *impl) : HTMLElement(impl)
00309 {
00310 }
00311 
00312 HTMLInputElement &HTMLInputElement::operator = (const Node &other)
00313 {
00314     assignOther( other, ID_INPUT );
00315     return *this;
00316 }
00317 
00318 HTMLInputElement &HTMLInputElement::operator = (const HTMLInputElement &other)
00319 {
00320     HTMLElement::operator = (other);
00321     return *this;
00322 }
00323 
00324 HTMLInputElement::~HTMLInputElement()
00325 {
00326 }
00327 
00328 DOMString HTMLInputElement::defaultValue() const
00329 {
00330     if(!impl) return DOMString();
00331     DOMString s = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_VALUE);
00332     if (s.isNull()) return DOMString("");
00333     return s;
00334 
00335 }
00336 
00337 void HTMLInputElement::setDefaultValue( const DOMString &value )
00338 {
00339     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VALUE, value);
00340 }
00341 
00342 bool HTMLInputElement::defaultChecked() const
00343 {
00344     if(!impl) return 0;
00345     return !((ElementImpl *)impl)->getAttribute(ATTR_CHECKED).isNull();
00346 }
00347 
00348 void HTMLInputElement::setDefaultChecked( bool _defaultChecked )
00349 {
00350     if(impl)
00351     ((ElementImpl *)impl)->setAttribute(ATTR_CHECKED, _defaultChecked ? "" : 0);
00352 }
00353 
00354 HTMLFormElement HTMLInputElement::form() const
00355 {
00356     return Element::form();
00357 }
00358 
00359 DOMString HTMLInputElement::accept() const
00360 {
00361     if(!impl) return DOMString();
00362     return ((ElementImpl *)impl)->getAttribute(ATTR_ACCEPT);
00363 }
00364 
00365 void HTMLInputElement::setAccept( const DOMString &value )
00366 {
00367     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ACCEPT, value);
00368 }
00369 
00370 DOMString HTMLInputElement::accessKey() const
00371 {
00372     if(!impl) return DOMString();
00373     return ((ElementImpl *)impl)->getAttribute(ATTR_ACCESSKEY);
00374 }
00375 
00376 void HTMLInputElement::setAccessKey( const DOMString &value )
00377 {
00378     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ACCESSKEY, value);
00379 }
00380 
00381 DOMString HTMLInputElement::align() const
00382 {
00383     if(!impl) return DOMString();
00384     return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
00385 }
00386 
00387 void HTMLInputElement::setAlign( const DOMString &value )
00388 {
00389     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
00390 }
00391 
00392 DOMString HTMLInputElement::alt() const
00393 {
00394     if(!impl) return DOMString();
00395     return ((ElementImpl *)impl)->getAttribute(ATTR_ALT);
00396 }
00397 
00398 void HTMLInputElement::setAlt( const DOMString &value )
00399 {
00400     if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALT, value);
00401 }
00402 
00403 bool HTMLInputElement::checked() const
00404 {
00405     if(!impl) return 0;
00406     return ((HTMLInputElementImpl*)impl)->checked();
00407 }
00408 
00409 void HTMLInputElement::setChecked( bool _checked )
00410 {
00411     if(impl)
00412     ((HTMLInputElementImpl*)impl)->setChecked(_checked);
00413 }
00414 
00415 bool HTMLInputElement::indeterminate() const
00416 {
00417     if(!impl) return 0;
00418     return ((HTMLInputElementImpl*)impl)->indeterminate();
00419 }
00420 
00421 void HTMLInputElement::setIndeterminate( bool _indeterminate )
00422 {
00423     if(impl)
00424     ((HTMLInputElementImpl*)impl)->setIndeterminate(_indeterminate);
00425 }
00426 
00427 bool HTMLInputElement::disabled() const
00428 {
00429     if(!impl) return 0;
00430     return !((ElementImpl *)impl)->getAttribute(ATTR_DISABLED).isNull();
00431 }
00432 
00433 void HTMLInputElement::setDisabled( bool _disabled )
00434 {
00435     if(impl)
00436     {
00437     ((ElementImpl *)impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
00438     }
00439 }
00440 
00441 long HTMLInputElement::maxLength() const
00442 {
00443     if(!impl) return 0;
00444     return ((HTMLInputElementImpl *)impl)->getAttribute(ATTR_MAXLENGTH).toInt();
00445 }
00446 
00447 void HTMLInputElement::setMaxLength( long _maxLength )
00448 {
00449     if(impl) {
00450         DOMString value(QString::number(_maxLength));
00451         ((ElementImpl *)impl)->setAttribute(ATTR_MAXLENGTH,value);
00452     }
00453 }
00454 
00455 DOMString HTMLInputElement::name() const
00456 {
00457     if(!impl) return DOMString();
00458     return static_cast<HTMLInputElementImpl* const>(impl)->name();
00459 }
00460 
00461 void HTMLInputElement::setName( const DOMString &value )
00462 {
00463     if(impl) static_cast<HTMLInputElementImpl*>(impl)->setName(value);
00464 }
00465 
00466 bool HTMLInputElement::readOnly() const
00467 {
00468     if(!impl) return 0;
00469     return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_READONLY).isNull();
00470 }
00471 
00472 void HTMLInputElement::setReadOnly( bool _readOnly )
00473 {
00474     if(impl)
00475     static_cast<ElementImpl*>(impl)->setAttribute(ATTR_READONLY, _readOnly ? "" : 0);
00476 }
00477 
00478 /* The next two are provided for backwards compatibility. */
00479 DOMString HTMLInputElement::size() const
00480 {
00481     if(!impl) return DOMString();
00482     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_SIZE);
00483 }
00484 
00485 void HTMLInputElement::setSize( const DOMString &value )
00486 {
00487     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_SIZE, value);
00488 }
00489 
00490 long HTMLInputElement::getSize() const
00491 {
00492     if(!impl) return 0;
00493     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_SIZE).toInt();
00494 }
00495 
00496 void HTMLInputElement::setSize( long value )
00497 {
00498     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_SIZE, QString::number(value));
00499 }
00500 
00501 DOMString HTMLInputElement::src() const
00502 {
00503     if(!impl) return DOMString();
00504     DOMString s = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_SRC);
00505     return !s.isNull() ? impl->getDocument()->completeURL( s.string() ) : s;
00506 }
00507 
00508 void HTMLInputElement::setSrc( const DOMString &value )
00509 {
00510     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_SRC, value);
00511 }
00512 
00513 long HTMLInputElement::tabIndex() const
00514 {
00515     if(!impl) return 0;
00516     return static_cast<ElementImpl*>(impl)->tabIndex();
00517 }
00518 
00519 void HTMLInputElement::setTabIndex( long _tabIndex )
00520 {
00521     if (!impl) return;
00522     static_cast<ElementImpl*>(impl)->setTabIndex(_tabIndex);
00523 }
00524 
00525 DOMString HTMLInputElement::type() const
00526 {
00527     if(!impl) return DOMString();
00528     return ((HTMLInputElementImpl *)impl)->type();
00529 }
00530 
00531 void HTMLInputElement::setType(const DOMString& _type)
00532 {
00533     if (!impl) return;
00534     static_cast<HTMLInputElementImpl*>(impl)->setType(_type);
00535 }
00536 
00537 DOMString HTMLInputElement::useMap() const
00538 {
00539     if(!impl) return DOMString();
00540     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_USEMAP);
00541 }
00542 
00543 void HTMLInputElement::setUseMap( const DOMString &value )
00544 {
00545     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_USEMAP, value);
00546 }
00547 
00548 DOMString HTMLInputElement::value() const
00549 {
00550     if(!impl) return DOMString();
00551     return ((HTMLInputElementImpl*)impl)->value();
00552 }
00553 
00554 void HTMLInputElement::setValue( const DOMString &value )
00555 {
00556     if (impl)
00557     ((HTMLInputElementImpl*)impl)->setValue(value);
00558 
00559 }
00560 
00561 void HTMLInputElement::blur(  )
00562 {
00563     if(impl)
00564     ((HTMLInputElementImpl*)impl)->blur();
00565 }
00566 
00567 void HTMLInputElement::focus(  )
00568 {
00569     if(impl)
00570     ((HTMLInputElementImpl*)impl)->focus();
00571 }
00572 
00573 void HTMLInputElement::select(  )
00574 {
00575     if(impl)
00576     ((HTMLInputElementImpl *)impl)->select(  );
00577 }
00578 
00579 void HTMLInputElement::click(  )
00580 {
00581     if(impl)
00582     ((HTMLInputElementImpl *)impl)->click(  );
00583 }
00584 
00585 long HTMLInputElement::selectionStart()
00586 {
00587     if (impl)
00588     return ((HTMLInputElementImpl *)impl)->selectionStart(  );
00589     return -1;
00590 }
00591 
00592 long HTMLInputElement::selectionEnd()
00593 {
00594     if (impl)
00595     return ((HTMLInputElementImpl *)impl)->selectionEnd(  );
00596     return -1;
00597 }
00598 
00599 void HTMLInputElement::setSelectionStart(long pos)
00600 {
00601     if (impl)
00602     ((HTMLInputElementImpl *)impl)->setSelectionStart( pos );
00603 }
00604 
00605 void HTMLInputElement::setSelectionEnd(long pos)
00606 {
00607     if (impl)
00608     ((HTMLInputElementImpl *)impl)->setSelectionEnd( pos );
00609 }
00610 
00611 void HTMLInputElement::setSelectionRange(long start, long end)
00612 {
00613     if (impl)
00614     ((HTMLInputElementImpl *)impl)->setSelectionRange( start, end );
00615 }
00616 
00617 // --------------------------------------------------------------------------
00618 
00619 HTMLLabelElement::HTMLLabelElement() : HTMLElement()
00620 {
00621 }
00622 
00623 HTMLLabelElement::HTMLLabelElement(const HTMLLabelElement &other) : HTMLElement(other)
00624 {
00625 }
00626 
00627 HTMLLabelElement::HTMLLabelElement(HTMLLabelElementImpl *impl) : HTMLElement(impl)
00628 {
00629 }
00630 
00631 HTMLLabelElement &HTMLLabelElement::operator = (const Node &other)
00632 {
00633     assignOther( other, ID_LABEL );
00634     return *this;
00635 }
00636 
00637 HTMLLabelElement &HTMLLabelElement::operator = (const HTMLLabelElement &other)
00638 {
00639     HTMLElement::operator = (other);
00640     return *this;
00641 }
00642 
00643 HTMLLabelElement::~HTMLLabelElement()
00644 {
00645 }
00646 
00647 DOMString HTMLLabelElement::accessKey() const
00648 {
00649     if(!impl) return DOMString();
00650     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ACCESSKEY);
00651 }
00652 
00653 void HTMLLabelElement::setAccessKey( const DOMString &value )
00654 {
00655     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ACCESSKEY, value);
00656 }
00657 
00658 DOMString HTMLLabelElement::htmlFor() const
00659 {
00660     if(!impl) return DOMString();
00661     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_FOR);
00662 }
00663 
00664 void HTMLLabelElement::setHtmlFor( const DOMString &value )
00665 {
00666     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_FOR, value);
00667 }
00668 
00669 // --------------------------------------------------------------------------
00670 
00671 HTMLLegendElement::HTMLLegendElement() : HTMLElement()
00672 {
00673 }
00674 
00675 HTMLLegendElement::HTMLLegendElement(const HTMLLegendElement &other) : HTMLElement(other)
00676 {
00677 }
00678 
00679 HTMLLegendElement::HTMLLegendElement(HTMLLegendElementImpl *impl) : HTMLElement(impl)
00680 {
00681 }
00682 
00683 HTMLLegendElement &HTMLLegendElement::operator = (const Node &other)
00684 {
00685     assignOther( other, ID_LEGEND );
00686     return *this;
00687 }
00688 
00689 HTMLLegendElement &HTMLLegendElement::operator = (const HTMLLegendElement &other)
00690 {
00691     HTMLElement::operator = (other);
00692     return *this;
00693 }
00694 
00695 HTMLLegendElement::~HTMLLegendElement()
00696 {
00697 }
00698 
00699 HTMLFormElement HTMLLegendElement::form() const
00700 {
00701     return Element::form();
00702 }
00703 
00704 DOMString HTMLLegendElement::accessKey() const
00705 {
00706     if(!impl) return DOMString();
00707     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ACCESSKEY);
00708 }
00709 
00710 void HTMLLegendElement::setAccessKey( const DOMString &value )
00711 {
00712     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ACCESSKEY, value);
00713 }
00714 
00715 DOMString HTMLLegendElement::align() const
00716 {
00717     if(!impl) return DOMString();
00718     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ALIGN);
00719 }
00720 
00721 void HTMLLegendElement::setAlign( const DOMString &value )
00722 {
00723     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ALIGN, value);
00724 }
00725 
00726 // --------------------------------------------------------------------------
00727 
00728 HTMLOptGroupElement::HTMLOptGroupElement() : HTMLElement()
00729 {
00730 }
00731 
00732 HTMLOptGroupElement::HTMLOptGroupElement(const HTMLOptGroupElement &other) : HTMLElement(other)
00733 {
00734 }
00735 
00736 HTMLOptGroupElement::HTMLOptGroupElement(HTMLOptGroupElementImpl *impl) : HTMLElement(impl)
00737 {
00738 }
00739 
00740 HTMLOptGroupElement &HTMLOptGroupElement::operator = (const Node &other)
00741 {
00742     assignOther( other, ID_OPTGROUP );
00743     return *this;
00744 }
00745 
00746 HTMLOptGroupElement &HTMLOptGroupElement::operator = (const HTMLOptGroupElement &other)
00747 {
00748     HTMLElement::operator = (other);
00749     return *this;
00750 }
00751 
00752 HTMLOptGroupElement::~HTMLOptGroupElement()
00753 {
00754 }
00755 
00756 bool HTMLOptGroupElement::disabled() const
00757 {
00758     if(!impl) return 0;
00759     return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_DISABLED).isNull();
00760 }
00761 
00762 void HTMLOptGroupElement::setDisabled( bool _disabled )
00763 {
00764     if(impl)
00765     static_cast<ElementImpl*>(impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
00766 }
00767 
00768 DOMString HTMLOptGroupElement::label() const
00769 {
00770     if(!impl) return DOMString();
00771     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_LABEL);
00772 }
00773 
00774 void HTMLOptGroupElement::setLabel( const DOMString &value )
00775 {
00776     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_LABEL, value);
00777 }
00778 
00779 // --------------------------------------------------------------------------
00780 
00781 HTMLSelectElement::HTMLSelectElement() : HTMLElement()
00782 {
00783 }
00784 
00785 HTMLSelectElement::HTMLSelectElement(const HTMLSelectElement &other) : HTMLElement(other)
00786 {
00787 }
00788 
00789 HTMLSelectElement::HTMLSelectElement(HTMLSelectElementImpl *impl) : HTMLElement(impl)
00790 {
00791 }
00792 
00793 HTMLSelectElement &HTMLSelectElement::operator = (const Node &other)
00794 {
00795     assignOther( other, ID_SELECT );
00796     return *this;
00797 }
00798 
00799 HTMLSelectElement &HTMLSelectElement::operator = (const HTMLSelectElement &other)
00800 {
00801     HTMLElement::operator = (other);
00802     return *this;
00803 }
00804 
00805 HTMLSelectElement::~HTMLSelectElement()
00806 {
00807 }
00808 
00809 DOMString HTMLSelectElement::type() const
00810 {
00811     if(!impl) return DOMString();
00812     return ((HTMLSelectElementImpl *)impl)->type();
00813 }
00814 
00815 long HTMLSelectElement::selectedIndex() const
00816 {
00817     if(!impl) return 0;
00818     return ((HTMLSelectElementImpl *)impl)->selectedIndex();
00819 }
00820 
00821 void HTMLSelectElement::setSelectedIndex( long _selectedIndex )
00822 {
00823     if(impl)
00824         ((HTMLSelectElementImpl *)impl)->setSelectedIndex(_selectedIndex);
00825 }
00826 
00827 DOMString HTMLSelectElement::value() const
00828 {
00829     if(!impl) return DOMString();
00830     return static_cast<HTMLSelectElementImpl*>(impl)->value();
00831 }
00832 
00833 void HTMLSelectElement::setValue( const DOMString &value )
00834 {
00835     if(!impl || value.isNull()) return;
00836     static_cast<HTMLSelectElementImpl*>(impl)->setValue(value.implementation());
00837 }
00838 
00839 long HTMLSelectElement::length() const
00840 {
00841     if(!impl) return 0;
00842     return ((HTMLSelectElementImpl *)impl)->length();
00843 }
00844 
00845 HTMLFormElement HTMLSelectElement::form() const
00846 {
00847     return Element::form();
00848 }
00849 
00850 HTMLCollection HTMLSelectElement::options() const
00851 {
00852     if(!impl) return HTMLCollection();
00853     return HTMLCollection(impl, HTMLCollectionImpl::SELECT_OPTIONS);
00854 }
00855 
00856 bool HTMLSelectElement::disabled() const
00857 {
00858     if(!impl) return 0;
00859     return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_DISABLED).isNull();
00860 }
00861 
00862 void HTMLSelectElement::setDisabled( bool _disabled )
00863 {
00864     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
00865 }
00866 
00867 
00868 bool HTMLSelectElement::multiple() const
00869 {
00870     if(!impl) return 0;
00871     return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_MULTIPLE).isNull();
00872 }
00873 
00874 void HTMLSelectElement::setMultiple( bool _multiple )
00875 {
00876     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_MULTIPLE, _multiple ? "" : 0);
00877 }
00878 
00879 DOMString HTMLSelectElement::name() const
00880 {
00881     if(!impl) return DOMString();
00882     return static_cast<HTMLSelectElementImpl* const>(impl)->name();
00883 }
00884 
00885 void HTMLSelectElement::setName( const DOMString &value )
00886 {
00887     if(impl) static_cast<HTMLSelectElementImpl*>(impl)->setName(value);
00888 }
00889 
00890 long HTMLSelectElement::size() const
00891 {
00892     if(!impl) return 0;
00893     return ((HTMLSelectElementImpl *)impl)->getAttribute(ATTR_SIZE).toInt();
00894 }
00895 
00896 void HTMLSelectElement::setSize( long _size )
00897 {
00898 
00899     if(impl) {
00900     DOMString value(QString::number(_size));
00901         static_cast<ElementImpl*>(impl)->setAttribute(ATTR_SIZE,