1 /*
2  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3  *
4  * This code is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 2 only, as
6  * published by the Free Software Foundation.  Oracle designates this
7  * particular file as subject to the "Classpath" exception as provided
8  * by Oracle in the LICENSE file that accompanied this code.
9  *
10  * This code is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
13  * version 2 for more details (a copy is included in the LICENSE file that
14  * accompanied this code).
15  *
16  * You should have received a copy of the GNU General Public License version
17  * 2 along with this work; if not, write to the Free Software Foundation,
18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19  *
20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21  * or visit www.oracle.com if you need additional information or have any
22  * questions.
23  */
24 
25 /*
26  * This file is available under and governed by the GNU General Public
27  * License version 2 only, as published by the Free Software Foundation.
28  * However, the following notice accompanied the original version of this
29  * file and, per its terms, should not be removed:
30  *
31  * Copyright (c) 2000 World Wide Web Consortium,
32  * (Massachusetts Institute of Technology, Institut National de
33  * Recherche en Informatique et en Automatique, Keio University). All
34  * Rights Reserved. This program is distributed under the W3C's Software
35  * Intellectual Property License. This program is distributed in the
36  * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
37  * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
38  * PURPOSE. See W3C License http://www.w3.org/Consortium/Legal/ for more
39  * details.
40  */
41 
42 package org.w3c.dom.html;
43 
44 /**
45  *  Form control.  Note. Depending upon the environment in which the page is
46  * being viewed, the value property may be read-only for the file upload
47  * input type. For the "password" input type, the actual value returned may
48  * be masked to prevent unauthorized use. See the  INPUT element definition
49  * in HTML 4.0.
50  * <p>See also the <a href='http://www.w3.org/TR/2000/CR-DOM-Level-2-20000510'>Document Object Model (DOM) Level 2 Specification</a>.
51  *
52  * @since 1.4, DOM Level 2
53  */
54 public interface HTMLInputElement extends HTMLElement {
55     /**
56      *  When the <code>type</code> attribute of the element has the value
57      * "Text", "File" or "Password", this represents the HTML value attribute
58      * of the element. The value of this attribute does not change if the
59      * contents of the corresponding form control, in an interactive user
60      * agent, changes. Changing this attribute, however, resets the contents
61      * of the form control. See the  value attribute definition in HTML 4.0.
62      */
getDefaultValue()63     public String getDefaultValue();
setDefaultValue(String defaultValue)64     public void setDefaultValue(String defaultValue);
65 
66     /**
67      *  When <code>type</code> has the value "Radio" or "Checkbox", this
68      * represents the HTML checked attribute of the element. The value of
69      * this attribute does not change if the state of the corresponding form
70      * control, in an interactive user agent, changes. Changes to this
71      * attribute, however, resets the state of the form control. See the
72      * checked attribute definition in HTML 4.0.
73      */
getDefaultChecked()74     public boolean getDefaultChecked();
setDefaultChecked(boolean defaultChecked)75     public void setDefaultChecked(boolean defaultChecked);
76 
77     /**
78      *  Returns the <code>FORM</code> element containing this control. Returns
79      * <code>null</code> if this control is not within the context of a form.
80      */
getForm()81     public HTMLFormElement getForm();
82 
83     /**
84      *  A comma-separated list of content types that a server processing this
85      * form will handle correctly. See the  accept attribute definition in
86      * HTML 4.0.
87      */
getAccept()88     public String getAccept();
setAccept(String accept)89     public void setAccept(String accept);
90 
91     /**
92      *  A single character access key to give access to the form control. See
93      * the  accesskey attribute definition in HTML 4.0.
94      */
getAccessKey()95     public String getAccessKey();
setAccessKey(String accessKey)96     public void setAccessKey(String accessKey);
97 
98     /**
99      *  Aligns this object (vertically or horizontally)  with respect to its
100      * surrounding text. See the  align attribute definition in HTML 4.0.
101      * This attribute is deprecated in HTML 4.0.
102      */
getAlign()103     public String getAlign();
setAlign(String align)104     public void setAlign(String align);
105 
106     /**
107      *  Alternate text for user agents not rendering the normal content of
108      * this element. See the  alt attribute definition in HTML 4.0.
109      */
getAlt()110     public String getAlt();
setAlt(String alt)111     public void setAlt(String alt);
112 
113     /**
114      *  When the <code>type</code> attribute of the element has the value
115      * "Radio" or "Checkbox", this represents the current state of the form
116      * control, in an interactive user agent. Changes to this attribute
117      * change the state of the form control, but do not change the value of
118      * the HTML value attribute of the element.
119      */
getChecked()120     public boolean getChecked();
setChecked(boolean checked)121     public void setChecked(boolean checked);
122 
123     /**
124      *  The control is unavailable in this context. See the  disabled
125      * attribute definition in HTML 4.0.
126      */
getDisabled()127     public boolean getDisabled();
setDisabled(boolean disabled)128     public void setDisabled(boolean disabled);
129 
130     /**
131      *  Maximum number of characters for text fields, when <code>type</code>
132      * has the value "Text" or "Password". See the  maxlength attribute
133      * definition in HTML 4.0.
134      */
getMaxLength()135     public int getMaxLength();
setMaxLength(int maxLength)136     public void setMaxLength(int maxLength);
137 
138     /**
139      *  Form control or object name when submitted with a form. See the  name
140      * attribute definition in HTML 4.0.
141      */
getName()142     public String getName();
setName(String name)143     public void setName(String name);
144 
145     /**
146      *  This control is read-only. Relevant only when <code>type</code> has
147      * the value "Text" or "Password". See the  readonly attribute definition
148      * in HTML 4.0.
149      */
getReadOnly()150     public boolean getReadOnly();
setReadOnly(boolean readOnly)151     public void setReadOnly(boolean readOnly);
152 
153     /**
154      *  Size information. The precise meaning is specific to each type of
155      * field.  See the  size attribute definition in HTML 4.0.
156      */
getSize()157     public String getSize();
setSize(String size)158     public void setSize(String size);
159 
160     /**
161      *  When the <code>type</code> attribute has the value "Image", this
162      * attribute specifies the location of the image to be used to decorate
163      * the graphical submit button. See the  src attribute definition in HTML
164      * 4.0.
165      */
getSrc()166     public String getSrc();
setSrc(String src)167     public void setSrc(String src);
168 
169     /**
170      *  Index that represents the element's position in the tabbing order. See
171      * the  tabindex attribute definition in HTML 4.0.
172      */
getTabIndex()173     public int getTabIndex();
setTabIndex(int tabIndex)174     public void setTabIndex(int tabIndex);
175 
176     /**
177      *  The type of control created. See the  type attribute definition in
178      * HTML 4.0.
179      */
getType()180     public String getType();
181 
182     /**
183      *  Use client-side image map. See the  usemap attribute definition in
184      * HTML 4.0.
185      */
getUseMap()186     public String getUseMap();
setUseMap(String useMap)187     public void setUseMap(String useMap);
188 
189     /**
190      *  When the <code>type</code> attribute of the element has the value
191      * "Text", "File" or "Password", this represents the current contents of
192      * the corresponding form control, in an interactive user agent. Changing
193      * this attribute changes the contents of the form control, but does not
194      * change the value of the HTML value attribute of the element. When the
195      * <code>type</code> attribute of the element has the value "Button",
196      * "Hidden", "Submit", "Reset", "Image", "Checkbox" or "Radio", this
197      * represents the HTML value attribute of the element. See the  value
198      * attribute definition in HTML 4.0.
199      */
getValue()200     public String getValue();
setValue(String value)201     public void setValue(String value);
202 
203     /**
204      *  Removes keyboard focus from this element.
205      */
blur()206     public void blur();
207 
208     /**
209      *  Gives keyboard focus to this element.
210      */
focus()211     public void focus();
212 
213     /**
214      *  Select the contents of the text area. For <code>INPUT</code> elements
215      * whose <code>type</code> attribute has one of the following values:
216      * "Text", "File", or "Password".
217      */
select()218     public void select();
219 
220     /**
221      *  Simulate a mouse-click. For <code>INPUT</code> elements whose
222      * <code>type</code> attribute has one of the following values: "Button",
223      * "Checkbox", "Radio", "Reset", or "Submit".
224      */
click()225     public void click();
226 
227 }
228