nav_math_description.js revision 116680a4aac90f2aa7413d9095a592090648e557
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 * @fileoverview A subclass of the navigation description container
7 * specialising on math objects.
8 *
9 */
10
11
12goog.provide('cvox.NavMathDescription');
13
14goog.require('cvox.NavDescription');
15
16
17/**
18 * Class specialising navigation descriptions for mathematics.
19 * @param {{context: (undefined|string),
20 *          text: (string),
21 *          userValue: (undefined|string),
22 *          annotation: (undefined|string),
23 *          earcons: (undefined|Array.<number>),
24 *          personality: (undefined|Object),
25 *          hint: (undefined|string),
26 *          category: (undefined|string),
27 *          domain: (undefined|string),
28 *          style: (undefined|string)}} kwargs The arguments for
29 * the specialised math navigationdescription. See arguments of nav
30 * description plus the following:
31 * domain Domain for translation.
32 * style Style for translation.
33 * @constructor
34 * @extends {cvox.NavDescription}
35 */
36cvox.NavMathDescription = function(kwargs) {
37  goog.base(this, kwargs);
38
39  var newPersonality = this.personality ? this.personality : {};
40  var mathDescr = new Object();
41
42  mathDescr['domain'] = kwargs.domain ? kwargs.domain : '';
43  // TODO (sorge) Collate and document styles in an enum structure.
44  mathDescr['style'] = kwargs.style ? kwargs.style : '';
45  newPersonality['math'] = mathDescr;
46  this.personality = newPersonality;
47};
48goog.inherits(cvox.NavMathDescription, cvox.NavDescription);
49