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

The QAccessibleObject class implements parts of the QAccessibleInterface for QObjects.

C++ class: QAccessibleObject.

C++ documentation:

The QAccessibleObject class implements parts of the QAccessibleInterface for QObjects.

This class is part of Accessibility for QWidget Applications.

This class is mainly provided for convenience. All subclasses of the QAccessibleInterface that provide implementations of non-widget objects should use this class as their base class.

Implementations§

source§

impl QAccessibleObject

source

pub unsafe fn child_at(&self, x: c_int, y: c_int) -> Ptr<QAccessibleInterface>

Reimplemented from QAccessibleInterface::childAt().

Calls C++ function: virtual QAccessibleInterface* QAccessibleObject::childAt(int x, int y) const.

C++ documentation:

Reimplemented from QAccessibleInterface::childAt().

source

pub unsafe fn is_valid(&self) -> bool

Reimplemented from QAccessibleInterface::isValid().

Calls C++ function: virtual bool QAccessibleObject::isValid() const.

C++ documentation:

Reimplemented from QAccessibleInterface::isValid().

source

pub unsafe fn object(&self) -> QPtr<QObject>

Reimplemented from QAccessibleInterface::object().

Calls C++ function: virtual QObject* QAccessibleObject::object() const.

C++ documentation:

Reimplemented from QAccessibleInterface::object().

source

pub unsafe fn rect(&self) -> CppBox<QRect>

Reimplemented from QAccessibleInterface::rect().

Calls C++ function: virtual QRect QAccessibleObject::rect() const.

C++ documentation:

Reimplemented from QAccessibleInterface::rect().

source

pub unsafe fn set_text(&self, t: Text, text: impl CastInto<Ref<QString>>)

Reimplemented from QAccessibleInterface::setText().

Calls C++ function: virtual void QAccessibleObject::setText(QAccessible::Text t, const QString& text).

C++ documentation:

Reimplemented from QAccessibleInterface::setText().

Methods from Deref<Target = QAccessibleInterface>§

source

pub unsafe fn action_interface(&self) -> Ptr<QAccessibleActionInterface>

Calls C++ function: QAccessibleActionInterface* QAccessibleInterface::actionInterface().

source

pub unsafe fn background_color(&self) -> CppBox<QColor>

Returns the accessible's background color if applicable or an invalid QColor.

Calls C++ function: virtual QColor QAccessibleInterface::backgroundColor() const.

C++ documentation:

Returns the accessible’s background color if applicable or an invalid QColor.

See also foregroundColor().

source

pub unsafe fn child(&self, index: c_int) -> Ptr<QAccessibleInterface>

Returns the accessible child with index index. 0-based index. The number of children of an object can be checked with childCount.

Calls C++ function: pure virtual QAccessibleInterface* QAccessibleInterface::child(int index) const.

C++ documentation:

Returns the accessible child with index index. 0-based index. The number of children of an object can be checked with childCount.

Returns 0 when asking for an invalid child (e.g. when the child became invalid in the meantime).

See also childCount() and parent().

source

pub unsafe fn child_at(&self, x: c_int, y: c_int) -> Ptr<QAccessibleInterface>

Returns the QAccessibleInterface of a child that contains the screen coordinates (x, y). If there are no children at this position this function returns 0. The returned accessible must be a child, but not necessarily a direct child.

Calls C++ function: pure virtual QAccessibleInterface* QAccessibleInterface::childAt(int x, int y) const.

C++ documentation:

Returns the QAccessibleInterface of a child that contains the screen coordinates (x, y). If there are no children at this position this function returns 0. The returned accessible must be a child, but not necessarily a direct child.

This function is only relyable for visible objects (invisible object might not be laid out correctly).

All visual objects provide this information.

A default implementation is provided for objects inheriting QAccessibleObject. This will iterate over all children. If the widget manages its children (e.g. a table) it will be more efficient to write a specialized implementation.

See also rect().

source

pub unsafe fn child_count(&self) -> c_int

Returns the number of children that belong to this object. A child can provide accessibility information on its own (e.g. a child widget), or be a sub-element of this accessible object.

Calls C++ function: pure virtual int QAccessibleInterface::childCount() const.

C++ documentation:

Returns the number of children that belong to this object. A child can provide accessibility information on its own (e.g. a child widget), or be a sub-element of this accessible object.

All objects provide this information.

See also indexOfChild().

source

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

The QAccessibleInterface class defines an interface that exposes information about accessible objects.

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

C++ documentation:

The QAccessibleInterface class defines an interface that exposes information about accessible objects.

This class is part of Accessibility for QWidget Applications.

Accessibility tools (also called AT Clients), such as screen readers or braille displays, require high-level information about accessible objects in an application. Accessible objects provide specialized input and output methods, making it possible for users to use accessibility tools with enabled applications (AT Servers).

Every element that the user needs to interact with or react to is an accessible object, and should provide this information. These are mainly visual objects, such as widgets and widget elements, but can also be content, such as sounds.

The AT client uses three basic concepts to acquire information about any accessible object in an application:

  • Properties The client can read information about accessible objects. In some cases the client can also modify these properties; such as text in a line edit.
  • Actions The client can invoke actions like pressing a button or .
  • Relationships and Navigation The client can traverse from one accessible object to another, using the relationships between objects.

The QAccessibleInterface defines the API for these three concepts.

source

pub unsafe fn editable_text_interface( &self ) -> Ptr<QAccessibleEditableTextInterface>

Calls C++ function: QAccessibleEditableTextInterface* QAccessibleInterface::editableTextInterface().

source

pub unsafe fn focus_child(&self) -> Ptr<QAccessibleInterface>

Returns the object that has the keyboard focus.

Calls C++ function: virtual QAccessibleInterface* QAccessibleInterface::focusChild() const.

C++ documentation:

Returns the object that has the keyboard focus.

The object returned can be any descendant, including itself.

source

pub unsafe fn foreground_color(&self) -> CppBox<QColor>

Returns the accessible's foreground color if applicable or an invalid QColor.

Calls C++ function: virtual QColor QAccessibleInterface::foregroundColor() const.

C++ documentation:

Returns the accessible’s foreground color if applicable or an invalid QColor.

See also backgroundColor().

source

pub unsafe fn index_of_child( &self, arg1: impl CastInto<Ptr<QAccessibleInterface>> ) -> c_int

Returns the 0-based index of the object child in this object's children list, or -1 if child is not a child of this object.

Calls C++ function: pure virtual int QAccessibleInterface::indexOfChild(const QAccessibleInterface* arg1) const.

C++ documentation:

Returns the 0-based index of the object child in this object’s children list, or -1 if child is not a child of this object.

All objects provide this information about their children.

See also childCount().

source

pub unsafe fn interface_cast(&self, arg1: InterfaceType) -> *mut c_void

Returns a specialized accessibility interface type from the generic QAccessibleInterface.

Calls C++ function: virtual void* QAccessibleInterface::interface_cast(QAccessible::InterfaceType arg1).

C++ documentation:

Returns a specialized accessibility interface type from the generic QAccessibleInterface.

This function must be reimplemented when providing more information about a widget or object through the specialized interfaces. For example a line edit should implement the QAccessibleTextInterface.

Qt's QLineEdit for example has its accessibility support implemented in QAccessibleLineEdit.

void QAccessibleLineEdit::interface_cast(QAccessible::InterfaceType t) { if (t == QAccessible::TextInterface) return static_cast<QAccessibleTextInterface>(this); return QAccessibleWidget::interface_cast(t); }

See also QAccessible::InterfaceType, QAccessibleTextInterface, QAccessibleValueInterface, QAccessibleActionInterface, QAccessibleTableInterface, and QAccessibleTableCellInterface.

source

pub unsafe fn is_valid(&self) -> bool

Returns true if all the data necessary to use this interface implementation is valid (e.g. all pointers are non-null); otherwise returns false.

Calls C++ function: pure virtual bool QAccessibleInterface::isValid() const.

C++ documentation:

Returns true if all the data necessary to use this interface implementation is valid (e.g. all pointers are non-null); otherwise returns false.

See also object().

source

pub unsafe fn object(&self) -> QPtr<QObject>

Returns a pointer to the QObject this interface implementation provides information for.

Calls C++ function: pure virtual QObject* QAccessibleInterface::object() const.

C++ documentation:

Returns a pointer to the QObject this interface implementation provides information for.

See also isValid().

source

pub unsafe fn parent(&self) -> Ptr<QAccessibleInterface>

Returns the QAccessibleInterface of the parent in the accessible object hierarchy.

Calls C++ function: pure virtual QAccessibleInterface* QAccessibleInterface::parent() const.

C++ documentation:

Returns the QAccessibleInterface of the parent in the accessible object hierarchy.

Returns 0 if no parent exists (e.g. for the top level application object).

See also child().

source

pub unsafe fn rect(&self) -> CppBox<QRect>

Returns the geometry of the object. The geometry is in screen coordinates.

Calls C++ function: pure virtual QRect QAccessibleInterface::rect() const.

C++ documentation:

Returns the geometry of the object. The geometry is in screen coordinates.

This function is only reliable for visible objects (invisible objects might not be laid out correctly).

All visual objects provide this information.

See also childAt().

source

pub unsafe fn relations_1a( &self, match_: QFlags<RelationFlag> ) -> CppBox<QVectorOfQPairOfQAccessibleInterfaceQFlagsRelationFlag>

Returns the meaningful relations to other widgets. Usually this will not return parent/child relations, unless they are handled in a specific way such as in tree views. It will typically return the labelled-by and label relations.

Calls C++ function: virtual QVector<QPair<QAccessibleInterface*, QFlags<QAccessible::RelationFlag>>> QAccessibleInterface::relations(QFlags<QAccessible::RelationFlag> match = …) const.

C++ documentation:

Returns the meaningful relations to other widgets. Usually this will not return parent/child relations, unless they are handled in a specific way such as in tree views. It will typically return the labelled-by and label relations.

It is possible to filter the relations by using match. It should never return itself.

See also parent() and child().

source

pub unsafe fn relations_0a( &self ) -> CppBox<QVectorOfQPairOfQAccessibleInterfaceQFlagsRelationFlag>

Returns the meaningful relations to other widgets. Usually this will not return parent/child relations, unless they are handled in a specific way such as in tree views. It will typically return the labelled-by and label relations.

Calls C++ function: virtual QVector<QPair<QAccessibleInterface*, QFlags<QAccessible::RelationFlag>>> QAccessibleInterface::relations() const.

C++ documentation:

Returns the meaningful relations to other widgets. Usually this will not return parent/child relations, unless they are handled in a specific way such as in tree views. It will typically return the labelled-by and label relations.

It is possible to filter the relations by using match. It should never return itself.

See also parent() and child().

source

pub unsafe fn role(&self) -> Role

Returns the role of the object. The role of an object is usually static.

Calls C++ function: pure virtual QAccessible::Role QAccessibleInterface::role() const.

C++ documentation:

Returns the role of the object. The role of an object is usually static.

All accessible objects have a role.

See also text() and state().

source

pub unsafe fn set_text(&self, t: Text, text: impl CastInto<Ref<QString>>)

Sets the text property t of the object to text.

Calls C++ function: pure virtual void QAccessibleInterface::setText(QAccessible::Text t, const QString& text).

C++ documentation:

Sets the text property t of the object to text.

Note that the text properties of most objects are read-only so calling this function might have no effect.

See also text().

source

pub unsafe fn state(&self) -> CppBox<State>

Returns the current state of the object. The returned value is a combination of the flags in the QAccessible::StateFlag enumeration.

Calls C++ function: pure virtual QAccessible::State QAccessibleInterface::state() const.

C++ documentation:

Returns the current state of the object. The returned value is a combination of the flags in the QAccessible::StateFlag enumeration.

All accessible objects have a state.

See also text() and role().

source

pub unsafe fn table_cell_interface(&self) -> Ptr<QAccessibleTableCellInterface>

Calls C++ function: QAccessibleTableCellInterface* QAccessibleInterface::tableCellInterface().

source

pub unsafe fn table_interface(&self) -> Ptr<QAccessibleTableInterface>

Calls C++ function: QAccessibleTableInterface* QAccessibleInterface::tableInterface().

source

pub unsafe fn text(&self, t: Text) -> CppBox<QString>

Returns the value of the text property t of the object.

Calls C++ function: pure virtual QString QAccessibleInterface::text(QAccessible::Text t) const.

C++ documentation:

Returns the value of the text property t of the object.

The QAccessible::Name is a string used by clients to identify, find, or announce an accessible object for the user. All objects must have a name that is unique within their container. The name can be used differently by clients, so the name should both give a short description of the object and be unique.

An accessible object's QAccessible::Description provides textual information about an object's visual appearance. The description is primarily used to provide greater context for vision-impaired users, but is also used for context searching or other applications. Not all objects have a description. An "OK" button would not need a description, but a tool button that shows a picture of a smiley would.

The QAccessible::Value of an accessible object represents visual information contained by the object, e.g. the text in a line edit. Usually, the value can be modified by the user. Not all objects have a value, e.g. static text labels don't, and some objects have a state that already is the value, e.g. toggle buttons.

The QAccessible::Help text provides information about the function and usage of an accessible object. Not all objects provide this information.

The QAccessible::Accelerator is a keyboard shortcut that activates the object's default action. A keyboard shortcut is the underlined character in the text of a menu, menu item or widget, and is either the character itself, or a combination of this character and a modifier key like Alt, Ctrl or Shift. Command controls like tool buttons also have shortcut keys and usually display them in their tooltip.

All objects provide a string for QAccessible::Name.

See also setText(), role(), and state().

source

pub unsafe fn text_interface(&self) -> Ptr<QAccessibleTextInterface>

Calls C++ function: QAccessibleTextInterface* QAccessibleInterface::textInterface().

source

pub unsafe fn value_interface(&self) -> Ptr<QAccessibleValueInterface>

Calls C++ function: QAccessibleValueInterface* QAccessibleInterface::valueInterface().

source

pub unsafe fn virtual_hook(&self, id: c_int, data: *mut c_void)

Calls C++ function: virtual void QAccessibleInterface::virtual_hook(int id, void* data).

source

pub unsafe fn window(&self) -> QPtr<QWindow>

Returns the window associated with the underlying object. For instance, QAccessibleWidget reimplements this and returns the windowHandle() of the QWidget.

Calls C++ function: virtual QWindow* QAccessibleInterface::window() const.

C++ documentation:

Returns the window associated with the underlying object. For instance, QAccessibleWidget reimplements this and returns the windowHandle() of the QWidget.

It is used on some platforms to be able to notify the AT client about state changes. The backend will traverse up all ancestors until it finds a window. (This means that at least one interface among the ancestors should return a valid QWindow pointer).

The default implementation returns 0.

Trait Implementations§

source§

impl Deref for QAccessibleObject

source§

fn deref(&self) -> &QAccessibleInterface

Calls C++ function: QAccessibleInterface* static_cast<QAccessibleInterface*>(QAccessibleObject* ptr).

§

type Target = QAccessibleInterface

The resulting type after dereferencing.
source§

impl DynamicCast<QAccessibleObject> for QAccessibleInterface

source§

unsafe fn dynamic_cast(ptr: Ptr<QAccessibleInterface>) -> Ptr<QAccessibleObject>

Calls C++ function: QAccessibleObject* dynamic_cast<QAccessibleObject*>(QAccessibleInterface* ptr).

source§

impl StaticDowncast<QAccessibleObject> for QAccessibleInterface

source§

unsafe fn static_downcast( ptr: Ptr<QAccessibleInterface> ) -> Ptr<QAccessibleObject>

Calls C++ function: QAccessibleObject* static_cast<QAccessibleObject*>(QAccessibleInterface* ptr).

source§

impl StaticUpcast<QAccessibleInterface> for QAccessibleObject

source§

unsafe fn static_upcast( ptr: Ptr<QAccessibleObject> ) -> Ptr<QAccessibleInterface>

Calls C++ function: QAccessibleInterface* static_cast<QAccessibleInterface*>(QAccessibleObject* ptr).

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.