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_keypressfor 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).
keyis the keycode for the key (in JavaScript,ev.key_code) The spoken text for the new current node is returned. - Get the braille associated with the MathML that was set by
set_mathml. The braille returned depends upon the preference for thecodepreference (defaultNemeth). If ‘nav_node_id’ is given, it is highlighted based on the value ofBrailleNavHighlight(default:EndPoints) - Return the start and end braille character positions associated with the current (navigation) node.
- Get the braille associated with the current navigation focus of the MathML that was set by
set_mathml. The braille returned depends upon the preference for thecodepreference (defaultNemeth). The returned braille is brailled as if the current navigation focus is the entire expression to be brailled. - Return the MathML associated with the current (navigation) node and the offset (0-based) from that mathml (not yet implemented) The offset is needed for token elements that have multiple characters.
- Return the
idandoffset(0-based) associated with the current (navigation) node.offset(not yet implemented) The offset is needed for token elements that have multiple characters. - Given a 0-based braille position, return the smallest MathML node enclosing it. This node might be a leaf with an offset.
- 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
nameis 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
BookmarkAPI preference is true. - Given an ‘id’ and an offset (for tokens), set the navigation node to that id. An error is returned if the ‘id’ doesn’t exist
- 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. If ‘dir’ is an empty string, the envirnoment var ‘MathCATRulesDir’ is tried.
- Not really meant to be public – used by tests in some packages