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)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2013 Apple Inc. All rights reserved.
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.
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.
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
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
27 #include "UIEventInit.h"
28 #include "WindowProxy.h"
32 // FIXME: Remove this when no one is depending on it anymore.
33 typedef WindowProxy AbstractView;
35 class UIEvent : public Event {
36 WTF_MAKE_ISO_ALLOCATED(UIEvent);
38 static Ref<UIEvent> create(const AtomString& type, CanBubble canBubble, IsCancelable isCancelable, IsComposed isComposed, RefPtr<WindowProxy>&& view, int detail)
40 return adoptRef(*new UIEvent(type, canBubble, isCancelable, isComposed, WTFMove(view), detail));
42 static Ref<UIEvent> createForBindings()
44 return adoptRef(*new UIEvent);
46 static Ref<UIEvent> create(const AtomString& type, const UIEventInit& initializer)
48 return adoptRef(*new UIEvent(type, initializer));
52 WEBCORE_EXPORT void initUIEvent(const AtomString& type, bool canBubble, bool cancelable, RefPtr<WindowProxy>&&, int detail);
54 WindowProxy* view() const { return m_view.get(); }
55 int detail() const { return m_detail; }
57 EventInterface eventInterface() const override;
62 virtual int pageX() const;
63 virtual int pageY() const;
65 virtual int which() const;
70 UIEvent(const AtomString& type, CanBubble, IsCancelable, IsComposed, RefPtr<WindowProxy>&&, int detail);
71 UIEvent(const AtomString& type, CanBubble, IsCancelable, IsComposed, MonotonicTime timestamp, RefPtr<WindowProxy>&&, int detail, IsTrusted = IsTrusted::Yes);
72 UIEvent(const AtomString&, const UIEventInit&);
75 bool isUIEvent() const final;
77 RefPtr<WindowProxy> m_view;
81 } // namespace WebCore
83 SPECIALIZE_TYPE_TRAITS_EVENT(UIEvent)