Package AEEvent :: Module CaretChange :: Class CaretChange
[hide private]
[frames] | no frames]

Class CaretChange

source code

            object --+    
                     |    
Base.AccessEngineEvent --+
                         |
                        CaretChange

Event that fires when the caret moves in an accessible.

This class registers its name and whether it should be monitored by default in an AEMonitor using the Base.registerEventType function when this module is first imported. The AEMonitor can use this information to build its menus.

Instance Methods [hide private]
 
__init__(self, por, text, text_offset, added=None, **kwargs)
Calls the base class (which set the event priority) and then stores the text and offset to be passed along to the Tier as part of the event.
source code
string
__str__(self)
Returns a human readable representation of this event including its name, its text, its text offset, and whether the text was added, removed, or moved.
source code
boolean
execute(self, tier_manager, view_manager, **kwargs)
Contacts the TierManager so it can manage the caret change event.
source code
POR
getFocusPOR(self)
Returns the POR for caret movement events.
source code
dictionary
getDataForTask(self)
Fetches data out of this CaretChange for use by a Task.CaretTask.
source code

Inherited from Base.AccessEngineEvent: getAppID, getLayer, getPOR, getPriority, getTimestamp, setLayer, setPriority

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

Instance Variables [hide private]
boolean added
True when text added, False when text deleted, and None (the default) when event is for caret movement only
string text
The text inserted, deleted or the line of the caret
integer text_offset
The offset of the inserted/deleted text or the line offset when movement only

Inherited from Base.AccessEngineEvent: focused, por, priority

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, por, text, text_offset, added=None, **kwargs)
(Constructor)

source code 

Calls the base class (which set the event priority) and then stores the text and offset to be passed along to the Tier as part of the event.

Parameters:
  • por (POR) - Point of regard
  • 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 (the default) when event is for caret movement only
Overrides: Base.AccessEngineEvent.__init__

__str__(self)
(Informal representation operator)

source code 

Returns a human readable representation of this event including its name, its text, its text offset, and whether the text was added, removed, or moved.

Returns: string
Information about this event
Overrides: Base.AccessEngineEvent.__str__

execute(self, tier_manager, view_manager, **kwargs)

source code 

Contacts the TierManager so it can manage the caret change event.

Parameters:
  • tier_manager (TierManager) - TierManager that will handle the event
  • kwargs (dictionary) - Packed references to other managers not of interest here
Returns: boolean
True if there is an active view, False if not to delay execution of this event until there is
Overrides: Base.AccessEngineEvent.execute

getFocusPOR(self)

source code 

Returns the POR for caret movement events. Used by Tier to maintain a focus POR.

Returns: POR
Point-of-regard for this focus event
Raises:
  • AttributeError - When the event does not represent a change in the focus

getDataForTask(self)

source code 

Fetches data out of this CaretChange for use by a Task.CaretTask.

Returns: dictionary
Dictionary of parameters to be passed to a Task.CaretTask as follows:
  • por: The POR of the accessible in which the caret moved
  • text: The text inserted, deleted or the line of the caret
  • text_offset: The offset of the inserted/deleted text or the line offset when movement only
  • added: Boolean that is True when the text was added
Overrides: Base.AccessEngineEvent.getDataForTask