Accessible2Object

Struct Accessible2Object 

Source
pub struct Accessible2Object { /* private fields */ }

Implementations§

Source§

impl Accessible2Object

Source

pub fn from_accessible_object(obj: AccessibleObject) -> Result<Self>

Source

pub fn selection_ranges(&self) -> Vec<IA2Range>

返回可访问的中的选择的范围数组。

Source

pub fn attribute(&self, name: &str) -> IA2ResultType

获取对象特定的属性值。 name 属性名称。

Source

pub fn accessible_with_caret(&self) -> Option<(IUnknown, i32)>

返回此对象子树中可访问的最深超文本,以及其中的插入符号偏移量。

Source

pub fn relation_targets_of_type( &self, type: &str, max_targets: i32, ) -> Vec<IUnknown>

返回指定目标类型的关系目标。 type 请求的@ref grpRelations“关系类型”。 max_targets请求的目标数。零表示应返回所有目标。

Source

pub fn n_relations(&self) -> i32

返回此对象的可访问关系数。

Source

pub fn relation(&self, index: i32) -> Result<AccessibleRelation>

返回此对象的一个可访问关系。 index 从0开始的关系对象索引。

Source

pub fn relations(&self, max_relations: i32) -> Vec<AccessibleRelation>

返回此对象的多个可访问关系。 max_relations 要获取关系对象的数量。

Source

pub fn role(&self) -> i32

返回%IAccessible2对象的角色。 为了方便起见,MSAA角色也通过此方法传递,因此AT不必也通过MSAA的get_role获取角色。 %IAccessible2角色不应通过MSAA的get_accRole传递。 为了与未启用IAccessible2的AT兼容,IAccessible 2应用程序还应添加对get_accRole的支持,以返回最接近的MSAA角色或role_SYSTEM_CLIENT(MSAA定义的默认角色)(如果不匹配)。 此方法在IDL中缺少[propget]前缀。结果是该方法在生成的C++代码中被命名为role,而不是get_role。

Source

pub fn scroll_to(&self, scroll_type: IA2ScrollType) -> bool

使对象在屏幕上可见。 scroll_type 定义对象应放在屏幕上的位置。

Source

pub fn scroll_to_point( &self, coordinate_type: IA2CoordinateType, x: i32, y: i32, ) -> bool

将对象的左上角移动到指定位置。 coordinate_type 指定坐标是相对于屏幕还是相对于父对象。 x 定义x坐标。 y 定义y坐标。

Source

pub fn group_position(&self) -> (i32, i32, i32)

返回分组信息(group_level, similar_items_in_group, position_in_group)。 用于树项目、列表项目、选项卡面板标签、单选按钮等。也用于非文本对象的集合。 group_level从1开始,0表示此值不适用。 similar_items_in_group 从1开始,0表示此值不适用。 position_in_group 从1开始,0表示此值不适用。这是对当前组中对象的索引,而不是对同一组级别的所有对象的索引。如果至少有一个值有效。 这个方法是用来描述对象包含结构的性质。它由树、树网格、嵌套列表、嵌套菜单公开,但不由使用级别对象属性的标题公开。它也通过单选按钮(group_level==0)显示。 一般的,这通常不会在组合框上实现,以描述其内容的性质。

Source

pub fn states(&self) -> Result<AccessibleStates>

返回包含任何IAccessible2状态的位带。 IAccessible2状态是MSAA状态之外的状态,在IA2States枚举中定义。

Source

pub fn extended_role(&self) -> Result<String>

返回扩展角色。 扩展角色是由应用程序动态生成的角色。 它不是由%IAccessible2规范预定义的。

Source

pub fn localized_extended_role(&self) -> Result<String>

返回本地化的扩展角色。

Source

pub fn n_extended_states(&self) -> Result<i32>

返回扩展状态的数目。

Source

pub fn extended_states(&self) -> Vec<String>

返回扩展状态(字符串数组)。扩展状态是由应用程序动态生成的状态。它不是由%IAccessible2规范预定义的。

Source

pub fn localized_extended_states(&self) -> Vec<String>

返回本地化的扩展状态(字符串数组)。

Source

pub fn unique_id(&self) -> Result<i32>

返回唯一的ID。 uniqueID是此对象的标识符,在当前窗口中是唯一的,并且在可访问对象的生存期内保持不变。 uniqueID与以下内容无关:

  • MSAA对象ID,服务器使用它来消除每个HWND的IAccessibles之间的歧义,或
  • MSAA childID,用于消除由IAccessible管理的子级之间的歧义。 提供该值是为了使AT即使在不处理对象的事件时也可以访问唯一的运行时持久标识符。 这个值何时有用的一个例子是,如果AT想要建立一个缓存。AT除了缓存其他数据之外,还可以缓存uniqueID。 当事件被触发时,AT可以将uniqueId映射到其内部模型。 因此,如果存在REORDER/SHOW/HIDE事件,AT就会知道内部结构的哪一部分已经失效,并且可以只重新蚀刻该部分。 AT也可以使用该值来确定当前控件是否已经改变。如果选项卡顺序中相邻的两个控件的角色相同,则可用于检测新控件。 AT对该值的另一个使用是识别分组对象何时改变,例如,何时从一个组中的单选按钮移动到不同组中的按钮。 实现这一点的一种方法是创建一个具有32位数字生成器和重用池的工厂。数字生成器将发出从1开始的数字。每次对象的生命周期结束时,其编号都会保存到重用池中。只要重用池为空,就会使用数字生成器。 创建唯一ID的另一种方法是根据指针值(例如对象的地址)生成唯一ID。这将是唯一的,因为没有两个活动对象可以使用相同的分配内存空间。
Source

pub fn window_handle(&self) -> Option<HWND>

辅助技术(AT)将不得不在每个IAccessible上使用WindowFromAccessibleObject。 它很慢,因为它涉及一个循环,该循环向上爬祖先链并搜索ROLE_WINDOW对象,将其映射回窗口句柄。这是由oleacc.dll实现的。 然而,有了windowHandle的可用性,可以避免这个过程。

Source

pub fn index_in_parent(&self) -> i32

返回此对象在其父对象中的索引。 从0开始,-1表示没有父级;

Source

pub fn locale(&self) -> Result<IA2Locale>

返回可访问对象的IA2Locale。

Source

pub fn attributes(&self) -> String

返回特定于此对象的属性,例如单元格的公式。

Trait Implementations§

Source§

impl Debug for Accessible2Object

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.