Module BasicBrailleScript :: Class BasicBrailleScript
[hide private]
[frames] | no frames]

Class BasicBrailleScript

source code

                                  object --+            
                                           |            
AccessEngine.AEUserInterface.AEUserInterface --+        
                                               |        
                  AccessEngine.AEScript.AEScript --+    
                                                   |    
                   AccessEngine.AEScript.EventScript --+
                                                       |
                                                      BasicBrailleScript

Defines a default braille user interface.

Nested Classes [hide private]
AEState class STATE
Class to instantiate and use to store state information across all instances of this AEScript.
Instance Methods [hide private]
 
init(self)
Registers tasks to handle focus, caret, selector, state, and property change events.
source code
 
close(self)
Unregisters commands.
source code
string
getDescription(self)
Provides a localized description of this AccessEngine.AEScript to be shown in SettingsChooser and ScriptChooser.
source code
string
getName(self)
Provides the localized name of this AccessEngine.AEScript.
source code
 
setAbsCaretPos(self, pos)
Set absolute caret position
source code
Integer
getRelCaretPos(self, totalcells, por, layer)
Get relative (to device display) caret position
source code
int
getLeftSlice(self, totalcells, por, layer)
Get the leftmost slice indice for the current braille output
source code
 
handleLineEnd(self, **kwargs)
Moves caret to last cell in current line of text, redraws braille display.
source code
 
handleHome(self, **kwargs)
Moves caret to first cell of first line, redraws braille display
source code
 
handleLineBegin(self, **kwargs)
Moves caret to first cell in current line of text, redraws braille display
source code
 
handleTouchCursor(self, argument=None, **kwargs)
Sets caret at given location in text accessibles or left clicks the center of the given accessible.
source code
 
handleScrollForward(self, **kwargs)
Scrolls Braille viewport to right
source code
 
handleScrollBackward(self, **kwargs)
Scrolls Braille viewport to left
source code
 
handlePageForward(self, **kwargs)
Scrolls Braille viewport to right one display length minus overlap
source code
 
handlePageBackward(self, **kwargs)
Scrolls Braille viewport to left one display length minus overlap
source code
boolean
onFocusGained(self, **kwargs)
Task that handles a AEEvent.FocusChange.
source code
boolean
onSelectorActive(self, por, text, **kwargs)
Announces the text of the active item.
source code
boolean
onCaretInserted(self, por, text, text_offset, **kwargs)
Outputs the entire text to braille display in a managed fashion (overlaps, caret position, padding etc.).
source code
boolean
onCaretMoved(self, **kwargs)
Outputs the entire text to braille display in a managed fashion (overlaps, caret position, padding etc.).
source code
boolean
onCaretDeleted(self, **kwargs)
Outputs the entire text to braille display in a managed fashion (overlaps, caret position, padding etc.).
source code
 
updateOnCaretChange(self, por, text, text_offset, added, **kwargs)
Updates state variables and relies on other methods to handle any output.
source code
 
outputText(self, **kwargs)
Outputs the current text to all Braille devices found.
source code
 
handleReview(self, **kwargs)
Synchronizes the Braille display with the text at the pointer when reviewing.
source code
 
handlePointerToFocus(self, **kwargs)
Synchronizes the Braille display with the text at the focus when the pointer is warped back to the caret.
source code
 
brailleText(self, text=None, **kwargs)
Outputs item text to Braille display.
source code

Inherited from AccessEngine.AEScript.EventScript: chainNewEventTaskAround, executeAroundTask, onCaretChange, onChildAdded, onChildRemoved, onChildrenChange, onChooserChange, onChooserEnd, onChooserSignal, onChooserStart, onFocusChange, onFocusLost, onMouseChange, onMouseMoved, onMousePressed, onMouseReleased, onPropertyChange, onScreenChange, onScreenReflowed, onScreenRefreshed, onScreenResized, onSelectorAdded, onSelectorChange, onSelectorRemoved, onSelectorText, onStateChange, onTableChange, onTableColumnDeleted, onTableColumnInserted, onTableColumnReordered, onTableRowDeleted, onTableRowInserted, onTableRowReordered, onViewChange, onViewFirstGained, onViewGained, onViewLost, onViewStartup, registerEventTask, unregisterEventTask, updateAroundTask, updateOnChildrenChange, updateOnFocusChange, updateOnMouseChange, updateOnPropertyChange, updateOnScreenChange, updateOnSelectorChange, updateOnStateChange, updateOnTableChange, updateOnViewChange

Inherited from AccessEngine.AEScript.AEScript: __init__, bindToEvent, chainTask, doCyclicInputTask, doTask, getAETier, getAnchorScriptClassName, getAnchorTaskId, getChainSegment, getChooserTask, getCommandTask, getEventTasks, getIdealOutput, getLastKey, getOutputDevices, getPointerPOR, getRegisteredTask, getScriptSetting, getScriptSettingVal, getState, getTaskKeys, getTempData, getVirtualPOR, mergeChain, postClose, preInit, registerChooserTask, registerCommand, registerCyclicInputTask, registerCyclicInputTasks, registerModifiers, registerTask, registerTimerTask, setIdealOutput, setPointerPOR, setScriptSettingVal, setTempData, setVirtualPOR, unbindFromEvent, unchainTask, unregisterChooserTask, unregisterCommand, unregisterCyclicInputTask, unregisterModifiers, unregisterTask, unregisterTaskFromCyclicInputTask, unregisterTimerTask

Inherited from AccessEngine.AEUserInterface.AEUserInterface: getClassName, getPath

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Instance Variables [hide private]
integer abscaretpos
Index of the caret position within current_text
string current_text
String containing current item accessible on the Braille display.
integer left_slice
Left slice index for current_text including scroll offset
integer pre_left_slice
Left slice index into current_text before scroll_offset
integer scroll_offset
Scroll offset relative to pre_left_slice

Inherited from AccessEngine.AEScript.AEScript: after_chains, around_chains, around_tasks, before_chains, chooser_tasks, command_descriptions, commands, cyclic_input_tasks, def_out, event_tasks, out_caps, registered_modifiers, registered_tasks, state, tier

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

init(self)

source code 
Registers tasks to handle focus, caret, selector, state, and property change events.
Overrides: AccessEngine.AEScript.AEScript.init

close(self)

source code 
Unregisters commands.
Overrides: AccessEngine.AEScript.AEScript.close

getDescription(self)

source code 
Provides a localized description of this AccessEngine.AEScript to be shown in SettingsChooser and ScriptChooser.
Returns: string
Description of this component. Defaults to the first paragraph (all lines up to the first blank line) in its class docstring.
Overrides: AccessEngine.AEUserInterface.AEUserInterface.getDescription

getName(self)

source code 
Provides the localized name of this AccessEngine.AEScript.
Returns: string
Human readable name of this object. Defaults to its class name.
Overrides: AccessEngine.AEUserInterface.AEUserInterface.getName

getRelCaretPos(self, totalcells, por, layer)

source code 
Get relative (to device display) caret position
Returns: Integer
caret position

getLeftSlice(self, totalcells, por, layer)

source code 
Get the leftmost slice indice for the current braille output
Returns: int
Left slice index

handleLineEnd(self, **kwargs)

source code 
Moves caret to last cell in current line of text, redraws braille display.

Note: getEndOfHardLine skews offset one cell on last line, probably an error

handleTouchCursor(self, argument=None, **kwargs)

source code 
Sets caret at given location in text accessibles or left clicks the center of the given accessible.
Parameters:
  • argument (int) -

Note: MW: LSR developers used to set the caret by generating a mouse event on that new caret position. This did not work in a text area where we do not want to perfom a left click on the center of a component but set the caret to a certain position within a line of text. Instead setAccCaret() is called to set the caret to its new position. This module needs testing for the component case - where do we decide which action to take? (See Bug#13)

onFocusGained(self, **kwargs)

source code 
Task that handles a AEEvent.FocusChange.
Returns: boolean
True to allow other tasks to process this event
Overrides: AccessEngine.AEScript.EventScript.onFocusGained

onSelectorActive(self, por, text, **kwargs)

source code 
Announces the text of the active item.
Parameters:
  • por (AEPor) - Point of regard where the selection event occurred
  • text (string) - The text of the active item
Returns: boolean
Should processing continue? Always returns True by default.
Overrides: AccessEngine.AEScript.EventScript.onSelectorActive

Note: One way to create this event was by placing the pointer por to virtual por.

onCaretInserted(self, por, text, text_offset, **kwargs)

source code 
Outputs the entire text to braille display in a managed fashion (overlaps, caret position, padding etc.). Snaps to original position (before any scrolling) if requested.
Parameters:
  • por (AEPor) - Point of regard where the caret event occurred
  • text (string) - The text inserted
  • text_offset (integer) - The offset of the inserted text
Returns: boolean
True to allow other tasks to process this event
Overrides: AccessEngine.AEScript.EventScript.onCaretInserted

onCaretMoved(self, **kwargs)

source code 
Outputs the entire text to braille display in a managed fashion (overlaps, caret position, padding etc.). Snaps to original position (before any scrolling) if requested.
Returns: boolean
True to allow other tasks to process this event
Overrides: AccessEngine.AEScript.EventScript.onCaretMoved

Note: This method does exactly the same as onCaretInserted(), so we're calling this one instead of programming things twice.

onCaretDeleted(self, **kwargs)

source code 
Outputs the entire text to braille display in a managed fashion (overlaps, caret position, padding etc.). Snaps to original position (before any scrolling) if requested.
Returns: boolean
True to allow other tasks to process this event
Overrides: AccessEngine.AEScript.EventScript.onCaretDeleted

Note: This method does exactly the same as onCaretInserted(), so we're calling this one instead of programming things twice.

updateOnCaretChange(self, por, text, text_offset, added, **kwargs)

source code 
Updates state variables and relies on other methods to handle any output.
Parameters:
  • por (AEPor) - Point of regard where the caret event occurred
  • text (string) - The text inserted, deleted or the line of the caret
  • text_offset (integer) - The offset of the inserted/deleted text or the line offset when movement only
  • added (boolean) - True when text added, False when text deleted, and None when event is for caret movement only
Overrides: AccessEngine.AEScript.EventScript.updateOnCaretChange

outputText(self, **kwargs)

source code 
Outputs the current text to all Braille devices found. Relays caret position and truncation information to device.

brailleText(self, text=None, **kwargs)

source code 
Outputs item text to Braille display. This method should be called from custom scripts when braille output is desired.

Instance Variable Details [hide private]

current_text

String containing current item accessible on the Braille display. Managed to support scrolling.
Type:
string