documentBase module

documentBase._TableID

A variety of types can be used for a tableID. Known to be a tuple for UIA, an integer for virtual buffers.

alias of Union[int, Tuple, Any]

class documentBase._Axis(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: str, Enum

ROW = 'row'
COLUMN = 'column'
_generate_next_value_(start, count, last_values)

Generate the next value when not given.

name: the name of the member start: the initial start value or None count: the number of existing members last_values: the list of values assigned

_new_member_(**kwargs)

Create and return a new object. See help(type) for accurate signature.

_use_args_ = True
_member_names_ = ['ROW', 'COLUMN']
_member_map_ = {'COLUMN': _Axis.COLUMN, 'ROW': _Axis.ROW}
_value2member_map_ = {'column': _Axis.COLUMN, 'row': _Axis.ROW}
_unhashable_values_ = []
_member_type_

alias of str

_value_repr_()

Return repr(self).

class documentBase._Movement(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: str, Enum

NEXT = 'next'
PREVIOUS = 'previous'
FIRST = 'first'
LAST = 'last'
_generate_next_value_(start, count, last_values)

Generate the next value when not given.

name: the name of the member start: the initial start value or None count: the number of existing members last_values: the list of values assigned

_new_member_(**kwargs)

Create and return a new object. See help(type) for accurate signature.

_use_args_ = True
_member_names_ = ['NEXT', 'PREVIOUS', 'FIRST', 'LAST']
_member_map_ = {'FIRST': _Movement.FIRST, 'LAST': _Movement.LAST, 'NEXT': _Movement.NEXT, 'PREVIOUS': _Movement.PREVIOUS}
_value2member_map_ = {'first': _Movement.FIRST, 'last': _Movement.LAST, 'next': _Movement.NEXT, 'previous': _Movement.PREVIOUS}
_unhashable_values_ = []
_member_type_

alias of str

_value_repr_()

Return repr(self).

class documentBase._TableSelection(axis: _Axis, lastRow: int, lastCol: int, trueRow: int, rowSpan: int, trueCol: int, colSpan: int)

Bases: object

Caches information about user navigating around the table. This class is used to store true row/column number when navigating through merged cells. lastRow/lastCol store coordinates of the last cell user explicitly navigated to. If they don’t match current selection we invalidate this cache. If they match, we use trueRow/trueCol to maintain row/column through merged cells.

axis: _Axis
lastRow: int
lastCol: int
trueRow: int
rowSpan: int
trueCol: int
colSpan: int
class documentBase._TableCell(tableID: int | Tuple | Any, row: int, col: int, rowSpan: int, colSpan: int)

Bases: object

Contains information about a cell in the table with matching tableID

tableID: int | Tuple | Any
row: int
col: int
rowSpan: int
colSpan: int
class documentBase.TextContainerObject(*args, **kwargs)

Bases: AutoPropertyObject

An object that contains text which can be accessed via a call to a makeTextInfo method. E.g. NVDAObjects, BrowseModeDocument TreeInterceptors.

_get_TextInfo()
makeTextInfo(position) TextInfo
property selection
_get_selection()
_set_selection(info)
TextInfo
_abc_impl = <_abc._abc_data object>
class documentBase.DocumentWithTableNavigation(*args, **kwargs)

Bases: TextContainerObject, ScriptableObject

A document that supports standard table navigiation comments (E.g. control+alt+arrows to move between table cells). The document could be an NVDAObject, or a BrowseModeDocument treeIntercepter for example.

_lastTableSelection: _TableSelection | None = None
_maybeGetLayoutTableIds(info: TextInfo)

If “Include layout tables” option is on, this will compute the set of layout tables that this textInfo is enclosed in, otherwise it will return empty set. @param info: the position where the layout tables should be looked for. @returns: A set of table IDs or empty set.

_getTableCellCoords(info: TextInfo) _TableCell

Fetches information about the deepest table cell at the given position. @param info: the position where the table cell should be looked for. @returns: Information about requested cell. @raises: LookupError if there is no table cell at this position.

_getTableCellCoordsCached(info: TextInfo, axis: _Axis | None = None) _TableCell
_getTableDimensions(info: TextInfo) Tuple[int, int]

Fetches information about the deepest table dimension. @param info: the position where the table cell should be looked for. @returns: a tuple of table height and width. @raises: LookupError if there is no table cell at this position.

_getTableCellAt(tableID, startPos, row, column)

Starting from the given start position, Locates the table cell with the given row and column coordinates and table ID. @param startPos: the position to start searching from. @type startPos: L{textInfos.TextInfo} @param tableID: the ID of the table. @param row: the row number of the cell @type row: int @param column: the column number of the table cell @type column: int @returns: the table cell’s position in the document @rtype: L{textInfos.TextInfo} @raises: LookupError if the cell does not exist

_missingTableCellSearchLimit = 3

The number of missing cells L{_getNearestTableCell} is allowed to skip over to locate the next available cell

_getNearestTableCell(startPos: TextInfo, cell: _TableCell, movement: _Movement, axis: _Axis) TextInfo

Locates the nearest table cell relative to another table cell in a given direction, given its coordinates. For example, this is used to move to the cell in the next column, previous row, etc. This method will skip over missing table cells (where L{_getTableCellAt} raises LookupError), up to the number of times set by _missingTableCellSearchLimit set on this instance. @param startPos: the position in the document to start searching from. @param cell: the cell information of start position. @param movement: the direction (“next” or “previous”) @param axis: the axis of movement (“row” or “column”) @returns: the position of the nearest table cell

_getFirstOrLastTableCell(startPos: TextInfo, cell: _TableCell, movement: _Movement, axis: _Axis) TextInfo

Locates the first or last cell in current row or column given coordinates of current cell. When jumping to the first row/column, It will try to set current row/column index to 1. When jumping to the last row/column, it will query table dimensions and set row/column index to corresponding dimension. After figuring out exact coordinates of the cell it will try to jump directly to that cell, or if that fails (due to missing table cell), it will walk in the opposite direction skipping missing cells up to the number of times set by _missingTableCellSearchLimit set on this instance. @param startPos: the position in the document to start searching from. @param cell: the cell information of start position. @param movement: the direction (“first” or “last”) @param axis: the axis of movement (“row” or “column”) @returns: the position of the destination table cell

_tableFindNewCell(movement: _Movement | None = None, axis: _Axis | None = None, selection: TextInfo | None = None, raiseOnEdge: bool = False) Tuple[_TableCell, TextInfo, _TableSelection | None]
_tableMovementScriptHelper(movement: _Movement = _Movement.NEXT, axis: _Axis | None = None)
_tableSayAll(movement: _Movement, axis: _Axis, updateCaret: bool = True) None
script_nextRow(gesture)

moves to the next table row

script_previousRow(gesture)

moves to the previous table row

script_nextColumn(gesture)

moves to the next table column

script_previousColumn(gesture)

moves to the previous table column

script_firstRow(gesture)

moves to the first table row

script_lastRow(gesture)

moves to the last table row

script_firstColumn(gesture)

moves to the first table column

script_lastColumn(gesture)

moves to the last table column

script_sayAllRow(gesture)

Reads the row horizontally from the current cell rightwards to the last cell in the row.

script_sayAllColumn(gesture)

Reads the column vertically from the current cell downwards to the last cell in the column.

script_speakRow(gesture)

Reads the current row horizontally from left to right without moving the system caret.

script_speakColumn(gesture)

Reads the current column vertically from top to bottom without moving the system caret.

script_toggleIncludeLayoutTables(gesture)

Toggles on and off the inclusion of layout tables in browse mode

__gestures = {'kb:NVDA+control+alt+downArrow': 'sayAllColumn', 'kb:NVDA+control+alt+leftArrow': 'speakRow', 'kb:NVDA+control+alt+rightArrow': 'sayAllRow', 'kb:NVDA+control+alt+upArrow': 'speakColumn', 'kb:control+alt+downArrow': 'nextRow', 'kb:control+alt+end': 'lastColumn', 'kb:control+alt+home': 'firstColumn', 'kb:control+alt+leftArrow': 'previousColumn', 'kb:control+alt+pageDown': 'lastRow', 'kb:control+alt+pageUp': 'firstRow', 'kb:control+alt+rightArrow': 'nextColumn', 'kb:control+alt+upArrow': 'previousRow'}
_abc_impl = <_abc._abc_data object>