blob: 3aabfcbe91a3cf4381287a5e7cdd99280b89535f [file] [log] [blame]
weinig681a5172006-06-19 22:58:36 +00001/*
weinig681a5172006-06-19 22:58:36 +00002 * 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.com48ac3c42008-06-14 08:46:51 +00005 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
weinig681a5172006-06-19 22:58:36 +00006 *
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
ddkilzerc8eccec2007-09-26 02:29:57 +000019 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
weinig681a5172006-06-19 22:58:36 +000021 *
22 */
23
commit-queue@webkit.orgd862d772016-10-31 22:07:53 +000024#pragma once
weinig681a5172006-06-19 22:58:36 +000025
weinig681a5172006-06-19 22:58:36 +000026#include "Event.h"
27
28namespace WebCore {
29
cdumez@apple.coma7d6ccf2016-10-09 00:03:14 +000030class DataTransfer;
darin@apple.com569b13f2013-03-03 05:55:53 +000031
cdumez@apple.coma7d6ccf2016-10-09 00:03:14 +000032class ClipboardEvent final : public Event {
ysuzuki@apple.come4070702019-09-18 22:10:00 +000033 WTF_MAKE_ISO_ALLOCATED(ClipboardEvent);
cdumez@apple.coma7d6ccf2016-10-09 00:03:14 +000034public:
35 virtual ~ClipboardEvent();
commit-queue@webkit.org7538c252010-10-09 02:00:07 +000036
cdumez@apple.com7df76282016-10-10 01:16:05 +000037 struct Init : EventInit {
cdumez@apple.coma7d6ccf2016-10-09 00:03:14 +000038 RefPtr<DataTransfer> clipboardData;
weinig681a5172006-06-19 22:58:36 +000039 };
40
darin@apple.com0ce67df2019-06-17 01:48:13 +000041 static Ref<ClipboardEvent> create(const AtomString& type, Ref<DataTransfer>&& dataTransfer)
cdumez@apple.coma7d6ccf2016-10-09 00:03:14 +000042 {
rniwa@webkit.org1321fa32018-08-24 20:14:50 +000043 return adoptRef(*new ClipboardEvent(type, WTFMove(dataTransfer)));
44 }
45
darin@apple.com0ce67df2019-06-17 01:48:13 +000046 static Ref<ClipboardEvent> create(const AtomString& type, const Init& init)
rniwa@webkit.org1321fa32018-08-24 20:14:50 +000047 {
48 return adoptRef(*new ClipboardEvent(type, init));
cdumez@apple.coma7d6ccf2016-10-09 00:03:14 +000049 }
50
51 DataTransfer* clipboardData() const { return m_clipboardData.get(); }
52
53private:
darin@apple.com0ce67df2019-06-17 01:48:13 +000054 ClipboardEvent(const AtomString& type, Ref<DataTransfer>&&);
55 ClipboardEvent(const AtomString& type, const Init&);
cdumez@apple.coma7d6ccf2016-10-09 00:03:14 +000056
57 EventInterface eventInterface() const final;
58 bool isClipboardEvent() const final;
59
60 RefPtr<DataTransfer> m_clipboardData;
61};
62
weinig681a5172006-06-19 22:58:36 +000063} // namespace WebCore