001: /*
002: * Copyright (c) 2006 World Wide Web Consortium,
003: *
004: * (Massachusetts Institute of Technology, European Research Consortium for
005: * Informatics and Mathematics, Keio University). All Rights Reserved. This
006: * work is distributed under the W3C(r) Software License [1] in the hope that
007: * it will be useful, but WITHOUT ANY WARRANTY; without even the implied
008: * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
009: *
010: * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
011: */
012:
013: package org.w3c.dom.events;
014:
015: import org.w3c.dom.Node;
016:
017: /**
018: * The <code>MutationEvent</code> interface provides specific contextual
019: * information associated with Mutation events.
020: * <p> To create an instance of the <code>MutationEvent</code> interface, use
021: * the <code>DocumentEvent.createEvent("MutationEvent")</code> method call.
022: * <p>See also the <a href='http://www.w3.org/TR/2006/WD-DOM-Level-3-Events-20060413'>
023: Document Object Model (DOM) Level 3 Events Specification
024: </a>.
025: * @since DOM Level 2
026: */
027: public interface MutationEvent extends Event {
028: // attrChangeType
029: /**
030: * The <code>Attr</code> was modified in place.
031: */
032: public static final short MODIFICATION = 1;
033: /**
034: * The <code>Attr</code> was just added.
035: */
036: public static final short ADDITION = 2;
037: /**
038: * The <code>Attr</code> was just removed.
039: */
040: public static final short REMOVAL = 3;
041:
042: /**
043: * <code>relatedNode</code> is used to identify a secondary node related
044: * to a mutation event. For example, if a mutation event is dispatched
045: * to a node indicating that its parent has changed, the
046: * <code>relatedNode</code> is the changed parent. If an event is
047: * instead dispatched to a subtree indicating a node was changed within
048: * it, the <code>relatedNode</code> is the changed node. In the case of
049: * the DOMAttrModified event it indicates the <code>Attr</code> node
050: * which was modified, added, or removed.
051: */
052: public Node getRelatedNode();
053:
054: /**
055: * <code>prevValue</code> indicates the previous value of the
056: * <code>Attr</code> node in DOMAttrModified events, and of the
057: * <code>CharacterData</code> node in DOMCharacterDataModified events.
058: */
059: public String getPrevValue();
060:
061: /**
062: * <code>newValue</code> indicates the new value of the <code>Attr</code>
063: * node in DOMAttrModified events, and of the <code>CharacterData</code>
064: * node in DOMCharacterDataModified events.
065: */
066: public String getNewValue();
067:
068: /**
069: * <code>attrName</code> indicates the name of the changed
070: * <code>Attr</code> node in a DOMAttrModified event.
071: */
072: public String getAttrName();
073:
074: /**
075: * <code>attrChange</code> indicates the type of change which triggered
076: * the DOMAttrModified event. The values can be <code>MODIFICATION</code>
077: * , <code>ADDITION</code>, or <code>REMOVAL</code>.
078: */
079: public short getAttrChange();
080:
081: /**
082: * The <code>initMutationEvent</code> method is used to initialize the
083: * value of a <code>MutationEvent</code> object and has the same
084: * behavior as <code>Event.initEvent()</code>.
085: * @param typeArg Refer to the <code>Event.initEvent()</code> method for
086: * a description of this parameter.
087: * @param canBubbleArg Refer to the <code>Event.initEvent()</code>
088: * method for a description of this parameter.
089: * @param cancelableArg Refer to the <code>Event.initEvent()</code>
090: * method for a description of this parameter.
091: * @param relatedNodeArg Specifies <code>MutationEvent.relatedNode</code>
092: * .
093: * @param prevValueArg Specifies <code>MutationEvent.prevValue</code>.
094: * This value may be null.
095: * @param newValueArg Specifies <code>MutationEvent.newValue</code>.
096: * This value may be null.
097: * @param attrNameArg Specifies <code>MutationEvent.attrname</code>.
098: * This value may be null.
099: * @param attrChangeArg Specifies <code>MutationEvent.attrChange</code>.
100: * This value may be null.
101: */
102: public void initMutationEvent(String typeArg, boolean canBubbleArg,
103: boolean cancelableArg, Node relatedNodeArg,
104: String prevValueArg, String newValueArg,
105: String attrNameArg, short attrChangeArg);
106:
107: /**
108: * The <code>initMutationEventNS</code> method is used to initialize the
109: * value of a <code>MutationEvent</code> object and has the same
110: * behavior as <code>Event.initEventNS()</code>.
111: * @param namespaceURI Refer to the <code>Event.initEventNS()</code>
112: * method for a description of this parameter.
113: * @param typeArg Refer to the <code>Event.initEventNS()</code> method
114: * for a description of this parameter.
115: * @param canBubbleArg Refer to the <code>Event.initEventNS()</code>
116: * method for a description of this parameter.
117: * @param cancelableArg Refer to the <code>Event.initEventNS()</code>
118: * method for a description of this parameter.
119: * @param relatedNodeArg Refer to the
120: * <code>MutationEvent.initMutationEvent()</code> method for a
121: * description of this parameter.
122: * @param prevValueArg Refer to the
123: * <code>MutationEvent.initMutationEvent()</code> method for a
124: * description of this parameter.
125: * @param newValueArg Refer to the
126: * <code>MutationEvent.initMutationEvent()</code> method for a
127: * description of this parameter.
128: * @param attrNameArg Refer to the
129: * <code>MutationEvent.initMutationEvent()</code> method for a
130: * description of this parameter.
131: * @param attrChangeArg Refer to the
132: * <code>MutationEvent.initMutationEvent()</code> method for a
133: * description of this parameter.
134: * @since DOM Level 3
135: */
136: public void initMutationEventNS(String namespaceURI,
137: String typeArg, boolean canBubbleArg,
138: boolean cancelableArg, Node relatedNodeArg,
139: String prevValueArg, String newValueArg,
140: String attrNameArg, short attrChangeArg);
141:
142: }
|