upstream version 1.2.2
[debian/freetts] / com / sun / speech / freetts / FreeTTSSpeakable.java
1 /**
2  * Portions Copyright 2001 Sun Microsystems, Inc.
3  * Portions Copyright 1999-2001 Language Technologies Institute, 
4  * Carnegie Mellon University.
5  * All Rights Reserved.  Use is subject to license terms.
6  * 
7  * See the file "license.terms" for information on usage and
8  * redistribution of this file, and for a DISCLAIMER OF ALL 
9  * WARRANTIES.
10  */
11 package com.sun.speech.freetts;
12
13 import org.w3c.dom.Document;
14 import java.io.InputStream;
15
16 /**
17  * Represents something that should be spoken.
18  */
19 public interface FreeTTSSpeakable {
20
21     /**
22      * Indicates that this speakable has been started.
23      */
24     public void started();
25
26     /**
27      * Indicates that this speakable has been completed.
28      */
29     public void completed();
30
31     /**
32      * Indicates that this speakable has been cancelled.
33      */
34     public void cancelled();
35
36     /**
37      * Returns <code>true</code> if this queue item has been 
38      * processed.
39      *
40      * @return true if it has been processed
41      */
42     public boolean isCompleted();
43
44     /**
45      * Waits for this speakable item to be completed.
46      *
47      * @return true if the item was completed successfully, false if
48      *   the speakable was cancelled or an error occurred.
49      */
50     public boolean waitCompleted();
51
52    /**
53     * Returns <code>true</code> if the item contains plain text
54     * (not Java Speech Markup Language text).
55     *
56     * @return true if the item contains plain text
57     */
58     public boolean isPlainText();
59
60    /**
61     * Returns <code>true</code> if the item is an input stream.
62     *
63     * @return true if the item is an input stream
64     */
65     public boolean isStream();
66
67    /**
68     * Returns <code>true</code> if the item is a JSML document
69     * (Java Speech Markup Language).
70     *
71     * @return true if the item is a document
72     */
73     public boolean isDocument();
74
75     /**
76      * Returns the text corresponding to this Playable.
77      *
78      * @return the Playable text
79      */
80     public String getText();
81
82     /**
83      * Gets the DOM document for this object.
84      *
85      * @return the DOM document for this object
86      */
87     public Document getDocument();
88
89     /**
90      * Gets the input stream
91      *
92      * @return the input stream
93      */
94     public InputStream getInputStream();
95 }