weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 1 | /* |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 2 | * Copyright (C) 2001 Peter Kelly (pmk@post.com) |
| 3 | * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) |
| 4 | * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
darin@apple.com | 48ac3c4 | 2008-06-14 08:46:51 +0000 | [diff] [blame] | 5 | * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 6 | * |
| 7 | * This library is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU Library General Public |
| 9 | * License as published by the Free Software Foundation; either |
| 10 | * version 2 of the License, or (at your option) any later version. |
| 11 | * |
| 12 | * This library is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * Library General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU Library General Public License |
| 18 | * along with this library; see the file COPYING.LIB. If not, write to |
ddkilzer | c8eccec | 2007-09-26 02:29:57 +0000 | [diff] [blame] | 19 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 20 | * Boston, MA 02110-1301, USA. |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 21 | * |
| 22 | */ |
| 23 | |
commit-queue@webkit.org | d862d77 | 2016-10-31 22:07:53 +0000 | [diff] [blame] | 24 | #pragma once |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 25 | |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 26 | #include "Event.h" |
| 27 | |
| 28 | namespace WebCore { |
| 29 | |
cdumez@apple.com | a7d6ccf | 2016-10-09 00:03:14 +0000 | [diff] [blame] | 30 | class DataTransfer; |
darin@apple.com | 569b13f | 2013-03-03 05:55:53 +0000 | [diff] [blame] | 31 | |
cdumez@apple.com | a7d6ccf | 2016-10-09 00:03:14 +0000 | [diff] [blame] | 32 | class ClipboardEvent final : public Event { |
ysuzuki@apple.com | e407070 | 2019-09-18 22:10:00 +0000 | [diff] [blame] | 33 | WTF_MAKE_ISO_ALLOCATED(ClipboardEvent); |
cdumez@apple.com | a7d6ccf | 2016-10-09 00:03:14 +0000 | [diff] [blame] | 34 | public: |
| 35 | virtual ~ClipboardEvent(); |
commit-queue@webkit.org | 7538c25 | 2010-10-09 02:00:07 +0000 | [diff] [blame] | 36 | |
cdumez@apple.com | 7df7628 | 2016-10-10 01:16:05 +0000 | [diff] [blame] | 37 | struct Init : EventInit { |
cdumez@apple.com | a7d6ccf | 2016-10-09 00:03:14 +0000 | [diff] [blame] | 38 | RefPtr<DataTransfer> clipboardData; |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 39 | }; |
| 40 | |
darin@apple.com | 0ce67df | 2019-06-17 01:48:13 +0000 | [diff] [blame] | 41 | static Ref<ClipboardEvent> create(const AtomString& type, Ref<DataTransfer>&& dataTransfer) |
cdumez@apple.com | a7d6ccf | 2016-10-09 00:03:14 +0000 | [diff] [blame] | 42 | { |
rniwa@webkit.org | 1321fa3 | 2018-08-24 20:14:50 +0000 | [diff] [blame] | 43 | return adoptRef(*new ClipboardEvent(type, WTFMove(dataTransfer))); |
| 44 | } |
| 45 | |
darin@apple.com | 0ce67df | 2019-06-17 01:48:13 +0000 | [diff] [blame] | 46 | static Ref<ClipboardEvent> create(const AtomString& type, const Init& init) |
rniwa@webkit.org | 1321fa3 | 2018-08-24 20:14:50 +0000 | [diff] [blame] | 47 | { |
| 48 | return adoptRef(*new ClipboardEvent(type, init)); |
cdumez@apple.com | a7d6ccf | 2016-10-09 00:03:14 +0000 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | DataTransfer* clipboardData() const { return m_clipboardData.get(); } |
| 52 | |
| 53 | private: |
darin@apple.com | 0ce67df | 2019-06-17 01:48:13 +0000 | [diff] [blame] | 54 | ClipboardEvent(const AtomString& type, Ref<DataTransfer>&&); |
| 55 | ClipboardEvent(const AtomString& type, const Init&); |
cdumez@apple.com | a7d6ccf | 2016-10-09 00:03:14 +0000 | [diff] [blame] | 56 | |
| 57 | EventInterface eventInterface() const final; |
| 58 | bool isClipboardEvent() const final; |
| 59 | |
| 60 | RefPtr<DataTransfer> m_clipboardData; |
| 61 | }; |
| 62 | |
weinig | 681a517 | 2006-06-19 22:58:36 +0000 | [diff] [blame] | 63 | } // namespace WebCore |