Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / resources / chromeos / chromevox / host / interface / tts_interface.js
index c575aa4..9a1b63d 100644 (file)
@@ -9,8 +9,43 @@
  *
  */
 
-goog.provide('cvox.TtsInterface');
+goog.provide('cvox.QueueMode');
 goog.provide('cvox.TtsCapturingEventListener');
+goog.provide('cvox.TtsCategory');
+goog.provide('cvox.TtsInterface');
+
+/**
+ * Categories for a speech utterance. This can be used with the
+ * CATEGORY_FLUSH queue mode, which flushes all utterances from a given
+ * category but not other utterances.
+ *
+ * NAV: speech related to explicit navigation, or focus changing.
+ * LIVE: speech coming from changes to live regions.
+ *
+ * @enum {string}
+ */
+cvox.TtsCategory = {
+  LIVE: 'live',
+  NAV: 'nav'
+};
+
+/**
+ * Queue modes for calls to {@code cvox.TtsInterface.speak}.
+ * @enum
+ */
+cvox.QueueMode = {
+  /** Stop speech, clear everything, then speak this utterance. */
+  FLUSH: 0,
+
+  /** Append this utterance to the end of the queue. */
+  QUEUE: 1,
+
+  /**
+   * Clear any utterances of the same category (as set by
+   * properties['category']) from the queue, then enqueue this utterance.
+   */
+  CATEGORY_FLUSH: 2
+};
 
 /**
  * @interface
@@ -38,8 +73,7 @@ cvox.TtsInterface = function() { };
 /**
  * Speaks the given string using the specified queueMode and properties.
  * @param {string} textString The string of text to be spoken.
- * @param {number=} queueMode The queue mode: cvox.AbstractTts.QUEUE_MODE_FLUSH
- *        for flush, cvox.AbstractTts.QUEUE_MODE_QUEUE for adding to queue.
+ * @param {cvox.QueueMode} queueMode The queue mode to use for speaking.
  * @param {Object=} properties Speech properties to use for this utterance.
  * @return {cvox.TtsInterface} A tts object useful for chaining speak calls.
  */