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

Class TextEventHandlerAdapter

source code

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

Overrides SimpleTextEventHandlerAdapter to fire AEEvent.CaretChange events on focus changes for text controls. Expects the subject to be a pyLinAcc.Accessible.

Adapts subject accessibles that have a role of terminal or have a state of multiline, single line, or editable and provide the Text interface. Does not adapt accessibles with role of page tab.

Instance Methods [hide private]
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: SimpleTextEventHandlerAdapter.when

_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: SimpleTextEventHandlerAdapter._handleFocusEvent