C# Class ACAT.Lib.Extension.AppAgents.MSWord.MSWordAgentBase

Base class for the Agent for Microsoft Word
Inheritance: ACAT.Lib.Core.AgentManagement.AgentBase
Show file Open project: brlima94/acat-localization

Protected Properties

Property Type Description
autoSwitchScanners bool
isWordInstalled bool
supportedFeatures String[]

Public Methods

Method Description
CheckWidgetEnabled ( ACAT.Lib.Core.AgentManagement.CheckEnabledArgs arg ) : void

Invoked to set the 'enabled' state of a widget. This will depend on the current context.

MSWordAgentBase ( ) : System

Initializes a new instance of the class.

OnContextMenuRequest ( ACAT.Lib.Core.Utility.WindowActivityMonitorInfo monitorInfo ) : void

Displays the contextual menu

OnFocusChanged ( ACAT.Lib.Core.Utility.WindowActivityMonitorInfo monitorInfo, bool &handled ) : void

Invoked when the foreground window focus changes. Displays the scanner depending on the context. Also, if this is a new window that has come into focus, adds its contents to the word prediction temporary batch model for more contextual prediction of words

OnFocusLost ( ) : void

Focus shifted to another app. This agent is getting deactivated.

OnRunCommand ( String command, object commandArg, bool &handled ) : void

Executes the specified command

Protected Methods

Method Description
OnDispose ( ) : void

Dispose allocated resources

createMSWordTextInterface ( ) : void

Creates the text control interface for MS Word

isRecentDocuments ( AutomationElement focusedElement ) : bool

Returns if the currently focused element is the "Recent Documents" window

launchLectureManager ( String fileName, String text ) : void

Launches lecture manager with text from the MS Word window. This function returns only after lecture manager has exited

Private Methods

Method Description
_textInterface_EvtTextChanged ( object sender, ACAT.Lib.Core.AgentManagement.TextInterface.TextChangedEventArgs e ) : void

Event handler for when text or caret position in the MS Word window has changed

disposeTextInterface ( ) : void

Disposes off the text interface

loadWordPredictionContext ( ) : void

Loads the text from the active word document to the word prediction engine as temporary context for better word prediction results, that are more relevant to the active document

unloadWordPredictionContext ( ) : void

Unloaded previously loaded context from the word predictor

Method Details

CheckWidgetEnabled() public method

Invoked to set the 'enabled' state of a widget. This will depend on the current context.
public CheckWidgetEnabled ( ACAT.Lib.Core.AgentManagement.CheckEnabledArgs arg ) : void
arg ACAT.Lib.Core.AgentManagement.CheckEnabledArgs contains info about the widget
return void

MSWordAgentBase() public method

Initializes a new instance of the class.
public MSWordAgentBase ( ) : System
return System

OnContextMenuRequest() public method

Displays the contextual menu
public OnContextMenuRequest ( ACAT.Lib.Core.Utility.WindowActivityMonitorInfo monitorInfo ) : void
monitorInfo ACAT.Lib.Core.Utility.WindowActivityMonitorInfo Foreground window info
return void

OnDispose() protected method

Dispose allocated resources
protected OnDispose ( ) : void
return void

OnFocusChanged() public method

Invoked when the foreground window focus changes. Displays the scanner depending on the context. Also, if this is a new window that has come into focus, adds its contents to the word prediction temporary batch model for more contextual prediction of words
public OnFocusChanged ( ACAT.Lib.Core.Utility.WindowActivityMonitorInfo monitorInfo, bool &handled ) : void
monitorInfo ACAT.Lib.Core.Utility.WindowActivityMonitorInfo Foreground window info
handled bool set to true if handled
return void

OnFocusLost() public method

Focus shifted to another app. This agent is getting deactivated.
public OnFocusLost ( ) : void
return void

OnRunCommand() public method

Executes the specified command
public OnRunCommand ( String command, object commandArg, bool &handled ) : void
command String The command to execute
commandArg object Optional arguments for the command
handled bool set this to true if handled
return void

createMSWordTextInterface() protected method

Creates the text control interface for MS Word
protected createMSWordTextInterface ( ) : void
return void

isRecentDocuments() protected method

Returns if the currently focused element is the "Recent Documents" window
protected isRecentDocuments ( AutomationElement focusedElement ) : bool
focusedElement System.Windows.Automation.AutomationElement focused element
return bool

launchLectureManager() protected method

Launches lecture manager with text from the MS Word window. This function returns only after lecture manager has exited
protected launchLectureManager ( String fileName, String text ) : void
fileName String
text String
return void

Property Details

autoSwitchScanners protected property

If set to true, the agent will autoswitch the scanners depending on which element has focus. Eg: Alphabet scanner if an edit text window has focus, the contextual menu if the main document has focus
protected bool autoSwitchScanners
return bool

isWordInstalled protected property

Is word installed on this computer?
protected bool isWordInstalled
return bool

supportedFeatures protected property

List of features supported by this agent. These widgets will be enabled in the scanners.
protected String[] supportedFeatures
return String[]