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 long HTMLButtonElement::tabIndex() const
00103 {
00104 if(!impl) return 0;
00105 return static_cast<ElementImpl*>(impl)->tabIndex();
00106 }
00107
00108 void HTMLButtonElement::setTabIndex( long _tabIndex )
00109 {
00110 if (!impl) return;
00111 static_cast<ElementImpl*>(impl)->setTabIndex(_tabIndex);
00112 }
00113
00114 DOMString HTMLButtonElement::type() const
00115 {
00116 if(!impl) return DOMString();
00117 return static_cast<HTMLButtonElementImpl*>(impl)->type();
00118 }
00119
00120 DOMString HTMLButtonElement::value() const
00121 {
00122 if(!impl) return DOMString();
00123 DOMString s = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_VALUE);
00124 if (s.isNull()) return DOMString("");
00125 return s;
00126 }
00127
00128 void HTMLButtonElement::setValue( const DOMString &value )
00129 {
00130 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_VALUE, value);
00131 }
00132
00133
00134
00135 HTMLFieldSetElement::HTMLFieldSetElement() : HTMLElement()
00136 {
00137 }
00138
00139 HTMLFieldSetElement::HTMLFieldSetElement(const HTMLFieldSetElement &other) : HTMLElement(other)
00140 {
00141 }
00142
00143 HTMLFieldSetElement::HTMLFieldSetElement(HTMLFieldSetElementImpl *impl) : HTMLElement(impl)
00144 {
00145 }
00146
00147 HTMLFieldSetElement &HTMLFieldSetElement::operator = (const Node &other)
00148 {
00149 assignOther( other, ID_FIELDSET );
00150 return *this;
00151 }
00152
00153 HTMLFieldSetElement &HTMLFieldSetElement::operator = (const HTMLFieldSetElement &other)
00154 {
00155 HTMLElement::operator = (other);
00156 return *this;
00157 }
00158
00159 HTMLFieldSetElement::~HTMLFieldSetElement()
00160 {
00161 }
00162
00163 HTMLFormElement HTMLFieldSetElement::form() const
00164 {
00165 return Element::form();
00166 }
00167
00168
00169
00170 HTMLFormElement::HTMLFormElement() : HTMLElement()
00171 {
00172 }
00173
00174 HTMLFormElement::HTMLFormElement(const HTMLFormElement &other) : HTMLElement(other)
00175 {
00176 }
00177
00178 HTMLFormElement::HTMLFormElement(HTMLFormElementImpl *impl) : HTMLElement(impl)
00179 {
00180 }
00181
00182 HTMLFormElement &HTMLFormElement::operator = (const Node &other)
00183 {
00184 assignOther( other, ID_FORM );
00185 return *this;
00186 }
00187
00188 HTMLFormElement &HTMLFormElement::operator = (const HTMLFormElement &other)
00189 {
00190 HTMLElement::operator = (other);
00191 return *this;
00192 }
00193
00194 HTMLFormElement::~HTMLFormElement()
00195 {
00196 }
00197
00198 HTMLCollection HTMLFormElement::elements() const
00199 {
00200 if(!impl) return HTMLCollection();
00201 return HTMLFormCollection(impl);
00202 }
00203
00204 long HTMLFormElement::length() const
00205 {
00206 if(!impl) return 0;
00207 return static_cast<HTMLFormElementImpl*>(impl)->length();
00208 }
00209
00210 DOMString HTMLFormElement::name() const
00211 {
00212 if(!impl) return DOMString();
00213 return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_NAME);
00214 }
00215
00216 void HTMLFormElement::setName( const DOMString &value )
00217 {
00218 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_NAME, value);
00219 }
00220
00221 DOMString HTMLFormElement::acceptCharset() const
00222 {
00223 if(!impl) return DOMString();
00224 return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ACCEPT_CHARSET);
00225 }
00226
00227 void HTMLFormElement::setAcceptCharset( const DOMString &value )
00228 {
00229 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ACCEPT_CHARSET, value);
00230 }
00231
00232 DOMString HTMLFormElement::action() const
00233 {
00234 if(!impl) return DOMString();
00235 return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ACTION);
00236 }
00237
00238 void HTMLFormElement::setAction( const DOMString &value )
00239 {
00240 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ACTION, value);
00241 }
00242
00243 DOMString HTMLFormElement::enctype() const
00244 {
00245 if(!impl) return DOMString();
00246 return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ENCTYPE);
00247 }
00248
00249 void HTMLFormElement::setEnctype( const DOMString &value )
00250 {
00251 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ENCTYPE, value);
00252 }
00253
00254 DOMString HTMLFormElement::method() const
00255 {
00256 if(!impl) return DOMString();
00257 return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_METHOD);
00258 }
00259
00260 void HTMLFormElement::setMethod( const DOMString &value )
00261 {
00262 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_METHOD, value);
00263 }
00264
00265 DOMString HTMLFormElement::target() const
00266 {
00267 if(!impl) return DOMString();
00268 return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_TARGET);
00269 }
00270
00271 void HTMLFormElement::setTarget( const DOMString &value )
00272 {
00273 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_TARGET, value);
00274 }
00275
00276 void HTMLFormElement::submit( )
00277 {
00278 if(impl) static_cast<HTMLFormElementImpl*>(impl)->submit( );
00279 }
00280
00281 void HTMLFormElement::reset( )
00282 {
00283 if(impl) static_cast<HTMLFormElementImpl*>(impl)->reset( );
00284 }
00285
00286
00287
00288 HTMLInputElement::HTMLInputElement() : HTMLElement()
00289 {
00290 }
00291
00292 HTMLInputElement::HTMLInputElement(const HTMLInputElement &other) : HTMLElement(other)
00293 {
00294 }
00295
00296 HTMLInputElement::HTMLInputElement(HTMLInputElementImpl *impl) : HTMLElement(impl)
00297 {
00298 }
00299
00300 HTMLInputElement &HTMLInputElement::operator = (const Node &other)
00301 {
00302 assignOther( other, ID_INPUT );
00303 return *this;
00304 }
00305
00306 HTMLInputElement &HTMLInputElement::operator = (const HTMLInputElement &other)
00307 {
00308 HTMLElement::operator = (other);
00309 return *this;
00310 }
00311
00312 HTMLInputElement::~HTMLInputElement()
00313 {
00314 }
00315
00316 DOMString HTMLInputElement::defaultValue() const
00317 {
00318 if(!impl) return DOMString();
00319 DOMString s = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_VALUE);
00320 if (s.isNull()) return DOMString("");
00321 return s;
00322
00323 }
00324
00325 void HTMLInputElement::setDefaultValue( const DOMString &value )
00326 {
00327 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_VALUE, value);
00328 }
00329
00330 bool HTMLInputElement::defaultChecked() const
00331 {
00332 if(!impl) return 0;
00333 return !((ElementImpl *)impl)->getAttribute(ATTR_CHECKED).isNull();
00334 }
00335
00336 void HTMLInputElement::setDefaultChecked( bool _defaultChecked )
00337 {
00338 if(impl)
00339 ((ElementImpl *)impl)->setAttribute(ATTR_CHECKED, _defaultChecked ? "" : 0);
00340 }
00341
00342 HTMLFormElement HTMLInputElement::form() const
00343 {
00344 return Element::form();
00345 }
00346
00347 DOMString HTMLInputElement::accept() const
00348 {
00349 if(!impl) return DOMString();
00350 return ((ElementImpl *)impl)->getAttribute(ATTR_ACCEPT);
00351 }
00352
00353 void HTMLInputElement::setAccept( const DOMString &value )
00354 {
00355 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ACCEPT, value);
00356 }
00357
00358 DOMString HTMLInputElement::accessKey() const
00359 {
00360 if(!impl) return DOMString();
00361 return ((ElementImpl *)impl)->getAttribute(ATTR_ACCESSKEY);
00362 }
00363
00364 void HTMLInputElement::setAccessKey( const DOMString &value )
00365 {
00366 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ACCESSKEY, value);
00367 }
00368
00369 DOMString HTMLInputElement::align() const
00370 {
00371 if(!impl) return DOMString();
00372 return ((ElementImpl *)impl)->getAttribute(ATTR_ALIGN);
00373 }
00374
00375 void HTMLInputElement::setAlign( const DOMString &value )
00376 {
00377 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALIGN, value);
00378 }
00379
00380 DOMString HTMLInputElement::alt() const
00381 {
00382 if(!impl) return DOMString();
00383 return ((ElementImpl *)impl)->getAttribute(ATTR_ALT);
00384 }
00385
00386 void HTMLInputElement::setAlt( const DOMString &value )
00387 {
00388 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ALT, value);
00389 }
00390
00391 bool HTMLInputElement::checked() const
00392 {
00393 if(!impl) return 0;
00394 return ((HTMLInputElementImpl*)impl)->checked();
00395 }
00396
00397 void HTMLInputElement::setChecked( bool _checked )
00398 {
00399 if(impl)
00400 ((HTMLInputElementImpl*)impl)->setChecked(_checked);
00401 }
00402
00403 bool HTMLInputElement::disabled() const
00404 {
00405 if(!impl) return 0;
00406 return !((ElementImpl *)impl)->getAttribute(ATTR_DISABLED).isNull();
00407 }
00408
00409 void HTMLInputElement::setDisabled( bool _disabled )
00410 {
00411 if(impl)
00412 {
00413 ((ElementImpl *)impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
00414 }
00415 }
00416
00417 long HTMLInputElement::maxLength() const
00418 {
00419 if(!impl) return 0;
00420 return ((HTMLInputElementImpl *)impl)->getAttribute(ATTR_MAXLENGTH).toInt();
00421 }
00422
00423 void HTMLInputElement::setMaxLength( long _maxLength )
00424 {
00425 if(impl) {
00426 DOMString value(QString::number(_maxLength));
00427 ((ElementImpl *)impl)->setAttribute(ATTR_MAXLENGTH,value);
00428 }
00429 }
00430
00431 DOMString HTMLInputElement::name() const
00432 {
00433 if(!impl) return DOMString();
00434 return static_cast<HTMLInputElementImpl* const>(impl)->name();
00435 }
00436
00437 void HTMLInputElement::setName( const DOMString &value )
00438 {
00439 if(impl) static_cast<HTMLInputElementImpl*>(impl)->setName(value);
00440 }
00441
00442 bool HTMLInputElement::readOnly() const
00443 {
00444 if(!impl) return 0;
00445 return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_READONLY).isNull();
00446 }
00447
00448 void HTMLInputElement::setReadOnly( bool _readOnly )
00449 {
00450 if(impl)
00451 static_cast<ElementImpl*>(impl)->setAttribute(ATTR_READONLY, _readOnly ? "" : 0);
00452 }
00453
00454
00455 DOMString HTMLInputElement::size() const
00456 {
00457 if(!impl) return DOMString();
00458 return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_SIZE);
00459 }
00460
00461 void HTMLInputElement::setSize( const DOMString &value )
00462 {
00463 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_SIZE, value);
00464 }
00465
00466 long HTMLInputElement::getSize() const
00467 {
00468 if(!impl) return 0;
00469 return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_SIZE).toInt();
00470 }
00471
00472 void HTMLInputElement::setSize( long value )
00473 {
00474 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_SIZE, QString::number(value));
00475 }
00476
00477 DOMString HTMLInputElement::src() const
00478 {
00479 if(!impl) return DOMString();
00480 DOMString s = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_SRC);
00481 return !s.isNull() ? impl->getDocument()->completeURL( s.string() ) : s;
00482 }
00483
00484 void HTMLInputElement::setSrc( const DOMString &value )
00485 {
00486 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_SRC, value);
00487 }
00488
00489 long HTMLInputElement::tabIndex() const
00490 {
00491 if(!impl) return 0;
00492 return static_cast<ElementImpl*>(impl)->tabIndex();
00493 }
00494
00495 void HTMLInputElement::setTabIndex( long _tabIndex )
00496 {
00497 if (!impl) return;
00498 static_cast<ElementImpl*>(impl)->setTabIndex(_tabIndex);
00499 }
00500
00501 DOMString HTMLInputElement::type() const
00502 {
00503 if(!impl) return DOMString();
00504 return ((HTMLInputElementImpl *)impl)->type();
00505 }
00506
00507 void HTMLInputElement::setType(const DOMString& _type)
00508 {
00509 if (!impl) return;
00510 static_cast<HTMLInputElementImpl*>(impl)->setType(_type);
00511 }
00512
00513 DOMString HTMLInputElement::useMap() const
00514 {
00515 if(!impl) return DOMString();
00516 return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_USEMAP);
00517 }
00518
00519 void HTMLInputElement::setUseMap( const DOMString &value )
00520 {
00521 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_USEMAP, value);
00522 }
00523
00524 DOMString HTMLInputElement::value() const
00525 {
00526 if(!impl) return DOMString();
00527 const DOMString val = ((HTMLInputElementImpl*)impl)->value();
00528 return val.isNull() ? DOMString("") : val;
00529 }
00530
00531 void HTMLInputElement::setValue( const DOMString &value )
00532 {
00533 if (impl)
00534 ((HTMLInputElementImpl*)impl)->setValue(value);
00535
00536 }
00537
00538 void HTMLInputElement::blur( )
00539 {
00540 if(impl)
00541 ((HTMLInputElementImpl*)impl)->blur();
00542 }
00543
00544 void HTMLInputElement::focus( )
00545 {
00546 if(impl)
00547 ((HTMLInputElementImpl*)impl)->focus();
00548 }
00549
00550 void HTMLInputElement::select( )
00551 {
00552 if(impl)
00553 ((HTMLInputElementImpl *)impl)->select( );
00554 }
00555
00556 void HTMLInputElement::click( )
00557 {
00558 if(impl)
00559 ((HTMLInputElementImpl *)impl)->click( );
00560 }
00561
00562
00563
00564 HTMLLabelElement::HTMLLabelElement() : HTMLElement()
00565 {
00566 }
00567
00568 HTMLLabelElement::HTMLLabelElement(const HTMLLabelElement &other) : HTMLElement(other)
00569 {
00570 }
00571
00572 HTMLLabelElement::HTMLLabelElement(HTMLLabelElementImpl *impl) : HTMLElement(impl)
00573 {
00574 }
00575
00576 HTMLLabelElement &HTMLLabelElement::operator = (const Node &other)
00577 {
00578 assignOther( other, ID_LABEL );
00579 return *this;
00580 }
00581
00582 HTMLLabelElement &HTMLLabelElement::operator = (const HTMLLabelElement &other)
00583 {
00584 HTMLElement::operator = (other);
00585 return *this;
00586 }
00587
00588 HTMLLabelElement::~HTMLLabelElement()
00589 {
00590 }
00591
00592 DOMString HTMLLabelElement::accessKey() const
00593 {
00594 if(!impl) return DOMString();
00595 return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ACCESSKEY);
00596 }
00597
00598 void HTMLLabelElement::setAccessKey( const DOMString &value )
00599 {
00600 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ACCESSKEY, value);
00601 }
00602
00603 DOMString HTMLLabelElement::htmlFor() const
00604 {
00605 if(!impl) return DOMString();
00606 return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_FOR);
00607 }
00608
00609 void HTMLLabelElement::setHtmlFor( const DOMString &value )
00610 {
00611 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_FOR, value);
00612 }
00613
00614
00615
00616 HTMLLegendElement::HTMLLegendElement() : HTMLElement()
00617 {
00618 }
00619
00620 HTMLLegendElement::HTMLLegendElement(const HTMLLegendElement &other) : HTMLElement(other)
00621 {
00622 }
00623
00624 HTMLLegendElement::HTMLLegendElement(HTMLLegendElementImpl *impl) : HTMLElement(impl)
00625 {
00626 }
00627
00628 HTMLLegendElement &HTMLLegendElement::operator = (const Node &other)
00629 {
00630 assignOther( other, ID_LEGEND );
00631 return *this;
00632 }
00633
00634 HTMLLegendElement &HTMLLegendElement::operator = (const HTMLLegendElement &other)
00635 {
00636 HTMLElement::operator = (other);
00637 return *this;
00638 }
00639
00640 HTMLLegendElement::~HTMLLegendElement()
00641 {
00642 }
00643
00644 HTMLFormElement HTMLLegendElement::form() const
00645 {
00646 return Element::form();
00647 }
00648
00649 DOMString HTMLLegendElement::accessKey() const
00650 {
00651 if(!impl) return DOMString();
00652 return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ACCESSKEY);
00653 }
00654
00655 void HTMLLegendElement::setAccessKey( const DOMString &value )
00656 {
00657 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ACCESSKEY, value);
00658 }
00659
00660 DOMString HTMLLegendElement::align() const
00661 {
00662 if(!impl) return DOMString();
00663 return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ALIGN);
00664 }
00665
00666 void HTMLLegendElement::setAlign( const DOMString &value )
00667 {
00668 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ALIGN, value);
00669 }
00670
00671
00672
00673 HTMLOptGroupElement::HTMLOptGroupElement() : HTMLElement()
00674 {
00675 }
00676
00677 HTMLOptGroupElement::HTMLOptGroupElement(const HTMLOptGroupElement &other) : HTMLElement(other)
00678 {
00679 }
00680
00681 HTMLOptGroupElement::HTMLOptGroupElement(HTMLOptGroupElementImpl *impl) : HTMLElement(impl)
00682 {
00683 }
00684
00685 HTMLOptGroupElement &HTMLOptGroupElement::operator = (const Node &other)
00686 {
00687 assignOther( other, ID_OPTGROUP );
00688 return *this;
00689 }
00690
00691 HTMLOptGroupElement &HTMLOptGroupElement::operator = (const HTMLOptGroupElement &other)
00692 {
00693 HTMLElement::operator = (other);
00694 return *this;
00695 }
00696
00697 HTMLOptGroupElement::~HTMLOptGroupElement()
00698 {
00699 }
00700
00701 bool HTMLOptGroupElement::disabled() const
00702 {
00703 if(!impl) return 0;
00704 return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_DISABLED).isNull();
00705 }
00706
00707 void HTMLOptGroupElement::setDisabled( bool _disabled )
00708 {
00709 if(impl)
00710 static_cast<ElementImpl*>(impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
00711 }
00712
00713 DOMString HTMLOptGroupElement::label() const
00714 {
00715 if(!impl) return DOMString();
00716 return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_LABEL);
00717 }
00718
00719 void HTMLOptGroupElement::setLabel( const DOMString &value )
00720 {
00721 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_LABEL, value);
00722 }
00723
00724
00725
00726 HTMLSelectElement::HTMLSelectElement() : HTMLElement()
00727 {
00728 }
00729
00730 HTMLSelectElement::HTMLSelectElement(const HTMLSelectElement &other) : HTMLElement(other)
00731 {
00732 }
00733
00734 HTMLSelectElement::HTMLSelectElement(HTMLSelectElementImpl *impl) : HTMLElement(impl)
00735 {
00736 }
00737
00738 HTMLSelectElement &HTMLSelectElement::operator = (const Node &other)
00739 {
00740 assignOther( other, ID_SELECT );
00741 return *this;
00742 }
00743
00744 HTMLSelectElement &HTMLSelectElement::operator = (const HTMLSelectElement &other)
00745 {
00746 HTMLElement::operator = (other);
00747 return *this;
00748 }
00749
00750 HTMLSelectElement::~HTMLSelectElement()
00751 {
00752 }
00753
00754 DOMString HTMLSelectElement::type() const
00755 {
00756 if(!impl) return DOMString();
00757 return ((HTMLSelectElementImpl *)impl)->type();
00758 }
00759
00760 long HTMLSelectElement::selectedIndex() const
00761 {
00762 if(!impl) return 0;
00763 return ((HTMLSelectElementImpl *)impl)->selectedIndex();
00764 }
00765
00766 void HTMLSelectElement::setSelectedIndex( long _selectedIndex )
00767 {
00768 if(impl)
00769 ((HTMLSelectElementImpl *)impl)->setSelectedIndex(_selectedIndex);
00770 }
00771
00772 DOMString HTMLSelectElement::value() const
00773 {
00774 if(!impl) return DOMString();
00775 return static_cast<HTMLSelectElementImpl*>(impl)->value();
00776 }
00777
00778 void HTMLSelectElement::setValue( const DOMString &value )
00779 {
00780 if(!impl || value.isNull()) return;
00781 static_cast<HTMLSelectElementImpl*>(impl)->setValue(value.implementation());
00782 }
00783
00784 long HTMLSelectElement::length() const
00785 {
00786 if(!impl) return 0;
00787 return ((HTMLSelectElementImpl *)impl)->length();
00788 }
00789
00790 HTMLFormElement HTMLSelectElement::form() const
00791 {
00792 return Element::form();
00793 }
00794
00795 HTMLCollection HTMLSelectElement::options() const
00796 {
00797 if(!impl) return HTMLCollection();
00798 return HTMLCollection(impl, HTMLCollectionImpl::SELECT_OPTIONS);
00799 }
00800
00801 bool HTMLSelectElement::disabled() const
00802 {
00803 if(!impl) return 0;
00804 return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_DISABLED).isNull();
00805 }
00806
00807 void HTMLSelectElement::setDisabled( bool _disabled )
00808 {
00809 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
00810 }
00811
00812
00813 bool HTMLSelectElement::multiple() const
00814 {
00815 if(!impl) return 0;
00816 return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_MULTIPLE).isNull();
00817 }
00818
00819 void HTMLSelectElement::setMultiple( bool _multiple )
00820 {
00821 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_MULTIPLE, _multiple ? "" : 0);
00822 }
00823
00824 DOMString HTMLSelectElement::name() const
00825 {
00826 if(!impl) return DOMString();
00827 return static_cast<HTMLSelectElementImpl* const>(impl)->name();
00828 }
00829
00830 void HTMLSelectElement::setName( const DOMString &value )
00831 {
00832 if(impl) static_cast<HTMLSelectElementImpl*>(impl)->setName(value);
00833 }
00834
00835 long HTMLSelectElement::size() const
00836 {
00837 if(!impl) return 0;
00838 return ((HTMLSelectElementImpl *)impl)->getAttribute(ATTR_SIZE).toInt();
00839 }
00840
00841 void HTMLSelectElement::setSize( long _size )
00842 {
00843
00844 if(impl) {
00845 DOMString value(QString::number(_size));
00846 static_cast<ElementImpl*>(impl)->setAttribute(ATTR_SIZE,value);
00847 }
00848 }
00849
00850 long HTMLSelectElement::tabIndex() const
00851 {
00852 if(!impl) return 0;
00853 return static_cast<ElementImpl*>(impl)->tabIndex();
00854 }
00855
00856 void HTMLSelectElement::setTabIndex( long _tabIndex )
00857 {
00858 if (!impl) return;
00859 static_cast<ElementImpl*>(impl)->setTabIndex(_tabIndex);
00860 }
00861
00862 void HTMLSelectElement::add( const HTMLElement &element, const HTMLElement &before )
00863 {
00864 if (!impl)
00865 throw DOMException(DOMException::NOT_FOUND_ERR);
00866
00867 int exceptioncode = 0;
00868 static_cast<HTMLSelectElementImpl*>(impl)->add( element, before, exceptioncode );
00869 if ( exceptioncode )
00870 throw DOMException( exceptioncode );
00871 }
00872
00873 void HTMLSelectElement::remove( long index )
00874 {
00875 if(impl) static_cast<HTMLSelectElementImpl*>(impl)->remove( index );
00876 }
00877
00878 void HTMLSelectElement::blur( )
00879 {
00880 if(impl)
00881 ((HTMLSelectElementImpl*)impl)->blur();
00882 }
00883
00884 void HTMLSelectElement::focus( )
00885 {
00886 if(impl)
00887 ((HTMLSelectElementImpl*)impl)->focus();
00888 }
00889
00890
00891
00892 HTMLTextAreaElement::HTMLTextAreaElement() : HTMLElement()
00893 {
00894 }
00895
00896 HTMLTextAreaElement::HTMLTextAreaElement(const HTMLTextAreaElement &other) : HTMLElement(other)
00897 {
00898 }
00899
00900 HTMLTextAreaElement::HTMLTextAreaElement(HTMLTextAreaElementImpl *impl) : HTMLElement(impl)
00901 {
00902 }
00903
00904 HTMLTextAreaElement &HTMLTextAreaElement::operator = (const Node &other)
00905 {
00906 assignOther( other, ID_TEXTAREA );
00907 return *this;
00908 }
00909
00910 HTMLTextAreaElement &HTMLTextAreaElement::operator = (const HTMLTextAreaElement &other)
00911 {
00912 HTMLElement::operator = (other);
00913 return *this;
00914 }
00915
00916 HTMLTextAreaElement::~HTMLTextAreaElement()
00917 {
00918 }
00919
00920 DOMString HTMLTextAreaElement::defaultValue() const
00921 {
00922 if(!impl) return DOMString();
00923 return ((HTMLTextAreaElementImpl *)impl)->defaultValue();
00924 }
00925
00926 void HTMLTextAreaElement::setDefaultValue( const DOMString &value )
00927 {
00928 if (impl) ((HTMLTextAreaElementImpl *)impl)->setDefaultValue(value);
00929 }
00930
00931 HTMLFormElement HTMLTextAreaElement::form() const
00932 {
00933 return Element::form();
00934 }
00935
00936 DOMString HTMLTextAreaElement::accessKey() const
00937 {
00938 if(!impl) return DOMString();
00939 return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ACCESSKEY);
00940 }
00941
00942 void HTMLTextAreaElement::setAccessKey( const DOMString &value )
00943 {
00944 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ACCESSKEY, value);
00945 }
00946
00947 long HTMLTextAreaElement::cols() const
00948 {
00949 if(!impl) return 0;
00950 return ((HTMLTextAreaElementImpl *)impl)->getAttribute(ATTR_COLS).toInt();
00951 }
00952
00953 void HTMLTextAreaElement::setCols( long _cols )
00954 {
00955
00956 if(impl) {
00957 DOMString value(QString::number(_cols));
00958 static_cast<ElementImpl*>(impl)->setAttribute(ATTR_COLS,value);
00959 }
00960 }
00961
00962 bool HTMLTextAreaElement::disabled() const
00963 {
00964 if(!impl) return 0;
00965 return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_DISABLED).isNull();
00966 }
00967
00968 void HTMLTextAreaElement::setDisabled( bool _disabled )
00969 {
00970 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
00971 }
00972
00973 DOMString HTMLTextAreaElement::name() const
00974 {
00975 if(!impl) return DOMString();
00976 return static_cast<HTMLTextAreaElementImpl* const>(impl)->name();
00977 }
00978
00979 void HTMLTextAreaElement::setName( const DOMString &value )
00980 {
00981 if(impl) static_cast<HTMLTextAreaElementImpl*>(impl)->setName(value);
00982 }
00983
00984 bool HTMLTextAreaElement::readOnly() const
00985 {
00986 if(!impl) return 0;
00987 return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_READONLY).isNull();
00988 }
00989
00990 void HTMLTextAreaElement::setReadOnly( bool _readOnly )
00991 {
00992 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_READONLY, _readOnly ? "" : 0);
00993 }
00994
00995 long HTMLTextAreaElement::rows() const
00996 {
00997 if(!impl) return 0;
00998 return ((HTMLTextAreaElementImpl *)impl)->getAttribute(ATTR_ROWS).toInt();
00999 }
01000
01001 void HTMLTextAreaElement::setRows( long _rows )
01002 {
01003
01004 if(impl) {
01005 DOMString value(QString::number(_rows));
01006 static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ROWS,value);
01007 }
01008 }
01009
01010 long HTMLTextAreaElement::tabIndex() const
01011 {
01012 if(!impl) return 0;
01013 return static_cast<ElementImpl*>(impl)->tabIndex();
01014 }
01015
01016 void HTMLTextAreaElement::setTabIndex( long _tabIndex )
01017 {
01018 if (!impl) return;
01019 static_cast<ElementImpl*>(impl)->setTabIndex(_tabIndex);
01020 }
01021
01022 DOMString HTMLTextAreaElement::type() const
01023 {
01024 if(!impl) return DOMString();
01025 return ((HTMLTextAreaElementImpl *)impl)->type();
01026 }
01027
01028 DOMString HTMLTextAreaElement::value() const
01029 {
01030 if(!impl) return DOMString();
01031 return ((HTMLTextAreaElementImpl *)impl)->value();
01032 }
01033
01034 void HTMLTextAreaElement::setValue( const DOMString &value )
01035 {
01036 if(impl) ((HTMLTextAreaElementImpl *)impl)->setValue(value);
01037 }
01038
01039 void HTMLTextAreaElement::blur( )
01040 {
01041 if(impl)
01042 ((HTMLTextAreaElementImpl*)impl)->blur();
01043 }
01044
01045 void HTMLTextAreaElement::focus( )
01046 {
01047 if(impl)
01048 ((HTMLTextAreaElementImpl*)impl)->focus();
01049 }
01050
01051 void HTMLTextAreaElement::select( )
01052 {
01053 if(impl)
01054 ((HTMLTextAreaElementImpl *)impl)->select( );
01055 }
01056
01057
01058
01059 HTMLOptionElement::HTMLOptionElement() : HTMLElement()
01060 {
01061 }
01062
01063 HTMLOptionElement::HTMLOptionElement(const HTMLOptionElement &other) : HTMLElement(other)
01064 {
01065 }
01066
01067 HTMLOptionElement::HTMLOptionElement(HTMLOptionElementImpl *impl) : HTMLElement(impl)
01068 {
01069 }
01070
01071 HTMLOptionElement &HTMLOptionElement::operator = (const Node &other)
01072 {
01073 assignOther( other, ID_OPTION );
01074 return *this;
01075 }
01076
01077 HTMLOptionElement &HTMLOptionElement::operator = (const HTMLOptionElement &other)
01078 {
01079 HTMLElement::operator = (other);
01080 return *this;
01081 }
01082
01083 HTMLOptionElement::~HTMLOptionElement()
01084 {
01085 }
01086
01087 HTMLFormElement HTMLOptionElement::form() const
01088 {
01089 return Element::form();
01090 }
01091
01092 bool HTMLOptionElement::defaultSelected() const
01093 {
01094 if(!impl) return 0;
01095 return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_SELECTED).isNull();
01096 }
01097
01098 void HTMLOptionElement::setDefaultSelected( bool _defaultSelected )
01099 {
01100 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_SELECTED, _defaultSelected ? "" : 0);
01101 }
01102
01103 DOMString HTMLOptionElement::text() const
01104 {
01105 if(!impl) return DOMString();
01106 return ((HTMLOptionElementImpl *)impl)->text();
01107 }
01108
01109 long HTMLOptionElement::index() const
01110 {
01111 if(!impl) return 0;
01112 return ((HTMLOptionElementImpl *)impl)->index();
01113 }
01114
01115 void HTMLOptionElement::setIndex( long )
01116 {
01117 throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
01118 }
01119
01120 bool HTMLOptionElement::disabled() const
01121 {
01122 if(!impl) return 0;
01123 return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_DISABLED).isNull();
01124 }
01125
01126 void HTMLOptionElement::setDisabled( bool _disabled )
01127 {
01128 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
01129 }
01130
01131 DOMString HTMLOptionElement::label() const
01132 {
01133 if(!impl) return DOMString();
01134 return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_LABEL);
01135 }
01136
01137 void HTMLOptionElement::setLabel( const DOMString &value )
01138 {
01139 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_LABEL, value);
01140 }
01141
01142 bool HTMLOptionElement::selected() const
01143 {
01144 if(!impl) return 0;
01145 return ((HTMLOptionElementImpl *)impl)->selected();
01146 }
01147
01148 void HTMLOptionElement::setSelected(bool _selected) {
01149 if(!impl) return;
01150 ((HTMLOptionElementImpl *)impl)->setSelected(_selected);
01151 }
01152
01153 DOMString HTMLOptionElement::value() const
01154 {
01155 if(!impl) return DOMString();
01156 return static_cast<HTMLOptionElementImpl*>(impl)->value();
01157 }
01158
01159 void HTMLOptionElement::setValue( const DOMString &value )
01160 {
01161 if(impl) static_cast<HTMLOptionElementImpl*>(impl)->setValue(value.implementation());
01162 }
01163
01164
01165
01166 HTMLIsIndexElement::HTMLIsIndexElement() : HTMLElement()
01167 {
01168 }
01169
01170 HTMLIsIndexElement::HTMLIsIndexElement(const HTMLIsIndexElement &other) : HTMLElement(other)
01171 {
01172 }
01173
01174 HTMLIsIndexElement::HTMLIsIndexElement(HTMLIsIndexElementImpl *impl) : HTMLElement(impl)
01175 {
01176 }
01177
01178 HTMLIsIndexElement &HTMLIsIndexElement::operator = (const Node &other)
01179 {
01180 assignOther( other, ID_ISINDEX );
01181 return *this;
01182 }
01183
01184 HTMLIsIndexElement &HTMLIsIndexElement::operator = (const HTMLIsIndexElement &other)
01185 {
01186 HTMLElement::operator = (other);
01187 return *this;
01188 }
01189
01190 HTMLIsIndexElement::~HTMLIsIndexElement()
01191 {
01192 }
01193
01194 HTMLFormElement HTMLIsIndexElement::form() const
01195 {
01196 return Element::form();
01197 }
01198
01199 DOMString HTMLIsIndexElement::prompt() const
01200 {
01201 if(!impl) return DOMString();
01202 return static_cast<HTMLIsIndexElementImpl*>(impl)->prompt();
01203 }
01204
01205 void HTMLIsIndexElement::setPrompt( const DOMString &value )
01206 {
01207 if(impl) static_cast<HTMLIsIndexElementImpl*>(impl)->setPrompt(value);
01208 }