1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 * @fileoverview A host factory. This factory allows us to decouple the
8 * cvox.Host|Tts|... creatation from the main ChromeVox code.
11 goog.provide('cvox.HostFactory');
13 goog.require('cvox.AbstractBraille');
14 goog.require('cvox.AbstractEarcons');
15 goog.require('cvox.AbstractHost');
16 goog.require('cvox.AbstractMathJax');
17 goog.require('cvox.AbstractTts');
23 cvox.HostFactory = function() {};
27 * @return {cvox.AbstractHost}
29 cvox.HostFactory.getHost = function() {
30 return new cvox.HostFactory.hostConstructor;
34 * Returns the TTS interface.
35 * @return {cvox.TtsInterface} The TTS engine.
37 cvox.HostFactory.getTts = function() {
38 return new cvox.HostFactory.ttsConstructor;
42 * Returns the Braille interface.
43 * @return {cvox.BrailleInterface} The Braille interface.
45 cvox.HostFactory.getBraille = function() {
46 return new cvox.HostFactory.brailleConstructor;
50 * Returns the earcons interface.
51 * @return {cvox.AbstractEarcons}
53 cvox.HostFactory.getEarcons = function() {
54 return new cvox.HostFactory.earconsConstructor;
58 * Returns the MathJax interface.
59 * @return {cvox.MathJaxInterface} The MathJax interface.
61 cvox.HostFactory.getMathJax = function() {
62 return new cvox.HostFactory.mathJaxConstructor;
66 * @type {function (new:cvox.AbstractHost)}
68 cvox.HostFactory.hostConstructor;
71 * @type {function (new:cvox.TtsInterface)}
73 cvox.HostFactory.ttsConstructor;
76 * @type {function (new:cvox.BrailleInterface)}
78 cvox.HostFactory.brailleConstructor;
81 * @type {function (new:cvox.AbstractEarcons)}
83 cvox.HostFactory.earconsConstructor;
87 * @type {function (new:cvox.AbstractMathJax)}
89 cvox.HostFactory.mathJaxConstructor;