| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef InputEvent_h | 5 #ifndef InputEvent_h |
| 6 #define InputEvent_h | 6 #define InputEvent_h |
| 7 | 7 |
| 8 #include "core/dom/StaticRange.h" | 8 #include "core/dom/StaticRange.h" |
| 9 #include "core/events/InputEventInit.h" | 9 #include "core/events/InputEventInit.h" |
| 10 #include "core/events/UIEvent.h" | 10 #include "core/events/UIEvent.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 } | 26 } |
| 27 | 27 |
| 28 enum class InputType { | 28 enum class InputType { |
| 29 None, | 29 None, |
| 30 InsertText, | 30 InsertText, |
| 31 ReplaceContent, | 31 ReplaceContent, |
| 32 DeleteContent, | 32 DeleteContent, |
| 33 DeleteComposedCharacter, | 33 DeleteComposedCharacter, |
| 34 Undo, | 34 Undo, |
| 35 Redo, | 35 Redo, |
| 36 Bold, |
| 36 | 37 |
| 37 // Add new input types immediately above this line. | 38 // Add new input types immediately above this line. |
| 38 NumberOfInputTypes, | 39 NumberOfInputTypes, |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 enum EventCancelable : bool { | 42 enum EventCancelable : bool { |
| 42 NotCancelable = false, | 43 NotCancelable = false, |
| 43 IsCancelable = true, | 44 IsCancelable = true, |
| 44 }; | 45 }; |
| 45 | 46 |
| 46 enum EventIsComposing : bool { | 47 enum EventIsComposing : bool { |
| 47 NotComposing = false, | 48 NotComposing = false, |
| 48 IsComposing = true, | 49 IsComposing = true, |
| 49 }; | 50 }; |
| 50 | 51 |
| 51 static InputEvent* createBeforeInput(InputType, const String& data, EventCan
celable, EventIsComposing, const RangeVector*); | 52 static InputEvent* createBeforeInput(InputType, const String& data, EventCan
celable, EventIsComposing, const RangeVector*); |
| 53 static InputEvent* createInput(InputType, const String& data, EventIsComposi
ng, const RangeVector*); |
| 52 | 54 |
| 53 String inputType() const; | 55 String inputType() const; |
| 54 const String& data() const { return m_data; } | 56 const String& data() const { return m_data; } |
| 55 bool isComposing() const { return m_isComposing; } | 57 bool isComposing() const { return m_isComposing; } |
| 56 // Returns a copy of target ranges during event dispatch, and returns an emp
ty | 58 // Returns a copy of target ranges during event dispatch, and returns an emp
ty |
| 57 // vector after dispatch. | 59 // vector after dispatch. |
| 58 StaticRangeVector getRanges() const; | 60 StaticRangeVector getRanges() const; |
| 59 | 61 |
| 60 bool isInputEvent() const override; | 62 bool isInputEvent() const override; |
| 61 | 63 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 84 explicit InputEventDispatchMediator(InputEvent*); | 86 explicit InputEventDispatchMediator(InputEvent*); |
| 85 InputEvent& event() const; | 87 InputEvent& event() const; |
| 86 DispatchEventResult dispatchEvent(EventDispatcher&) const override; | 88 DispatchEventResult dispatchEvent(EventDispatcher&) const override; |
| 87 }; | 89 }; |
| 88 | 90 |
| 89 DEFINE_EVENT_TYPE_CASTS(InputEvent); | 91 DEFINE_EVENT_TYPE_CASTS(InputEvent); |
| 90 | 92 |
| 91 } // namespace blink | 93 } // namespace blink |
| 92 | 94 |
| 93 #endif // InputEvent_h | 95 #endif // InputEvent_h |
| OLD | NEW |