Home | History | Annotate | Download | only in smil
      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. See W3C License http://www.w3.org/Consortium/Legal/ for more
     10  * details.
     11  */
     12 
     13 package org.w3c.dom.smil;
     14 
     15 import org.w3c.dom.DOMException;
     16 import org.w3c.dom.Element;
     17 
     18 /**
     19  *  The <code>Time</code> interface is a datatype that represents times within
     20  * the timegraph. A <code>Time</code> has a type, key values to describe the
     21  * time, and a boolean to indicate whether the values are currently
     22  * unresolved.  Still need to address the wallclock values.
     23  */
     24 public interface Time {
     25     /**
     26      *  A boolean indicating whether the current <code>Time</code> has been
     27      * fully resolved to the document schedule.  Note that for this to be
     28      * true, the current <code>Time</code> must be defined (not indefinite),
     29      * the syncbase and all <code>Time</code> 's that the syncbase depends on
     30      * must be defined (not indefinite), and the begin <code>Time</code> of
     31      * all ascendent time containers of this element and all <code>Time</code>
     32      *  elements that this depends upon must be defined (not indefinite).
     33      * <br> If this <code>Time</code> is based upon an event, this
     34      * <code>Time</code> will only be resolved once the specified event has
     35      * happened, subject to the constraints of the time container.
     36      * <br> Note that this may change from true to false when the parent time
     37      * container ends its simple duration (including when it repeats or
     38      * restarts).
     39      */
     40     public boolean getResolved();
     41 
     42     /**
     43      *  The clock value in seconds relative to the parent time container begin.
     44      *  This indicates the resolved time relationship to the parent time
     45      * container.  This is only valid if resolved is true.
     46      */
     47     public double getResolvedOffset();
     48 
     49     // TimeTypes
     50     public static final short SMIL_TIME_INDEFINITE      = 0;
     51     public static final short SMIL_TIME_OFFSET          = 1;
     52     public static final short SMIL_TIME_SYNC_BASED      = 2;
     53     public static final short SMIL_TIME_EVENT_BASED     = 3;
     54     public static final short SMIL_TIME_WALLCLOCK       = 4;
     55     public static final short SMIL_TIME_MEDIA_MARKER    = 5;
     56 
     57     /**
     58      *  A code representing the type of the underlying object, as defined
     59      * above.
     60      */
     61     public short getTimeType();
     62 
     63     /**
     64      *  The clock value in seconds relative to the syncbase or eventbase.
     65      * Default value is <code>0</code> .
     66      * @exception DOMException
     67      *    NO_MODIFICATION_ALLOWED_ERR: Raised on attempts to modify this
     68      *   readonly attribute.
     69      */
     70     public double getOffset();
     71     public void setOffset(double offset)
     72                                       throws DOMException;
     73 
     74     /**
     75      *  The base element for a sync-based or event-based time.
     76      * @exception DOMException
     77      *    NO_MODIFICATION_ALLOWED_ERR: Raised on attempts to modify this
     78      *   readonly attribute.
     79      */
     80     public Element getBaseElement();
     81     public void setBaseElement(Element baseElement)
     82                                       throws DOMException;
     83 
     84     /**
     85      *  If <code>true</code> , indicates that a sync-based time is relative to
     86      * the begin of the baseElement.  If <code>false</code> , indicates that a
     87      *  sync-based time is relative to the active end of the baseElement.
     88      * @exception DOMException
     89      *    NO_MODIFICATION_ALLOWED_ERR: Raised on attempts to modify this
     90      *   readonly attribute.
     91      */
     92     public boolean getBaseBegin();
     93     public void setBaseBegin(boolean baseBegin)
     94                                       throws DOMException;
     95 
     96     /**
     97      *  The name of the event for an event-based time. Default value is
     98      * <code>null</code> .
     99      * @exception DOMException
    100      *    NO_MODIFICATION_ALLOWED_ERR: Raised on attempts to modify this
    101      *   readonly attribute.
    102      */
    103     public String getEvent();
    104     public void setEvent(String event)
    105                                       throws DOMException;
    106 
    107     /**
    108      *  The name of the marker from the media element, for media marker times.
    109      * Default value is <code>null</code> .
    110      * @exception DOMException
    111      *    NO_MODIFICATION_ALLOWED_ERR: Raised on attempts to modify this
    112      *   readonly attribute.
    113      */
    114     public String getMarker();
    115     public void setMarker(String marker)
    116                                       throws DOMException;
    117 
    118 }
    119 
    120