Package AccessEngine :: Package AEAccAdapters :: Package ATSPI :: Module ComboboxAdapter :: Class ComboboxEventHandlerAdapter
[hide private]
[frames] | no frames]

Class ComboboxEventHandlerAdapter

source code

TextAdapter.TextEventHandlerAdapter --+
                                      |
                                     ComboboxEventHandlerAdapter

Overrides TextEventHandlerAdapter to enable processing of events from text areas within combo boxes where the combo box gets focus, the text area doesn't, and the text area is the source of all text events. Fires a AEEvent.FocusChange and either a AEEvent.CaretChange or AEEvent.SelectorChange on focus. Expects the subject to be a pyatspi.Accessibility.Accessible.

Adapts subject accessibles that have a role of combo box or whose parent have have a role of combo box.

Instance Methods [hide private]
2-tuple of pyatspi.Accessibility.Accessible
_getTextArea(self)
Looks for a widgets supporting the text interface within the combo box.
source code
boolean
_isFocused(self)
Gets if the subject or its parent is focused.
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
tuple of AEEvent
_handleTextEvent(self, event, focused, **kwargs)
Called when text is inserted or deleted (object:text-changed:insert & object:text-changed:delete).
source code
tuple of AEEvent
_handleCaretEvent(self, event, focused, **kwargs)
Creates and returns an AEEvent.CaretChange indicating the caret moved in the subject accessible.
source code
tuple of AEEvent
_handleSelectionChangedEvent(self, event, focused, **kwargs)
Creates an AEEvent.SelectorChange.
source code
Static Methods [hide private]
boolean
when(subject)
Tests if the given subject can be adapted by this class.
source code
Class Variables [hide private]
  provides = [IEventHandler]
Method Details [hide private]

when(subject)
Static Method

source code 
Tests if the given subject can be adapted by this class.
Parameters:
  • subject (pyatspi.Accessibility.Accessible) - Accessible to test
Returns: boolean
True when the subject meets the condition named in the docstring for this class, False otherwise

_getTextArea(self)

source code 
Looks for a widgets supporting the text interface within the combo box.
Returns: 2-tuple of pyatspi.Accessibility.Accessible
The accessible that provides the text interface and the accessible already queried to that interface

_isFocused(self)

source code 
Gets if the subject or its parent is focused.
Returns: boolean
Does the subject or its parent have focus?

_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:
  • event (pyatspi.event.Event) - Raw focus change event
  • kwargs (dictionary) - Parameters to be passed to any created AEEvent
Returns: tuple of AEEvent
AEEvent.FocusChange and AEEvent.CaretChange

_handleTextEvent(self, event, focused, **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.

pyatspi.event.Event.type.minor is "insert" or "delete". pyatspi.event.Event.detail1 has start offset of text change. pyatspi.event.Event.detail2 has length of text change. pyatspi.event.Event.any_data has text inserted/deleted.
Parameters:
  • event (pyatspi.event.Event) - Raw text-changed event
  • kwargs (dictionary) - Parameters to be passed to any created AEEvent
Returns: tuple of AEEvent
AEEvent.CaretChange

_handleCaretEvent(self, event, focused, **kwargs)

source code 

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

pyatspi.event.Event.detail1 has caret offset.
Parameters:
  • event (pyatspi.event.Event) - Raw caret movement event
  • kwargs (dictionary) - Parameters to be passed to any created AEEvent
Returns: tuple of AEEvent
AEEvent.CaretChange

_handleSelectionChangedEvent(self, event, focused, **kwargs)

source code 
Creates an AEEvent.SelectorChange.
Parameters:
  • event (pyatspi.event.Event) - Raw selection changed event
  • kwargs (dictionary) - Parameters to be passed to any created AEEvent
Returns: tuple of AEEvent
AEEvent.SelectorChange