Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Side by Side Diff: Source/WebCore/html/shadow/DateTimeFieldElement.h

Issue 11557024: Merge 136808 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1312/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 16 matching lines...) Expand all
27 #define DateTimeFieldElement_h 27 #define DateTimeFieldElement_h
28 28
29 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI) 29 #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
30 30
31 #include "HTMLDivElement.h" 31 #include "HTMLDivElement.h"
32 32
33 namespace WebCore { 33 namespace WebCore {
34 34
35 class DateComponents; 35 class DateComponents;
36 class DateTimeFieldsState; 36 class DateTimeFieldsState;
37 class Font;
37 38
38 // DateTimeFieldElement is base class of date time field element. 39 // DateTimeFieldElement is base class of date time field element.
39 class DateTimeFieldElement : public HTMLElement { 40 class DateTimeFieldElement : public HTMLElement {
40 WTF_MAKE_NONCOPYABLE(DateTimeFieldElement); 41 WTF_MAKE_NONCOPYABLE(DateTimeFieldElement);
41 42
42 public: 43 public:
43 enum EventBehavior { 44 enum EventBehavior {
44 DispatchNoEvent, 45 DispatchNoEvent,
45 DispatchEvent, 46 DispatchEvent,
46 }; 47 };
47 48
48 // FieldOwner implementer must call removeEventHandler when 49 // FieldOwner implementer must call removeEventHandler when
49 // it doesn't handle event, e.g. at destruction. 50 // it doesn't handle event, e.g. at destruction.
50 class FieldOwner { 51 class FieldOwner {
51 public: 52 public:
52 virtual ~FieldOwner(); 53 virtual ~FieldOwner();
53 virtual void didBlurFromField() = 0; 54 virtual void didBlurFromField() = 0;
54 virtual void didFocusOnField() = 0; 55 virtual void didFocusOnField() = 0;
55 virtual void fieldValueChanged() = 0; 56 virtual void fieldValueChanged() = 0;
56 virtual bool focusOnNextField(const DateTimeFieldElement&) = 0; 57 virtual bool focusOnNextField(const DateTimeFieldElement&) = 0;
57 virtual bool focusOnPreviousField(const DateTimeFieldElement&) = 0; 58 virtual bool focusOnPreviousField(const DateTimeFieldElement&) = 0;
58 virtual bool isFieldOwnerDisabledOrReadOnly() const = 0; 59 virtual bool isFieldOwnerDisabledOrReadOnly() const = 0;
59 virtual AtomicString localeIdentifier() const = 0; 60 virtual AtomicString localeIdentifier() const = 0;
60 }; 61 };
61 62
62 virtual void defaultEventHandler(Event*) OVERRIDE; 63 virtual void defaultEventHandler(Event*) OVERRIDE;
63 virtual bool hasValue() const = 0; 64 virtual bool hasValue() const = 0;
64 bool isReadOnly() const; 65 bool isReadOnly() const;
66 virtual float maximumWidth(const Font&);
65 virtual void populateDateTimeFieldsState(DateTimeFieldsState&) = 0; 67 virtual void populateDateTimeFieldsState(DateTimeFieldsState&) = 0;
66 void removeEventHandler() { m_fieldOwner = 0; } 68 void removeEventHandler() { m_fieldOwner = 0; }
67 void setReadOnly(); 69 void setReadOnly();
68 virtual void setEmptyValue(EventBehavior = DispatchNoEvent) = 0; 70 virtual void setEmptyValue(EventBehavior = DispatchNoEvent) = 0;
69 virtual void setValueAsDate(const DateComponents&) = 0; 71 virtual void setValueAsDate(const DateComponents&) = 0;
70 virtual void setValueAsDateTimeFieldsState(const DateTimeFieldsState&) = 0; 72 virtual void setValueAsDateTimeFieldsState(const DateTimeFieldsState&) = 0;
71 virtual void setValueAsInteger(int, EventBehavior = DispatchNoEvent) = 0; 73 virtual void setValueAsInteger(int, EventBehavior = DispatchNoEvent) = 0;
72 virtual void stepDown() = 0; 74 virtual void stepDown() = 0;
73 virtual void stepUp() = 0; 75 virtual void stepUp() = 0;
74 virtual String value() const = 0; 76 virtual String value() const = 0;
75 virtual int valueAsInteger() const = 0; 77 virtual int valueAsInteger() const = 0;
76 virtual String visibleValue() const = 0; 78 virtual String visibleValue() const = 0;
77 79
78 protected: 80 protected:
79 DateTimeFieldElement(Document*, FieldOwner&); 81 DateTimeFieldElement(Document*, FieldOwner&);
80 virtual void didBlur(); 82 virtual void didBlur();
81 virtual void didFocus(); 83 virtual void didFocus();
82 void focusOnNextField(); 84 void focusOnNextField();
83 virtual void handleKeyboardEvent(KeyboardEvent*) = 0; 85 virtual void handleKeyboardEvent(KeyboardEvent*) = 0;
84 void initialize(const AtomicString& shadowPseudoId, const String& axHelpText ); 86 void initialize(const AtomicString& shadowPseudoId, const String& axHelpText );
85 AtomicString localeIdentifier() const; 87 AtomicString localeIdentifier() const;
86 virtual int maximum() const = 0; 88 virtual int maximum() const = 0;
87 virtual int minimum() const = 0; 89 virtual int minimum() const = 0;
88 void updateVisibleValue(EventBehavior); 90 void updateVisibleValue(EventBehavior);
89 91
90 private: 92 private:
91 void defaultKeyboardEventHandler(KeyboardEvent*); 93 void defaultKeyboardEventHandler(KeyboardEvent*);
94 virtual bool isDateTimeFieldElement() const OVERRIDE;
92 virtual bool isFocusable() const OVERRIDE FINAL; 95 virtual bool isFocusable() const OVERRIDE FINAL;
93 bool isRTL() const; 96 bool isRTL() const;
94 virtual bool supportsFocus() const OVERRIDE FINAL; 97 virtual bool supportsFocus() const OVERRIDE FINAL;
95 98
96 FieldOwner* m_fieldOwner; 99 FieldOwner* m_fieldOwner;
97 }; 100 };
98 101
99 } // namespace WebCore 102 } // namespace WebCore
100 103
101 #endif 104 #endif
102 #endif 105 #endif
OLDNEW
« no previous file with comments | « Source/WebCore/html/shadow/DateTimeEditElement.cpp ('k') | Source/WebCore/html/shadow/DateTimeFieldElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698