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 23 matching lines...) Expand all Loading... |
34 | 34 |
35 // DateTimeSymbolicFieldElement represents non-numeric field of data time | 35 // DateTimeSymbolicFieldElement represents non-numeric field of data time |
36 // format, such as: AM/PM, and month. | 36 // format, such as: AM/PM, and month. |
37 class DateTimeSymbolicFieldElement : public DateTimeFieldElement, public TypeAhe
adDataSource { | 37 class DateTimeSymbolicFieldElement : public DateTimeFieldElement, public TypeAhe
adDataSource { |
38 WTF_MAKE_NONCOPYABLE(DateTimeSymbolicFieldElement); | 38 WTF_MAKE_NONCOPYABLE(DateTimeSymbolicFieldElement); |
39 | 39 |
40 protected: | 40 protected: |
41 DateTimeSymbolicFieldElement(Document*, FieldOwner&, const Vector<String>&); | 41 DateTimeSymbolicFieldElement(Document*, FieldOwner&, const Vector<String>&); |
42 size_t symbolsSize() const { return m_symbols.size(); } | 42 size_t symbolsSize() const { return m_symbols.size(); } |
43 virtual bool hasValue() const OVERRIDE FINAL; | 43 virtual bool hasValue() const OVERRIDE FINAL; |
| 44 void initialize(const AtomicString& pseudo, const String& axHelpText); |
44 virtual void setEmptyValue(EventBehavior = DispatchNoEvent) OVERRIDE FINAL; | 45 virtual void setEmptyValue(EventBehavior = DispatchNoEvent) OVERRIDE FINAL; |
45 virtual void setValueAsInteger(int, EventBehavior = DispatchNoEvent) OVERRID
E FINAL; | 46 virtual void setValueAsInteger(int, EventBehavior = DispatchNoEvent) OVERRID
E FINAL; |
46 virtual int valueAsInteger() const OVERRIDE FINAL; | 47 virtual int valueAsInteger() const OVERRIDE FINAL; |
47 | 48 |
48 private: | 49 private: |
49 static const int invalidIndex = -1; | 50 static const int invalidIndex = -1; |
50 | 51 |
51 String visibleEmptyValue() const; | 52 String visibleEmptyValue() const; |
52 | 53 |
53 // DateTimeFieldElement functions. | 54 // DateTimeFieldElement functions. |
54 virtual void handleKeyboardEvent(KeyboardEvent*) OVERRIDE FINAL; | 55 virtual void handleKeyboardEvent(KeyboardEvent*) OVERRIDE FINAL; |
55 virtual int maximum() const OVERRIDE FINAL; | |
56 virtual float maximumWidth(const Font&) OVERRIDE; | 56 virtual float maximumWidth(const Font&) OVERRIDE; |
57 virtual int minimum() const OVERRIDE FINAL; | |
58 virtual void stepDown() OVERRIDE FINAL; | 57 virtual void stepDown() OVERRIDE FINAL; |
59 virtual void stepUp() OVERRIDE FINAL; | 58 virtual void stepUp() OVERRIDE FINAL; |
60 virtual String value() const OVERRIDE FINAL; | 59 virtual String value() const OVERRIDE FINAL; |
61 virtual String visibleValue() const OVERRIDE FINAL; | 60 virtual String visibleValue() const OVERRIDE FINAL; |
62 | 61 |
63 // TypeAheadDataSource functions. | 62 // TypeAheadDataSource functions. |
64 virtual int indexOfSelectedOption() const OVERRIDE; | 63 virtual int indexOfSelectedOption() const OVERRIDE; |
65 virtual int optionCount() const OVERRIDE; | 64 virtual int optionCount() const OVERRIDE; |
66 virtual String optionAtIndex(int index) const OVERRIDE; | 65 virtual String optionAtIndex(int index) const OVERRIDE; |
67 | 66 |
68 const Vector<String> m_symbols; | 67 const Vector<String> m_symbols; |
69 | 68 |
70 // We use AtomicString to share visible empty value among multiple | 69 // We use AtomicString to share visible empty value among multiple |
71 // DateTimeEditElements in the page. | 70 // DateTimeEditElements in the page. |
72 const AtomicString m_visibleEmptyValue; | 71 const AtomicString m_visibleEmptyValue; |
73 int m_selectedIndex; | 72 int m_selectedIndex; |
74 TypeAhead m_typeAhead; | 73 TypeAhead m_typeAhead; |
75 }; | 74 }; |
76 | 75 |
77 } // namespace WebCore | 76 } // namespace WebCore |
78 | 77 |
79 #endif | 78 #endif |
80 #endif | 79 #endif |
OLD | NEW |