#ifndef WebInputElement_h
#define WebInputElement_h
#include "WebFormControlElement.h"
#if WEBKIT_IMPLEMENTATION
namespace WebCore { class HTMLInputElement; }
#endif
namespace WebKit {
class WebNodeCollection;
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); }
WEBKIT_EXPORT bool isTextField() const;
WEBKIT_EXPORT bool isText() const;
WEBKIT_EXPORT bool isPasswordField() const;
WEBKIT_EXPORT bool isImageButton() const;
WEBKIT_EXPORT bool autoComplete() const;
WEBKIT_EXPORT int maxLength() const;
WEBKIT_EXPORT bool isActivatedSubmit() const;
WEBKIT_EXPORT void setActivatedSubmit(bool);
WEBKIT_EXPORT int size() const;
WEBKIT_EXPORT void setValue(const WebString&, bool sendChangeEvent = false);
WEBKIT_EXPORT WebString value() const;
WEBKIT_EXPORT void setSuggestedValue(const WebString&);
WEBKIT_EXPORT WebString suggestedValue() const;
WEBKIT_EXPORT void setPlaceholder(const WebString&);
WEBKIT_EXPORT WebString placeholder() const;
WEBKIT_EXPORT bool isAutofilled() const;
WEBKIT_EXPORT void setAutofilled(bool);
WEBKIT_EXPORT void setSelectionRange(int, int);
WEBKIT_EXPORT int selectionStart() const;
WEBKIT_EXPORT int selectionEnd() const;
WEBKIT_EXPORT bool isValidValue(const WebString&) const;
WEBKIT_EXPORT bool isChecked() const;
WEBKIT_EXPORT WebNodeCollection dataListOptions() const;
WEBKIT_EXPORT bool isSpeechInputEnabled() const;
WEBKIT_EXPORT SpeechInputState getSpeechInputState() const;
WEBKIT_EXPORT void startSpeechInput();
WEBKIT_EXPORT void stopSpeechInput();
WEBKIT_EXPORT static int defaultMaxLength();
#if WEBKIT_IMPLEMENTATION
WebInputElement(const WTF::PassRefPtr<WebCore::HTMLInputElement>&);
WebInputElement& operator=(const WTF::PassRefPtr<WebCore::HTMLInputElement>&);
operator WTF::PassRefPtr<WebCore::HTMLInputElement>() const;
#endif
};
WEBKIT_EXPORT WebInputElement* toWebInputElement(WebElement*);
inline const WebInputElement* toWebInputElement(const WebElement* element)
{
return toWebInputElement(const_cast<WebElement*>(element));
}
}
#endif