Remove RenderTheme::supportsCalendarPicker
[WebKit-https.git] / Source / WebCore / html / BaseMultipleFieldsDateAndTimeInputType.h
index bd41fff..b0e3a17 100644 (file)
 #ifndef BaseMultipleFieldsDateAndTimeInputType_h
 #define BaseMultipleFieldsDateAndTimeInputType_h
 
+#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
 #include "BaseDateAndTimeInputType.h"
 
-#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
+#include "ClearButtonElement.h"
 #include "DateTimeEditElement.h"
 #include "PickerIndicatorElement.h"
 #include "SpinButtonElement.h"
@@ -42,12 +43,19 @@ namespace WebCore {
 
 struct DateTimeChooserParameters;
 
-class BaseMultipleFieldsDateAndTimeInputType : public BaseDateAndTimeInputType, protected DateTimeEditElement::EditControlOwner, protected PickerIndicatorElement::PickerIndicatorOwner {
+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();
 
-    int fullYear(const String&) const;
     virtual void setupLayoutParameters(DateTimeEditElement::LayoutParameters&, const DateComponents&) const = 0;
     bool shouldHaveSecondField(const DateComponents&) const;
 
@@ -72,30 +80,37 @@ private:
     virtual void pickerIndicatorChooseValue(const String&) OVERRIDE FINAL;
     virtual bool setupDateTimeChooserParameters(DateTimeChooserParameters&) OVERRIDE FINAL;
 
+    // ClearButtonElement::ClearButtonOwner functions.
+    virtual void focusAndSelectClearButtonOwner() OVERRIDE;
+    virtual bool shouldClearButtonRespondToMouseEvents() OVERRIDE;
+    virtual void clearValue() OVERRIDE;
+
     // InputType functions
     virtual String badInputText() const OVERRIDE;
     virtual void blur() OVERRIDE FINAL;
-    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) const 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 focus(bool restorePreviousSelection) OVERRIDE FINAL;
     virtual void forwardEvent(Event*) OVERRIDE FINAL;
+    virtual void handleFocusEvent(Node* oldFocusedNode, FocusDirection) OVERRIDE;
     virtual void handleKeydownEvent(KeyboardEvent*) OVERRIDE FINAL;
     virtual bool hasBadInput() const OVERRIDE;
     virtual bool hasCustomFocusLogic() const OVERRIDE FINAL;
     virtual bool isKeyboardFocusable(KeyboardEvent*) const OVERRIDE FINAL;
     virtual bool isMouseFocusable() const OVERRIDE FINAL;
-    virtual bool isTextField() 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 updateInnerTextValue() OVERRIDE FINAL;
+    virtual void valueAttributeChanged() OVERRIDE;
     virtual void listAttributeTargetChanged() OVERRIDE FINAL;
+    virtual void updateClearButtonVisibility() OVERRIDE FINAL;
 
     void showPickerIndicator();
     void hidePickerIndicator();
@@ -103,12 +118,12 @@ private:
 
     DateTimeEditElement* m_dateTimeEditElement;
     SpinButtonElement* m_spinButtonElement;
+    ClearButtonElement* m_clearButton;
     PickerIndicatorElement* m_pickerIndicatorElement;
     bool m_pickerIndicatorIsVisible;
-    bool m_pickerIndicatorIsAlwaysVisible;
 };
 
 } // namespace WebCore
 
 #endif
-#endif // TimeInputType_h
+#endif // BaseMultipleFieldsDateAndTimeInputType_h