OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (C) 2006, 2007, 2009, 2011 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> |
| 4 * |
| 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. |
| 9 * |
| 10 * This library is distributed in the hope that it will be useful, |
| 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 * Library General Public License for more details. |
| 14 * |
| 15 * You should have received a copy of the GNU Library General Public License |
| 16 * along with this library; see the file COPYING.LIB. If not, write to |
| 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 * Boston, MA 02110-1301, USA. |
| 19 */ |
| 20 |
| 21 module events { |
| 22 |
| 23 // Introduced in DOM Level 2: |
| 24 interface [ |
| 25 CustomToJSObject, |
| 26 ConstructorTemplate=Event, |
| 27 JSNoStaticTables, |
| 28 ObjCPolymorphic |
| 29 ] Event { |
| 30 |
| 31 // DOM PhaseType |
| 32 const unsigned short CAPTURING_PHASE = 1; |
| 33 const unsigned short AT_TARGET = 2; |
| 34 const unsigned short BUBBLING_PHASE = 3; |
| 35 |
| 36 #if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C |
| 37 // Reverse-engineered from Netscape |
| 38 const unsigned short MOUSEDOWN = 1; |
| 39 const unsigned short MOUSEUP = 2; |
| 40 const unsigned short MOUSEOVER = 4; |
| 41 const unsigned short MOUSEOUT = 8; |
| 42 const unsigned short MOUSEMOVE = 16; |
| 43 const unsigned short MOUSEDRAG = 32; |
| 44 const unsigned short CLICK = 64; |
| 45 const unsigned short DBLCLICK = 128; |
| 46 const unsigned short KEYDOWN = 256; |
| 47 const unsigned short KEYUP = 512; |
| 48 const unsigned short KEYPRESS = 1024; |
| 49 const unsigned short DRAGDROP = 2048; |
| 50 const unsigned short FOCUS = 4096; |
| 51 const unsigned short BLUR = 8192; |
| 52 const unsigned short SELECT = 16384; |
| 53 const unsigned short CHANGE = 32768; |
| 54 #endif |
| 55 |
| 56 readonly attribute DOMString type; |
| 57 readonly attribute EventTarget target; |
| 58 readonly attribute EventTarget currentTarget; |
| 59 readonly attribute unsigned short eventPhase; |
| 60 readonly attribute [InitializedByEventConstructor] boolean bubbles; |
| 61 readonly attribute [InitializedByEventConstructor] boolean cancelable; |
| 62 readonly attribute DOMTimeStamp timeStamp; |
| 63 |
| 64 void stopPropagation(); |
| 65 void preventDefault(); |
| 66 [ObjCLegacyUnnamedParameters] void initEvent(in [Optional=DefaultIsUndef
ined] DOMString eventTypeArg, |
| 67 in [Optional=DefaultIsUndefined] boolean c
anBubbleArg, |
| 68 in [Optional=DefaultIsUndefined] boolean c
ancelableArg); |
| 69 |
| 70 // DOM Level 3 Additions. |
| 71 readonly attribute boolean defaultPrevented; |
| 72 void stopImmediatePropagation(); |
| 73 |
| 74 // IE Extensions |
| 75 readonly attribute EventTarget srcElement; |
| 76 attribute boolean returnValue; |
| 77 attribute boolean cancelBubble; |
| 78 |
| 79 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT |
| 80 readonly attribute [Custom] Clipboard clipboardData; |
| 81 #endif |
| 82 |
| 83 #if defined(LANGUAGE_CPP) && LANGUAGE_CPP |
| 84 // Extra WebCore methods exposed to allow compile-time casting in C++ |
| 85 boolean isMouseEvent(); |
| 86 boolean isUIEvent(); |
| 87 #endif |
| 88 |
| 89 }; |
| 90 |
| 91 } |
OLD | NEW |