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<HTMLFormElementImpl*>(impl)->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<HTMLFormElementImpl*>(impl)->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
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->document()->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(((HTMLSelectElementImpl*)impl)->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,value);
00902 }
00903 }
00904
00905 long HTMLSelectElement::tabIndex() const
00906 {
00907 if(!impl) return 0;
00908 return static_cast<ElementImpl*>(impl)->tabIndex();
00909 }
00910
00911 void HTMLSelectElement::setTabIndex( long _tabIndex )
00912 {
00913 if (!impl) return;
00914 static_cast<ElementImpl*>(impl)->setTabIndex(_tabIndex);
00915 }
00916
00917 void HTMLSelectElement::add( const HTMLElement &element, const HTMLElement &before )
00918 {
00919 if (!impl)
00920 throw DOMException(DOMException::NOT_FOUND_ERR);
00921
00922 int exceptioncode = 0;
00923 static_cast<HTMLSelectElementImpl*>(impl)->add(
00924 static_cast<HTMLElementImpl*>(element.handle()),
00925 static_cast<HTMLElementImpl*>(before.handle()), exceptioncode );
00926 if ( exceptioncode )
00927 throw DOMException( exceptioncode );
00928 }
00929
00930 void HTMLSelectElement::remove( long index )
00931 {
00932 if(impl) static_cast<HTMLSelectElementImpl*>(impl)->remove( index );
00933 }
00934
00935 void HTMLSelectElement::blur( )
00936 {
00937 if(impl)
00938 ((HTMLSelectElementImpl*)impl)->blur();
00939 }
00940
00941 void HTMLSelectElement::focus( )
00942 {
00943 if(impl)
00944 ((HTMLSelectElementImpl*)impl)->focus();
00945 }
00946
00947
00948
00949 HTMLTextAreaElement::HTMLTextAreaElement() : HTMLElement()
00950 {
00951 }
00952
00953 HTMLTextAreaElement::HTMLTextAreaElement(const HTMLTextAreaElement &other) : HTMLElement(other)
00954 {
00955 }
00956
00957 HTMLTextAreaElement::HTMLTextAreaElement(HTMLTextAreaElementImpl *impl) : HTMLElement(impl)
00958 {
00959 }
00960
00961 HTMLTextAreaElement &HTMLTextAreaElement::operator = (const Node &other)
00962 {
00963 assignOther( other, ID_TEXTAREA );
00964 return *this;
00965 }
00966
00967 HTMLTextAreaElement &HTMLTextAreaElement::operator = (const HTMLTextAreaElement &other)
00968 {
00969 HTMLElement::operator = (other);
00970 return *this;
00971 }
00972
00973 HTMLTextAreaElement::~HTMLTextAreaElement()
00974 {
00975 }
00976
00977 DOMString HTMLTextAreaElement::defaultValue() const
00978 {
00979 if(!impl) return DOMString();
00980 return ((HTMLTextAreaElementImpl *)impl)->defaultValue();
00981 }
00982
00983 void HTMLTextAreaElement::setDefaultValue( const DOMString &value )
00984 {
00985 if (impl) ((HTMLTextAreaElementImpl *)impl)->setDefaultValue(value);
00986 }
00987
00988 HTMLFormElement HTMLTextAreaElement::form() const
00989 {
00990 return Element::form();
00991 }
00992
00993 DOMString HTMLTextAreaElement::accessKey() const
00994 {
00995 if(!impl) return DOMString();
00996 return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ACCESSKEY);
00997 }
00998
00999 void HTMLTextAreaElement::setAccessKey( const DOMString &value )
01000 {
01001 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ACCESSKEY, value);
01002 }
01003
01004 long HTMLTextAreaElement::cols() const
01005 {
01006 if(!impl) return 0;
01007 return ((HTMLTextAreaElementImpl *)impl)->getAttribute(ATTR_COLS).toInt();
01008 }
01009
01010 void HTMLTextAreaElement::setCols( long _cols )
01011 {
01012
01013 if(impl) {
01014 DOMString value(QString::number(_cols));
01015 static_cast<ElementImpl*>(impl)->setAttribute(ATTR_COLS,value);
01016 }
01017 }
01018
01019 bool HTMLTextAreaElement::disabled() const
01020 {
01021 if(!impl) return 0;
01022 return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_DISABLED).isNull();
01023 }
01024
01025 void HTMLTextAreaElement::setDisabled( bool _disabled )
01026 {
01027 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
01028 }
01029
01030 DOMString HTMLTextAreaElement::name() const
01031 {
01032 if(!impl) return DOMString();
01033 return static_cast<HTMLTextAreaElementImpl* const>(impl)->name();
01034 }
01035
01036 void HTMLTextAreaElement::setName( const DOMString &value )
01037 {
01038 if(impl) static_cast<HTMLTextAreaElementImpl*>(impl)->setName(value);
01039 }
01040
01041 bool HTMLTextAreaElement::readOnly() const
01042 {
01043 if(!impl) return 0;
01044 return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_READONLY).isNull();
01045 }
01046
01047 void HTMLTextAreaElement::setReadOnly( bool _readOnly )
01048 {
01049 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_READONLY, _readOnly ? "" : 0);
01050 }
01051
01052 long HTMLTextAreaElement::rows() const
01053 {
01054 if(!impl) return 0;
01055 return ((HTMLTextAreaElementImpl *)impl)->getAttribute(ATTR_ROWS).toInt();
01056 }
01057
01058 void HTMLTextAreaElement::setRows( long _rows )
01059 {
01060
01061 if(impl) {
01062 DOMString value(QString::number(_rows));
01063 static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ROWS,value);
01064 }
01065 }
01066
01067 long HTMLTextAreaElement::tabIndex() const
01068 {
01069 if(!impl) return 0;
01070 return static_cast<ElementImpl*>(impl)->tabIndex();
01071 }
01072
01073 void HTMLTextAreaElement::setTabIndex( long _tabIndex )
01074 {
01075 if (!impl) return;
01076 static_cast<ElementImpl*>(impl)->setTabIndex(_tabIndex);
01077 }
01078
01079 DOMString HTMLTextAreaElement::type() const
01080 {
01081 if(!impl) return DOMString();
01082 return ((HTMLTextAreaElementImpl *)impl)->type();
01083 }
01084
01085 DOMString HTMLTextAreaElement::value() const
01086 {
01087 if(!impl) return DOMString();
01088 return ((HTMLTextAreaElementImpl *)impl)->value();
01089 }
01090
01091 void HTMLTextAreaElement::setValue( const DOMString &value )
01092 {
01093 if(impl) ((HTMLTextAreaElementImpl *)impl)->setValue(value);
01094 }
01095
01096 void HTMLTextAreaElement::blur( )
01097 {
01098 if(impl)
01099 ((HTMLTextAreaElementImpl*)impl)->blur();
01100 }
01101
01102 void HTMLTextAreaElement::focus( )
01103 {
01104 if(impl)
01105 ((HTMLTextAreaElementImpl*)impl)->focus();
01106 }
01107
01108 void HTMLTextAreaElement::select( )
01109 {
01110 if(impl)
01111 ((HTMLTextAreaElementImpl *)impl)->select( );
01112 }
01113
01114 long HTMLTextAreaElement::selectionStart()
01115 {
01116 if (impl)
01117 return ((HTMLTextAreaElementImpl *)impl)->selectionStart( );
01118 return 0;
01119 }
01120
01121 long HTMLTextAreaElement::selectionEnd()
01122 {
01123 if (impl)
01124 return ((HTMLTextAreaElementImpl *)impl)->selectionEnd( );
01125 return 0;
01126 }
01127
01128 long HTMLTextAreaElement::textLength()
01129 {
01130 if (impl)
01131 return ((HTMLTextAreaElementImpl *)impl)->textLength( );
01132 return 0;
01133 }
01134
01135 void HTMLTextAreaElement::setSelectionStart(long pos)
01136 {
01137 if (impl)
01138 ((HTMLTextAreaElementImpl *)impl)->setSelectionStart( pos );
01139 }
01140
01141 void HTMLTextAreaElement::setSelectionEnd(long pos)
01142 {
01143 if (impl)
01144 ((HTMLTextAreaElementImpl *)impl)->setSelectionEnd( pos );
01145 }
01146
01147 void HTMLTextAreaElement::setSelectionRange(long start, long end)
01148 {
01149 if (impl)
01150 ((HTMLTextAreaElementImpl *)impl)->setSelectionRange( start, end );
01151 }
01152
01153
01154
01155 HTMLOptionElement::HTMLOptionElement() : HTMLElement()
01156 {
01157 }
01158
01159 HTMLOptionElement::HTMLOptionElement(const HTMLOptionElement &other) : HTMLElement(other)
01160 {
01161 }
01162
01163 HTMLOptionElement::HTMLOptionElement(HTMLOptionElementImpl *impl) : HTMLElement(impl)
01164 {
01165 }
01166
01167 HTMLOptionElement &HTMLOptionElement::operator = (const Node &other)
01168 {
01169 assignOther( other, ID_OPTION );
01170 return *this;
01171 }
01172
01173 HTMLOptionElement &HTMLOptionElement::operator = (const HTMLOptionElement &other)
01174 {
01175 HTMLElement::operator = (other);
01176 return *this;
01177 }
01178
01179 HTMLOptionElement::~HTMLOptionElement()
01180 {
01181 }
01182
01183 HTMLFormElement HTMLOptionElement::form() const
01184 {
01185 return Element::form();
01186 }
01187
01188 bool HTMLOptionElement::defaultSelected() const
01189 {
01190 if(!impl) return 0;
01191 return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_SELECTED).isNull();
01192 }
01193
01194 void HTMLOptionElement::setDefaultSelected( bool _defaultSelected )
01195 {
01196 if(impl) static_cast<HTMLOptionElementImpl*>(impl)->setDefaultSelected(_defaultSelected);
01197 }
01198
01199 DOMString HTMLOptionElement::text() const
01200 {
01201 if(!impl) return DOMString();
01202 return ((HTMLOptionElementImpl *)impl)->text();
01203 }
01204
01205 long HTMLOptionElement::index() const
01206 {
01207 if(!impl) return 0;
01208 return ((HTMLOptionElementImpl *)impl)->index();
01209 }
01210
01211 void HTMLOptionElement::setIndex( long )
01212 {
01213 throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
01214 }
01215
01216 bool HTMLOptionElement::disabled() const
01217 {
01218 if(!impl) return 0;
01219 return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_DISABLED).isNull();
01220 }
01221
01222 void HTMLOptionElement::setDisabled( bool _disabled )
01223 {
01224 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
01225 }
01226
01227 DOMString HTMLOptionElement::label() const
01228 {
01229 if(!impl) return DOMString();
01230 return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_LABEL);
01231 }
01232
01233 void HTMLOptionElement::setLabel( const DOMString &value )
01234 {
01235 if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_LABEL, value);
01236 }
01237
01238 bool HTMLOptionElement::selected() const
01239 {
01240 if(!impl) return 0;
01241 return ((HTMLOptionElementImpl *)impl)->selected();
01242 }
01243
01244 void HTMLOptionElement::setSelected(bool _selected) {
01245 if(!impl) return;
01246 ((HTMLOptionElementImpl *)impl)->setSelected(_selected);
01247 }
01248
01249 DOMString HTMLOptionElement::value() const
01250 {
01251 if(!impl) return DOMString();
01252 return static_cast<HTMLOptionElementImpl*>(impl)->value();
01253 }
01254
01255 void HTMLOptionElement::setValue( const DOMString &value )
01256 {
01257 if(impl) static_cast<HTMLOptionElementImpl*>(impl)->setValue(value.implementation());
01258 }
01259
01260
01261
01262 HTMLIsIndexElement::HTMLIsIndexElement() : HTMLElement()
01263 {
01264 }
01265
01266 HTMLIsIndexElement::HTMLIsIndexElement(const HTMLIsIndexElement &other) : HTMLElement(other)
01267 {
01268 }
01269
01270 HTMLIsIndexElement::HTMLIsIndexElement(HTMLIsIndexElementImpl *impl) : HTMLElement(impl)
01271 {
01272 }
01273
01274 HTMLIsIndexElement &HTMLIsIndexElement::operator = (const Node &other)
01275 {
01276 assignOther( other, ID_ISINDEX );
01277 return *this;
01278 }
01279
01280 HTMLIsIndexElement &HTMLIsIndexElement::operator = (const HTMLIsIndexElement &other)
01281 {
01282 HTMLElement::operator = (other);
01283 return *this;
01284 }
01285
01286 HTMLIsIndexElement::~HTMLIsIndexElement()
01287 {
01288 }
01289
01290 HTMLFormElement HTMLIsIndexElement::form() const
01291 {
01292 return Element::form();
01293 }
01294
01295 DOMString HTMLIsIndexElement::prompt() const
01296 {
01297 if(!impl) return DOMString();
01298 return static_cast<HTMLIsIndexElementImpl*>(impl)->prompt();
01299 }
01300
01301 void HTMLIsIndexElement::setPrompt( const DOMString &value )
01302 {
01303 if(impl) static_cast<HTMLIsIndexElementImpl*>(impl)->setPrompt(value);
01304 }