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 19 matching lines...) Expand all Loading... |
30 #include "core/events/TextEventInputType.h" | 30 #include "core/events/TextEventInputType.h" |
31 #include "core/events/UIEvent.h" | 31 #include "core/events/UIEvent.h" |
32 | 32 |
33 namespace WebCore { | 33 namespace WebCore { |
34 | 34 |
35 class DocumentFragment; | 35 class DocumentFragment; |
36 | 36 |
37 class TextEvent FINAL : public UIEvent { | 37 class TextEvent FINAL : public UIEvent { |
38 public: | 38 public: |
39 | 39 |
40 static PassRefPtr<TextEvent> create(); | 40 static PassRefPtrWillBeRawPtr<TextEvent> create(); |
41 static PassRefPtr<TextEvent> create(PassRefPtrWillBeRawPtr<AbstractView>
, const String& data, TextEventInputType = TextEventInputKeyboard); | 41 static PassRefPtrWillBeRawPtr<TextEvent> create(PassRefPtrWillBeRawPtr<A
bstractView>, const String& data, TextEventInputType = TextEventInputKeyboard); |
42 static PassRefPtr<TextEvent> createForPlainTextPaste(PassRefPtrWillBeRaw
Ptr<AbstractView>, const String& data, bool shouldSmartReplace); | 42 static PassRefPtrWillBeRawPtr<TextEvent> createForPlainTextPaste(PassRef
PtrWillBeRawPtr<AbstractView>, const String& data, bool shouldSmartReplace); |
43 static PassRefPtr<TextEvent> createForFragmentPaste(PassRefPtrWillBeRawP
tr<AbstractView>, PassRefPtr<DocumentFragment> data, bool shouldSmartReplace, bo
ol shouldMatchStyle); | 43 static PassRefPtrWillBeRawPtr<TextEvent> createForFragmentPaste(PassRefP
trWillBeRawPtr<AbstractView>, PassRefPtr<DocumentFragment> data, bool shouldSmar
tReplace, bool shouldMatchStyle); |
44 static PassRefPtr<TextEvent> createForDrop(PassRefPtrWillBeRawPtr<Abstra
ctView>, const String& data); | 44 static PassRefPtrWillBeRawPtr<TextEvent> createForDrop(PassRefPtrWillBeR
awPtr<AbstractView>, const String& data); |
45 | 45 |
46 virtual ~TextEvent(); | 46 virtual ~TextEvent(); |
47 | 47 |
48 void initTextEvent(const AtomicString& type, bool canBubble, bool cancel
able, PassRefPtrWillBeRawPtr<AbstractView>, const String& data); | 48 void initTextEvent(const AtomicString& type, bool canBubble, bool cancel
able, 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 virtual const AtomicString& interfaceName() const OVERRIDE; |
53 | 53 |
54 bool isLineBreak() const { return m_inputType == TextEventInputLineBreak
; } | 54 bool isLineBreak() const { return m_inputType == TextEventInputLineBreak
; } |
(...skipping 25 matching lines...) Expand all Loading... |
80 inline bool isTextEvent(const Event& event) | 80 inline bool isTextEvent(const Event& event) |
81 { | 81 { |
82 return event.type() == EventTypeNames::textInput && event.hasInterface(Event
Names::TextEvent); | 82 return event.type() == EventTypeNames::textInput && event.hasInterface(Event
Names::TextEvent); |
83 } | 83 } |
84 | 84 |
85 DEFINE_TYPE_CASTS(TextEvent, Event, event, isTextEvent(*event), isTextEvent(even
t)); | 85 DEFINE_TYPE_CASTS(TextEvent, Event, event, isTextEvent(*event), isTextEvent(even
t)); |
86 | 86 |
87 } // namespace WebCore | 87 } // namespace WebCore |
88 | 88 |
89 #endif // TextEvent_h | 89 #endif // TextEvent_h |
OLD | NEW |