1f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson/* 2f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * Copyright (c) 2000 World Wide Web Consortium, 3f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * (Massachusetts Institute of Technology, Institut National de 4f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * Recherche en Informatique et en Automatique, Keio University). All 5f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * Rights Reserved. This program is distributed under the W3C's Software 6f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * Intellectual Property License. This program is distributed in the 7f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * hope that it will be useful, but WITHOUT ANY WARRANTY; without even 8f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 9f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * PURPOSE. 10f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * See W3C License http://www.w3.org/Consortium/Legal/ for more details. 11f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson */ 12f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson 13f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilsonpackage org.w3c.dom.events; 14f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson 15f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson/** 16f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * The <code>EventListener</code> interface is the primary method for 17f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * handling events. Users implement the <code>EventListener</code> interface 18f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * and register their listener on an <code>EventTarget</code> using the 19f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * <code>AddEventListener</code> method. The users should also remove their 20f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * <code>EventListener</code> from its <code>EventTarget</code> after they 21f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * have completed using the listener. 22f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * <p> When a <code>Node</code> is copied using the <code>cloneNode</code> 23f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * method the <code>EventListener</code>s attached to the source 24f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * <code>Node</code> are not attached to the copied <code>Node</code>. If 25f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * the user wishes the same <code>EventListener</code>s to be added to the 26f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * newly created copy the user must add them manually. 27f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * <p>See also the <a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113'>Document Object Model (DOM) Level 2 Events Specification</a>. 28f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * @since DOM Level 2 29f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson */ 30f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilsonpublic interface EventListener { 31f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson /** 32f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * This method is called whenever an event occurs of the type for which 33f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * the <code> EventListener</code> interface was registered. 34f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * @param evt The <code>Event</code> contains contextual information 35f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * about the event. It also contains the <code>stopPropagation</code> 36f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * and <code>preventDefault</code> methods which are used in 37f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson * determining the event's flow and default action. 38f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson */ 39f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson public void handleEvent(Event evt); 40f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson 41f4ce5c4028bf4001cd718df83d5641913ca9c928Jesse Wilson} 42