KHTML
html_form.h
Go to the documentation of this file.
00001 /* 00002 * This file is part of the DOM implementation for KDE. 00003 * 00004 * Copyright 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., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, 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 */ 00029 #ifndef HTML_FORM_H 00030 #define HTML_FORM_H 00031 00032 // -------------------------------------------------------------------------- 00033 #include <dom/html_element.h> 00034 #include <dom/html_misc.h> 00035 00036 #include <kdemacros.h> 00037 00038 namespace DOM { 00039 00040 class HTMLButtonElementImpl; 00041 class HTMLFormElement; 00042 class DOMString; 00043 00050 class KHTML_EXPORT HTMLButtonElement : public HTMLElement 00051 { 00052 public: 00053 HTMLButtonElement(); 00054 HTMLButtonElement(const HTMLButtonElement &other); 00055 HTMLButtonElement(const Node &other) : HTMLElement() 00056 {(*this)=other;} 00057 protected: 00058 HTMLButtonElement(HTMLButtonElementImpl *impl); 00059 public: 00060 00061 HTMLButtonElement & operator = (const HTMLButtonElement &other); 00062 HTMLButtonElement & operator = (const Node &other); 00063 00064 ~HTMLButtonElement(); 00065 00072 HTMLFormElement form() const; 00073 00081 DOMString accessKey() const; 00082 00086 void setAccessKey( const DOMString & ); 00087 00094 bool disabled() const; 00095 00099 void setDisabled( bool ); 00100 00108 DOMString name() const; 00109 00113 void setName( const DOMString & ); 00114 00122 long tabIndex() const; 00123 00127 void setTabIndex( long ); 00128 00135 DOMString type() const; 00136 00143 DOMString value() const; 00144 00148 void setValue( const DOMString & ); 00149 00154 void blur ( ); 00155 00160 void focus ( ); 00161 }; 00162 00163 // -------------------------------------------------------------------------- 00164 00165 class HTMLFieldSetElementImpl; 00172 class KHTML_EXPORT HTMLFieldSetElement : public HTMLElement 00173 { 00174 public: 00175 HTMLFieldSetElement(); 00176 HTMLFieldSetElement(const HTMLFieldSetElement &other); 00177 HTMLFieldSetElement(const Node &other) : HTMLElement() 00178 {(*this)=other;} 00179 protected: 00180 HTMLFieldSetElement(HTMLFieldSetElementImpl *impl); 00181 public: 00182 00183 HTMLFieldSetElement & operator = (const HTMLFieldSetElement &other); 00184 HTMLFieldSetElement & operator = (const Node &other); 00185 00186 ~HTMLFieldSetElement(); 00187 00191 HTMLFormElement form() const; 00192 }; 00193 00194 // -------------------------------------------------------------------------- 00195 00196 class HTMLFormElementImpl; 00206 class KHTML_EXPORT HTMLFormElement : public HTMLElement 00207 { 00208 friend class HTMLButtonElement; 00209 friend class HTMLFieldSetElement; 00210 friend class HTMLInputElement; 00211 friend class HTMLLabelElement; 00212 friend class HTMLLegendElement; 00213 friend class HTMLSelectElement; 00214 friend class HTMLTextAreaElement; 00215 friend class HTMLOptionElement; 00216 friend class HTMLIsIndexElement; 00217 friend class HTMLObjectElement; 00218 00219 public: 00220 HTMLFormElement(); 00221 HTMLFormElement(const HTMLFormElement &other); 00222 HTMLFormElement(const Node &other) : HTMLElement() 00223 {(*this)=other;} 00224 protected: 00225 HTMLFormElement(HTMLFormElementImpl *impl); 00226 public: 00227 00228 HTMLFormElement & operator = (const HTMLFormElement &other); 00229 HTMLFormElement & operator = (const Node &other); 00230 00231 ~HTMLFormElement(); 00232 00237 HTMLCollection elements() const; 00238 00243 long length() const; 00244 00249 DOMString name() const; 00250 00254 void setName( const DOMString & ); 00255 00262 DOMString acceptCharset() const; 00263 00267 void setAcceptCharset( const DOMString & ); 00268 00275 DOMString action() const; 00276 00280 void setAction( const DOMString & ); 00281 00289 DOMString enctype() const; 00290 00294 void setEnctype( const DOMString & ); 00295 00302 DOMString method() const; 00303 00307 void setMethod( const DOMString & ); 00308 00315 DOMString target() const; 00316 00320 void setTarget( const DOMString & ); 00321 00327 void submit ( ); 00328 00334 void reset ( ); 00335 }; 00336 00337 // -------------------------------------------------------------------------- 00338 00339 class HTMLInputElementImpl; 00349 class KHTML_EXPORT HTMLInputElement : public HTMLElement 00350 { 00351 public: 00352 HTMLInputElement(); 00353 HTMLInputElement(const HTMLInputElement &other); 00354 HTMLInputElement(const Node &other) : HTMLElement() 00355 {(*this)=other;} 00356 protected: 00357 HTMLInputElement(HTMLInputElementImpl *impl); 00358 public: 00359 00360 HTMLInputElement & operator = (const HTMLInputElement &other); 00361 HTMLInputElement & operator = (const Node &other); 00362 00363 ~HTMLInputElement(); 00364 00370 DOMString defaultValue() const; 00371 00375 void setDefaultValue( const DOMString & ); 00376 00383 bool defaultChecked() const; 00384 00388 void setDefaultChecked( bool ); 00389 00393 HTMLFormElement form() const; 00394 00402 DOMString accept() const; 00403 00407 void setAccept( const DOMString & ); 00408 00416 DOMString accessKey() const; 00417 00421 void setAccessKey( const DOMString & ); 00422 00431 DOMString align() const; 00432 00436 void setAlign( const DOMString & ); 00437 00445 DOMString alt() const; 00446 00450 void setAlt( const DOMString & ); 00451 00461 bool checked() const; 00462 00466 void setChecked( bool ); 00467 00471 bool indeterminate() const; 00472 00476 void setIndeterminate( bool ); 00477 00484 bool disabled() const; 00485 00489 void setDisabled( bool ); 00490 00498 long maxLength() const; 00499 00503 void setMaxLength( long ); 00504 00512 DOMString name() const; 00513 00517 void setName( const DOMString & ); 00518 00526 bool readOnly() const; 00527 00528 // ### remove in 4.0 00532 void setReadOnly( bool ); 00533 00537 #ifndef KDE_NO_DEPRECATED 00538 KDE_DEPRECATED DOMString size() const; 00539 #endif 00540 00544 #ifndef KDE_NO_DEPRECATED 00545 KDE_DEPRECATED void setSize( const DOMString & ); 00546 #endif 00547 00555 long getSize() const; 00556 00560 void setSize( long ); 00561 00570 DOMString src() const; 00571 00575 void setSrc( const DOMString & ); 00576 00584 long tabIndex() const; 00585 00589 void setTabIndex( long ); 00590 00597 DOMString type() const; 00598 00602 void setType(const DOMString&); 00603 00610 DOMString useMap() const; 00611 00615 void setUseMap( const DOMString & ); 00616 00624 DOMString value() const; 00625 00629 void setValue( const DOMString & ); 00630 00635 void blur ( ); 00636 00641 void focus ( ); 00642 00649 void select ( ); 00650 00656 void click ( ); 00657 00658 00666 long selectionStart(); 00667 00673 void setSelectionStart(long offset); 00674 00682 long selectionEnd(); 00683 00689 void setSelectionEnd(long offset); 00690 00696 void setSelectionRange(long start, long end); 00697 00698 }; 00699 00700 // -------------------------------------------------------------------------- 00701 00702 class HTMLLabelElementImpl; 00709 class KHTML_EXPORT HTMLLabelElement : public HTMLElement 00710 { 00711 public: 00712 HTMLLabelElement(); 00713 HTMLLabelElement(const HTMLLabelElement &other); 00714 HTMLLabelElement(const Node &other) : HTMLElement() 00715 {(*this)=other;} 00716 protected: 00717 HTMLLabelElement(HTMLLabelElementImpl *impl); 00718 public: 00719 00720 HTMLLabelElement & operator = (const HTMLLabelElement &other); 00721 HTMLLabelElement & operator = (const Node &other); 00722 00723 ~HTMLLabelElement(); 00724 00732 DOMString accessKey() const; 00733 00737 void setAccessKey( const DOMString & ); 00738 00746 DOMString htmlFor() const; 00747 00751 void setHtmlFor( const DOMString & ); 00752 }; 00753 00754 // -------------------------------------------------------------------------- 00755 00756 class HTMLLegendElementImpl; 00764 class KHTML_EXPORT HTMLLegendElement : public HTMLElement 00765 { 00766 public: 00767 HTMLLegendElement(); 00768 HTMLLegendElement(const HTMLLegendElement &other); 00769 HTMLLegendElement(const Node &other) : HTMLElement() 00770 {(*this)=other;} 00771 protected: 00772 HTMLLegendElement(HTMLLegendElementImpl *impl); 00773 public: 00774 00775 HTMLLegendElement & operator = (const HTMLLegendElement &other); 00776 HTMLLegendElement & operator = (const Node &other); 00777 00778 ~HTMLLegendElement(); 00779 00783 HTMLFormElement form() const; 00784 00792 DOMString accessKey() const; 00793 00797 void setAccessKey( const DOMString & ); 00798 00806 DOMString align() const; 00807 00811 void setAlign( const DOMString & ); 00812 }; 00813 00814 // -------------------------------------------------------------------------- 00815 00816 class HTMLOptGroupElementImpl; 00823 class KHTML_EXPORT HTMLOptGroupElement : public HTMLElement 00824 { 00825 public: 00826 HTMLOptGroupElement(); 00827 HTMLOptGroupElement(const HTMLOptGroupElement &other); 00828 HTMLOptGroupElement(const Node &other) : HTMLElement() 00829 {(*this)=other;} 00830 protected: 00831 HTMLOptGroupElement(HTMLOptGroupElementImpl *impl); 00832 public: 00833 00834 HTMLOptGroupElement & operator = (const HTMLOptGroupElement &other); 00835 HTMLOptGroupElement & operator = (const Node &other); 00836 00837 ~HTMLOptGroupElement(); 00838 00845 bool disabled() const; 00846 00850 void setDisabled( bool ); 00851 00858 DOMString label() const; 00859 00863 void setLabel( const DOMString & ); 00864 }; 00865 00866 // -------------------------------------------------------------------------- 00867 00868 class HTMLSelectElementImpl; 00877 class KHTML_EXPORT HTMLSelectElement : public HTMLElement 00878 { 00879 public: 00880 HTMLSelectElement(); 00881 HTMLSelectElement(const HTMLSelectElement &other); 00882 HTMLSelectElement(const Node &other) : HTMLElement() 00883 {(*this)=other;} 00884 protected: 00885 HTMLSelectElement(HTMLSelectElementImpl *impl); 00886 public: 00887 00888 HTMLSelectElement & operator = (const HTMLSelectElement &other); 00889 HTMLSelectElement & operator = (const Node &other); 00890 00891 ~HTMLSelectElement(); 00892 00897 DOMString type() const; 00898 00905 long selectedIndex() const; 00906 00910 void setSelectedIndex( long ); 00911 00916 DOMString value() const; 00917 00921 void setValue( const DOMString & ); 00922 00927 long length() const; 00928 00932 HTMLFormElement form() const; 00933 00939 HTMLCollection options() const; 00940 00947 bool disabled() const; 00948 00952 void setDisabled( bool ); 00953 00961 bool multiple() const; 00962 00966 void setMultiple( bool ); 00967 00975 DOMString name() const; 00976 00980 void setName( const DOMString & ); 00981 00988 long size() const; 00989 00993 void setSize( long ); 00994 01002 long tabIndex() const; 01003 01007 void setTabIndex( long ); 01008 01019 void add ( const HTMLElement &element, const HTMLElement &before ); 01020 01029 void remove ( long index ); 01030 01035 void blur ( ); 01036 01041 void focus ( ); 01042 }; 01043 01044 // -------------------------------------------------------------------------- 01045 01046 class HTMLTextAreaElementImpl; 01053 class KHTML_EXPORT HTMLTextAreaElement : public HTMLElement 01054 { 01055 public: 01056 HTMLTextAreaElement(); 01057 HTMLTextAreaElement(const HTMLTextAreaElement &other); 01058 HTMLTextAreaElement(const Node &other) : HTMLElement() 01059 {(*this)=other;} 01060 protected: 01061 HTMLTextAreaElement(HTMLTextAreaElementImpl *impl); 01062 public: 01063 01064 HTMLTextAreaElement & operator = (const HTMLTextAreaElement &other); 01065 HTMLTextAreaElement & operator = (const Node &other); 01066 01067 ~HTMLTextAreaElement(); 01068 01074 DOMString defaultValue() const; 01075 01079 void setDefaultValue( const DOMString & ); 01080 01084 HTMLFormElement form() const; 01085 01093 DOMString accessKey() const; 01094 01098 void setAccessKey( const DOMString & ); 01099 01106 long cols() const; 01107 01111 void setCols( long ); 01112 01119 bool disabled() const; 01120 01124 void setDisabled( bool ); 01125 01133 DOMString name() const; 01134 01138 void setName( const DOMString & ); 01139 01146 bool readOnly() const; 01147 01151 void setReadOnly( bool ); 01152 01159 long rows() const; 01160 01164 void setRows( long ); 01165 01173 long tabIndex() const; 01174 01178 void setTabIndex( long ); 01179 01184 DOMString type() const; 01185 01192 DOMString value() const; 01193 01197 void setValue( const DOMString & ); 01198 01202 void blur ( ); 01203 01207 void focus ( ); 01208 01212 void select ( ); 01213 01219 long selectionStart(); 01220 01225 void setSelectionStart(long offset); 01226 01232 long selectionEnd(); 01233 01238 void setSelectionEnd(long offset); 01239 01244 void setSelectionRange(long start, long end); 01245 01250 long textLength(); 01251 }; 01252 01253 // -------------------------------------------------------------------------- 01254 01255 class HTMLOptionElementImpl; 01262 class KHTML_EXPORT HTMLOptionElement : public HTMLElement 01263 { 01264 public: 01265 HTMLOptionElement(); 01266 HTMLOptionElement(const HTMLOptionElement &other); 01267 HTMLOptionElement(const Node &other) : HTMLElement() 01268 {(*this)=other;} 01269 protected: 01270 HTMLOptionElement(HTMLOptionElementImpl *impl); 01271 public: 01272 01273 HTMLOptionElement & operator = (const HTMLOptionElement &other); 01274 HTMLOptionElement & operator = (const Node &other); 01275 01276 ~HTMLOptionElement(); 01277 01281 HTMLFormElement form() const; 01282 01288 bool defaultSelected() const; 01289 01293 void setDefaultSelected( bool ); 01294 01299 DOMString text() const; 01300 01306 long index() const; 01307 01314 void setIndex( long ); 01315 01322 bool disabled() const; 01323 01327 void setDisabled( bool ); 01328 01335 DOMString label() const; 01336 01340 void setLabel( const DOMString & ); 01341 01348 bool selected() const; 01349 01353 void setSelected( bool ); 01354 01361 DOMString value() const; 01362 01366 void setValue( const DOMString & ); 01367 }; 01368 01369 01370 // -------------------------------------------------------------------------- 01371 01372 class HTMLIsIndexElementImpl; 01373 class HTMLFormElement; 01374 01382 class KHTML_EXPORT HTMLIsIndexElement : public HTMLElement 01383 { 01384 public: 01385 HTMLIsIndexElement(); 01386 HTMLIsIndexElement(const HTMLIsIndexElement &other); 01387 HTMLIsIndexElement(const Node &other) : HTMLElement() 01388 {(*this)=other;} 01389 protected: 01390 HTMLIsIndexElement(HTMLIsIndexElementImpl *impl); 01391 public: 01392 01393 HTMLIsIndexElement & operator = (const HTMLIsIndexElement &other); 01394 HTMLIsIndexElement & operator = (const Node &other); 01395 01396 ~HTMLIsIndexElement(); 01397 01401 HTMLFormElement form() const; 01402 01410 DOMString prompt() const; 01411 01415 void setPrompt( const DOMString & ); 01416 }; 01417 01418 } //namespace 01419 01420 #endif
KDE 4.6 API Reference