001: /*
002:
003: Licensed to the Apache Software Foundation (ASF) under one or more
004: contributor license agreements. See the NOTICE file distributed with
005: this work for additional information regarding copyright ownership.
006: The ASF licenses this file to You under the Apache License, Version 2.0
007: (the "License"); you may not use this file except in compliance with
008: the License. You may obtain a copy of the License at
009:
010: http://www.apache.org/licenses/LICENSE-2.0
011:
012: Unless required by applicable law or agreed to in writing, software
013: distributed under the License is distributed on an "AS IS" BASIS,
014: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015: See the License for the specific language governing permissions and
016: limitations under the License.
017:
018: */
019: package org.apache.batik.dom.events;
020:
021: import org.w3c.dom.DOMException;
022: import org.w3c.dom.events.Event;
023: import org.w3c.dom.events.EventException;
024: import org.w3c.dom.events.EventListener;
025: import org.w3c.dom.events.EventTarget;
026:
027: /**
028: * A Node that uses an EventSupport for its event registration and
029: * dispatch.
030: *
031: * @author <a href="mailto:Thierry.Kormann@sophia.inria.fr">Thierry Kormann</a>
032: * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
033: * @version $Id: NodeEventTarget.java 484911 2006-12-09 04:37:29Z cam $
034: */
035: public interface NodeEventTarget extends EventTarget {
036:
037: /**
038: * Returns the event support instance for this node, or null if any.
039: */
040: EventSupport getEventSupport();
041:
042: /**
043: * Returns the parent node event target.
044: */
045: NodeEventTarget getParentNodeEventTarget();
046:
047: // Members inherited from DOM Level 3 Events org.w3c.dom.events.EventTarget
048: // follow.
049:
050: /**
051: * This method allows the dispatch of events into the implementation's
052: * event model. The event target of the event is the
053: * <code>EventTarget</code> object on which <code>dispatchEvent</code>
054: * is called.
055: * @param evt The event to be dispatched.
056: * @return Indicates whether any of the listeners which handled the
057: * event called <code>Event.preventDefault()</code>. If
058: * <code>Event.preventDefault()</code> was called the returned value
059: * is <code>false</code>, else it is <code>true</code>.
060: * @exception EventException
061: * UNSPECIFIED_EVENT_TYPE_ERR: Raised if the <code>Event.type</code>
062: * was not specified by initializing the event before
063: * <code>dispatchEvent</code> was called. Specification of the
064: * <code>Event.type</code> as <code>null</code> or an empty string
065: * will also trigger this exception.
066: * <br> DISPATCH_REQUEST_ERR: Raised if the <code>Event</code> object is
067: * already being dispatched.
068: * @exception DOMException
069: * NOT_SUPPORTED_ERR: Raised if the <code>Event</code> object has not
070: * been created using <code>DocumentEvent.createEvent()</code>.
071: * <br> INVALID_CHARACTER_ERR: Raised if <code>Event.type</code> is not
072: * an <a href='http://www.w3.org/TR/2004/REC-xml-names11-20040204/#NT-NCName'>NCName</a> as defined in [<a href='http://www.w3.org/TR/2004/REC-xml-names11-20040204/'>XML Namespaces 1.1</a>]
073: * .
074: * @version DOM Level 3
075: */
076: boolean dispatchEvent(Event evt) throws EventException,
077: DOMException;
078:
079: /**
080: * This method allows the registration of an event listener in a
081: * specified group or the default group and, depending on the
082: * <code>useCapture</code> parameter, on the capture phase of the DOM
083: * event flow or its target and bubbling phases.
084: * @param namespaceURI Specifies the <code>Event.namespaceURI</code>
085: * associated with the event for which the user is registering.
086: * @param type Refer to the <code>EventTarget.addEventListener()</code>
087: * method for a description of this parameter.
088: * @param listener Refer to the
089: * <code>EventTarget.addEventListener()</code> method for a
090: * description of this parameter.
091: * @param useCapture Refer to the
092: * <code>EventTarget.addEventListener()</code> method for a
093: * description of this parameter.
094: * @param evtGroup The object that represents the event group to
095: * associate with the <code>EventListener</code> (see also ). Use
096: * <code>null</code> to attach the event listener to the default
097: * group.
098: * @since DOM Level 3
099: */
100: void addEventListenerNS(String namespaceURI, String type,
101: EventListener listener, boolean useCapture, Object evtGroup);
102:
103: /**
104: * This method allows the removal of an event listener, independently of
105: * the associated event group. Calling <code>removeEventListenerNS</code>
106: * with arguments which do not identify any currently registered
107: * <code>EventListener</code> on the <code>EventTarget</code> has no
108: * effect.
109: * @param namespaceURI Specifies the <code>Event.namespaceURI</code>
110: * associated with the event for which the user registered the event
111: * listener.
112: * @param type Refer to the
113: * <code>EventTarget.removeEventListener()</code> method for a
114: * description of this parameter.
115: * @param listener Refer to the
116: * <code>EventTarget.removeEventListener()</code> method for a
117: * description of this parameter.
118: * @param useCapture Refer to the
119: * <code>EventTarget.removeEventListener()</code> method for a
120: * description of this parameter.
121: * @since DOM Level 3
122: */
123: void removeEventListenerNS(String namespaceURI, String type,
124: EventListener listener, boolean useCapture);
125: }
|