| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "platform/DateComponents.h" | 35 #include "platform/DateComponents.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 class ExceptionState; | 39 class ExceptionState; |
| 40 | 40 |
| 41 // A super class of date, datetime, datetime-local, month, time, and week types. | 41 // A super class of date, datetime, datetime-local, month, time, and week types. |
| 42 class BaseDateAndTimeInputType : public InputType { | 42 class BaseDateAndTimeInputType : public InputType { |
| 43 protected: | 43 protected: |
| 44 BaseDateAndTimeInputType(HTMLInputElement& element) : InputType(element) { } | 44 BaseDateAndTimeInputType(HTMLInputElement& element) : InputType(element) { } |
| 45 virtual Decimal parseToNumber(const String&, const Decimal&) const OVERRIDE; | 45 virtual Decimal parseToNumber(const String&, const Decimal&) const override; |
| 46 // Parses the specified string for this InputType, and returns true if it | 46 // Parses the specified string for this InputType, and returns true if it |
| 47 // is successfully parsed. An instance pointed by the DateComponents* | 47 // is successfully parsed. An instance pointed by the DateComponents* |
| 48 // parameter will have parsed values and be modified even if the parsing | 48 // parameter will have parsed values and be modified even if the parsing |
| 49 // fails. The DateComponents* parameter may be 0. | 49 // fails. The DateComponents* parameter may be 0. |
| 50 bool parseToDateComponents(const String&, DateComponents*) const; | 50 bool parseToDateComponents(const String&, DateComponents*) const; |
| 51 virtual String sanitizeValue(const String&) const OVERRIDE; | 51 virtual String sanitizeValue(const String&) const override; |
| 52 virtual String serialize(const Decimal&) const OVERRIDE; | 52 virtual String serialize(const Decimal&) const override; |
| 53 String serializeWithComponents(const DateComponents&) const; | 53 String serializeWithComponents(const DateComponents&) const; |
| 54 virtual bool setMillisecondToDateComponents(double, DateComponents*) const =
0; | 54 virtual bool setMillisecondToDateComponents(double, DateComponents*) const =
0; |
| 55 virtual String visibleValue() const OVERRIDE; | 55 virtual String visibleValue() const override; |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 virtual bool parseToDateComponentsInternal(const String&, DateComponents*) c
onst = 0; | 58 virtual bool parseToDateComponentsInternal(const String&, DateComponents*) c
onst = 0; |
| 59 virtual double valueAsDate() const OVERRIDE; | 59 virtual double valueAsDate() const override; |
| 60 virtual void setValueAsDate(double, ExceptionState&) const OVERRIDE; | 60 virtual void setValueAsDate(double, ExceptionState&) const override; |
| 61 virtual double valueAsDouble() const OVERRIDE; | 61 virtual double valueAsDouble() const override; |
| 62 virtual void setValueAsDouble(double, TextFieldEventBehavior, ExceptionState
&) const OVERRIDE; | 62 virtual void setValueAsDouble(double, TextFieldEventBehavior, ExceptionState
&) const override; |
| 63 virtual bool typeMismatchFor(const String&) const OVERRIDE; | 63 virtual bool typeMismatchFor(const String&) const override; |
| 64 virtual bool typeMismatch() const OVERRIDE; | 64 virtual bool typeMismatch() const override; |
| 65 virtual bool valueMissing(const String&) const OVERRIDE; | 65 virtual bool valueMissing(const String&) const override; |
| 66 virtual String rangeOverflowText(const Decimal& maximum) const OVERRIDE; | 66 virtual String rangeOverflowText(const Decimal& maximum) const override; |
| 67 virtual String rangeUnderflowText(const Decimal& minimum) const OVERRIDE; | 67 virtual String rangeUnderflowText(const Decimal& minimum) const override; |
| 68 virtual Decimal defaultValueForStepUp() const OVERRIDE; | 68 virtual Decimal defaultValueForStepUp() const override; |
| 69 virtual bool isSteppable() const OVERRIDE; | 69 virtual bool isSteppable() const override; |
| 70 virtual String serializeWithMilliseconds(double) const; | 70 virtual String serializeWithMilliseconds(double) const; |
| 71 virtual String localizeValue(const String&) const OVERRIDE; | 71 virtual String localizeValue(const String&) const override; |
| 72 virtual bool supportsReadOnly() const OVERRIDE; | 72 virtual bool supportsReadOnly() const override; |
| 73 virtual bool shouldRespectListAttribute() OVERRIDE; | 73 virtual bool shouldRespectListAttribute() override; |
| 74 virtual bool shouldShowFocusRingOnMouseFocus() const OVERRIDE; | 74 virtual bool shouldShowFocusRingOnMouseFocus() const override; |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 } // namespace blink | 77 } // namespace blink |
| 78 #endif // BaseDateAndTimeInputType_h | 78 #endif // BaseDateAndTimeInputType_h |
| OLD | NEW |