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.AbstractEarcons');
14 goog
.require('cvox.AbstractHost');
15 goog
.require('cvox.AbstractMathJax');
16 goog
.require('cvox.AbstractTts');
22 cvox
.HostFactory = function() {};
26 * @return {cvox.AbstractHost}
28 cvox
.HostFactory
.getHost = function() {
29 return new cvox
.HostFactory
.hostConstructor
;
33 * Returns the TTS interface.
34 * @return {cvox.TtsInterface} The TTS engine.
36 cvox
.HostFactory
.getTts = function() {
37 return new cvox
.HostFactory
.ttsConstructor
;
41 * Returns the Braille interface.
42 * @return {cvox.BrailleInterface} The Braille interface.
44 cvox
.HostFactory
.getBraille = function() {
45 return new cvox
.HostFactory
.brailleConstructor
;
49 * Returns the earcons interface.
50 * @return {cvox.AbstractEarcons}
52 cvox
.HostFactory
.getEarcons = function() {
53 return new cvox
.HostFactory
.earconsConstructor
;
57 * Returns the MathJax interface.
58 * @return {cvox.MathJaxInterface} The MathJax interface.
60 cvox
.HostFactory
.getMathJax = function() {
61 return new cvox
.HostFactory
.mathJaxConstructor
;
65 * @type {function (new:cvox.AbstractHost)}
67 cvox
.HostFactory
.hostConstructor
;
70 * @type {function (new:cvox.TtsInterface)}
72 cvox
.HostFactory
.ttsConstructor
;
75 * @type {function (new:cvox.BrailleInterface)}
77 cvox
.HostFactory
.brailleConstructor
;
80 * @type {function (new:cvox.AbstractEarcons)}
82 cvox
.HostFactory
.earconsConstructor
;
86 * @type {function (new:cvox.AbstractMathJax)}
88 cvox
.HostFactory
.mathJaxConstructor
;