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