blob: 211371952f1825762e38f166d324e0ea3e5fd5ed [file] [log] [blame]
darinb9481ed2006-03-20 02:57:59 +00001/*
mjs@apple.com92047332014-03-15 04:08:27 +00002 * Copyright (C) 2006 Apple Inc. All rights reserved.
darinb9481ed2006-03-20 02:57:59 +00003 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
mjs@apple.com92047332014-03-15 04:08:27 +000013 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
darinb9481ed2006-03-20 02:57:59 +000014 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
mjs@apple.com92047332014-03-15 04:08:27 +000016 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
darinb9481ed2006-03-20 02:57:59 +000017 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
commit-queue@webkit.orgd862d772016-10-31 22:07:53 +000026#pragma once
darinb9481ed2006-03-20 02:57:59 +000027
weinig681a5172006-06-19 22:58:36 +000028#include "Event.h"
darinb9481ed2006-03-20 02:57:59 +000029
30namespace WebCore {
31
cdumez@apple.com84f686f2014-10-23 23:26:01 +000032class BeforeTextInsertedEvent final : public Event {
ysuzuki@apple.come4070702019-09-18 22:10:00 +000033 WTF_MAKE_ISO_ALLOCATED(BeforeTextInsertedEvent);
darinb9481ed2006-03-20 02:57:59 +000034public:
commit-queue@webkit.org7538c252010-10-09 02:00:07 +000035 virtual ~BeforeTextInsertedEvent();
36
akling@apple.comb6c8c7c2014-12-14 12:23:31 +000037 static Ref<BeforeTextInsertedEvent> create(const String& text)
darin@apple.com48ac3c42008-06-14 08:46:51 +000038 {
akling@apple.comb6c8c7c2014-12-14 12:23:31 +000039 return adoptRef(*new BeforeTextInsertedEvent(text));
darin@apple.com48ac3c42008-06-14 08:46:51 +000040 }
darinb9481ed2006-03-20 02:57:59 +000041
darin@apple.com11ff47c2016-03-04 16:47:55 +000042 EventInterface eventInterface() const override;
abarth@webkit.org090fa4b2011-10-21 00:00:37 +000043
darin8c6bf622006-04-09 05:08:56 +000044 const String& text() const { return m_text; }
45 void setText(const String& s) { m_text = s; }
darinb9481ed2006-03-20 02:57:59 +000046
47private:
gyuyoung.kim@samsung.com5da00cb2012-07-24 10:27:51 +000048 explicit BeforeTextInsertedEvent(const String&);
darin@apple.com11ff47c2016-03-04 16:47:55 +000049 bool isBeforeTextInsertedEvent() const override { return true; }
darin@apple.com48ac3c42008-06-14 08:46:51 +000050
darinb9481ed2006-03-20 02:57:59 +000051 String m_text;
52};
53
cdumez@apple.com434faff2014-10-01 22:29:14 +000054} // namespace WebCore
akling@apple.com3a14a922014-02-16 02:01:04 +000055
cdumez@apple.com434faff2014-10-01 22:29:14 +000056SPECIALIZE_TYPE_TRAITS_EVENT(BeforeTextInsertedEvent)