#ifndef WebInputElement_h
#define WebInputElement_h
#include "WebFormControlElement.h"
#if BLINK_IMPLEMENTATION
namespace WebCore { class HTMLInputElement; }
#endif
namespace blink {
class WebElementCollection;
class WebInputElement : public WebFormControlElement {
public:
enum SpeechInputState {
Idle,
Recording,
Recognizing,
};
WebInputElement() : WebFormControlElement() { }
WebInputElement(const WebInputElement& element) : WebFormControlElement(element) { }
WebInputElement& operator=(const WebInputElement& element)
{
WebFormControlElement::assign(element);
return *this;
}
void assign(const WebInputElement& element) { WebFormControlElement::assign(element); }
BLINK_EXPORT bool isTextField() const;
BLINK_EXPORT bool isText() const;
BLINK_EXPORT bool isPasswordField() const;
BLINK_EXPORT bool isImageButton() const;
BLINK_EXPORT bool isRadioButton() const;
BLINK_EXPORT bool isCheckbox() const;
BLINK_EXPORT int maxLength() const;
BLINK_EXPORT bool isActivatedSubmit() const;
BLINK_EXPORT void setActivatedSubmit(bool);
BLINK_EXPORT int size() const;
BLINK_EXPORT void setChecked(bool, bool sendEvents = false);
BLINK_EXPORT void setEditingValue(const WebString&);
BLINK_EXPORT bool isValidValue(const WebString&) const;
BLINK_EXPORT bool isChecked() const;
BLINK_EXPORT bool isMultiple() const;
BLINK_EXPORT WebElementCollection dataListOptions() const;
BLINK_EXPORT WebString localizeValue(const WebString&) const;
BLINK_EXPORT bool isSpeechInputEnabled() const;
BLINK_EXPORT SpeechInputState getSpeechInputState() const;
BLINK_EXPORT void startSpeechInput();
BLINK_EXPORT void stopSpeechInput();
BLINK_EXPORT static int defaultMaxLength();
BLINK_EXPORT WebElement decorationElementFor(void*);
BLINK_EXPORT WebElement passwordGeneratorButtonElement() const;
BLINK_EXPORT void setShouldRevealPassword(bool value);
#if BLINK_IMPLEMENTATION
WebInputElement(const WTF::PassRefPtr<WebCore::HTMLInputElement>&);
WebInputElement& operator=(const WTF::PassRefPtr<WebCore::HTMLInputElement>&);
operator WTF::PassRefPtr<WebCore::HTMLInputElement>() const;
#endif
};
BLINK_EXPORT WebInputElement* toWebInputElement(WebElement*);
inline const WebInputElement* toWebInputElement(const WebElement* element)
{
return toWebInputElement(const_cast<WebElement*>(element));
}
}
#endif