001    /*
002     * Copyright (c) 2000 World Wide Web Consortium,
003     * (Massachusetts Institute of Technology, Institut National de
004     * Recherche en Informatique et en Automatique, Keio University). All
005     * Rights Reserved. This program is distributed under the W3C's Software
006     * Intellectual Property License. This program is distributed in the
007     * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
008     * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
009     * PURPOSE.
010     * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
011     */
012    
013    package org.w3c.dom.events;
014    
015    /**
016     *  The <code>EventListener</code> interface is the primary method for 
017     * handling events. Users implement the <code>EventListener</code> interface 
018     * and register their listener on an <code>EventTarget</code> using the 
019     * <code>AddEventListener</code> method. The users should also remove their 
020     * <code>EventListener</code> from its <code>EventTarget</code> after they 
021     * have completed using the listener. 
022     * <p> When a <code>Node</code> is copied using the <code>cloneNode</code> 
023     * method the <code>EventListener</code>s attached to the source 
024     * <code>Node</code> are not attached to the copied <code>Node</code>. If 
025     * the user wishes the same <code>EventListener</code>s to be added to the 
026     * newly created copy the user must add them manually. 
027     * <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>.
028     * @since DOM Level 2
029     */
030    public interface EventListener {
031        /**
032         *  This method is called whenever an event occurs of the type for which 
033         * the <code> EventListener</code> interface was registered. 
034         * @param evt  The <code>Event</code> contains contextual information 
035         *   about the event. It also contains the <code>stopPropagation</code> 
036         *   and <code>preventDefault</code> methods which are used in 
037         *   determining the event's flow and default action. 
038         */
039        public void handleEvent(Event evt);
040    
041    }