displayModel module
- displayModel.UNIT_DISPLAYCHUNK = 'displayChunk'
A text info unit constant for a single chunk in a display model
- displayModel.wcharToInt(c)
- displayModel.detectStringDirection(s)
- displayModel.normalizeRtlString(s)
- displayModel.yieldListRange(l, start, stop)
- displayModel.processWindowChunksInLine(commandList, rects, startIndex, startOffset, endIndex, endOffset)
- displayModel.processFieldsAndRectsRangeReadingdirection(commandList, rects, startIndex, startOffset, endIndex, endOffset)
- displayModel._textChangeNotificationObjs = []
Objects that have registered for text change notifications.
- displayModel.initialize()
- displayModel.getCaretRect(obj)
- displayModel.getWindowTextInRect(bindingHandle, windowHandle, left, top, right, bottom, minHorizontalWhitespace, minVerticalWhitespace, stripOuterWhitespace=True, includeDescendantWindows=True)
- displayModel.getFocusRect(obj)
- displayModel.requestTextChangeNotifications(obj, enable)
Request or cancel notifications for when the display text changes in an NVDAObject. A textChange event (event_textChange) will be fired on the object when its text changes. Note that this event does not provide any information about the changed text itself. It is important to request that notifications be cancelled when you no longer require them or when the object is no longer in use, as otherwise, resources will not be released. @param obj: The NVDAObject for which text change notifications are desired. @type obj: NVDAObject @param enable: C{True} to enable notifications, C{False} to disable them. @type enable: bool
- displayModel.textChangeNotify(windowHandle, left, top, right, bottom)
- class displayModel.DisplayModelTextInfo(*args, **kwargs)
Bases:
OffsetsTextInfo
Constructor. Subclasses may extend this to perform implementation specific initialisation, calling their superclass method afterwards.
- minHorizontalWhitespace = 8
- minVerticalWhitespace = 32
- stripOuterWhitespace = True
- includeDescendantWindows = True
- _get_backgroundSelectionColor()
- _get_foregroundSelectionColor()
- _getSelectionOffsets()
- _cache__storyFieldsAndRects = True
- _get__storyFieldsAndRects() Tuple[List[str | FieldCommand], List[RectLTRB], List[int], List[int]]
- _getStoryOffsetLocations()
- _getFieldsInRange(start, end)
- _getStoryText()
Retrieve the entire text of the object. @return: The entire text of the object. @rtype: str
- _getStoryLength()
- useUniscribe: bool = False
Use uniscribe to calculate word offsets etc.
- _getTextRange(start, end)
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
- getTextWithFields(formatConfig: Dict | None = None) List[str | FieldCommand]
Retrieves the text in this range, as well as any control/format fields associated therewith. Subclasses may override this. The base implementation just returns the text. @param formatConfig: Document formatting configuration, useful if you wish to force a particular
configuration for a particular task.
@return: A sequence of text strings interspersed with associated field commands.
- _normalizeFormatField(field)
- _getOffsetFromPoint(x, y)
- _getClosestOffsetFromPoint(x, y)
- _getBoundingRectFromOffset(offset)
- _getNVDAObjectFromOffset(offset)
- _getOffsetsFromNVDAObject(obj)
- _getOffsetsInPreCalculatedOffsets(preCalculated, offset)
- _getLineOffsets(offset)
- _getDisplayChunkOffsets(offset)
- _getUnitOffsets(unit, offset)
- _get_clipboardText()
Text suitably formatted for copying to the clipboard. E.g. crlf characters inserted between lines.
- getTextInChunks(unit)
Retrieve the text of this instance in chunks of a given unit. @param unit: The unit at which chunks should be split. @return: Chunks of text. @rtype: generator of str
- _get_boundingRects()
Per line bounding rectangles for the visible text in this range. Implementations should ensure that the bounding rectangles don’t contain off screen coordinates. @rtype: [L{locationHelper.RectLTWH}] @raise NotImplementedError: If not supported. @raise LookupError: If not available (i.e. off screen, hidden, etc.)
- _getFirstVisibleOffset()
- _getLastVisibleOffset()
- _abc_impl = <_abc._abc_data object>
- _storyFieldsAndRects
- backgroundSelectionColor
- boundingRects
- clipboardText
- foregroundSelectionColor
- class displayModel.EditableTextDisplayModelTextInfo(*args, **kwargs)
Bases:
DisplayModelTextInfo
Constructor. Subclasses may extend this to perform implementation specific initialisation, calling their superclass method afterwards.
- minHorizontalWhitespace = 1
- minVerticalWhitespace = 4
- stripOuterWhitespace = False
- _findCaretOffsetFromLocation(caretRect: RectLTRB, validateBaseline: bool = True, validateDirection: bool = True)
- _getCaretOffset()
- _setCaretOffset(offset)
- _getSelectionOffsets()
- _abc_impl = <_abc._abc_data object>
- _setSelectionOffsets(start, end)