darin | b9481ed | 2006-03-20 02:57:59 +0000 | [diff] [blame] | 1 | /* |
mjs@apple.com | 9204733 | 2014-03-15 04:08:27 +0000 | [diff] [blame] | 2 | * Copyright (C) 2006 Apple Inc. All rights reserved. |
darin | b9481ed | 2006-03-20 02:57:59 +0000 | [diff] [blame] | 3 | * |
| 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.com | 9204733 | 2014-03-15 04:08:27 +0000 | [diff] [blame] | 13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY |
darin | b9481ed | 2006-03-20 02:57:59 +0000 | [diff] [blame] | 14 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
mjs@apple.com | 9204733 | 2014-03-15 04:08:27 +0000 | [diff] [blame] | 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR |
darin | b9481ed | 2006-03-20 02:57:59 +0000 | [diff] [blame] | 17 | * 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.org | d862d77 | 2016-10-31 22:07:53 +0000 | [diff] [blame] | 26 | #pragma once |
darin | b9481ed | 2006-03-20 02:57:59 +0000 | [diff] [blame] | 27 | |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 28 | #include "Event.h" |
darin | b9481ed | 2006-03-20 02:57:59 +0000 | [diff] [blame] | 29 | |
| 30 | namespace WebCore { |
| 31 | |
cdumez@apple.com | 84f686f | 2014-10-23 23:26:01 +0000 | [diff] [blame] | 32 | class BeforeTextInsertedEvent final : public Event { |
ysuzuki@apple.com | e407070 | 2019-09-18 22:10:00 +0000 | [diff] [blame] | 33 | WTF_MAKE_ISO_ALLOCATED(BeforeTextInsertedEvent); |
darin | b9481ed | 2006-03-20 02:57:59 +0000 | [diff] [blame] | 34 | public: |
commit-queue@webkit.org | 7538c25 | 2010-10-09 02:00:07 +0000 | [diff] [blame] | 35 | virtual ~BeforeTextInsertedEvent(); |
| 36 | |
akling@apple.com | b6c8c7c | 2014-12-14 12:23:31 +0000 | [diff] [blame] | 37 | static Ref<BeforeTextInsertedEvent> create(const String& text) |
darin@apple.com | 48ac3c4 | 2008-06-14 08:46:51 +0000 | [diff] [blame] | 38 | { |
akling@apple.com | b6c8c7c | 2014-12-14 12:23:31 +0000 | [diff] [blame] | 39 | return adoptRef(*new BeforeTextInsertedEvent(text)); |
darin@apple.com | 48ac3c4 | 2008-06-14 08:46:51 +0000 | [diff] [blame] | 40 | } |
darin | b9481ed | 2006-03-20 02:57:59 +0000 | [diff] [blame] | 41 | |
darin@apple.com | 11ff47c | 2016-03-04 16:47:55 +0000 | [diff] [blame] | 42 | EventInterface eventInterface() const override; |
abarth@webkit.org | 090fa4b | 2011-10-21 00:00:37 +0000 | [diff] [blame] | 43 | |
darin | 8c6bf62 | 2006-04-09 05:08:56 +0000 | [diff] [blame] | 44 | const String& text() const { return m_text; } |
| 45 | void setText(const String& s) { m_text = s; } |
darin | b9481ed | 2006-03-20 02:57:59 +0000 | [diff] [blame] | 46 | |
| 47 | private: |
gyuyoung.kim@samsung.com | 5da00cb | 2012-07-24 10:27:51 +0000 | [diff] [blame] | 48 | explicit BeforeTextInsertedEvent(const String&); |
darin@apple.com | 11ff47c | 2016-03-04 16:47:55 +0000 | [diff] [blame] | 49 | bool isBeforeTextInsertedEvent() const override { return true; } |
darin@apple.com | 48ac3c4 | 2008-06-14 08:46:51 +0000 | [diff] [blame] | 50 | |
darin | b9481ed | 2006-03-20 02:57:59 +0000 | [diff] [blame] | 51 | String m_text; |
| 52 | }; |
| 53 | |
cdumez@apple.com | 434faff | 2014-10-01 22:29:14 +0000 | [diff] [blame] | 54 | } // namespace WebCore |
akling@apple.com | 3a14a92 | 2014-02-16 02:01:04 +0000 | [diff] [blame] | 55 | |
cdumez@apple.com | 434faff | 2014-10-01 22:29:14 +0000 | [diff] [blame] | 56 | SPECIALIZE_TYPE_TRAITS_EVENT(BeforeTextInsertedEvent) |