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

Class GEditScript

source code

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

A special AEScript for gedit. This class register tasks that handle the check spelling dialog and document statistics dialog. It also defines hotkeys. Caps-Lock+K reads the current misspelled word in the context of the spell check dialog. Caps-Lock+I reads the line containing the misspelled word.

Instance Methods [hide private]
 
init(self)
Registers event_tasks to handle focus, caret and property change events.
source code
string
getDescription(self)
Describe which AETier this script applies to by default.
source code
boolean
_isDocument(self, por)
Check if por is in the document.
source code
boolean
_isStatistic(self, por)
Check if por is in the statistic dialog.
source code
 
_sayStatistic(self, rootPor, **kwargs)
Read all information on the statistic dialog in a sensible order.
source code
 
readStatisticDialog(self, **kwargs)
Reads the documents statistics dialog.
source code
boolean
_isSpelling(self, por)
Check if por is in the spelling dialog.
source code
 
_saySpelling(self, por)
Read the misspelled word.
source code
 
readSpellingDialog(self, **kwargs)
Reads the misspelled word in the spelling dialog when it first appears.
source code
 
readMisspelledWord(self, **kwargs)
Reads the misspelled word whenever the user presses a hotkey.
source code
 
readMisspelledContext(self, **kwargs)
Reads the line containing the misspelled word.
source code
boolean
onFocusLost(self, **kwargs)
Keeps track of the AEPor to the misspelled word.
source code
boolean
onCaretMoved(self, **kwargs)
Keeps track of the AEPor to the misspelled word.
source code
boolean
onStateChange(self, **kwargs)
Monitors state changes on the table to determine if a word is misspelled or correct.
source code

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

Inherited from AccessEngine.AEScript.AEScript: __init__, bindToEvent, chainTask, close, 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, getName, getPath

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

Class Variables [hide private]

Inherited from AccessEngine.AEScript.AEScript: STATE

Instance Variables [hide private]
string context
Context of the current cursor position.
boolean spelling
Is the spell check dialog active?

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 event_tasks to handle focus, caret and property change events. Registers tasks that can be mapped to AEInput.Gestures.
Overrides: AccessEngine.AEScript.AEScript.init

getDescription(self)

source code 
Describe which AETier this script applies to by default.
Returns: string
Human readable translated description of this script.
Overrides: AccessEngine.AEUserInterface.AEUserInterface.getDescription

_isDocument(self, por)

source code 
Check if por is in the document.
Parameters:
  • por (AEPor) - Point of regard for the related accessible
Returns: boolean
True if por is in the document.

_isStatistic(self, por)

source code 
Check if por is in the statistic dialog.
Parameters:
  • por (AEPor) - Point of regard for the related accessible
Returns: boolean
True if por is in the statistic dialog, False if not.

_sayStatistic(self, rootPor, **kwargs)

source code 
Read all information on the statistic dialog in a sensible order.
Parameters:
  • rootPor (AEPor) - Point of regard for the related accessible
  • kwargs (dictionary) - Arbitrary keyword arguments to pass to the task

readStatisticDialog(self, **kwargs)

source code 
Reads the documents statistics dialog.
Parameters:
  • kwargs (dictionary) - Arbitrary keyword arguments to pass to the task

To Do: we should say the labels as row and column headers, at least for the first row

_isSpelling(self, por)

source code 
Check if por is in the spelling dialog.
Parameters:
  • por (AEPor) - Point of regard for the related accessible
Returns: boolean
True if por in the spelling dialog, False if not.

_saySpelling(self, por)

source code 
Read the misspelled word.
Parameters:
  • por (AEPor) - Point of regard for the related accessible

readSpellingDialog(self, **kwargs)

source code 
Reads the misspelled word in the spelling dialog when it first appears.
Parameters:
  • kwargs (dictionary) - Arbitrary keyword arguments to pass to the task

readMisspelledWord(self, **kwargs)

source code 
Reads the misspelled word whenever the user presses a hotkey. Because the first misspelled word is not highlighted by gedit, getAccSelection cannot be used to retrieve the misspelled word. The only way to get to the misspelled word is by accessing the misspelled word label to explicitly extract its contents.
Parameters:
  • kwargs (dictionary) - Arbitrary keyword arguments to pass to the task

readMisspelledContext(self, **kwargs)

source code 
Reads the line containing the misspelled word. Raises pitch on the misspelled word if that feature is supported.
Parameters:
  • kwargs (dictionary) - Arbitrary keyword arguments to pass to the task

onFocusLost(self, **kwargs)

source code 
Keeps track of the AEPor to the misspelled word.
Parameters:
  • kwargs (dictionary) - Arbitrary keyword arguments to pass to the task
Returns: boolean
True to allow other tasks to process this event
Overrides: AccessEngine.AEScript.EventScript.onFocusLost

onCaretMoved(self, **kwargs)

source code 
Keeps track of the AEPor to the misspelled word. Announces it when the spelling dialog is not shown.
Parameters:
  • kwargs (dictionary) - Arbitrary keyword arguments to pass to the task
Returns: boolean
True to allow other tasks to process this event
Overrides: AccessEngine.AEScript.EventScript.onCaretMoved

onStateChange(self, **kwargs)

source code 
Monitors state changes on the table to determine if a word is misspelled or correct.
Parameters:
  • kwargs (dictionary) - Arbitrary keyword arguments to pass to the task
Returns: boolean
True to allow other tasks to process this event
Overrides: AccessEngine.AEScript.EventScript.onStateChange

To Do: needs work, what about the case where the table doesn't change state?