NVDAObjects.JAB package

NVDAObjects.JAB._subHtmlTag(match: match) str

Determines whether to replace the tag with a space or to just remove it.

NVDAObjects.JAB._processHtml(text: str) str

Strips HTML tags from text if it is HTML

class NVDAObjects.JAB.JABTextInfo(*args, **kwargs)

Bases: OffsetsTextInfo

Constructor. Subclasses may extend this to perform implementation specific initialisation, calling their superclass method afterwards.

_getOffsetFromPoint(x: int, y: int) int
_getBoundingRectFromOffset(offset: int) RectLTWH
_getCaretOffset() int
_setCaretOffset(offset: int) None
_getSelectionOffsets() tuple[int, int]
_setSelectionOffsets(start: int, end: int) None
_getStoryLength() int
_getTextRange(start: int, end: int) str

Retrieve the text in a given offset range. @param start: The start offset. @type start: int @param end: The end offset (exclusive). @type end: int @return: The text contained in the requested range. @rtype: str

_getLineNumFromOffset(offset: int) None
_getLineOffsets(offset: int) tuple[int, int]
_getParagraphOffsets(offset: int) tuple[int, int]
_getFormatFieldAndOffsets(offset: int, formatConfig, calculateOffsets=True)

Retrieve the formatting information for a given offset and the offsets spanned by that field. Subclasses must override this if support for text formatting is desired. The base implementation associates text with line numbers if possible.

getEmbeddedObject(offset: int = 0) JAB
_abc_impl = <_abc._abc_data object>
class NVDAObjects.JAB.JAB(chooseBestAPI=True, **kwargs)

Bases: Window

findOverlayClasses(clsList: list[NVDAObject]) None

Chooses overlay classes which should be added to this object’s class structure, after the object has been initially instantiated. After an NVDAObject class (normally an API-level class) is instantiated, this method is called on the instance to choose appropriate overlay classes.

This method may use properties, etc. on the instance to make this choice. The object’s class structure is then mutated to contain these classes.

L{initOverlayClass} is then called for each class which was not part of the initially instantiated object. This process allows an NVDAObject to be dynamically created using the most appropriate NVDAObject subclass at each API level. Classes should be listed with subclasses first. That is, subclasses should generally call super and then append their own classes to the list.

For example: Called on an IAccessible NVDAObject, the list might contain: “DialogIAccessible (a subclass of IAccessible), Edit (a subclass of Window)”.

@param clsList: The list of classes, which will be modified by this method if appropriate.

classmethod kwargsFromSuper(kwargs, relation: str | None = None) bool

Finds out if this class can be instanciated from the given super kwargs. If so it updates the kwargs to contain everything it will need to instanciate this class, and returns True. If this class can not be instanciated, it returns False and kwargs is not touched. @param relation: why is this class being instanciated? parent, focus, foreground etc… @type relation: string @param kwargs: the kwargs for constructing this class’s super class. @type kwargs: dict @rtype: boolean

_get__JABAccContextInfo()
_get_TextInfo()
_isEqual(other: Any) bool

Calculates if this object is equal to another object. Used by L{NVDAObject.__eq__}. @param other: the other object to compare with. @type other: L{NVDAObject} @return: True if equal, false otherwise. @rtype: boolean

_get_keyboardShortcut() str | None

The shortcut key that activates this object(example: alt+t). @rtype: str

_get_name()

The name or label of this object (example: the text of a button).

_get_JABRole()
_get_role()

The role or type of control this object represents (example: button, list, dialog).

_get_JABStates()
_get_states()

Retrieves the current states of this object (example: selected, focused). @return: a set of State constants from L{controlTypes}.

_get_value()

The value of this object (example: the current percentage of a scrollbar, the selected option in a combo box).

_get_description()

The description or help text of this object.

_get_location()

The location of this object on the screen. @return: left, top, width and height of the object. @rtype: tuple of int

_get_hasFocus() bool

Whether this object has focus. @rtype: bool

_get_positionInfo()

Retrieves position information for this object such as its level, its index with in a group, and the number of items in that group. @return: a dictionary containing any of level, groupIndex and similarItemsInGroup.

_get_activeChild()

Retrieves the child of this object that currently has, or contains, the focus. @return: the active child if it has one else None @rtype: L{NVDAObject} or None

_get_parent()

Retrieves this object’s parent (the object that contains this object). @return: the parent object if it exists else None.

_get_next()

Retrieves the object directly after this object with the same parent. @return: the next object if it exists else None.

_get_previous()

Retrieves the object directly before this object with the same parent. @return: the previous object if it exists else None.

_get_firstChild()

Retrieves the first object that this object contains. @return: the first child object if it exists else None.

_get_lastChild()

Retrieves the last object that this object contains. @return: the last child object if it exists else None.

_get_childCount() int

Retrieves the number of children this object contains. @rtype: int

_get_children() list[JAB]

Retrieves a list of all the objects directly contained by this object (who’s parent is this object). @rtype: list of L{NVDAObject}

_get_indexInParent() int | None

The index of this object in its parent object. @return: The 0 based index, C{None} if there is no parent. @raise NotImplementedError: If not supported by the underlying object.

_getJABRelationTargets(key: str) list[JABContext]
_get_flowsTo()

The object to which content flows from this object. @return: The object to which this object flows, C{None} if none. @rtype: L{NVDAObject} @raise NotImplementedError: If not supported by the underlying object.

_get_flowsFrom()

The object from which content flows to this object. @return: The object from which this object flows, C{None} if none. @rtype: L{NVDAObject} @raise NotImplementedError: If not supported by the underlying object.

reportFocus()

Announces this object in a way suitable such that it gained focus.

_get__actions()
_get_actionCount() int

Retrieves the number of actions supported by this object.

getActionName(index=None)

Retrieves the name of an action supported by this object. If index is not given then the default action will be used if it exists. @param index: the optional 0-based index of the wanted action. @type index: int @return: the action’s name @rtype: str

doAction(index=None)

Performs an action supported by this object. If index is not given then the default action will be used if it exists.

_get_activeDescendant()
event_gainFocus()

This code is executed if a gain focus event is received by this object.

JABRole
JABStates
TextInfo

The TextInfo class this object should use to provide access to text. @type: type; L{textInfos.TextInfo}

_JABAccContextInfo
_abc_impl = <_abc._abc_data object>
_actions
actionCount
activeChild
activeDescendant
childCount
children: List['NVDAObject']

Type definition for auto prop ‘_get_children’

description: str

Typing information for auto property _get_description

firstChild: Optional['NVDAObject']

Type definition for auto prop ‘_get_firstChild’

flowsFrom
flowsTo
hasFocus: bool

Type definition for auto prop ‘_get_hasFocus’

indexInParent: int | None

Type definition for auto prop ‘_get_indexInParent’

keyboardShortcut
lastChild: Optional['NVDAObject']

Type definition for auto prop ‘_get_lastChild’

location
name: str

Type definition for auto prop ‘_get_name’

next: Optional['NVDAObject']

The object directly after this object with the same parent.

parent: Optional['NVDAObject']

This object’s parent (the object that contains this object).

positionInfo: Dict[str, int]

Type definition for auto prop ‘_get_positionInfo’

previous: Optional['NVDAObject']

The object directly before this object with the same parent.

role: controlTypes.Role

Type definition for auto prop ‘_get_role’

states: Set[controlTypes.State]
value: str

Typing information for auto property _get_value

class NVDAObjects.JAB.ComboBox(chooseBestAPI=True, **kwargs)

Bases: JAB

_get_states()

Retrieves the current states of this object (example: selected, focused). @return: a set of State constants from L{controlTypes}.

_get_activeDescendant()
_get_value()

The value of this object (example: the current percentage of a scrollbar, the selected option in a combo box).

_abc_impl = <_abc._abc_data object>
activeDescendant
states: Set[controlTypes.State]
value: str

Typing information for auto property _get_value

_propertyCache: Set[GetterMethodT]
class NVDAObjects.JAB.Table(chooseBestAPI=True, **kwargs)

Bases: JAB

_get__jabTableInfo()
_get_rowCount() int | None

Retrieves the number of rows this object contains if its a table. @rtype: int

_get_columnCount() int | None

Retrieves the number of columns this object contains if its a table. @rtype: int

_get_tableID()

The identifier of the table associated with this object if it is a table cell. This identifier must distinguish this table from other tables. If this is not implemented, table cell information will still be reported, but row and column information will always be reported even if the user moves to a cell in the same row/column.

_abc_impl = <_abc._abc_data object>
_jabTableInfo
columnCount
rowCount
tableID
_propertyCache: Set[GetterMethodT]
class NVDAObjects.JAB.TableCell(chooseBestAPI=True, **kwargs)

Bases: JAB

_get_table()

Retrieves the object that represents the table that this object is contained in, if this object is a table cell. @rtype: L{NVDAObject}

_get_tableID()

The identifier of the table associated with this object if it is a table cell. This identifier must distinguish this table from other tables. If this is not implemented, table cell information will still be reported, but row and column information will always be reported even if the user moves to a cell in the same row/column.

_get_rowNumber() int

Retrieves the row number of this object if it is in a table. @rtype: int

_get_columnNumber() int

Retrieves the column number of this object if it is in a table. @rtype: int

_get_rowHeaderText() str | None

The text of the row headers for this cell. @rtype: str

_get_columnHeaderText() str | None

The text of the column headers for this cell. @rtype: str

_abc_impl = <_abc._abc_data object>
columnHeaderText
columnNumber
rowHeaderText
rowNumber
table
tableID
_propertyCache: Set[GetterMethodT]