mathjax_interface.js revision cedac228d2dd51db4b79ea1e72c7f249408ee061
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 Interface of ChromeVox's bridge to MathJax.
7 *
8 */
9
10goog.provide('cvox.MathJaxInterface');
11
12
13/**
14 * @interface
15 */
16cvox.MathJaxInterface = function() { };
17
18
19/**
20 * True if MathJax is injected in a page.
21 * @param {function(boolean)} callback A function with the active status as
22 *    argument.
23 */
24cvox.MathJaxInterface.prototype.isMathjaxActive = function(callback) { };
25
26
27/**
28 * Get MathML for all MathJax nodes that already exist by applying the callback
29 * to every single MathJax node.
30 * @param {function(Node, string)} callback A function taking a node and an id
31 * string.
32 */
33cvox.MathJaxInterface.prototype.getAllJax = function(callback) { };
34
35
36/**
37 * Registers a persistent callback function to be executed by Mathjax on the
38 * given signal.
39 * @param {function(Node, string)} callback A function taking a node and an id
40 * string.
41 * @param {string} signal The Mathjax signal to fire the callback.
42 */
43cvox.MathJaxInterface.prototype.registerSignal = function(callback, signal) { };
44
45
46/**
47 * Injects some minimalistic MathJax script into the page to translate LaTeX
48 * expressions.
49 */
50cvox.MathJaxInterface.prototype.injectScripts = function() { };
51
52
53/**
54 * Loads configurations for MediaWiki pages (e.g., Wikipedia).
55 */
56cvox.MathJaxInterface.prototype.configMediaWiki = function() { };
57
58
59/**
60 * Get MathML representation of images with tex or latex class if it has an
61 * alt text or title.
62 * @param {function(Node, string)} callback A function taking a MathML node and
63 * an id string.
64 * @param {Node} texNode Node with img tag and tex or latex class.
65 */
66cvox.MathJaxInterface.prototype.getTex = function(callback, texNode) { };
67
68
69/**
70 * Get MathML representation of images that have asciiMath in alt text.
71 * @param {function(Node, string)} callback A function taking a MathML node and
72 *     an id string.
73 * @param {Node} asciiMathNode Node with img tag and class of numberedequation,
74 *     inlineformula, or displayformula.
75 */
76cvox.MathJaxInterface.prototype.getAsciiMath = function(
77    callback, asciiMathNode) { };
78