<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: MediaList.xml 225913 2001-06-01 11:15:37Z dims $ -->
<interface id="StyleSheets-MediaList" name="MediaList" since="DOM Level 2">
  <descr>
    <p>
      The <code>MediaList</code> interface provides the abstraction of an
      ordered collection of <xspecref
      href="&html40;/types.html#h-6.13">media</xspecref>,
      without defining or constraining how this collection is implemented. An
      empty list is the same as a list that contains the medium
      <code>"all"</code>.
    </p>
    <p>
      The items in the <code>MediaList</code> are accessible via an integral
      index, starting from 0.
    </p>
  </descr>
  
  <attribute type="DOMString" name="mediaText" id="StyleSheets-MediaList-mediaText">
    <descr>
      <p>
	The parsable textual representation of the media list. This is a
	comma-separated list of media.
      </p>
    </descr>
    <setraises>
      <exception name="DOMException">
        <descr>
          <p>SYNTAX_ERR: Raised if the specified string value has a syntax
          error and is unparsable.</p> 
	  <p>NO_MODIFICATION_ALLOWED_ERR: Raised if this media list is
	  readonly.</p>
	</descr>
      </exception>
    </setraises>
  </attribute>

  <attribute id="StyleSheets-MediaList-length" name="length" type="unsigned long" readonly="yes">
    <descr>
      <p>
	The number of media in the list. The range of valid media is
	<code>0</code> to <code>length-1</code> inclusive.
      </p>
    </descr>
  </attribute>
  
  <method id="StyleSheets-MediaList-item" name="item">
    <descr>
      <p>
	Returns the <code>index</code>th in the list. If <code>index</code> is
	greater than or equal to the number of media in the list, this returns
	<code>null</code>.
      </p>
    </descr>
    <parameters>
      <param name="index" type="unsigned long" attr="in">
	<descr>
	  <p>
	    Index into the collection.
	  </p>
	</descr>
      </param>
    </parameters>
    <returns type="DOMString">
      <descr>
	<p>
	  The medium at the <code>index</code>th position in the
	  <code>MediaList</code>, or <code>null</code> if that is not a
	  valid index.
	</p>
      </descr>
    </returns>
    <raises>
    </raises>
  </method>
  
  <method name="deleteMedium" id="StyleSheets-MediaList-deleteMedium">
    <descr>
      <p>
	Deletes the medium indicated by <code>oldMedium</code> from the list.
      </p>
    </descr>
    <parameters>
      <param name="oldMedium" type="DOMString" attr="in">
	<descr>
	  <p>The medium to delete in the media list.</p>
	</descr>
      </param>
    </parameters>
    <returns type="void">
      <descr>
	<p></p>
      </descr>
    </returns>
    <raises>
      <exception name="DOMException">
	<descr>
	  <p>
	    NO_MODIFICATION_ALLOWED_ERR: Raised if this list is readonly.
	  </p>
	  <p>
	    NOT_FOUND_ERR: Raised if <code>oldMedium</code> is not in the list.
	  </p>
	</descr>
      </exception>
    </raises>
  </method>
  
  <method id="StyleSheets-MediaList-appendMedium" name="appendMedium">
    <descr>
      <p>
	Adds the medium <code>newMedium</code> to the end of the list. If the
	<code>newMedium</code> is already used, it is first removed.
      </p>
    </descr>
    <parameters>
      <param name="newMedium" type="DOMString" attr="in">
	<descr>
	  <p>The new medium to add.</p>
	</descr>
      </param>
    </parameters>
    <returns type="void">
      <descr>
	<p></p>
      </descr>
    </returns>
    <raises>
      <exception name="DOMException">
	<descr>
	  <p>
	    INVALID_CHARACTER_ERR: If the medium contains characters that are
	    invalid in the underlying style language.
	  </p>	  
	  <p>
	    NO_MODIFICATION_ALLOWED_ERR: Raised if this list is readonly.
	  </p>
	</descr>
      </exception>
    </raises>
  </method>
  
</interface>
