Source for org.w3c.dom.events.MutationEvent

   1: /*
   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
   9:  * PURPOSE.
  10:  * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
  11:  */
  12: 
  13: package org.w3c.dom.events;
  14: 
  15: import org.w3c.dom.Node;
  16: 
  17: /**
  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>.
  21:  * @since DOM Level 2
  22:  */
  23: public interface MutationEvent extends Event {
  24:     // attrChangeType
  25:     /**
  26:      * The <code>Attr</code> was modified in place.
  27:      */
  28:     public static final short MODIFICATION              = 1;
  29:     /**
  30:      * The <code>Attr</code> was just added.
  31:      */
  32:     public static final short ADDITION                  = 2;
  33:     /**
  34:      * The <code>Attr</code> was just removed.
  35:      */
  36:     public static final short REMOVAL                   = 3;
  37: 
  38:     /**
  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. 
  47:      */
  48:     public Node getRelatedNode();
  49: 
  50:     /**
  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. 
  54:      */
  55:     public String getPrevValue();
  56: 
  57:     /**
  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. 
  61:      */
  62:     public String getNewValue();
  63: 
  64:     /**
  65:      *  <code>attrName</code> indicates the name of the changed 
  66:      * <code>Attr</code> node in a DOMAttrModified event. 
  67:      */
  68:     public String getAttrName();
  69: 
  70:     /**
  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>. 
  74:      */
  75:     public short getAttrChange();
  76: 
  77:     /**
  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
  98:      */
  99:     public void initMutationEvent(String typeArg, 
 100:                                   boolean canBubbleArg, 
 101:                                   boolean cancelableArg, 
 102:                                   Node relatedNodeArg, 
 103:                                   String prevValueArg, 
 104:                                   String newValueArg, 
 105:                                   String attrNameArg, 
 106:                                   short attrChangeArg);
 107: 
 108: }