| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple 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 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 class TextEvent final : public UIEvent { | 37 class TextEvent final : public UIEvent { |
| 38 DEFINE_WRAPPERTYPEINFO(); | 38 DEFINE_WRAPPERTYPEINFO(); |
| 39 public: | 39 public: |
| 40 static PassRefPtrWillBeRawPtr<TextEvent> create(); | 40 static PassRefPtrWillBeRawPtr<TextEvent> create(); |
| 41 static PassRefPtrWillBeRawPtr<TextEvent> create(PassRefPtrWillBeRawPtr<Abstr
actView>, const String& data, TextEventInputType = TextEventInputKeyboard); | 41 static PassRefPtrWillBeRawPtr<TextEvent> create(PassRefPtrWillBeRawPtr<Abstr
actView>, const String& data, TextEventInputType = TextEventInputKeyboard); |
| 42 static PassRefPtrWillBeRawPtr<TextEvent> createForPlainTextPaste(PassRefPtrW
illBeRawPtr<AbstractView>, const String& data, bool shouldSmartReplace); | 42 static PassRefPtrWillBeRawPtr<TextEvent> createForPlainTextPaste(PassRefPtrW
illBeRawPtr<AbstractView>, const String& data, bool shouldSmartReplace); |
| 43 static PassRefPtrWillBeRawPtr<TextEvent> createForFragmentPaste(PassRefPtrWi
llBeRawPtr<AbstractView>, PassRefPtrWillBeRawPtr<DocumentFragment> data, bool sh
ouldSmartReplace, bool shouldMatchStyle); | 43 static PassRefPtrWillBeRawPtr<TextEvent> createForFragmentPaste(PassRefPtrWi
llBeRawPtr<AbstractView>, PassRefPtrWillBeRawPtr<DocumentFragment> data, bool sh
ouldSmartReplace, bool shouldMatchStyle); |
| 44 static PassRefPtrWillBeRawPtr<TextEvent> createForDrop(PassRefPtrWillBeRawPt
r<AbstractView>, const String& data); | 44 static PassRefPtrWillBeRawPtr<TextEvent> createForDrop(PassRefPtrWillBeRawPt
r<AbstractView>, const String& data); |
| 45 | 45 |
| 46 virtual ~TextEvent(); | 46 ~TextEvent() override; |
| 47 | 47 |
| 48 void initTextEvent(const AtomicString& type, bool canBubble, bool cancelable
, PassRefPtrWillBeRawPtr<AbstractView>, const String& data); | 48 void initTextEvent(const AtomicString& type, bool canBubble, bool cancelable
, PassRefPtrWillBeRawPtr<AbstractView>, const String& data); |
| 49 | 49 |
| 50 String data() const { return m_data; } | 50 String data() const { return m_data; } |
| 51 | 51 |
| 52 virtual const AtomicString& interfaceName() const override; | 52 const AtomicString& interfaceName() const override; |
| 53 | 53 |
| 54 bool isLineBreak() const { return m_inputType == TextEventInputLineBreak; } | 54 bool isLineBreak() const { return m_inputType == TextEventInputLineBreak; } |
| 55 bool isComposition() const { return m_inputType == TextEventInputComposition
; } | 55 bool isComposition() const { return m_inputType == TextEventInputComposition
; } |
| 56 bool isPaste() const { return m_inputType == TextEventInputPaste; } | 56 bool isPaste() const { return m_inputType == TextEventInputPaste; } |
| 57 bool isDrop() const { return m_inputType == TextEventInputDrop; } | 57 bool isDrop() const { return m_inputType == TextEventInputDrop; } |
| 58 | 58 |
| 59 bool shouldSmartReplace() const { return m_shouldSmartReplace; } | 59 bool shouldSmartReplace() const { return m_shouldSmartReplace; } |
| 60 bool shouldMatchStyle() const { return m_shouldMatchStyle; } | 60 bool shouldMatchStyle() const { return m_shouldMatchStyle; } |
| 61 DocumentFragment* pastingFragment() const { return m_pastingFragment.get();
} | 61 DocumentFragment* pastingFragment() const { return m_pastingFragment.get();
} |
| 62 | 62 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 79 inline bool isTextEvent(const Event& event) | 79 inline bool isTextEvent(const Event& event) |
| 80 { | 80 { |
| 81 return event.type() == EventTypeNames::textInput && event.hasInterface(Event
Names::TextEvent); | 81 return event.type() == EventTypeNames::textInput && event.hasInterface(Event
Names::TextEvent); |
| 82 } | 82 } |
| 83 | 83 |
| 84 DEFINE_TYPE_CASTS(TextEvent, Event, event, isTextEvent(*event), isTextEvent(even
t)); | 84 DEFINE_TYPE_CASTS(TextEvent, Event, event, isTextEvent(*event), isTextEvent(even
t)); |
| 85 | 85 |
| 86 } // namespace blink | 86 } // namespace blink |
| 87 | 87 |
| 88 #endif // TextEvent_h | 88 #endif // TextEvent_h |
| OLD | NEW |