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 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 "DOMWindow.h"
29 #include "EventDispatchMediator.h"
33 typedef DOMWindow AbstractView;
35 class UIEvent : public Event {
37 static PassRefPtr<UIEvent> create()
39 return adoptRef(new UIEvent);
41 static PassRefPtr<UIEvent> create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView> view, int detail)
43 return adoptRef(new UIEvent(type, canBubble, cancelable, view, detail));
47 void initUIEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView>, int detail);
49 AbstractView* view() const { return m_view.get(); }
50 int detail() const { return m_detail; }
52 virtual bool isUIEvent() const;
54 virtual int keyCode() const;
55 virtual int charCode() const;
60 virtual int pageX() const;
61 virtual int pageY() const;
63 virtual int which() const;
67 UIEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView>, int detail);
70 RefPtr<AbstractView> m_view;
74 class FocusInEventDispatchMediator : public EventDispatchMediator {
76 static PassRefPtr<FocusInEventDispatchMediator> create(PassRefPtr<Event>, PassRefPtr<Node> oldFocusedNode);
78 explicit FocusInEventDispatchMediator(PassRefPtr<Event>, PassRefPtr<Node> oldFocusedNode);
79 virtual bool dispatchEvent(EventDispatcher*) const;
80 RefPtr<Node> m_oldFocusedNode;
83 class FocusOutEventDispatchMediator : public EventDispatchMediator {
85 static PassRefPtr<FocusOutEventDispatchMediator> create(PassRefPtr<Event>, PassRefPtr<Node> newFocusedNode);
87 explicit FocusOutEventDispatchMediator(PassRefPtr<Event>, PassRefPtr<Node> newFocusedNode);
88 virtual bool dispatchEvent(EventDispatcher*) const;
89 RefPtr<Node> m_newFocusedNode;
92 } // namespace WebCore