Package Adapters :: Package ATSPI :: Module TextAdapter :: Class SimpleTextEventHandlerAdapter
[hide private]
[frames] | no frames]

Class SimpleTextEventHandlerAdapter

source code

                                object --+        
                                         |        
                          AccAdapt.Adapter --+    
                                             |    
DefaultEventHandler.DefaultEventHandlerAdapter --+
                                                 |
                                                SimpleTextEventHandlerAdapter

Overrides DefaultEventHandlerAdapter to fire AEEvent.CaretChange events for caret and text events. Expects the subject to be a pyLinAcc.Accessible.

Adapts subject accessibles that provide the Text interface.

Instance Methods [hide private]
tuple of AEEvent
_handleTextEvent(self, event, **kwargs)
Called when text is inserted or deleted (object:text-changed:insert & object:text-changed:delete).
source code
tuple of AEEvent
_handleCaretEvent(self, event, **kwargs)
Creates and returns an AEEvent.CaretChange indicating the caret moved in the subject accessible.
source code
tuple of AEEvent
_handleTextSelectionEvent(self, event, **kwargs)
Creates and returns a AEEvent.SelectorChange event when text selection changes.
source code
tuple of AEEvent
_handleFocusEvent(self, event, **kwargs)
Creates an AEEvent.FocusChange indicating that the accessible being adapted has gained the focus.
source code

Inherited from DefaultEventHandler.DefaultEventHandlerAdapter: getAEEvents, getAEViewEvents, getRawEvents

Inherited from AccAdapt.Adapter: __call__, __init__

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

Static Methods [hide private]
boolean
when(subject)
Condition under which this adapter is applicable to the given subject.
source code
Class Variables [hide private]
list of Interface provides = [IEventHandler]
Interfaces provided by this adapter

Inherited from DefaultEventHandler.DefaultEventHandlerAdapter: last_focus, singleton

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

when(subject)
Static Method

source code 
Condition under which this adapter is applicable to the given subject. The condition can either be a staticmethod callable that results in a boolean value or a string that will be evaluated as a boolean Python expression in the namespace in which it is defined. This implies any variables in the global namespace of the Adapter subclass can be used in the when clause. String conditions are only evaluated once at startup rather than on each call. If the condition is None, the Adapter is considered a default.
Parameters:
  • subject (pyLinAcc.Accessible) - Accessible to test
Returns: boolean
True when the subject meets the condition named in the docstring for this class, False otherwise
Overrides: when

_handleTextEvent(self, event, **kwargs)

source code 

Called when text is inserted or deleted (object:text-changed:insert & object:text-changed:delete). Creates and returns an AEEvent.CaretChange to indicate a change in the caret context.

pyLinAcc.Event.Event.type.minor is "insert" or "delete". pyLinAcc.Event.Event.detail1 has start offset of text change. pyLinAcc.Event.Event.detail2 has length of text change. pyLinAcc.Event.Event.any_data has text inserted/deleted.

Parameters:
Returns: tuple of AEEvent
AEEvent.CaretChange

_handleCaretEvent(self, event, **kwargs)

source code 

Creates and returns an AEEvent.CaretChange indicating the caret moved in the subject accessible.

pyLinAcc.Event.Event.detail1 has caret offset.

Parameters:
Returns: tuple of AEEvent
AEEvent.CaretChange

_handleTextSelectionEvent(self, event, **kwargs)

source code 

Creates and returns a AEEvent.SelectorChange event when text selection changes.

Parameters:
Returns: tuple of AEEvent
AEEvent.SelectorChange

_handleFocusEvent(self, event, **kwargs)

source code 

Creates an AEEvent.FocusChange indicating that the accessible being adapted has gained the focus. Also a AEEvent.CaretChange. This sequence of AEEvents will be posted by the caller.

Parameters:
Returns: tuple of AEEvent
AEEvent.FocusChange and AEEvent.CaretChange
Overrides: DefaultEventHandler.DefaultEventHandlerAdapter._handleFocusEvent