286N/A/*
286N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
286N/A *
286N/A * This code is free software; you can redistribute it and/or modify it
286N/A * under the terms of the GNU General Public License version 2 only, as
286N/A * published by the Free Software Foundation. Oracle designates this
286N/A * particular file as subject to the "Classpath" exception as provided
286N/A * by Oracle in the LICENSE file that accompanied this code.
286N/A *
286N/A * This code is distributed in the hope that it will be useful, but WITHOUT
286N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
286N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
286N/A * version 2 for more details (a copy is included in the LICENSE file that
286N/A * accompanied this code).
286N/A *
286N/A * You should have received a copy of the GNU General Public License version
286N/A * 2 along with this work; if not, write to the Free Software Foundation,
286N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
286N/A *
286N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
286N/A * or visit www.oracle.com if you need additional information or have any
286N/A * questions.
286N/A */
286N/A
286N/A/*
286N/A * This file is available under and governed by the GNU General Public
286N/A * License version 2 only, as published by the Free Software Foundation.
286N/A * However, the following notice accompanied the original version of this
286N/A * file and, per its terms, should not be removed:
286N/A *
286N/A * Copyright (c) 2000 World Wide Web Consortium,
286N/A * (Massachusetts Institute of Technology, Institut National de
286N/A * Recherche en Informatique et en Automatique, Keio University). All
286N/A * Rights Reserved. This program is distributed under the W3C's Software
286N/A * Intellectual Property License. This program is distributed in the
286N/A * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
286N/A * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
286N/A * PURPOSE.
286N/A * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
286N/A */
286N/A
286N/Apackage org.w3c.dom.events;
286N/A
286N/A/**
286N/A * The <code>Event</code> interface is used to provide contextual information
286N/A * about an event to the handler processing the event. An object which
286N/A * implements the <code>Event</code> interface is generally passed as the
286N/A * first parameter to an event handler. More specific context information is
286N/A * passed to event handlers by deriving additional interfaces from
286N/A * <code>Event</code> which contain information directly relating to the
286N/A * type of event they accompany. These derived interfaces are also
286N/A * implemented by the object passed to the event listener.
286N/A * <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>.
286N/A * @since DOM Level 2
286N/A */
286N/Apublic interface Event {
286N/A // PhaseType
286N/A /**
286N/A * The current event phase is the capturing phase.
286N/A */
286N/A public static final short CAPTURING_PHASE = 1;
286N/A /**
286N/A * The event is currently being evaluated at the target
286N/A * <code>EventTarget</code>.
286N/A */
286N/A public static final short AT_TARGET = 2;
286N/A /**
286N/A * The current event phase is the bubbling phase.
286N/A */
286N/A public static final short BUBBLING_PHASE = 3;
286N/A
286N/A /**
286N/A * The name of the event (case-insensitive). The name must be an XML name.
286N/A */
286N/A public String getType();
286N/A
286N/A /**
286N/A * Used to indicate the <code>EventTarget</code> to which the event was
286N/A * originally dispatched.
286N/A */
286N/A public EventTarget getTarget();
286N/A
286N/A /**
286N/A * Used to indicate the <code>EventTarget</code> whose
286N/A * <code>EventListeners</code> are currently being processed. This is
286N/A * particularly useful during capturing and bubbling.
286N/A */
286N/A public EventTarget getCurrentTarget();
286N/A
286N/A /**
286N/A * Used to indicate which phase of event flow is currently being
286N/A * evaluated.
286N/A */
286N/A public short getEventPhase();
286N/A
286N/A /**
286N/A * Used to indicate whether or not an event is a bubbling event. If the
286N/A * event can bubble the value is true, else the value is false.
286N/A */
286N/A public boolean getBubbles();
286N/A
286N/A /**
286N/A * Used to indicate whether or not an event can have its default action
286N/A * prevented. If the default action can be prevented the value is true,
286N/A * else the value is false.
286N/A */
286N/A public boolean getCancelable();
286N/A
286N/A /**
286N/A * Used to specify the time (in milliseconds relative to the epoch) at
286N/A * which the event was created. Due to the fact that some systems may
286N/A * not provide this information the value of <code>timeStamp</code> may
286N/A * be not available for all events. When not available, a value of 0
286N/A * will be returned. Examples of epoch time are the time of the system
286N/A * start or 0:0:0 UTC 1st January 1970.
286N/A */
286N/A public long getTimeStamp();
286N/A
286N/A /**
286N/A * The <code>stopPropagation</code> method is used prevent further
286N/A * propagation of an event during event flow. If this method is called
286N/A * by any <code>EventListener</code> the event will cease propagating
286N/A * through the tree. The event will complete dispatch to all listeners
286N/A * on the current <code>EventTarget</code> before event flow stops. This
286N/A * method may be used during any stage of event flow.
286N/A */
286N/A public void stopPropagation();
286N/A
286N/A /**
286N/A * If an event is cancelable, the <code>preventDefault</code> method is
286N/A * used to signify that the event is to be canceled, meaning any default
286N/A * action normally taken by the implementation as a result of the event
286N/A * will not occur. If, during any stage of event flow, the
286N/A * <code>preventDefault</code> method is called the event is canceled.
286N/A * Any default action associated with the event will not occur. Calling
286N/A * this method for a non-cancelable event has no effect. Once
286N/A * <code>preventDefault</code> has been called it will remain in effect
286N/A * throughout the remainder of the event's propagation. This method may
286N/A * be used during any stage of event flow.
286N/A */
286N/A public void preventDefault();
286N/A
286N/A /**
286N/A * The <code>initEvent</code> method is used to initialize the value of an
286N/A * <code>Event</code> created through the <code>DocumentEvent</code>
286N/A * interface. This method may only be called before the
286N/A * <code>Event</code> has been dispatched via the
286N/A * <code>dispatchEvent</code> method, though it may be called multiple
286N/A * times during that phase if necessary. If called multiple times the
286N/A * final invocation takes precedence. If called from a subclass of
286N/A * <code>Event</code> interface only the values specified in the
286N/A * <code>initEvent</code> method are modified, all other attributes are
286N/A * left unchanged.
286N/A * @param eventTypeArg Specifies the event type. This type may be any
286N/A * event type currently defined in this specification or a new event
286N/A * type.. The string must be an XML name. Any new event type must not
286N/A * begin with any upper, lower, or mixed case version of the string
286N/A * "DOM". This prefix is reserved for future DOM event sets. It is
286N/A * also strongly recommended that third parties adding their own
286N/A * events use their own prefix to avoid confusion and lessen the
286N/A * probability of conflicts with other new events.
286N/A * @param canBubbleArg Specifies whether or not the event can bubble.
286N/A * @param cancelableArg Specifies whether or not the event's default
286N/A * action can be prevented.
286N/A */
286N/A public void initEvent(String eventTypeArg,
286N/A boolean canBubbleArg,
286N/A boolean cancelableArg);
286N/A
286N/A}