56
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
package org.w3c.dom.events;
|
|
18 |
|
|
19 |
import org.w3c.dom.DOMException;
|
|
20 |
|
|
21 |
/**
|
|
22 |
*
|
|
23 |
* This interface represents an event target, and is a subset of the EventTarget interface
|
|
24 |
* defined in the <a href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/idl-definitions.html">
|
|
25 |
* DOM Level 2 Event model</a>.
|
|
26 |
* <br>
|
|
27 |
* This interface is implemented by an object (SVGElements) that can notify listeners about events and allows
|
|
28 |
* registration and removal of {@link org.w3c.dom.events.EventListener EventListener} objects.
|
|
29 |
*
|
|
30 |
*
|
|
31 |
*/
|
|
32 |
|
|
33 |
public interface EventTarget
|
|
34 |
{
|
|
35 |
|
|
36 |
/**
|
|
37 |
* This method registers the specified listener with the event target. If an EventListener is added to an EventTarget
|
|
38 |
* while it is processing an event, it will not be triggered by the current actions. If multiple identical EventListeners
|
|
39 |
* are registered on the same EventTarget with the same parameters the duplicate instances are discarded. They do not cause
|
|
40 |
* the EventListener to be called twice and since they are discarded they do not need to be removed with the removeEventListener
|
|
41 |
* method.
|
|
42 |
*
|
|
43 |
* @param type The type of event to listen to.
|
|
44 |
* @param listener Will be notified when an event of the desired type happens on this target or one of its descendant.
|
|
45 |
* @param useCapture If true, the listener will be called during the event flow capture phase. Otherwise, the listener
|
|
46 |
* will be called during the bubble phase. If the event's target is this target, then the listener will be called during the 'at target' phase of event flow.
|
|
47 |
*
|
|
48 |
* @throws DOMException with error code NOT_SUPPORTED_ERR if useCapture is true since capture phase is not supported in SVG Tiny.
|
|
49 |
* @throws NullPointerException if <code>listener</code> is null.
|
|
50 |
* @throws NullPointerException if <code>type</code> is null.
|
|
51 |
*/
|
|
52 |
public void addEventListener(String type, EventListener listener, boolean useCapture);
|
|
53 |
|
|
54 |
/**
|
|
55 |
* This method removes the specified listener from the event target. If an EventListener is removed
|
|
56 |
* from an EventTarget while it is processing an event, it will not be triggered by the current actions. Calling removeEventListener
|
|
57 |
* with arguments which do not identify any currently registered EventListener on the EventTarget has no effect.
|
|
58 |
*
|
|
59 |
* @param type The type of event that was listened to.
|
|
60 |
* @param listener The listener that was previously registered.
|
|
61 |
* @param useCapture If true, the listener was listening to events in the capture phase of event flow, otherwise the listener
|
|
62 |
* was listening to events in the bubble phase.
|
|
63 |
*
|
|
64 |
* @throws DOMException with error code NOT_SUPPORTED_ERR if useCapture is true since capture phase is not supported in SVG Tiny.
|
|
65 |
* @throws NullPointerException if <code>listener</code> is null.
|
|
66 |
* @throws NullPointerException if <code>type</code> is null.
|
|
67 |
*/
|
|
68 |
public void removeEventListener(String type, EventListener listener, boolean useCapture);
|
|
69 |
|
|
70 |
} |