#ifndef BaseMultipleFieldsDateAndTimeInputType_h
#define BaseMultipleFieldsDateAndTimeInputType_h
#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
#include "core/html/forms/BaseDateAndTimeInputType.h"
#include "core/html/shadow/ClearButtonElement.h"
#include "core/html/shadow/DateTimeEditElement.h"
#include "core/html/shadow/PickerIndicatorElement.h"
#include "core/html/shadow/SpinButtonElement.h"
namespace WebCore {
struct DateTimeChooserParameters;
class BaseMultipleFieldsDateAndTimeInputType
: public BaseDateAndTimeInputType
, protected DateTimeEditElement::EditControlOwner
, protected PickerIndicatorElement::PickerIndicatorOwner
, protected SpinButtonElement::SpinButtonOwner
, protected ClearButtonElement::ClearButtonOwner {
public:
virtual bool isValidFormat(bool hasYear, bool hasMonth, bool hasWeek, bool hasDay, bool hasAMPM, bool hasHour, bool hasMinute, bool hasSecond) const = 0;
protected:
BaseMultipleFieldsDateAndTimeInputType(HTMLInputElement&);
virtual ~BaseMultipleFieldsDateAndTimeInputType();
virtual void setupLayoutParameters(DateTimeEditElement::LayoutParameters&, const DateComponents&) const = 0;
bool shouldHaveSecondField(const DateComponents&) const;
private:
virtual void didBlurFromControl() OVERRIDE FINAL;
virtual void didFocusOnControl() OVERRIDE FINAL;
virtual void editControlValueChanged() OVERRIDE FINAL;
virtual bool isEditControlOwnerDisabled() const OVERRIDE FINAL;
virtual bool isEditControlOwnerReadOnly() const OVERRIDE FINAL;
virtual AtomicString localeIdentifier() const OVERRIDE FINAL;
virtual void focusAndSelectSpinButtonOwner() OVERRIDE;
virtual bool shouldSpinButtonRespondToMouseEvents() OVERRIDE;
virtual bool shouldSpinButtonRespondToWheelEvents() OVERRIDE;
virtual void spinButtonStepDown() OVERRIDE;
virtual void spinButtonStepUp() OVERRIDE;
virtual bool isPickerIndicatorOwnerDisabledOrReadOnly() const OVERRIDE FINAL;
virtual void pickerIndicatorChooseValue(const String&) OVERRIDE FINAL;
virtual void pickerIndicatorChooseValue(double) OVERRIDE FINAL;
virtual bool setupDateTimeChooserParameters(DateTimeChooserParameters&) OVERRIDE FINAL;
virtual void focusAndSelectClearButtonOwner() OVERRIDE;
virtual bool shouldClearButtonRespondToMouseEvents() OVERRIDE;
virtual void clearValue() OVERRIDE;
virtual String badInputText() const OVERRIDE;
virtual void blur() OVERRIDE FINAL;
virtual PassRefPtr<RenderStyle> customStyleForRenderer(PassRefPtr<RenderStyle>) OVERRIDE;
virtual void createShadowSubtree() OVERRIDE FINAL;
virtual void destroyShadowSubtree() OVERRIDE FINAL;
virtual void disabledAttributeChanged() OVERRIDE FINAL;
virtual void forwardEvent(Event*) OVERRIDE FINAL;
virtual void handleFocusEvent(Element* oldFocusedElement, FocusType) OVERRIDE;
virtual void handleKeydownEvent(KeyboardEvent*) OVERRIDE FINAL;
virtual bool hasBadInput() const OVERRIDE;
virtual bool hasCustomFocusLogic() const OVERRIDE FINAL;
virtual void minOrMaxAttributeChanged() OVERRIDE FINAL;
virtual void readonlyAttributeChanged() OVERRIDE FINAL;
virtual void requiredAttributeChanged() OVERRIDE FINAL;
virtual void restoreFormControlState(const FormControlState&) OVERRIDE FINAL;
virtual FormControlState saveFormControlState() const OVERRIDE FINAL;
virtual void setValue(const String&, bool valueChanged, TextFieldEventBehavior) OVERRIDE FINAL;
virtual bool shouldUseInputMethod() const OVERRIDE FINAL;
virtual void stepAttributeChanged() OVERRIDE FINAL;
virtual void updateView() OVERRIDE FINAL;
virtual void valueAttributeChanged() OVERRIDE;
virtual void listAttributeTargetChanged() OVERRIDE FINAL;
virtual void updateClearButtonVisibility() OVERRIDE FINAL;
DateTimeEditElement* dateTimeEditElement() const;
SpinButtonElement* spinButtonElement() const;
ClearButtonElement* clearButtonElement() const;
PickerIndicatorElement* pickerIndicatorElement() const;
bool containsFocusedShadowElement() const;
void showPickerIndicator();
void hidePickerIndicator();
void updatePickerIndicatorVisibility();
bool m_isDestroyingShadowSubtree;
bool m_pickerIndicatorIsVisible;
bool m_pickerIndicatorIsAlwaysVisible;
};
}
#endif
#endif