| 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/clipboard/DataTransfer.h" | 8 #include "core/clipboard/DataTransfer.h" |
| 9 #include "core/dom/StaticRange.h" | 9 #include "core/dom/StaticRange.h" |
| 10 #include "core/events/InputEventInit.h" | 10 #include "core/events/InputEventInit.h" |
| 11 #include "core/events/UIEvent.h" | 11 #include "core/events/UIEvent.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 class InputEvent final : public UIEvent { | 15 class InputEvent final : public UIEvent { |
| 16 DEFINE_WRAPPERTYPEINFO(); | 16 DEFINE_WRAPPERTYPEINFO(); |
| 17 | 17 |
| 18 public: | 18 public: |
| 19 static InputEvent* create(const AtomicString& type, | 19 static InputEvent* create(const AtomicString& type, |
| 20 const InputEventInit& initializer) { | 20 const InputEventInit& initializer) { |
| 21 return new InputEvent(type, initializer); | 21 return new InputEvent(type, initializer); |
| 22 } | 22 } |
| 23 | 23 |
| 24 // https://w3c.github.io/input-events/#h-interface-inputevent-attributes |
| 24 enum class InputType { | 25 enum class InputType { |
| 25 None, | 26 None, |
| 26 // Insertion. | 27 // Insertion. |
| 27 InsertText, | 28 InsertText, |
| 28 InsertNonText, | |
| 29 InsertLineBreak, | 29 InsertLineBreak, |
| 30 InsertParagraph, | 30 InsertParagraph, |
| 31 InsertOrderedList, | 31 InsertOrderedList, |
| 32 InsertUnorderedList, | 32 InsertUnorderedList, |
| 33 InsertHorizontalRule, | 33 InsertHorizontalRule, |
| 34 InsertFromPaste, | 34 InsertFromPaste, |
| 35 InsertFromDrop, | 35 InsertFromDrop, |
| 36 // Deletion. | 36 // Deletion. |
| 37 DeleteComposedCharacterForward, | 37 DeleteComposedCharacterForward, |
| 38 DeleteComposedCharacterBackward, | 38 DeleteComposedCharacterBackward, |
| 39 DeleteWordBackward, | 39 DeleteWordBackward, |
| 40 DeleteWordForward, | 40 DeleteWordForward, |
| 41 DeleteLineBackward, | 41 DeleteLineBackward, |
| 42 DeleteLineForward, | 42 DeleteLineForward, |
| 43 DeleteContentBackward, | 43 DeleteContentBackward, |
| 44 DeleteContentForward, | 44 DeleteContentForward, |
| 45 DeleteByCut, | 45 DeleteByCut, |
| 46 DeleteByDrag, | 46 DeleteByDrag, |
| 47 // Command. | 47 // History. |
| 48 Undo, | 48 HistoryUndo, |
| 49 Redo, | 49 HistoryRedo, |
| 50 // Styling. | |
| 51 Bold, | |
| 52 Italic, | |
| 53 Underline, | |
| 54 StrikeThrough, | |
| 55 Superscript, | |
| 56 Subscript, | |
| 57 // Formatting. | 50 // Formatting. |
| 58 JustifyCenter, | 51 FormatBold, |
| 59 JustifyRight, | 52 FormatItalic, |
| 60 JustifyLeft, | 53 FormatUnderline, |
| 61 Indent, | 54 FormatStrikeThrough, |
| 62 Outdent, | 55 FormatSuperscript, |
| 63 RemoveFormat, | 56 FormatSubscript, |
| 64 // Not on spec. | 57 FormatJustifyCenter, |
| 65 JustifyFull, | 58 FormatJustifyFull, |
| 66 SetColor, | 59 FormatJustifyRight, |
| 67 SetBackgroundColor, | 60 FormatJustifyLeft, |
| 68 SetFont, | 61 FormatIndent, |
| 69 ChangeAttributes, | 62 FormatOutdent, |
| 70 SetWritingDirection, | 63 FormatRemove, |
| 71 Unscript, | 64 FormatSetBlockTextDirection, |
| 72 CreateLink, | |
| 73 Unlink, | |
| 74 FormatBlock, | |
| 75 | 65 |
| 76 // Add new input types immediately above this line. | 66 // Add new input types immediately above this line. |
| 77 NumberOfInputTypes, | 67 NumberOfInputTypes, |
| 78 }; | 68 }; |
| 79 | 69 |
| 80 enum EventCancelable : bool { | 70 enum EventCancelable : bool { |
| 81 NotCancelable = false, | 71 NotCancelable = false, |
| 82 IsCancelable = true, | 72 IsCancelable = true, |
| 83 }; | 73 }; |
| 84 | 74 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 explicit InputEventDispatchMediator(InputEvent*); | 127 explicit InputEventDispatchMediator(InputEvent*); |
| 138 InputEvent& event() const; | 128 InputEvent& event() const; |
| 139 DispatchEventResult dispatchEvent(EventDispatcher&) const override; | 129 DispatchEventResult dispatchEvent(EventDispatcher&) const override; |
| 140 }; | 130 }; |
| 141 | 131 |
| 142 DEFINE_EVENT_TYPE_CASTS(InputEvent); | 132 DEFINE_EVENT_TYPE_CASTS(InputEvent); |
| 143 | 133 |
| 144 } // namespace blink | 134 } // namespace blink |
| 145 | 135 |
| 146 #endif // InputEvent_h | 136 #endif // InputEvent_h |
| OLD | NEW |