001    /*
002     * Copyright (c) 2003 World Wide Web Consortium,
003     * (Massachusetts Institute of Technology, Institut National de
004     * Recherche en Informatique et en Automatique, Keio University). All
005     * Rights Reserved. This program is distributed under the W3C's Software
006     * Intellectual Property License. This program is distributed in the
007     * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
008     * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
009     * PURPOSE.
010     * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
011     */
012    
013    package org.w3c.dom.html2;
014    
015    /**
016     * Form control.Depending upon the environment in which the page is being
017     * viewed, the value property may be read-only for the file upload input
018     * type. For the "password" input type, the actual value returned may be
019     * masked to prevent unauthorized use. See the INPUT element definition in [<a href='http://www.w3.org/TR/1999/REC-html401-19991224'>HTML 4.01</a>].
020     * <p>See also the <a href='http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109'>Document Object Model (DOM) Level 2 HTML Specification</a>.
021     */
022    public interface HTMLInputElement extends HTMLElement {
023        /**
024         * When the <code>type</code> attribute of the element has the value
025         * "text", "file" or "password", this represents the HTML value
026         * attribute of the element. The value of this attribute does not change
027         * if the contents of the corresponding form control, in an interactive
028         * user agent, changes. See the value attribute definition in HTML 4.01.
029         */
030        public String getDefaultValue();
031        /**
032         * When the <code>type</code> attribute of the element has the value
033         * "text", "file" or "password", this represents the HTML value
034         * attribute of the element. The value of this attribute does not change
035         * if the contents of the corresponding form control, in an interactive
036         * user agent, changes. See the value attribute definition in HTML 4.01.
037         */
038        public void setDefaultValue(String defaultValue);
039    
040        /**
041         * When <code>type</code> has the value "radio" or "checkbox", this
042         * represents the HTML checked attribute of the element. The value of
043         * this attribute does not change if the state of the corresponding form
044         * control, in an interactive user agent, changes. See the checked
045         * attribute definition in HTML 4.01.
046         */
047        public boolean getDefaultChecked();
048        /**
049         * When <code>type</code> has the value "radio" or "checkbox", this
050         * represents the HTML checked attribute of the element. The value of
051         * this attribute does not change if the state of the corresponding form
052         * control, in an interactive user agent, changes. See the checked
053         * attribute definition in HTML 4.01.
054         */
055        public void setDefaultChecked(boolean defaultChecked);
056    
057        /**
058         * Returns the <code>FORM</code> element containing this control. Returns
059         * <code>null</code> if this control is not within the context of a
060         * form.
061         */
062        public HTMLFormElement getForm();
063    
064        /**
065         * A comma-separated list of content types that a server processing this
066         * form will handle correctly. See the accept attribute definition in
067         * HTML 4.01.
068         */
069        public String getAccept();
070        /**
071         * A comma-separated list of content types that a server processing this
072         * form will handle correctly. See the accept attribute definition in
073         * HTML 4.01.
074         */
075        public void setAccept(String accept);
076    
077        /**
078         * A single character access key to give access to the form control. See
079         * the accesskey attribute definition in HTML 4.01.
080         */
081        public String getAccessKey();
082        /**
083         * A single character access key to give access to the form control. See
084         * the accesskey attribute definition in HTML 4.01.
085         */
086        public void setAccessKey(String accessKey);
087    
088        /**
089         * Aligns this object (vertically or horizontally) with respect to its
090         * surrounding text. See the align attribute definition in HTML 4.01.
091         * This attribute is deprecated in HTML 4.01.
092         */
093        public String getAlign();
094        /**
095         * Aligns this object (vertically or horizontally) with respect to its
096         * surrounding text. See the align attribute definition in HTML 4.01.
097         * This attribute is deprecated in HTML 4.01.
098         */
099        public void setAlign(String align);
100    
101        /**
102         * Alternate text for user agents not rendering the normal content of this
103         * element. See the alt attribute definition in HTML 4.01.
104         */
105        public String getAlt();
106        /**
107         * Alternate text for user agents not rendering the normal content of this
108         * element. See the alt attribute definition in HTML 4.01.
109         */
110        public void setAlt(String alt);
111    
112        /**
113         * When the <code>type</code> attribute of the element has the value
114         * "radio" or "checkbox", this represents the current state of the form
115         * control, in an interactive user agent. Changes to this attribute
116         * change the state of the form control, but do not change the value of
117         * the HTML checked attribute of the INPUT element.During the handling
118         * of a click event on an input element with a type attribute that has
119         * the value "radio" or "checkbox", some implementations may change the
120         * value of this property before the event is being dispatched in the
121         * document. If the default action of the event is canceled, the value
122         * of the property may be changed back to its original value. This means
123         * that the value of this property during the handling of click events
124         * is implementation dependent.
125         */
126        public boolean getChecked();
127        /**
128         * When the <code>type</code> attribute of the element has the value
129         * "radio" or "checkbox", this represents the current state of the form
130         * control, in an interactive user agent. Changes to this attribute
131         * change the state of the form control, but do not change the value of
132         * the HTML checked attribute of the INPUT element.During the handling
133         * of a click event on an input element with a type attribute that has
134         * the value "radio" or "checkbox", some implementations may change the
135         * value of this property before the event is being dispatched in the
136         * document. If the default action of the event is canceled, the value
137         * of the property may be changed back to its original value. This means
138         * that the value of this property during the handling of click events
139         * is implementation dependent.
140         */
141        public void setChecked(boolean checked);
142    
143        /**
144         * The control is unavailable in this context. See the disabled attribute
145         * definition in HTML 4.01.
146         */
147        public boolean getDisabled();
148        /**
149         * The control is unavailable in this context. See the disabled attribute
150         * definition in HTML 4.01.
151         */
152        public void setDisabled(boolean disabled);
153    
154        /**
155         * Maximum number of characters for text fields, when <code>type</code>
156         * has the value "text" or "password". See the maxlength attribute
157         * definition in HTML 4.01.
158         */
159        public int getMaxLength();
160        /**
161         * Maximum number of characters for text fields, when <code>type</code>
162         * has the value "text" or "password". See the maxlength attribute
163         * definition in HTML 4.01.
164         */
165        public void setMaxLength(int maxLength);
166    
167        /**
168         * Form control or object name when submitted with a form. See the name
169         * attribute definition in HTML 4.01.
170         */
171        public String getName();
172        /**
173         * Form control or object name when submitted with a form. See the name
174         * attribute definition in HTML 4.01.
175         */
176        public void setName(String name);
177    
178        /**
179         * This control is read-only. Relevant only when <code>type</code> has the
180         * value "text" or "password". See the readonly attribute definition in
181         * HTML 4.01.
182         */
183        public boolean getReadOnly();
184        /**
185         * This control is read-only. Relevant only when <code>type</code> has the
186         * value "text" or "password". See the readonly attribute definition in
187         * HTML 4.01.
188         */
189        public void setReadOnly(boolean readOnly);
190    
191        /**
192         * Size information. The precise meaning is specific to each type of
193         * field. See the size attribute definition in HTML 4.01.
194         * @version DOM Level 2
195         */
196        public int getSize();
197        /**
198         * Size information. The precise meaning is specific to each type of
199         * field. See the size attribute definition in HTML 4.01.
200         * @version DOM Level 2
201         */
202        public void setSize(int size);
203    
204        /**
205         * When the <code>type</code> attribute has the value "image", this
206         * attribute specifies the location of the image to be used to decorate
207         * the graphical submit button. See the src attribute definition in HTML
208         * 4.01.
209         */
210        public String getSrc();
211        /**
212         * When the <code>type</code> attribute has the value "image", this
213         * attribute specifies the location of the image to be used to decorate
214         * the graphical submit button. See the src attribute definition in HTML
215         * 4.01.
216         */
217        public void setSrc(String src);
218    
219        /**
220         * Index that represents the element's position in the tabbing order. See
221         * the tabindex attribute definition in HTML 4.01.
222         */
223        public int getTabIndex();
224        /**
225         * Index that represents the element's position in the tabbing order. See
226         * the tabindex attribute definition in HTML 4.01.
227         */
228        public void setTabIndex(int tabIndex);
229    
230        /**
231         * The type of control created (all lower case). See the type attribute
232         * definition in HTML 4.01.
233         * @version DOM Level 2
234         */
235        public String getType();
236        /**
237         * The type of control created (all lower case). See the type attribute
238         * definition in HTML 4.01.
239         * @version DOM Level 2
240         */
241        public void setType(String type);
242    
243        /**
244         * Use client-side image map. See the usemap attribute definition in HTML
245         * 4.01.
246         */
247        public String getUseMap();
248        /**
249         * Use client-side image map. See the usemap attribute definition in HTML
250         * 4.01.
251         */
252        public void setUseMap(String useMap);
253    
254        /**
255         * When the <code>type</code> attribute of the element has the value
256         * "text", "file" or "password", this represents the current contents of
257         * the corresponding form control, in an interactive user agent.
258         * Changing this attribute changes the contents of the form control, but
259         * does not change the value of the HTML value attribute of the element.
260         * When the <code>type</code> attribute of the element has the value
261         * "button", "hidden", "submit", "reset", "image", "checkbox" or
262         * "radio", this represents the HTML value attribute of the element. See
263         * the value attribute definition in HTML 4.01.
264         */
265        public String getValue();
266        /**
267         * When the <code>type</code> attribute of the element has the value
268         * "text", "file" or "password", this represents the current contents of
269         * the corresponding form control, in an interactive user agent.
270         * Changing this attribute changes the contents of the form control, but
271         * does not change the value of the HTML value attribute of the element.
272         * When the <code>type</code> attribute of the element has the value
273         * "button", "hidden", "submit", "reset", "image", "checkbox" or
274         * "radio", this represents the HTML value attribute of the element. See
275         * the value attribute definition in HTML 4.01.
276         */
277        public void setValue(String value);
278    
279        /**
280         * Removes keyboard focus from this element.
281         */
282        public void blur();
283    
284        /**
285         * Gives keyboard focus to this element.
286         */
287        public void focus();
288    
289        /**
290         * Select the contents of the text area. For <code>INPUT</code> elements
291         * whose <code>type</code> attribute has one of the following values:
292         * "text", "file", or "password".
293         */
294        public void select();
295    
296        /**
297         * Simulate a mouse-click. For <code>INPUT</code> elements whose
298         * <code>type</code> attribute has one of the following values:
299         * "button", "checkbox", "radio", "reset", or "submit".
300         */
301        public void click();
302    
303    }