OLD | NEW |
(Empty) | |
| 1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
| 2 /* ***** BEGIN LICENSE BLOCK ***** |
| 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| 4 * |
| 5 * The contents of this file are subject to the Mozilla Public License Version |
| 6 * 1.1 (the "License"); you may not use this file except in compliance with |
| 7 * the License. You may obtain a copy of the License at |
| 8 * http://www.mozilla.org/MPL/ |
| 9 * |
| 10 * Software distributed under the License is distributed on an "AS IS" basis, |
| 11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
| 12 * for the specific language governing rights and limitations under the |
| 13 * License. |
| 14 * |
| 15 * The Original Code is mozilla.org code. |
| 16 * |
| 17 * The Initial Developer of the Original Code is |
| 18 * Netscape Communications Corporation. |
| 19 * Portions created by the Initial Developer are Copyright (C) 2000 |
| 20 * the Initial Developer. All Rights Reserved. |
| 21 * |
| 22 * Contributor(s): |
| 23 * Tom Pixley <joki@netscape.com> (original author) |
| 24 * Johnny Stenback <jst@netscape.com> |
| 25 * |
| 26 * Alternatively, the contents of this file may be used under the terms of |
| 27 * either of the GNU General Public License Version 2 or later (the "GPL"), |
| 28 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), |
| 29 * in which case the provisions of the GPL or the LGPL are applicable instead |
| 30 * of those above. If you wish to allow use of your version of this file only |
| 31 * under the terms of either the GPL or the LGPL, and not to allow others to |
| 32 * use your version of this file under the terms of the MPL, indicate your |
| 33 * decision by deleting the provisions above and replace them with the notice |
| 34 * and other provisions required by the GPL or the LGPL. If you do not delete |
| 35 * the provisions above, a recipient may use your version of this file under |
| 36 * the terms of any one of the MPL, the GPL or the LGPL. |
| 37 * |
| 38 * ***** END LICENSE BLOCK ***** */ |
| 39 |
| 40 #include "domstubs.idl" |
| 41 |
| 42 interface nsIDOMEventTarget; |
| 43 |
| 44 /** |
| 45 * The nsIDOMEvent interface is the primary datatype for all events in |
| 46 * the Document Object Model. |
| 47 * |
| 48 * For more information on this interface please see |
| 49 * http://www.w3.org/TR/DOM-Level-2-Events/ |
| 50 * |
| 51 * @status FROZEN |
| 52 */ |
| 53 |
| 54 [scriptable, uuid(a66b7b80-ff46-bd97-0080-5f8ae38add32)] |
| 55 interface nsIDOMEvent : nsISupports |
| 56 { |
| 57 // PhaseType |
| 58 /** |
| 59 * The current event phase is the capturing phase. |
| 60 */ |
| 61 const unsigned short CAPTURING_PHASE = 1; |
| 62 |
| 63 /** |
| 64 * The event is currently being evaluated at the target EventTarget. |
| 65 */ |
| 66 const unsigned short AT_TARGET = 2; |
| 67 |
| 68 /** |
| 69 * The current event phase is the bubbling phase. |
| 70 */ |
| 71 const unsigned short BUBBLING_PHASE = 3; |
| 72 |
| 73 /** |
| 74 * The name of the event (case-insensitive). The name must be an XML |
| 75 * name. |
| 76 */ |
| 77 readonly attribute DOMString type; |
| 78 |
| 79 /** |
| 80 * Used to indicate the EventTarget to which the event was originally |
| 81 * dispatched. |
| 82 */ |
| 83 readonly attribute nsIDOMEventTarget target; |
| 84 |
| 85 /** |
| 86 * Used to indicate the EventTarget whose EventListeners are currently |
| 87 * being processed. This is particularly useful during capturing and |
| 88 * bubbling. |
| 89 */ |
| 90 readonly attribute nsIDOMEventTarget currentTarget; |
| 91 |
| 92 /** |
| 93 * Used to indicate which phase of event flow is currently being |
| 94 * evaluated. |
| 95 */ |
| 96 readonly attribute unsigned short eventPhase; |
| 97 |
| 98 /** |
| 99 * Used to indicate whether or not an event is a bubbling event. If the |
| 100 * event can bubble the value is true, else the value is false. |
| 101 */ |
| 102 readonly attribute boolean bubbles; |
| 103 |
| 104 /** |
| 105 * Used to indicate whether or not an event can have its default action |
| 106 * prevented. If the default action can be prevented the value is true, |
| 107 * else the value is false. |
| 108 */ |
| 109 readonly attribute boolean cancelable; |
| 110 |
| 111 /** |
| 112 * Used to specify the time (in milliseconds relative to the epoch) at |
| 113 * which the event was created. Due to the fact that some systems may |
| 114 * not provide this information the value of timeStamp may be not |
| 115 * available for all events. When not available, a value of 0 will be |
| 116 * returned. Examples of epoch time are the time of the system start or |
| 117 * 0:0:0 UTC 1st January 1970. |
| 118 */ |
| 119 readonly attribute DOMTimeStamp timeStamp; |
| 120 |
| 121 /** |
| 122 * The stopPropagation method is used prevent further propagation of an |
| 123 * event during event flow. If this method is called by any |
| 124 * EventListener the event will cease propagating through the tree. The |
| 125 * event will complete dispatch to all listeners on the current |
| 126 * EventTarget before event flow stops. This method may be used during |
| 127 * any stage of event flow. |
| 128 */ |
| 129 void stopPropagation(); |
| 130 |
| 131 /** |
| 132 * If an event is cancelable, the preventDefault method is used to |
| 133 * signify that the event is to be canceled, meaning any default action |
| 134 * normally taken by the implementation as a result of the event will |
| 135 * not occur. If, during any stage of event flow, the preventDefault |
| 136 * method is called the event is canceled. Any default action associated |
| 137 * with the event will not occur. Calling this method for a |
| 138 * non-cancelable event has no effect. Once preventDefault has been |
| 139 * called it will remain in effect throughout the remainder of the |
| 140 * event's propagation. This method may be used during any stage of |
| 141 * event flow. |
| 142 */ |
| 143 void preventDefault(); |
| 144 |
| 145 /** |
| 146 * The initEvent method is used to initialize the value of an Event |
| 147 * created through the DocumentEvent interface. This method may only be |
| 148 * called before the Event has been dispatched via the dispatchEvent |
| 149 * method, though it may be called multiple times during that phase if |
| 150 * necessary. If called multiple times the final invocation takes |
| 151 * precedence. If called from a subclass of Event interface only the |
| 152 * values specified in the initEvent method are modified, all other |
| 153 * attributes are left unchanged. |
| 154 * |
| 155 * @param eventTypeArg Specifies the event type. This type may be |
| 156 * any event type currently defined in this |
| 157 * specification or a new event type.. The string |
| 158 * must be an XML name. |
| 159 * Any new event type must not begin with any |
| 160 * upper, lower, or mixed case version of the |
| 161 * string "DOM". This prefix is reserved for |
| 162 * future DOM event sets. It is also strongly |
| 163 * recommended that third parties adding their |
| 164 * own events use their own prefix to avoid |
| 165 * confusion and lessen the probability of |
| 166 * conflicts with other new events. |
| 167 * @param canBubbleArg Specifies whether or not the event can bubble. |
| 168 * @param cancelableArg Specifies whether or not the event's default |
| 169 * action can be prevented. |
| 170 */ |
| 171 void initEvent(in DOMString eventTypeArg, |
| 172 in boolean canBubbleArg, |
| 173 in boolean cancelableArg); |
| 174 }; |
OLD | NEW |