#ifndef InputTypeView_h
#define InputTypeView_h
#include "core/page/FocusType.h"
#include "wtf/FastAllocBase.h"
#include "wtf/Forward.h"
#include "wtf/Noncopyable.h"
#include "wtf/RefCounted.h"
#include "wtf/RefPtr.h"
namespace WebCore {
class BeforeTextInsertedEvent;
class Element;
class Event;
class HTMLFormElement;
class HTMLInputElement;
class KeyboardEvent;
class MouseEvent;
class RenderObject;
class RenderStyle;
class TouchEvent;
struct ClickHandlingState {
WTF_MAKE_FAST_ALLOCATED;
public:
bool checked;
bool indeterminate;
RefPtr<HTMLInputElement> checkedRadioButton;
};
class InputTypeView : public RefCounted<InputTypeView> {
WTF_MAKE_NONCOPYABLE(InputTypeView);
WTF_MAKE_FAST_ALLOCATED;
public:
static PassRefPtr<InputTypeView> create(HTMLInputElement&);
virtual ~InputTypeView();
virtual bool sizeShouldIncludeDecoration(int defaultSize, int& preferredSize) const;
virtual void handleClickEvent(MouseEvent*);
virtual void handleMouseDownEvent(MouseEvent*);
virtual PassOwnPtr<ClickHandlingState> willDispatchClick();
virtual void didDispatchClick(Event*, const ClickHandlingState&);
virtual void handleKeydownEvent(KeyboardEvent*);
virtual void handleKeypressEvent(KeyboardEvent*);
virtual void handleKeyupEvent(KeyboardEvent*);
virtual void handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*);
virtual void handleTouchEvent(TouchEvent*);
virtual void forwardEvent(Event*);
virtual bool shouldSubmitImplicitly(Event*);
virtual PassRefPtr<HTMLFormElement> formForSubmission() const;
virtual bool hasCustomFocusLogic() const;
virtual void handleFocusEvent(Element* oldFocusedElement, FocusType);
virtual void handleBlurEvent();
virtual void subtreeHasChanged();
virtual bool hasTouchEventHandler() const;
virtual void blur();
virtual RenderObject* createRenderer(RenderStyle*) const;
virtual PassRefPtr<RenderStyle> customStyleForRenderer(PassRefPtr<RenderStyle>);
virtual void startResourceLoading();
virtual void closePopupView();
virtual void createShadowSubtree();
virtual void destroyShadowSubtree();
virtual void minOrMaxAttributeChanged();
virtual void stepAttributeChanged();
virtual void altAttributeChanged();
virtual void srcAttributeChanged();
virtual void updateView();
virtual void attributeChanged();
virtual void multipleAttributeChanged();
virtual void disabledAttributeChanged();
virtual void readonlyAttributeChanged();
virtual void requiredAttributeChanged();
virtual void valueAttributeChanged();
virtual void listAttributeTargetChanged();
virtual void updateClearButtonVisibility();
virtual void updatePlaceholderText();
protected:
InputTypeView(HTMLInputElement& element) : m_element(element) { }
HTMLInputElement& element() const { return m_element; }
private:
HTMLInputElement& m_element;
};
}
#endif