Module libmathcat::interface

source ·
Expand description

The interface module provides functionality both for calling from an API and also running the code from main.

Constants

  • The current node being navigated (also spoken and brailled) is stored in MATHML_INSTANCE.

Functions

  • Given a navigation command, the current node is moved accordingly. This is a higher level interface than do_navigate_keypress for applications that want to interpret the keys themselves. The valid commands are:
  • Given a key code along with the modifier keys, the current node is moved accordingly (or value reported in some cases). key is the keycode for the key (in JavaScript, ev.key_code) The spoken text for the new current node is returned.
  • Convert the returned error from set_mathml, etc., to a useful string for display
  • Get the braille associated with the MathML that was set by set_mathml. The braille returned depends upon the preference for the code preference (default Nemeth).
  • Return the MathML associated with the current (navigation) node. The returned result is the id of the node and the offset (0-based) from that node (not yet implemented) The offset is needed for token elements that have multiple characters.
  • Return the id and offset (0-based) associated with the current (navigation) node. offset (not yet implemented) The offset is needed for token elements that have multiple characters.
  • Get the spoken text for an overview of the MathML that was set. The speech takes into account any AT or user preferences. Note: this implementation for is currently minimal and should not be used.
  • Get the value of the named preference. None is returned if name is not a known preference.
  • Get the spoken text of the MathML that was set. The speech takes into account any AT or user preferences.
  • Returns the version number (from Cargo.toml) of the build
  • returns Ok() if two Documents are equal or some info where they differ in the Err
  • This will override any previous MathML that was set. This returns canonical MathML with ’id’s set on any node that doesn’t have an id. The ids can be used for sync highlighting if the Bookmark API preference is true.
  • Set a MathCAT preference. The preference name should be a known preference name. The value should either be a string or a number (depending upon the preference being set) The list of known user preferences is in the MathCAT user documentation. Here are common preferences set by programs (not settable by the user):
  • Set the Rules directory IMPORTANT: this should be the very first call to MathCAT unless the environment var MathCATRulesDir is set
  • Not really meant to be public – used by tests in some packages