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::disabled() const
00416 {
00417     if(!impl) return 0;
00418     return !((ElementImpl *)impl)->getAttribute(ATTR_DISABLED).isNull();
00419 }
00420 
00421 void HTMLInputElement::setDisabled( bool _disabled )
00422 {
00423     if(impl)
00424     {
00425     ((ElementImpl *)impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
00426     }
00427 }
00428 
00429 long HTMLInputElement::maxLength() const
00430 {
00431     if(!impl) return 0;
00432     return ((HTMLInputElementImpl *)impl)->getAttribute(ATTR_MAXLENGTH).toInt();
00433 }
00434 
00435 void HTMLInputElement::setMaxLength( long _maxLength )
00436 {
00437     if(impl) {
00438         DOMString value(QString::number(_maxLength));
00439         ((ElementImpl *)impl)->setAttribute(ATTR_MAXLENGTH,value);
00440     }
00441 }
00442 
00443 DOMString HTMLInputElement::name() const
00444 {
00445     if(!impl) return DOMString();
00446     return static_cast<HTMLInputElementImpl* const>(impl)->name();
00447 }
00448 
00449 void HTMLInputElement::setName( const DOMString &value )
00450 {
00451     if(impl) static_cast<HTMLInputElementImpl*>(impl)->setName(value);
00452 }
00453 
00454 bool HTMLInputElement::readOnly() const
00455 {
00456     if(!impl) return 0;
00457     return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_READONLY).isNull();
00458 }
00459 
00460 void HTMLInputElement::setReadOnly( bool _readOnly )
00461 {
00462     if(impl)
00463     static_cast<ElementImpl*>(impl)->setAttribute(ATTR_READONLY, _readOnly ? "" : 0);
00464 }
00465 
00466 /* The next two are provided for backwards compatibility. */
00467 DOMString HTMLInputElement::size() const
00468 {
00469     if(!impl) return DOMString();
00470     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_SIZE);
00471 }
00472 
00473 void HTMLInputElement::setSize( const DOMString &value )
00474 {
00475     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_SIZE, value);
00476 }
00477 
00478 long HTMLInputElement::getSize() const
00479 {
00480     if(!impl) return 0;
00481     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_SIZE).toInt();
00482 }
00483 
00484 void HTMLInputElement::setSize( long value )
00485 {
00486     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_SIZE, QString::number(value));
00487 }
00488 
00489 DOMString HTMLInputElement::src() const
00490 {
00491     if(!impl) return DOMString();
00492     DOMString s = static_cast<ElementImpl*>(impl)->getAttribute(ATTR_SRC);
00493     return !s.isNull() ? impl->getDocument()->completeURL( s.string() ) : s;
00494 }
00495 
00496 void HTMLInputElement::setSrc( const DOMString &value )
00497 {
00498     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_SRC, value);
00499 }
00500 
00501 long HTMLInputElement::tabIndex() const
00502 {
00503     if(!impl) return 0;
00504     return static_cast<ElementImpl*>(impl)->tabIndex();
00505 }
00506 
00507 void HTMLInputElement::setTabIndex( long _tabIndex )
00508 {
00509     if (!impl) return;
00510     static_cast<ElementImpl*>(impl)->setTabIndex(_tabIndex);
00511 }
00512 
00513 DOMString HTMLInputElement::type() const
00514 {
00515     if(!impl) return DOMString();
00516     return ((HTMLInputElementImpl *)impl)->type();
00517 }
00518 
00519 void HTMLInputElement::setType(const DOMString& _type)
00520 {
00521     if (!impl) return;
00522     static_cast<HTMLInputElementImpl*>(impl)->setType(_type);
00523 }
00524 
00525 DOMString HTMLInputElement::useMap() const
00526 {
00527     if(!impl) return DOMString();
00528     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_USEMAP);
00529 }
00530 
00531 void HTMLInputElement::setUseMap( const DOMString &value )
00532 {
00533     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_USEMAP, value);
00534 }
00535 
00536 DOMString HTMLInputElement::value() const
00537 {
00538     if(!impl) return DOMString();
00539     return ((HTMLInputElementImpl*)impl)->value();
00540 }
00541 
00542 void HTMLInputElement::setValue( const DOMString &value )
00543 {
00544     if (impl)
00545     ((HTMLInputElementImpl*)impl)->setValue(value);
00546 
00547 }
00548 
00549 void HTMLInputElement::blur(  )
00550 {
00551     if(impl)
00552     ((HTMLInputElementImpl*)impl)->blur();
00553 }
00554 
00555 void HTMLInputElement::focus(  )
00556 {
00557     if(impl)
00558     ((HTMLInputElementImpl*)impl)->focus();
00559 }
00560 
00561 void HTMLInputElement::select(  )
00562 {
00563     if(impl)
00564     ((HTMLInputElementImpl *)impl)->select(  );
00565 }
00566 
00567 void HTMLInputElement::click(  )
00568 {
00569     if(impl)
00570     ((HTMLInputElementImpl *)impl)->click(  );
00571 }
00572 
00573 long HTMLInputElement::selectionStart()
00574 {
00575     if (impl)
00576     return ((HTMLInputElementImpl *)impl)->selectionStart(  );
00577     return -1;
00578 }
00579 
00580 long HTMLInputElement::selectionEnd()
00581 {
00582     if (impl)
00583     return ((HTMLInputElementImpl *)impl)->selectionEnd(  );
00584     return -1;
00585 }
00586 
00587 void HTMLInputElement::setSelectionStart(long pos)
00588 {
00589     if (impl)
00590     ((HTMLInputElementImpl *)impl)->setSelectionStart( pos );
00591 }
00592 
00593 void HTMLInputElement::setSelectionEnd(long pos)
00594 {
00595     if (impl)
00596     ((HTMLInputElementImpl *)impl)->setSelectionEnd( pos );
00597 }
00598 
00599 void HTMLInputElement::setSelectionRange(long start, long end)
00600 {
00601     if (impl)
00602     ((HTMLInputElementImpl *)impl)->setSelectionRange( start, end );
00603 }
00604 
00605 // --------------------------------------------------------------------------
00606 
00607 HTMLLabelElement::HTMLLabelElement() : HTMLElement()
00608 {
00609 }
00610 
00611 HTMLLabelElement::HTMLLabelElement(const HTMLLabelElement &other) : HTMLElement(other)
00612 {
00613 }
00614 
00615 HTMLLabelElement::HTMLLabelElement(HTMLLabelElementImpl *impl) : HTMLElement(impl)
00616 {
00617 }
00618 
00619 HTMLLabelElement &HTMLLabelElement::operator = (const Node &other)
00620 {
00621     assignOther( other, ID_LABEL );
00622     return *this;
00623 }
00624 
00625 HTMLLabelElement &HTMLLabelElement::operator = (const HTMLLabelElement &other)
00626 {
00627     HTMLElement::operator = (other);
00628     return *this;
00629 }
00630 
00631 HTMLLabelElement::~HTMLLabelElement()
00632 {
00633 }
00634 
00635 DOMString HTMLLabelElement::accessKey() const
00636 {
00637     if(!impl) return DOMString();
00638     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ACCESSKEY);
00639 }
00640 
00641 void HTMLLabelElement::setAccessKey( const DOMString &value )
00642 {
00643     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ACCESSKEY, value);
00644 }
00645 
00646 DOMString HTMLLabelElement::htmlFor() const
00647 {
00648     if(!impl) return DOMString();
00649     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_FOR);
00650 }
00651 
00652 void HTMLLabelElement::setHtmlFor( const DOMString &value )
00653 {
00654     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_FOR, value);
00655 }
00656 
00657 // --------------------------------------------------------------------------
00658 
00659 HTMLLegendElement::HTMLLegendElement() : HTMLElement()
00660 {
00661 }
00662 
00663 HTMLLegendElement::HTMLLegendElement(const HTMLLegendElement &other) : HTMLElement(other)
00664 {
00665 }
00666 
00667 HTMLLegendElement::HTMLLegendElement(HTMLLegendElementImpl *impl) : HTMLElement(impl)
00668 {
00669 }
00670 
00671 HTMLLegendElement &HTMLLegendElement::operator = (const Node &other)
00672 {
00673     assignOther( other, ID_LEGEND );
00674     return *this;
00675 }
00676 
00677 HTMLLegendElement &HTMLLegendElement::operator = (const HTMLLegendElement &other)
00678 {
00679     HTMLElement::operator = (other);
00680     return *this;
00681 }
00682 
00683 HTMLLegendElement::~HTMLLegendElement()
00684 {
00685 }
00686 
00687 HTMLFormElement HTMLLegendElement::form() const
00688 {
00689     return Element::form();
00690 }
00691 
00692 DOMString HTMLLegendElement::accessKey() const
00693 {
00694     if(!impl) return DOMString();
00695     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ACCESSKEY);
00696 }
00697 
00698 void HTMLLegendElement::setAccessKey( const DOMString &value )
00699 {
00700     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ACCESSKEY, value);
00701 }
00702 
00703 DOMString HTMLLegendElement::align() const
00704 {
00705     if(!impl) return DOMString();
00706     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ALIGN);
00707 }
00708 
00709 void HTMLLegendElement::setAlign( const DOMString &value )
00710 {
00711     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ALIGN, value);
00712 }
00713 
00714 // --------------------------------------------------------------------------
00715 
00716 HTMLOptGroupElement::HTMLOptGroupElement() : HTMLElement()
00717 {
00718 }
00719 
00720 HTMLOptGroupElement::HTMLOptGroupElement(const HTMLOptGroupElement &other) : HTMLElement(other)
00721 {
00722 }
00723 
00724 HTMLOptGroupElement::HTMLOptGroupElement(HTMLOptGroupElementImpl *impl) : HTMLElement(impl)
00725 {
00726 }
00727 
00728 HTMLOptGroupElement &HTMLOptGroupElement::operator = (const Node &other)
00729 {
00730     assignOther( other, ID_OPTGROUP );
00731     return *this;
00732 }
00733 
00734 HTMLOptGroupElement &HTMLOptGroupElement::operator = (const HTMLOptGroupElement &other)
00735 {
00736     HTMLElement::operator = (other);
00737     return *this;
00738 }
00739 
00740 HTMLOptGroupElement::~HTMLOptGroupElement()
00741 {
00742 }
00743 
00744 bool HTMLOptGroupElement::disabled() const
00745 {
00746     if(!impl) return 0;
00747     return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_DISABLED).isNull();
00748 }
00749 
00750 void HTMLOptGroupElement::setDisabled( bool _disabled )
00751 {
00752     if(impl)
00753     static_cast<ElementImpl*>(impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
00754 }
00755 
00756 DOMString HTMLOptGroupElement::label() const
00757 {
00758     if(!impl) return DOMString();
00759     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_LABEL);
00760 }
00761 
00762 void HTMLOptGroupElement::setLabel( const DOMString &value )
00763 {
00764     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_LABEL, value);
00765 }
00766 
00767 // --------------------------------------------------------------------------
00768 
00769 HTMLSelectElement::HTMLSelectElement() : HTMLElement()
00770 {
00771 }
00772 
00773 HTMLSelectElement::HTMLSelectElement(const HTMLSelectElement &other) : HTMLElement(other)
00774 {
00775 }
00776 
00777 HTMLSelectElement::HTMLSelectElement(HTMLSelectElementImpl *impl) : HTMLElement(impl)
00778 {
00779 }
00780 
00781 HTMLSelectElement &HTMLSelectElement::operator = (const Node &other)
00782 {
00783     assignOther( other, ID_SELECT );
00784     return *this;
00785 }
00786 
00787 HTMLSelectElement &HTMLSelectElement::operator = (const HTMLSelectElement &other)
00788 {
00789     HTMLElement::operator = (other);
00790     return *this;
00791 }
00792 
00793 HTMLSelectElement::~HTMLSelectElement()
00794 {
00795 }
00796 
00797 DOMString HTMLSelectElement::type() const
00798 {
00799     if(!impl) return DOMString();
00800     return ((HTMLSelectElementImpl *)impl)->type();
00801 }
00802 
00803 long HTMLSelectElement::selectedIndex() const
00804 {
00805     if(!impl) return 0;
00806     return ((HTMLSelectElementImpl *)impl)->selectedIndex();
00807 }
00808 
00809 void HTMLSelectElement::setSelectedIndex( long _selectedIndex )
00810 {
00811     if(impl)
00812         ((HTMLSelectElementImpl *)impl)->setSelectedIndex(_selectedIndex);
00813 }
00814 
00815 DOMString HTMLSelectElement::value() const
00816 {
00817     if(!impl) return DOMString();
00818     return static_cast<HTMLSelectElementImpl*>(impl)->value();
00819 }
00820 
00821 void HTMLSelectElement::setValue( const DOMString &value )
00822 {
00823     if(!impl || value.isNull()) return;
00824     static_cast<HTMLSelectElementImpl*>(impl)->setValue(value.implementation());
00825 }
00826 
00827 long HTMLSelectElement::length() const
00828 {
00829     if(!impl) return 0;
00830     return ((HTMLSelectElementImpl *)impl)->length();
00831 }
00832 
00833 HTMLFormElement HTMLSelectElement::form() const
00834 {
00835     return Element::form();
00836 }
00837 
00838 HTMLCollection HTMLSelectElement::options() const
00839 {
00840     if(!impl) return HTMLCollection();
00841     return HTMLCollection(impl, HTMLCollectionImpl::SELECT_OPTIONS);
00842 }
00843 
00844 bool HTMLSelectElement::disabled() const
00845 {
00846     if(!impl) return 0;
00847     return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_DISABLED).isNull();
00848 }
00849 
00850 void HTMLSelectElement::setDisabled( bool _disabled )
00851 {
00852     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
00853 }
00854 
00855 
00856 bool HTMLSelectElement::multiple() const
00857 {
00858     if(!impl) return 0;
00859     return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_MULTIPLE).isNull();
00860 }
00861 
00862 void HTMLSelectElement::setMultiple( bool _multiple )
00863 {
00864     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_MULTIPLE, _multiple ? "" : 0);
00865 }
00866 
00867 DOMString HTMLSelectElement::name() const
00868 {
00869     if(!impl) return DOMString();
00870     return static_cast<HTMLSelectElementImpl* const>(impl)->name();
00871 }
00872 
00873 void HTMLSelectElement::setName( const DOMString &value )
00874 {
00875     if(impl) static_cast<HTMLSelectElementImpl*>(impl)->setName(value);
00876 }
00877 
00878 long HTMLSelectElement::size() const
00879 {
00880     if(!impl) return 0;
00881     return ((HTMLSelectElementImpl *)impl)->getAttribute(ATTR_SIZE).toInt();
00882 }
00883 
00884 void HTMLSelectElement::setSize( long _size )
00885 {
00886 
00887     if(impl) {
00888     DOMString value(QString::number(_size));
00889         static_cast<ElementImpl*>(impl)->setAttribute(ATTR_SIZE,value);
00890     }
00891 }
00892 
00893 long HTMLSelectElement::tabIndex() const
00894 {
00895     if(!impl) return 0;
00896     return static_cast<ElementImpl*>(impl)->tabIndex();
00897 }
00898 
00899 void HTMLSelectElement::setTabIndex( long _tabIndex )
00900 {
00901     if (!impl) return;
00902     static_cast<ElementImpl*>(impl)->setTabIndex(_tabIndex);
00903 }
00904 
00905 void HTMLSelectElement::add( const HTMLElement &element, const HTMLElement &before )
00906 {
00907     if (!impl)
00908         throw DOMException(DOMException::NOT_FOUND_ERR);
00909 
00910     int exceptioncode = 0;
00911     static_cast<HTMLSelectElementImpl*>(impl)->add( element, before, exceptioncode );
00912     if ( exceptioncode )
00913         throw DOMException( exceptioncode );
00914 }
00915 
00916 void HTMLSelectElement::remove( long index )
00917 {
00918     if(impl) static_cast<HTMLSelectElementImpl*>(impl)->remove( index );
00919 }
00920 
00921 void HTMLSelectElement::blur(  )
00922 {
00923     if(impl)
00924     ((HTMLSelectElementImpl*)impl)->blur();
00925 }
00926 
00927 void HTMLSelectElement::focus(  )
00928 {
00929     if(impl)
00930     ((HTMLSelectElementImpl*)impl)->focus();
00931 }
00932 
00933 // --------------------------------------------------------------------------
00934 
00935 HTMLTextAreaElement::HTMLTextAreaElement() : HTMLElement()
00936 {
00937 }
00938 
00939 HTMLTextAreaElement::HTMLTextAreaElement(const HTMLTextAreaElement &other) : HTMLElement(other)
00940 {
00941 }
00942 
00943 HTMLTextAreaElement::HTMLTextAreaElement(HTMLTextAreaElementImpl *impl) : HTMLElement(impl)
00944 {
00945 }
00946 
00947 HTMLTextAreaElement &HTMLTextAreaElement::operator = (const Node &other)
00948 {
00949     assignOther( other, ID_TEXTAREA );
00950     return *this;
00951 }
00952 
00953 HTMLTextAreaElement &HTMLTextAreaElement::operator = (const HTMLTextAreaElement &other)
00954 {
00955     HTMLElement::operator = (other);
00956     return *this;
00957 }
00958 
00959 HTMLTextAreaElement::~HTMLTextAreaElement()
00960 {
00961 }
00962 
00963 DOMString HTMLTextAreaElement::defaultValue() const
00964 {
00965     if(!impl) return DOMString();
00966     return ((HTMLTextAreaElementImpl *)impl)->defaultValue();
00967 }
00968 
00969 void HTMLTextAreaElement::setDefaultValue( const DOMString &value )
00970 {
00971     if (impl) ((HTMLTextAreaElementImpl *)impl)->setDefaultValue(value);
00972 }
00973 
00974 HTMLFormElement HTMLTextAreaElement::form() const
00975 {
00976     return Element::form();
00977 }
00978 
00979 DOMString HTMLTextAreaElement::accessKey() const
00980 {
00981     if(!impl) return DOMString();
00982     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_ACCESSKEY);
00983 }
00984 
00985 void HTMLTextAreaElement::setAccessKey( const DOMString &value )
00986 {
00987     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ACCESSKEY, value);
00988 }
00989 
00990 long HTMLTextAreaElement::cols() const
00991 {
00992     if(!impl) return 0;
00993     return ((HTMLTextAreaElementImpl *)impl)->getAttribute(ATTR_COLS).toInt();
00994 }
00995 
00996 void HTMLTextAreaElement::setCols( long _cols )
00997 {
00998 
00999     if(impl) {
01000     DOMString value(QString::number(_cols));
01001         static_cast<ElementImpl*>(impl)->setAttribute(ATTR_COLS,value);
01002     }
01003 }
01004 
01005 bool HTMLTextAreaElement::disabled() const
01006 {
01007     if(!impl) return 0;
01008     return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_DISABLED).isNull();
01009 }
01010 
01011 void HTMLTextAreaElement::setDisabled( bool _disabled )
01012 {
01013     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
01014 }
01015 
01016 DOMString HTMLTextAreaElement::name() const
01017 {
01018     if(!impl) return DOMString();
01019     return static_cast<HTMLTextAreaElementImpl* const>(impl)->name();
01020 }
01021 
01022 void HTMLTextAreaElement::setName( const DOMString &value )
01023 {
01024     if(impl) static_cast<HTMLTextAreaElementImpl*>(impl)->setName(value);
01025 }
01026 
01027 bool HTMLTextAreaElement::readOnly() const
01028 {
01029     if(!impl) return 0;
01030     return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_READONLY).isNull();
01031 }
01032 
01033 void HTMLTextAreaElement::setReadOnly( bool _readOnly )
01034 {
01035     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_READONLY, _readOnly ? "" : 0);
01036 }
01037 
01038 long HTMLTextAreaElement::rows() const
01039 {
01040     if(!impl) return 0;
01041     return ((HTMLTextAreaElementImpl *)impl)->getAttribute(ATTR_ROWS).toInt();
01042 }
01043 
01044 void HTMLTextAreaElement::setRows( long _rows )
01045 {
01046 
01047     if(impl) {
01048     DOMString value(QString::number(_rows));
01049         static_cast<ElementImpl*>(impl)->setAttribute(ATTR_ROWS,value);
01050     }
01051 }
01052 
01053 long HTMLTextAreaElement::tabIndex() const
01054 {
01055     if(!impl) return 0;
01056     return static_cast<ElementImpl*>(impl)->tabIndex();
01057 }
01058 
01059 void HTMLTextAreaElement::setTabIndex( long _tabIndex )
01060 {
01061     if (!impl) return;
01062     static_cast<ElementImpl*>(impl)->setTabIndex(_tabIndex);
01063 }
01064 
01065 DOMString HTMLTextAreaElement::type() const
01066 {
01067     if(!impl) return DOMString();
01068     return ((HTMLTextAreaElementImpl *)impl)->type();
01069 }
01070 
01071 DOMString HTMLTextAreaElement::value() const
01072 {
01073     if(!impl) return DOMString();
01074     return ((HTMLTextAreaElementImpl *)impl)->value();
01075 }
01076 
01077 void HTMLTextAreaElement::setValue( const DOMString &value )
01078 {
01079     if(impl) ((HTMLTextAreaElementImpl *)impl)->setValue(value);
01080 }
01081 
01082 void HTMLTextAreaElement::blur(  )
01083 {
01084     if(impl)
01085     ((HTMLTextAreaElementImpl*)impl)->blur();
01086 }
01087 
01088 void HTMLTextAreaElement::focus(  )
01089 {
01090     if(impl)
01091     ((HTMLTextAreaElementImpl*)impl)->focus();
01092 }
01093 
01094 void HTMLTextAreaElement::select(  )
01095 {
01096     if(impl)
01097     ((HTMLTextAreaElementImpl *)impl)->select(  );
01098 }
01099 
01100 long HTMLTextAreaElement::selectionStart()
01101 {
01102     if (impl)
01103     return ((HTMLTextAreaElementImpl *)impl)->selectionStart(  );
01104     return 0;
01105 }
01106 
01107 long HTMLTextAreaElement::selectionEnd()
01108 {
01109     if (impl)
01110     return ((HTMLTextAreaElementImpl *)impl)->selectionEnd(  );
01111     return 0;
01112 }
01113 
01114 long HTMLTextAreaElement::textLength()
01115 {
01116     if (impl)
01117     return ((HTMLTextAreaElementImpl *)impl)->textLength(  );
01118     return 0;
01119 }
01120 
01121 void HTMLTextAreaElement::setSelectionStart(long pos)
01122 {
01123     if (impl)
01124     ((HTMLTextAreaElementImpl *)impl)->setSelectionStart( pos );
01125 }
01126 
01127 void HTMLTextAreaElement::setSelectionEnd(long pos)
01128 {
01129     if (impl)
01130     ((HTMLTextAreaElementImpl *)impl)->setSelectionEnd( pos );
01131 }
01132 
01133 void HTMLTextAreaElement::setSelectionRange(long start, long end)
01134 {
01135     if (impl)
01136     ((HTMLTextAreaElementImpl *)impl)->setSelectionRange( start, end );
01137 }
01138 
01139 // --------------------------------------------------------------------------
01140 
01141 HTMLOptionElement::HTMLOptionElement() : HTMLElement()
01142 {
01143 }
01144 
01145 HTMLOptionElement::HTMLOptionElement(const HTMLOptionElement &other) : HTMLElement(other)
01146 {
01147 }
01148 
01149 HTMLOptionElement::HTMLOptionElement(HTMLOptionElementImpl *impl) : HTMLElement(impl)
01150 {
01151 }
01152 
01153 HTMLOptionElement &HTMLOptionElement::operator = (const Node &other)
01154 {
01155     assignOther( other, ID_OPTION );
01156     return *this;
01157 }
01158 
01159 HTMLOptionElement &HTMLOptionElement::operator = (const HTMLOptionElement &other)
01160 {
01161     HTMLElement::operator = (other);
01162     return *this;
01163 }
01164 
01165 HTMLOptionElement::~HTMLOptionElement()
01166 {
01167 }
01168 
01169 HTMLFormElement HTMLOptionElement::form() const
01170 {
01171     return Element::form();
01172 }
01173 
01174 bool HTMLOptionElement::defaultSelected() const
01175 {
01176     if(!impl) return 0;
01177     return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_SELECTED).isNull();
01178 }
01179 
01180 void HTMLOptionElement::setDefaultSelected( bool _defaultSelected )
01181 {
01182     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_SELECTED, _defaultSelected ? "" : 0);
01183 }
01184 
01185 DOMString HTMLOptionElement::text() const
01186 {
01187     if(!impl) return DOMString();
01188     return ((HTMLOptionElementImpl *)impl)->text();
01189 }
01190 
01191 long HTMLOptionElement::index() const
01192 {
01193     if(!impl) return 0;
01194     return ((HTMLOptionElementImpl *)impl)->index();
01195 }
01196 
01197 void HTMLOptionElement::setIndex( long /*_index*/ )
01198 {
01199     throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR);
01200 }
01201 
01202 bool HTMLOptionElement::disabled() const
01203 {
01204     if(!impl) return 0;
01205     return !static_cast<ElementImpl*>(impl)->getAttribute(ATTR_DISABLED).isNull();
01206 }
01207 
01208 void HTMLOptionElement::setDisabled( bool _disabled )
01209 {
01210     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_DISABLED, _disabled ? "" : 0);
01211 }
01212 
01213 DOMString HTMLOptionElement::label() const
01214 {
01215     if(!impl) return DOMString();
01216     return static_cast<ElementImpl*>(impl)->getAttribute(ATTR_LABEL);
01217 }
01218 
01219 void HTMLOptionElement::setLabel( const DOMString &value )
01220 {
01221     if(impl) static_cast<ElementImpl*>(impl)->setAttribute(ATTR_LABEL, value);
01222 }
01223 
01224 bool HTMLOptionElement::selected() const
01225 {
01226     if(!impl) return 0;
01227     return ((HTMLOptionElementImpl *)impl)->selected();
01228 }
01229 
01230 void HTMLOptionElement::setSelected(bool _selected) {
01231     if(!impl) return;
01232     ((HTMLOptionElementImpl *)impl)->setSelected(_selected);
01233 }
01234 
01235 DOMString HTMLOptionElement::value() const
01236 {
01237     if(!impl) return DOMString();
01238     return static_cast<HTMLOptionElementImpl*>(impl)->value();
01239 }
01240 
01241 void HTMLOptionElement::setValue( const DOMString &value )
01242 {
01243     if(impl) static_cast<HTMLOptionElementImpl*>(impl)->setValue(value.implementation());
01244 }
01245 
01246 // -----------------------------------------------------------------------------
01247 
01248 HTMLIsIndexElement::HTMLIsIndexElement() : HTMLElement()
01249 {
01250 }
01251 
01252 HTMLIsIndexElement::HTMLIsIndexElement(const HTMLIsIndexElement &other) : HTMLElement(other)
01253 {
01254 }
01255 
01256 HTMLIsIndexElement::HTMLIsIndexElement(HTMLIsIndexElementImpl *impl) : HTMLElement(impl)
01257 {
01258 }
01259 
01260 HTMLIsIndexElement &HTMLIsIndexElement::operator = (const Node &other)
01261 {
01262     assignOther( other, ID_ISINDEX );
01263     return *this;
01264 }
01265 
01266 HTMLIsIndexElement &HTMLIsIndexElement::operator = (const HTMLIsIndexElement &other)
01267 {
01268     HTMLElement::operator = (other);
01269     return *this;
01270 }
01271 
01272 HTMLIsIndexElement::~HTMLIsIndexElement()
01273 {
01274 }
01275 
01276 HTMLFormElement HTMLIsIndexElement::form() const
01277 {
01278     return Element::form();
01279 }
01280 
01281 DOMString HTMLIsIndexElement::prompt() const
01282 {
01283     if(!impl) return DOMString();
01284     return static_cast<HTMLIsIndexElementImpl*>(impl)->prompt();
01285 }
01286 
01287 void HTMLIsIndexElement::setPrompt( const DOMString &value )
01288 {
01289     if(impl) static_cast<HTMLIsIndexElementImpl*>(impl)->setPrompt(value);
01290 }
KDE Home | KDE Accessibility Home | Description of Access Keys