001/**
002 * Portions Copyright 2001 Sun Microsystems, Inc.
003 * Portions Copyright 1999-2001 Language Technologies Institute, 
004 * Carnegie Mellon University.
005 * All Rights Reserved.  Use is subject to license terms.
006 * 
007 * See the file "license.terms" for information on usage and
008 * redistribution of this file, and for a DISCLAIMER OF ALL 
009 * WARRANTIES.
010 */
011package com.sun.speech.freetts;
012
013import org.w3c.dom.Document;
014import java.io.InputStream;
015
016/**
017 * Represents something that should be spoken.
018 */
019public interface FreeTTSSpeakable {
020
021    /**
022     * Indicates that this speakable has been started.
023     */
024    public void started();
025
026    /**
027     * Indicates that this speakable has been completed.
028     */
029    public void completed();
030
031    /**
032     * Indicates that this speakable has been cancelled.
033     */
034    public void cancelled();
035
036    /**
037     * Returns <code>true</code> if this queue item has been 
038     * processed.
039     *
040     * @return true if it has been processed
041     */
042    public boolean isCompleted();
043
044    /**
045     * Waits for this speakable item to be completed.
046     *
047     * @return true if the item was completed successfully, false if
048     *   the speakable was cancelled or an error occurred.
049     */
050    public boolean waitCompleted();
051
052   /**
053    * Returns <code>true</code> if the item contains plain text
054    * (not Java Speech Markup Language text).
055    *
056    * @return true if the item contains plain text
057    */
058    public boolean isPlainText();
059
060   /**
061    * Returns <code>true</code> if the item is an input stream.
062    *
063    * @return true if the item is an input stream
064    */
065    public boolean isStream();
066
067   /**
068    * Returns <code>true</code> if the item is a JSML document
069    * (Java Speech Markup Language).
070    *
071    * @return true if the item is a document
072    */
073    public boolean isDocument();
074
075    /**
076     * Returns the text corresponding to this Playable.
077     *
078     * @return the Playable text
079     */
080    public String getText();
081
082    /**
083     * Gets the DOM document for this object.
084     *
085     * @return the DOM document for this object
086     */
087    public Document getDocument();
088
089    /**
090     * Gets the input stream
091     *
092     * @return the input stream
093     */
094    public InputStream getInputStream();
095}