| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 // This returns true for all of textfield-looking types such as text, | 63 // This returns true for all of textfield-looking types such as text, |
| 64 // password, search, email, url, and number. | 64 // password, search, email, url, and number. |
| 65 BLINK_EXPORT bool isTextField() const; | 65 BLINK_EXPORT bool isTextField() const; |
| 66 // This returns true only for type=text. | 66 // This returns true only for type=text. |
| 67 BLINK_EXPORT bool isText() const; | 67 BLINK_EXPORT bool isText() const; |
| 68 BLINK_EXPORT bool isPasswordField() const; | 68 BLINK_EXPORT bool isPasswordField() const; |
| 69 BLINK_EXPORT bool isImageButton() const; | 69 BLINK_EXPORT bool isImageButton() const; |
| 70 BLINK_EXPORT bool isRadioButton() const; | 70 BLINK_EXPORT bool isRadioButton() const; |
| 71 BLINK_EXPORT bool isCheckbox() const; | 71 BLINK_EXPORT bool isCheckbox() const; |
| 72 BLINK_EXPORT bool autoComplete() const; | |
| 73 BLINK_EXPORT int maxLength() const; | 72 BLINK_EXPORT int maxLength() const; |
| 74 BLINK_EXPORT bool isActivatedSubmit() const; | 73 BLINK_EXPORT bool isActivatedSubmit() const; |
| 75 BLINK_EXPORT void setActivatedSubmit(bool); | 74 BLINK_EXPORT void setActivatedSubmit(bool); |
| 76 BLINK_EXPORT int size() const; | 75 BLINK_EXPORT int size() const; |
| 77 BLINK_EXPORT void setValue(const WebString&, bool sendChangeEvent = fals
e); | |
| 78 BLINK_EXPORT void setChecked(bool, bool sendChangeEvent = false); | 76 BLINK_EXPORT void setChecked(bool, bool sendChangeEvent = false); |
| 79 BLINK_EXPORT WebString value() const; | |
| 80 // Sets the value inside the text field without being sanitized. | 77 // Sets the value inside the text field without being sanitized. |
| 81 // Can't be used if a renderer doesn't exist or on a non text field type
. | 78 // Can't be used if a renderer doesn't exist or on a non text field type
. |
| 82 // Caret will be moved to the end. | 79 // Caret will be moved to the end. |
| 83 BLINK_EXPORT void setEditingValue(const WebString&); | 80 BLINK_EXPORT void setEditingValue(const WebString&); |
| 84 BLINK_EXPORT void setSuggestedValue(const WebString&); | |
| 85 BLINK_EXPORT WebString suggestedValue() const; | |
| 86 BLINK_EXPORT void setSelectionRange(int, int); | |
| 87 BLINK_EXPORT bool isValidValue(const WebString&) const; | 81 BLINK_EXPORT bool isValidValue(const WebString&) const; |
| 88 BLINK_EXPORT bool isChecked() const; | 82 BLINK_EXPORT bool isChecked() const; |
| 89 BLINK_EXPORT bool isMultiple() const; | 83 BLINK_EXPORT bool isMultiple() const; |
| 90 | 84 |
| 91 BLINK_EXPORT WebElementCollection dataListOptions() const; | 85 BLINK_EXPORT WebElementCollection dataListOptions() const; |
| 92 | 86 |
| 93 // Return the localized value for this input type. | 87 // Return the localized value for this input type. |
| 94 BLINK_EXPORT WebString localizeValue(const WebString&) const; | 88 BLINK_EXPORT WebString localizeValue(const WebString&) const; |
| 95 | 89 |
| 96 BLINK_EXPORT bool isSpeechInputEnabled() const; | 90 BLINK_EXPORT bool isSpeechInputEnabled() const; |
| 97 BLINK_EXPORT SpeechInputState getSpeechInputState() const; | 91 BLINK_EXPORT SpeechInputState getSpeechInputState() const; |
| 98 BLINK_EXPORT void startSpeechInput(); | 92 BLINK_EXPORT void startSpeechInput(); |
| 99 BLINK_EXPORT void stopSpeechInput(); | 93 BLINK_EXPORT void stopSpeechInput(); |
| 100 | 94 |
| 101 // Exposes the default value of the maxLength attribute. | 95 // Exposes the default value of the maxLength attribute. |
| 102 BLINK_EXPORT static int defaultMaxLength(); | 96 BLINK_EXPORT static int defaultMaxLength(); |
| 103 | 97 |
| 104 // Returns the direction of the text in this element. | |
| 105 BLINK_EXPORT WebString directionForFormData() const; | |
| 106 | |
| 107 BLINK_EXPORT WebElement decorationElementFor(void*); | 98 BLINK_EXPORT WebElement decorationElementFor(void*); |
| 108 BLINK_EXPORT WebElement passwordGeneratorButtonElement() const; | 99 BLINK_EXPORT WebElement passwordGeneratorButtonElement() const; |
| 109 | 100 |
| 110 // If true, forces the text of the element to be visible. | 101 // If true, forces the text of the element to be visible. |
| 111 BLINK_EXPORT void setShouldRevealPassword(bool value); | 102 BLINK_EXPORT void setShouldRevealPassword(bool value); |
| 112 | 103 |
| 113 #if BLINK_IMPLEMENTATION | 104 #if BLINK_IMPLEMENTATION |
| 114 WebInputElement(const WTF::PassRefPtr<WebCore::HTMLInputElement>&); | 105 WebInputElement(const WTF::PassRefPtr<WebCore::HTMLInputElement>&); |
| 115 WebInputElement& operator=(const WTF::PassRefPtr<WebCore::HTMLInputEleme
nt>&); | 106 WebInputElement& operator=(const WTF::PassRefPtr<WebCore::HTMLInputEleme
nt>&); |
| 116 operator WTF::PassRefPtr<WebCore::HTMLInputElement>() const; | 107 operator WTF::PassRefPtr<WebCore::HTMLInputElement>() const; |
| 117 #endif | 108 #endif |
| 118 }; | 109 }; |
| 119 | 110 |
| 120 BLINK_EXPORT WebInputElement* toWebInputElement(WebElement*); | 111 BLINK_EXPORT WebInputElement* toWebInputElement(WebElement*); |
| 121 | 112 |
| 122 inline const WebInputElement* toWebInputElement(const WebElement* element) | 113 inline const WebInputElement* toWebInputElement(const WebElement* element) |
| 123 { | 114 { |
| 124 return toWebInputElement(const_cast<WebElement*>(element)); | 115 return toWebInputElement(const_cast<WebElement*>(element)); |
| 125 } | 116 } |
| 126 | 117 |
| 127 } // namespace blink | 118 } // namespace blink |
| 128 | 119 |
| 129 #endif | 120 #endif |
| OLD | NEW |