OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview A subclass of the navigation description container | 6 * @fileoverview A subclass of the navigation description container |
7 * specialising on math objects. | 7 * specialising on math objects. |
8 * | 8 * |
9 */ | 9 */ |
10 | 10 |
11 | 11 |
12 goog.provide('cvox.NavMathDescription'); | 12 goog.provide('cvox.NavMathDescription'); |
13 | 13 |
14 goog.require('cvox.NavDescription'); | 14 goog.require('cvox.NavDescription'); |
15 | 15 |
16 | 16 |
17 /** | 17 /** |
18 * Class specialising navigation descriptions for mathematics. | 18 * Class specialising navigation descriptions for mathematics. |
19 * @param {{context: (undefined|string), | 19 * @param {{context: (undefined|string), |
20 * text: (string), | 20 * text: (string), |
21 * userValue: (undefined|string), | 21 * userValue: (undefined|string), |
22 * annotation: (undefined|string), | 22 * annotation: (undefined|string), |
23 * earcons: (undefined|Array<number>), | 23 * earcons: (undefined|Array<cvox.Earcon>), |
24 * personality: (undefined|Object), | 24 * personality: (undefined|Object), |
25 * hint: (undefined|string), | 25 * hint: (undefined|string), |
26 * category: (undefined|string), | 26 * category: (undefined|string), |
27 * domain: (undefined|string), | 27 * domain: (undefined|string), |
28 * style: (undefined|string)}} kwargs The arguments for | 28 * style: (undefined|string)}} kwargs The arguments for |
29 * the specialised math navigationdescription. See arguments of nav | 29 * the specialised math navigationdescription. See arguments of nav |
30 * description plus the following: | 30 * description plus the following: |
31 * domain Domain for translation. | 31 * domain Domain for translation. |
32 * style Style for translation. | 32 * style Style for translation. |
33 * @constructor | 33 * @constructor |
34 * @extends {cvox.NavDescription} | 34 * @extends {cvox.NavDescription} |
35 */ | 35 */ |
36 cvox.NavMathDescription = function(kwargs) { | 36 cvox.NavMathDescription = function(kwargs) { |
37 goog.base(this, kwargs); | 37 goog.base(this, kwargs); |
38 | 38 |
39 var newPersonality = this.personality ? this.personality : {}; | 39 var newPersonality = this.personality ? this.personality : {}; |
40 var mathDescr = new Object(); | 40 var mathDescr = new Object(); |
41 | 41 |
42 mathDescr['domain'] = kwargs.domain ? kwargs.domain : ''; | 42 mathDescr['domain'] = kwargs.domain ? kwargs.domain : ''; |
43 // TODO (sorge) Collate and document styles in an enum structure. | 43 // TODO (sorge) Collate and document styles in an enum structure. |
44 mathDescr['style'] = kwargs.style ? kwargs.style : ''; | 44 mathDescr['style'] = kwargs.style ? kwargs.style : ''; |
45 newPersonality['math'] = mathDescr; | 45 newPersonality['math'] = mathDescr; |
46 this.personality = newPersonality; | 46 this.personality = newPersonality; |
47 }; | 47 }; |
48 goog.inherits(cvox.NavMathDescription, cvox.NavDescription); | 48 goog.inherits(cvox.NavMathDescription, cvox.NavDescription); |
OLD | NEW |