html_form.h
00001 /* 00002 * This file is part of the DOM implementation for KDE. 00003 * 00004 * (C) 1999 Lars Knoll (knoll@kde.org) 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Library General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Library General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Library General Public License 00017 * along with this library; see the file COPYING.LIB. If not, write to 00018 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00019 * Boston, MA 02111-1307, USA. 00020 * 00021 * This file includes excerpts from the Document Object Model (DOM) 00022 * Level 1 Specification (Recommendation) 00023 * http://www.w3.org/TR/REC-DOM-Level-1/ 00024 * Copyright © World Wide Web Consortium , (Massachusetts Institute of 00025 * Technology , Institut National de Recherche en Informatique et en 00026 * Automatique , Keio University ). All Rights Reserved. 00027 * 00028 * $Id: html_form.h,v 1.14.2.2 2003/05/18 12:34:37 mueller Exp $ 00029 */ 00030 #ifndef HTML_FORM_H 00031 #define HTML_FORM_H 00032 00033 // -------------------------------------------------------------------------- 00034 #include <dom/html_element.h> 00035 #include <dom/html_misc.h> 00036 00037 namespace DOM { 00038 00039 class HTMLButtonElementImpl; 00040 class HTMLFormElement; 00041 class DOMString; 00042 00049 class HTMLButtonElement : public HTMLElement 00050 { 00051 public: 00052 HTMLButtonElement(); 00053 HTMLButtonElement(const HTMLButtonElement &other); 00054 HTMLButtonElement(const Node &other) : HTMLElement() 00055 {(*this)=other;} 00056 protected: 00057 HTMLButtonElement(HTMLButtonElementImpl *impl); 00058 public: 00059 00060 HTMLButtonElement & operator = (const HTMLButtonElement &other); 00061 HTMLButtonElement & operator = (const Node &other); 00062 00063 ~HTMLButtonElement(); 00064 00071 HTMLFormElement form() const; 00072 00080 DOMString accessKey() const; 00081 00085 void setAccessKey( const DOMString & ); 00086 00093 bool disabled() const; 00094 00098 void setDisabled( bool ); 00099 00107 DOMString name() const; 00108 00112 void setName( const DOMString & ); 00113 00121 long tabIndex() const; 00122 00126 void setTabIndex( long ); 00127 00134 DOMString type() const; 00135 00142 DOMString value() const; 00143 00147 void setValue( const DOMString & ); 00148 }; 00149 00150 // -------------------------------------------------------------------------- 00151 00152 class HTMLFieldSetElementImpl; 00159 class HTMLFieldSetElement : public HTMLElement 00160 { 00161 public: 00162 HTMLFieldSetElement(); 00163 HTMLFieldSetElement(const HTMLFieldSetElement &other); 00164 HTMLFieldSetElement(const Node &other) : HTMLElement() 00165 {(*this)=other;} 00166 protected: 00167 HTMLFieldSetElement(HTMLFieldSetElementImpl *impl); 00168 public: 00169 00170 HTMLFieldSetElement & operator = (const HTMLFieldSetElement &other); 00171 HTMLFieldSetElement & operator = (const Node &other); 00172 00173 ~HTMLFieldSetElement(); 00174 00178 HTMLFormElement form() const; 00179 }; 00180 00181 // -------------------------------------------------------------------------- 00182 00183 class HTMLFormElementImpl; 00193 class HTMLFormElement : public HTMLElement 00194 { 00195 friend class HTMLButtonElement; 00196 friend class HTMLFieldSetElement; 00197 friend class HTMLInputElement; 00198 friend class HTMLLabelElement; 00199 friend class HTMLLegendElement; 00200 friend class HTMLSelectElement; 00201 friend class HTMLTextAreaElement; 00202 friend class HTMLOptionElement; 00203 friend class HTMLIsIndexElement; 00204 friend class HTMLObjectElement; 00205 00206 public: 00207 HTMLFormElement(); 00208 HTMLFormElement(const HTMLFormElement &other); 00209 HTMLFormElement(const Node &other) : HTMLElement() 00210 {(*this)=other;} 00211 protected: 00212 HTMLFormElement(HTMLFormElementImpl *impl); 00213 public: 00214 00215 HTMLFormElement & operator = (const HTMLFormElement &other); 00216 HTMLFormElement & operator = (const Node &other); 00217 00218 ~HTMLFormElement(); 00219 00224 HTMLCollection elements() const; 00225 00230 long length() const; 00231 00236 DOMString name() const; 00237 00241 void setName( const DOMString & ); 00242 00249 DOMString acceptCharset() const; 00250 00254 void setAcceptCharset( const DOMString & ); 00255 00262 DOMString action() const; 00263 00267 void setAction( const DOMString & ); 00268 00276 DOMString enctype() const; 00277 00281 void setEnctype( const DOMString & ); 00282 00289 DOMString method() const; 00290 00294 void setMethod( const DOMString & ); 00295 00302 DOMString target() const; 00303 00307 void setTarget( const DOMString & ); 00308 00314 void submit ( ); 00315 00321 void reset ( ); 00322 }; 00323 00324 // -------------------------------------------------------------------------- 00325 00326 class HTMLInputElementImpl; 00336 class HTMLInputElement : public HTMLElement 00337 { 00338 public: 00339 HTMLInputElement(); 00340 HTMLInputElement(const HTMLInputElement &other); 00341 HTMLInputElement(const Node &other) : HTMLElement() 00342 {(*this)=other;} 00343 protected: 00344 HTMLInputElement(HTMLInputElementImpl *impl); 00345 public: 00346 00347 HTMLInputElement & operator = (const HTMLInputElement &other); 00348 HTMLInputElement & operator = (const Node &other); 00349 00350 ~HTMLInputElement(); 00351 00357 DOMString defaultValue() const; 00358 00362 void setDefaultValue( const DOMString & ); 00363 00370 bool defaultChecked() const; 00371 00375 void setDefaultChecked( bool ); 00376 00380 HTMLFormElement form() const; 00381 00389 DOMString accept() const; 00390 00394 void setAccept( const DOMString & ); 00395 00403 DOMString accessKey() const; 00404 00408 void setAccessKey( const DOMString & ); 00409 00418 DOMString align() const; 00419 00423 void setAlign( const DOMString & ); 00424 00432 DOMString alt() const; 00433 00437 void setAlt( const DOMString & ); 00438 00448 bool checked() const; 00449 00453 void setChecked( bool ); 00454 00461 bool disabled() const; 00462 00466 void setDisabled( bool ); 00467 00475 long maxLength() const; 00476 00480 void setMaxLength( long ); 00481 00489 DOMString name() const; 00490 00494 void setName( const DOMString & ); 00495 00503 bool readOnly() const; 00504 00505 // ### remove in 4.0 00509 void setReadOnly( bool ); 00510 00514 DOMString size() const; 00515 00519 void setSize( const DOMString & ); 00520 00528 long getSize() const; 00529 00533 void setSize( long ); 00534 00543 DOMString src() const; 00544 00548 void setSrc( const DOMString & ); 00549 00557 long tabIndex() const; 00558 00562 void setTabIndex( long ); 00563 00570 DOMString type() const; 00571 00575 void setType(const DOMString&); 00576 00583 DOMString useMap() const; 00584 00588 void setUseMap( const DOMString & ); 00589 00597 DOMString value() const; 00598 00602 void setValue( const DOMString & ); 00603 00608 void blur ( ); 00609 00614 void focus ( ); 00615 00622 void select ( ); 00623 00629 void click ( ); 00630 }; 00631 00632 // -------------------------------------------------------------------------- 00633 00634 class HTMLLabelElementImpl; 00641 class HTMLLabelElement : public HTMLElement 00642 { 00643 public: 00644 HTMLLabelElement(); 00645 HTMLLabelElement(const HTMLLabelElement &other); 00646 HTMLLabelElement(const Node &other) : HTMLElement() 00647 {(*this)=other;} 00648 protected: 00649 HTMLLabelElement(HTMLLabelElementImpl *impl); 00650 public: 00651 00652 HTMLLabelElement & operator = (const HTMLLabelElement &other); 00653 HTMLLabelElement & operator = (const Node &other); 00654 00655 ~HTMLLabelElement(); 00656 00664 DOMString accessKey() const; 00665 00669 void setAccessKey( const DOMString & ); 00670 00678 DOMString htmlFor() const; 00679 00683 void setHtmlFor( const DOMString & ); 00684 }; 00685 00686 // -------------------------------------------------------------------------- 00687 00688 class HTMLLegendElementImpl; 00696 class HTMLLegendElement : public HTMLElement 00697 { 00698 public: 00699 HTMLLegendElement(); 00700 HTMLLegendElement(const HTMLLegendElement &other); 00701 HTMLLegendElement(const Node &other) : HTMLElement() 00702 {(*this)=other;} 00703 protected: 00704 HTMLLegendElement(HTMLLegendElementImpl *impl); 00705 public: 00706 00707 HTMLLegendElement & operator = (const HTMLLegendElement &other); 00708 HTMLLegendElement & operator = (const Node &other); 00709 00710 ~HTMLLegendElement(); 00711 00715 HTMLFormElement form() const; 00716 00724 DOMString accessKey() const; 00725 00729 void setAccessKey( const DOMString & ); 00730 00738 DOMString align() const; 00739 00743 void setAlign( const DOMString & ); 00744 }; 00745 00746 // -------------------------------------------------------------------------- 00747 00748 class HTMLOptGroupElementImpl; 00755 class HTMLOptGroupElement : public HTMLElement 00756 { 00757 public: 00758 HTMLOptGroupElement(); 00759 HTMLOptGroupElement(const HTMLOptGroupElement &other); 00760 HTMLOptGroupElement(const Node &other) : HTMLElement() 00761 {(*this)=other;} 00762 protected: 00763 HTMLOptGroupElement(HTMLOptGroupElementImpl *impl); 00764 public: 00765 00766 HTMLOptGroupElement & operator = (const HTMLOptGroupElement &other); 00767 HTMLOptGroupElement & operator = (const Node &other); 00768 00769 ~HTMLOptGroupElement(); 00770 00777 bool disabled() const; 00778 00782 void setDisabled( bool ); 00783 00790 DOMString label() const; 00791 00795 void setLabel( const DOMString & ); 00796 }; 00797 00798 // -------------------------------------------------------------------------- 00799 00800 class HTMLSelectElementImpl; 00809 class HTMLSelectElement : public HTMLElement 00810 { 00811 public: 00812 HTMLSelectElement(); 00813 HTMLSelectElement(const HTMLSelectElement &other); 00814 HTMLSelectElement(const Node &other) : HTMLElement() 00815 {(*this)=other;} 00816 protected: 00817 HTMLSelectElement(HTMLSelectElementImpl *impl); 00818 public: 00819 00820 HTMLSelectElement & operator = (const HTMLSelectElement &other); 00821 HTMLSelectElement & operator = (const Node &other); 00822 00823 ~HTMLSelectElement(); 00824 00829 DOMString type() const; 00830 00837 long selectedIndex() const; 00838 00842 void setSelectedIndex( long ); 00843 00848 DOMString value() const; 00849 00853 void setValue( const DOMString & ); 00854 00859 long length() const; 00860 00864 HTMLFormElement form() const; 00865 00871 HTMLCollection options() const; 00872 00879 bool disabled() const; 00880 00884 void setDisabled( bool ); 00885 00893 bool multiple() const; 00894 00898 void setMultiple( bool ); 00899 00907 DOMString name() const; 00908 00912 void setName( const DOMString & ); 00913 00920 long size() const; 00921 00925 void setSize( long ); 00926 00934 long tabIndex() const; 00935 00939 void setTabIndex( long ); 00940 00951 void add ( const HTMLElement &element, const HTMLElement &before ); 00952 00961 void remove ( long index ); 00962 00967 void blur ( ); 00968 00973 void focus ( ); 00974 }; 00975 00976 // -------------------------------------------------------------------------- 00977 00978 class HTMLTextAreaElementImpl; 00985 class HTMLTextAreaElement : public HTMLElement 00986 { 00987 public: 00988 HTMLTextAreaElement(); 00989 HTMLTextAreaElement(const HTMLTextAreaElement &other); 00990 HTMLTextAreaElement(const Node &other) : HTMLElement() 00991 {(*this)=other;} 00992 protected: 00993 HTMLTextAreaElement(HTMLTextAreaElementImpl *impl); 00994 public: 00995 00996 HTMLTextAreaElement & operator = (const HTMLTextAreaElement &other); 00997 HTMLTextAreaElement & operator = (const Node &other); 00998 00999 ~HTMLTextAreaElement(); 01000 01006 DOMString defaultValue() const; 01007 01011 void setDefaultValue( const DOMString & ); 01012 01016 HTMLFormElement form() const; 01017 01025 DOMString accessKey() const; 01026 01030 void setAccessKey( const DOMString & ); 01031 01038 long cols() const; 01039 01043 void setCols( long ); 01044 01051 bool disabled() const; 01052 01056 void setDisabled( bool ); 01057 01065 DOMString name() const; 01066 01070 void setName( const DOMString & ); 01071 01078 bool readOnly() const; 01079 01083 void setReadOnly( bool ); 01084 01091 long rows() const; 01092 01096 void setRows( long ); 01097 01105 long tabIndex() const; 01106 01110 void setTabIndex( long ); 01111 01116 DOMString type() const; 01117 01124 DOMString value() const; 01125 01129 void setValue( const DOMString & ); 01130 01134 void blur ( ); 01135 01139 void focus ( ); 01140 01144 void select ( ); 01145 }; 01146 01147 // -------------------------------------------------------------------------- 01148 01149 class HTMLOptionElementImpl; 01156 class HTMLOptionElement : public HTMLElement 01157 { 01158 public: 01159 HTMLOptionElement(); 01160 HTMLOptionElement(const HTMLOptionElement &other); 01161 HTMLOptionElement(const Node &other) : HTMLElement() 01162 {(*this)=other;} 01163 protected: 01164 HTMLOptionElement(HTMLOptionElementImpl *impl); 01165 public: 01166 01167 HTMLOptionElement & operator = (const HTMLOptionElement &other); 01168 HTMLOptionElement & operator = (const Node &other); 01169 01170 ~HTMLOptionElement(); 01171 01175 HTMLFormElement form() const; 01176 01182 bool defaultSelected() const; 01183 01187 void setDefaultSelected( bool ); 01188 01193 DOMString text() const; 01194 01200 long index() const; 01201 01208 void setIndex( long ); 01209 01216 bool disabled() const; 01217 01221 void setDisabled( bool ); 01222 01229 DOMString label() const; 01230 01234 void setLabel( const DOMString & ); 01235 01242 bool selected() const; 01243 01247 void setSelected( bool ); 01248 01255 DOMString value() const; 01256 01260 void setValue( const DOMString & ); 01261 }; 01262 01263 01264 // -------------------------------------------------------------------------- 01265 01266 class HTMLIsIndexElementImpl; 01267 class HTMLFormElement; 01268 01276 class HTMLIsIndexElement : public HTMLElement 01277 { 01278 public: 01279 HTMLIsIndexElement(); 01280 HTMLIsIndexElement(const HTMLIsIndexElement &other); 01281 HTMLIsIndexElement(const Node &other) : HTMLElement() 01282 {(*this)=other;} 01283 protected: 01284 HTMLIsIndexElement(HTMLIsIndexElementImpl *impl); 01285 public: 01286 01287 HTMLIsIndexElement & operator = (const HTMLIsIndexElement &other); 01288 HTMLIsIndexElement & operator = (const Node &other); 01289 01290 ~HTMLIsIndexElement(); 01291 01295 HTMLFormElement form() const; 01296 01304 DOMString prompt() const; 01305 01309 void setPrompt( const DOMString & ); 01310 }; 01311 01312 } //namespace 01313 01314 #endif