Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / resources / chromeos / chromevox / host / interface / host_factory.js
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.
4
5
6 /**
7  * @fileoverview A host factory.  This factory allows us to decouple the
8  * cvox.Host|Tts|... creatation from the main ChromeVox code.
9  */
10
11 goog.provide('cvox.HostFactory');
12
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');
18
19
20 /**
21  * @constructor
22  */
23 cvox.HostFactory = function() {};
24
25 /**
26  * Returns the host.
27  * @return {cvox.AbstractHost}
28  */
29 cvox.HostFactory.getHost = function() {
30   return new cvox.HostFactory.hostConstructor;
31 };
32
33 /**
34  * Returns the TTS interface.
35  * @return {cvox.TtsInterface} The TTS engine.
36  */
37 cvox.HostFactory.getTts = function() {
38   return new cvox.HostFactory.ttsConstructor;
39 };
40
41 /**
42  * Returns the Braille interface.
43  * @return {cvox.BrailleInterface} The Braille interface.
44  */
45 cvox.HostFactory.getBraille = function() {
46   return new cvox.HostFactory.brailleConstructor;
47 };
48
49 /**
50  * Returns the earcons interface.
51  * @return {cvox.AbstractEarcons}
52  */
53 cvox.HostFactory.getEarcons = function() {
54   return new cvox.HostFactory.earconsConstructor;
55 };
56
57 /**
58  * Returns the MathJax interface.
59  * @return {cvox.MathJaxInterface} The MathJax interface.
60  */
61 cvox.HostFactory.getMathJax = function() {
62   return new cvox.HostFactory.mathJaxConstructor;
63 };
64
65 /**
66  * @type {function (new:cvox.AbstractHost)}
67  */
68 cvox.HostFactory.hostConstructor;
69
70 /**
71  * @type {function (new:cvox.TtsInterface)}
72  */
73 cvox.HostFactory.ttsConstructor;
74
75 /**
76  * @type {function (new:cvox.BrailleInterface)}
77  */
78 cvox.HostFactory.brailleConstructor;
79
80 /**
81  * @type {function (new:cvox.AbstractEarcons)}
82  */
83 cvox.HostFactory.earconsConstructor;
84
85
86 /**
87  * @type {function (new:cvox.AbstractMathJax)}
88  */
89 cvox.HostFactory.mathJaxConstructor;