#[repr(C)]
pub struct QAccessibleTextInterface { /* private fields */ }
Expand description

The QAccessibleTextInterface class implements support for text handling.

C++ class: QAccessibleTextInterface.

C++ documentation:

The QAccessibleTextInterface class implements support for text handling.

This interface corresponds to the IAccessibleText interface. It should be implemented for widgets that display more text than a plain label. Labels should be represented by only QAccessibleInterface and return their text as name (QAccessibleInterface::text() with QAccessible::Name as type). The QAccessibleTextInterface is typically for text that a screen reader might want to read line by line, and for widgets that support text selection and input. This interface is, for example, implemented for QLineEdit.

IAccessible2 Specification

Implementations§

source§

impl QAccessibleTextInterface

source

pub unsafe fn add_selection(&self, start_offset: c_int, end_offset: c_int)

Select the text from startOffset to endOffset. The startOffset is the first character that will be selected. The endOffset is the first character that will not be selected.

Calls C++ function: pure virtual void QAccessibleTextInterface::addSelection(int startOffset, int endOffset).

C++ documentation:

Select the text from startOffset to endOffset. The startOffset is the first character that will be selected. The endOffset is the first character that will not be selected.

When the object supports multiple selections (e.g. in a word processor), this adds a new selection, otherwise it replaces the previous selection.

The selection will be endOffset - startOffset characters long.

source

pub unsafe fn attributes( &self, offset: c_int, start_offset: *mut c_int, end_offset: *mut c_int ) -> CppBox<QString>

Returns the text attributes at the position offset. In addition the range of the attributes is returned in startOffset and endOffset.

Calls C++ function: pure virtual QString QAccessibleTextInterface::attributes(int offset, int* startOffset, int* endOffset) const.

C++ documentation:

Returns the text attributes at the position offset. In addition the range of the attributes is returned in startOffset and endOffset.

source

pub unsafe fn character_count(&self) -> c_int

Returns the length of the text (total size including spaces).

Calls C++ function: pure virtual int QAccessibleTextInterface::characterCount() const.

C++ documentation:

Returns the length of the text (total size including spaces).

source

pub unsafe fn character_rect(&self, offset: c_int) -> CppBox<QRect>

Returns the position and size of the character at position offset in screen coordinates.

Calls C++ function: pure virtual QRect QAccessibleTextInterface::characterRect(int offset) const.

C++ documentation:

Returns the position and size of the character at position offset in screen coordinates.

source

pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QAccessibleTextInterface>> ) -> Ref<QAccessibleTextInterface>

The QAccessibleTextInterface class implements support for text handling.

Calls C++ function: QAccessibleTextInterface& QAccessibleTextInterface::operator=(const QAccessibleTextInterface& other).

C++ documentation:

The QAccessibleTextInterface class implements support for text handling.

This interface corresponds to the IAccessibleText interface. It should be implemented for widgets that display more text than a plain label. Labels should be represented by only QAccessibleInterface and return their text as name (QAccessibleInterface::text() with QAccessible::Name as type). The QAccessibleTextInterface is typically for text that a screen reader might want to read line by line, and for widgets that support text selection and input. This interface is, for example, implemented for QLineEdit.

IAccessible2 Specification

source

pub unsafe fn cursor_position(&self) -> c_int

Returns the current cursor position.

Calls C++ function: pure virtual int QAccessibleTextInterface::cursorPosition() const.

C++ documentation:

Returns the current cursor position.

See also setCursorPosition().

source

pub unsafe fn offset_at_point(&self, point: impl CastInto<Ref<QPoint>>) -> c_int

Returns the offset of the character at the point in screen coordinates.

Calls C++ function: pure virtual int QAccessibleTextInterface::offsetAtPoint(const QPoint& point) const.

C++ documentation:

Returns the offset of the character at the point in screen coordinates.

source

pub unsafe fn remove_selection(&self, selection_index: c_int)

Clears the selection with index selectionIndex.

Calls C++ function: pure virtual void QAccessibleTextInterface::removeSelection(int selectionIndex).

C++ documentation:

Clears the selection with index selectionIndex.

source

pub unsafe fn scroll_to_substring(&self, start_index: c_int, end_index: c_int)

Ensures that the text between startIndex and endIndex is visible.

Calls C++ function: pure virtual void QAccessibleTextInterface::scrollToSubstring(int startIndex, int endIndex).

C++ documentation:

Ensures that the text between startIndex and endIndex is visible.

source

pub unsafe fn selection( &self, selection_index: c_int, start_offset: *mut c_int, end_offset: *mut c_int )

Returns a selection. The size of the selection is returned in startOffset and endOffset. If there is no selection both startOffset and endOffset are 0.

Calls C++ function: pure virtual void QAccessibleTextInterface::selection(int selectionIndex, int* startOffset, int* endOffset) const.

C++ documentation:

Returns a selection. The size of the selection is returned in startOffset and endOffset. If there is no selection both startOffset and endOffset are 0.

The accessibility APIs support multiple selections. For most widgets though, only one selection is supported with selectionIndex equal to 0.

See also setSelection().

source

pub unsafe fn selection_count(&self) -> c_int

Returns the number of selections in this text.

Calls C++ function: pure virtual int QAccessibleTextInterface::selectionCount() const.

C++ documentation:

Returns the number of selections in this text.

source

pub unsafe fn set_cursor_position(&self, position: c_int)

Moves the cursor to position.

Calls C++ function: pure virtual void QAccessibleTextInterface::setCursorPosition(int position).

C++ documentation:

Moves the cursor to position.

See also cursorPosition().

source

pub unsafe fn set_selection( &self, selection_index: c_int, start_offset: c_int, end_offset: c_int )

Set the selection selectionIndex to the range from startOffset to endOffset.

Calls C++ function: pure virtual void QAccessibleTextInterface::setSelection(int selectionIndex, int startOffset, int endOffset).

C++ documentation:

Set the selection selectionIndex to the range from startOffset to endOffset.

See also selection(), addSelection(), and removeSelection().

source

pub unsafe fn text( &self, start_offset: c_int, end_offset: c_int ) -> CppBox<QString>

Returns the text from startOffset to endOffset. The startOffset is the first character that will be returned. The endOffset is the first character that will not be returned.

Calls C++ function: pure virtual QString QAccessibleTextInterface::text(int startOffset, int endOffset) const.

C++ documentation:

Returns the text from startOffset to endOffset. The startOffset is the first character that will be returned. The endOffset is the first character that will not be returned.

source

pub unsafe fn text_after_offset( &self, offset: c_int, boundary_type: TextBoundaryType, start_offset: *mut c_int, end_offset: *mut c_int ) -> CppBox<QString>

Returns the text item of type boundaryType that is right after offset offset and sets startOffset and endOffset values to the start and end positions of that item; returns an empty string if there is no such an item. Sets startOffset and endOffset values to -1 on error.

Calls C++ function: virtual QString QAccessibleTextInterface::textAfterOffset(int offset, QAccessible::TextBoundaryType boundaryType, int* startOffset, int* endOffset) const.

C++ documentation:

Returns the text item of type boundaryType that is right after offset offset and sets startOffset and endOffset values to the start and end positions of that item; returns an empty string if there is no such an item. Sets startOffset and endOffset values to -1 on error.

This default implementation is provided for small text edits. A word processor or text editor should provide their own efficient implementations. This function makes no distinction between paragraphs and lines.

Note: this function can not take the cursor position into account. By convention an offset of -2 means that this function should use the cursor position as offset. Thus an offset of -2 must be converted to the cursor position before calling this function. An offset of -1 is used for the text length and custom implementations of this function have to return the result as if the length was passed in as offset.

source

pub unsafe fn text_at_offset( &self, offset: c_int, boundary_type: TextBoundaryType, start_offset: *mut c_int, end_offset: *mut c_int ) -> CppBox<QString>

Returns the text item of type boundaryType at offset offset and sets startOffset and endOffset values to the start and end positions of that item; returns an empty string if there is no such an item. Sets startOffset and endOffset values to -1 on error.

Calls C++ function: virtual QString QAccessibleTextInterface::textAtOffset(int offset, QAccessible::TextBoundaryType boundaryType, int* startOffset, int* endOffset) const.

C++ documentation:

Returns the text item of type boundaryType at offset offset and sets startOffset and endOffset values to the start and end positions of that item; returns an empty string if there is no such an item. Sets startOffset and endOffset values to -1 on error.

This default implementation is provided for small text edits. A word processor or text editor should provide their own efficient implementations. This function makes no distinction between paragraphs and lines.

Note: this function can not take the cursor position into account. By convention an offset of -2 means that this function should use the cursor position as offset. Thus an offset of -2 must be converted to the cursor position before calling this function. An offset of -1 is used for the text length and custom implementations of this function have to return the result as if the length was passed in as offset.

source

pub unsafe fn text_before_offset( &self, offset: c_int, boundary_type: TextBoundaryType, start_offset: *mut c_int, end_offset: *mut c_int ) -> CppBox<QString>

Returns the text item of type boundaryType that is close to offset offset and sets startOffset and endOffset values to the start and end positions of that item; returns an empty string if there is no such an item. Sets startOffset and endOffset values to -1 on error.

Calls C++ function: virtual QString QAccessibleTextInterface::textBeforeOffset(int offset, QAccessible::TextBoundaryType boundaryType, int* startOffset, int* endOffset) const.

C++ documentation:

Returns the text item of type boundaryType that is close to offset offset and sets startOffset and endOffset values to the start and end positions of that item; returns an empty string if there is no such an item. Sets startOffset and endOffset values to -1 on error.

This default implementation is provided for small text edits. A word processor or text editor should provide their own efficient implementations. This function makes no distinction between paragraphs and lines.

Note: this function can not take the cursor position into account. By convention an offset of -2 means that this function should use the cursor position as offset. Thus an offset of -2 must be converted to the cursor position before calling this function. An offset of -1 is used for the text length and custom implementations of this function have to return the result as if the length was passed in as offset.

Trait Implementations§

source§

impl CppDeletable for QAccessibleTextInterface

source§

unsafe fn delete(&self)

Destroys the QAccessibleTextInterface.

Calls C++ function: virtual [destructor] void QAccessibleTextInterface::~QAccessibleTextInterface().

C++ documentation:

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.