#ifndef DateTimeSymbolicFieldElement_h
#define DateTimeSymbolicFieldElement_h
#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
#include "core/html/forms/TypeAhead.h"
#include "core/html/shadow/DateTimeFieldElement.h"
namespace WebCore {
class DateTimeSymbolicFieldElement : public DateTimeFieldElement, public TypeAheadDataSource {
WTF_MAKE_NONCOPYABLE(DateTimeSymbolicFieldElement);
protected:
DateTimeSymbolicFieldElement(Document&, FieldOwner&, const Vector<String>&, int minimum, int maximum);
size_t symbolsSize() const { return m_symbols.size(); }
virtual bool hasValue() const OVERRIDE FINAL;
void initialize(const AtomicString& pseudo, const String& axHelpText);
virtual void setEmptyValue(EventBehavior = DispatchNoEvent) OVERRIDE FINAL;
virtual void setValueAsInteger(int, EventBehavior = DispatchNoEvent) OVERRIDE FINAL;
virtual int valueAsInteger() const OVERRIDE FINAL;
private:
static const int invalidIndex = -1;
String visibleEmptyValue() const;
bool indexIsInRange(int index) const { return index >= m_minimumIndex && index <= m_maximumIndex; }
virtual void handleKeyboardEvent(KeyboardEvent*) OVERRIDE FINAL;
virtual float maximumWidth(const Font&) OVERRIDE;
virtual void stepDown() OVERRIDE FINAL;
virtual void stepUp() OVERRIDE FINAL;
virtual String value() const OVERRIDE FINAL;
virtual int valueForARIAValueNow() const OVERRIDE FINAL;
virtual String visibleValue() const OVERRIDE FINAL;
virtual int indexOfSelectedOption() const OVERRIDE;
virtual int optionCount() const OVERRIDE;
virtual String optionAtIndex(int index) const OVERRIDE;
const Vector<String> m_symbols;
const AtomicString m_visibleEmptyValue;
int m_selectedIndex;
TypeAhead m_typeAhead;
const int m_minimumIndex;
const int m_maximumIndex;
};
}
#endif
#endif