html_form.cpp Source File (khtml Library)

| # khtml Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# html_form.cpp

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

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:33:51 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001