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
10 * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
13 package org.w3c.dom.events;
15 import org.w3c.dom.Node;
18 * The <code>MutationEvent</code> interface provides specific contextual
19 * information associated with Mutation events.
20 * <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>.
23 public interface MutationEvent extends Event {
26 * The <code>Attr</code> was modified in place.
28 public static final short MODIFICATION = 1;
30 * The <code>Attr</code> was just added.
32 public static final short ADDITION = 2;
34 * The <code>Attr</code> was just removed.
36 public static final short REMOVAL = 3;
39 * <code>relatedNode</code> is used to identify a secondary node related
40 * to a mutation event. For example, if a mutation event is dispatched
41 * to a node indicating that its parent has changed, the
42 * <code>relatedNode</code> is the changed parent. If an event is
43 * instead dispatched to a subtree indicating a node was changed within
44 * it, the <code>relatedNode</code> is the changed node. In the case of
45 * the DOMAttrModified event it indicates the <code>Attr</code> node
46 * which was modified, added, or removed.
48 public Node getRelatedNode();
51 * <code>prevValue</code> indicates the previous value of the
52 * <code>Attr</code> node in DOMAttrModified events, and of the
53 * <code>CharacterData</code> node in DOMCharacterDataModified events.
55 public String getPrevValue();
58 * <code>newValue</code> indicates the new value of the <code>Attr</code>
59 * node in DOMAttrModified events, and of the <code>CharacterData</code>
60 * node in DOMCharacterDataModified events.
62 public String getNewValue();
65 * <code>attrName</code> indicates the name of the changed
66 * <code>Attr</code> node in a DOMAttrModified event.
68 public String getAttrName();
71 * <code>attrChange</code> indicates the type of change which triggered
72 * the DOMAttrModified event. The values can be <code>MODIFICATION</code>
73 * , <code>ADDITION</code>, or <code>REMOVAL</code>.
75 public short getAttrChange();
78 * The <code>initMutationEvent</code> method is used to initialize the
79 * value of a <code>MutationEvent</code> created through the
80 * <code>DocumentEvent</code> interface. This method may only be called
81 * before the <code>MutationEvent</code> has been dispatched via the
82 * <code>dispatchEvent</code> method, though it may be called multiple
83 * times during that phase if necessary. If called multiple times, the
84 * final invocation takes precedence.
85 * @param typeArg Specifies the event type.
86 * @param canBubbleArg Specifies whether or not the event can bubble.
87 * @param cancelableArg Specifies whether or not the event's default
88 * action can be prevented.
89 * @param relatedNodeArg Specifies the <code>Event</code>'s related Node.
90 * @param prevValueArg Specifies the <code>Event</code>'s
91 * <code>prevValue</code> attribute. This value may be null.
92 * @param newValueArg Specifies the <code>Event</code>'s
93 * <code>newValue</code> attribute. This value may be null.
94 * @param attrNameArg Specifies the <code>Event</code>'s
95 * <code>attrName</code> attribute. This value may be null.
96 * @param attrChangeArg Specifies the <code>Event</code>'s
97 * <code>attrChange</code> attribute
99 public void initMutationEvent(String typeArg,
100 boolean canBubbleArg,
101 boolean cancelableArg,
106 short attrChangeArg);