This source file includes following definitions.
- create
- create
- createForPlainTextPaste
- createForFragmentPaste
- createForDrop
- m_shouldMatchStyle
- m_shouldMatchStyle
- m_shouldMatchStyle
- initTextEvent
- interfaceName
- trace
#include "config.h"
#include "core/events/TextEvent.h"
#include "core/dom/DocumentFragment.h"
namespace WebCore {
PassRefPtrWillBeRawPtr<TextEvent> TextEvent::create()
{
return adoptRefWillBeNoop(new TextEvent);
}
PassRefPtrWillBeRawPtr<TextEvent> TextEvent::create(PassRefPtrWillBeRawPtr<AbstractView> view, const String& data, TextEventInputType inputType)
{
return adoptRefWillBeNoop(new TextEvent(view, data, inputType));
}
PassRefPtrWillBeRawPtr<TextEvent> TextEvent::createForPlainTextPaste(PassRefPtrWillBeRawPtr<AbstractView> view, const String& data, bool shouldSmartReplace)
{
return adoptRefWillBeNoop(new TextEvent(view, data, nullptr, shouldSmartReplace, false));
}
PassRefPtrWillBeRawPtr<TextEvent> TextEvent::createForFragmentPaste(PassRefPtrWillBeRawPtr<AbstractView> view, PassRefPtr<DocumentFragment> data, bool shouldSmartReplace, bool shouldMatchStyle)
{
return adoptRefWillBeNoop(new TextEvent(view, "", data, shouldSmartReplace, shouldMatchStyle));
}
PassRefPtrWillBeRawPtr<TextEvent> TextEvent::createForDrop(PassRefPtrWillBeRawPtr<AbstractView> view, const String& data)
{
return adoptRefWillBeNoop(new TextEvent(view, data, TextEventInputDrop));
}
TextEvent::TextEvent()
: m_inputType(TextEventInputKeyboard)
, m_shouldSmartReplace(false)
, m_shouldMatchStyle(false)
{
ScriptWrappable::init(this);
}
TextEvent::TextEvent(PassRefPtrWillBeRawPtr<AbstractView> view, const String& data, TextEventInputType inputType)
: UIEvent(EventTypeNames::textInput, true, true, view, 0)
, m_inputType(inputType)
, m_data(data)
, m_pastingFragment(nullptr)
, m_shouldSmartReplace(false)
, m_shouldMatchStyle(false)
{
ScriptWrappable::init(this);
}
TextEvent::TextEvent(PassRefPtrWillBeRawPtr<AbstractView> view, const String& data, PassRefPtr<DocumentFragment> pastingFragment,
bool shouldSmartReplace, bool shouldMatchStyle)
: UIEvent(EventTypeNames::textInput, true, true, view, 0)
, m_inputType(TextEventInputPaste)
, m_data(data)
, m_pastingFragment(pastingFragment)
, m_shouldSmartReplace(shouldSmartReplace)
, m_shouldMatchStyle(shouldMatchStyle)
{
ScriptWrappable::init(this);
}
TextEvent::~TextEvent()
{
}
void TextEvent::initTextEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView> view, const String& data)
{
if (dispatched())
return;
initUIEvent(type, canBubble, cancelable, view, 0);
m_data = data;
}
const AtomicString& TextEvent::interfaceName() const
{
return EventNames::TextEvent;
}
void TextEvent::trace(Visitor* visitor)
{
UIEvent::trace(visitor);
}
}