OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 DateTimeNumericFieldElement(Document*, FieldOwner&, int minimum, int maximum
, const String& placeholder, const Parameters& = Parameters()); | 61 DateTimeNumericFieldElement(Document*, FieldOwner&, int minimum, int maximum
, const String& placeholder, const Parameters& = Parameters()); |
62 | 62 |
63 int clampValue(int value) const { return m_range.clampValue(value); } | 63 int clampValue(int value) const { return m_range.clampValue(value); } |
64 virtual int clampValueForHardLimits(int) const; | 64 virtual int clampValueForHardLimits(int) const; |
65 virtual int defaultValueForStepDown() const; | 65 virtual int defaultValueForStepDown() const; |
66 virtual int defaultValueForStepUp() const; | 66 virtual int defaultValueForStepUp() const; |
67 const Range& range() const { return m_range; } | 67 const Range& range() const { return m_range; } |
68 | 68 |
69 // DateTimeFieldElement functions. | 69 // DateTimeFieldElement functions. |
70 virtual bool hasValue() const OVERRIDE FINAL; | 70 virtual bool hasValue() const OVERRIDE FINAL; |
71 virtual int maximum() const OVERRIDE FINAL; | 71 void initialize(const AtomicString& pseudo, const String& axHelpText); |
| 72 int maximum() const; |
72 virtual void setEmptyValue(EventBehavior = DispatchNoEvent) OVERRIDE FINAL; | 73 virtual void setEmptyValue(EventBehavior = DispatchNoEvent) OVERRIDE FINAL; |
73 virtual void setValueAsInteger(int, EventBehavior = DispatchNoEvent) OVERRID
E; | 74 virtual void setValueAsInteger(int, EventBehavior = DispatchNoEvent) OVERRID
E; |
74 virtual int valueAsInteger() const OVERRIDE FINAL; | 75 virtual int valueAsInteger() const OVERRIDE FINAL; |
75 virtual String visibleValue() const OVERRIDE FINAL; | 76 virtual String visibleValue() const OVERRIDE FINAL; |
76 | 77 |
77 private: | 78 private: |
78 // DateTimeFieldElement functions. | 79 // DateTimeFieldElement functions. |
79 virtual void didBlur() OVERRIDE FINAL; | 80 virtual void didBlur() OVERRIDE FINAL; |
80 virtual void handleKeyboardEvent(KeyboardEvent*) OVERRIDE FINAL; | 81 virtual void handleKeyboardEvent(KeyboardEvent*) OVERRIDE FINAL; |
81 virtual float maximumWidth(const Font&) OVERRIDE; | 82 virtual float maximumWidth(const Font&) OVERRIDE; |
82 virtual int minimum() const OVERRIDE FINAL; | |
83 virtual void stepDown() OVERRIDE FINAL; | 83 virtual void stepDown() OVERRIDE FINAL; |
84 virtual void stepUp() OVERRIDE FINAL; | 84 virtual void stepUp() OVERRIDE FINAL; |
85 virtual String value() const OVERRIDE FINAL; | 85 virtual String value() const OVERRIDE FINAL; |
86 | 86 |
87 String formatValue(int) const; | 87 String formatValue(int) const; |
88 int roundUp(int) const; | 88 int roundUp(int) const; |
89 int roundDown(int) const; | 89 int roundDown(int) const; |
90 int typeAheadValue() const; | 90 int typeAheadValue() const; |
91 | 91 |
92 DOMTimeStamp m_lastDigitCharTime; | 92 DOMTimeStamp m_lastDigitCharTime; |
93 const String m_placeholder; | 93 const String m_placeholder; |
94 const Range m_range; | 94 const Range m_range; |
95 int m_value; | 95 int m_value; |
96 bool m_hasValue; | 96 bool m_hasValue; |
97 int m_step; | 97 int m_step; |
98 int m_stepBase; | 98 int m_stepBase; |
99 mutable StringBuilder m_typeAheadBuffer; | 99 mutable StringBuilder m_typeAheadBuffer; |
100 }; | 100 }; |
101 | 101 |
102 } // namespace WebCore | 102 } // namespace WebCore |
103 | 103 |
104 #endif | 104 #endif |
105 #endif | 105 #endif |
OLD | NEW |