Struct win_wrap::uia::pattern::text::UiAutomationTextPattern2

source ·
pub struct UiAutomationTextPattern2(/* private fields */);
Expand description

扩展 UiAutomationTextPattern。

Implementations§

source§

impl UiAutomationTextPattern2

source

pub fn obtain(value: &UiAutomationElement) -> Result<Self, String>

从UI元素获取此模式。

source

pub fn get_caret_range(&self) -> Option<(bool, UiAutomationTextRange)>

查询属于基于文本的控件的插入符号位置的零长度文本范围。 此方法检索一个文本区域,客户端可以使用该文本区域查找属于基于文本的控件的插入符号的边界矩形,或查找插入符号附近的文本。 返回(is_active,range)。 is_active 如果包含插入符号的基于文本的控件具有键盘焦点,则为 true,否则为 false。如果 is_active 为 false,则属于基于文本的控件的插入符号可能与系统插入符号位于同一位置。 range 接收一个文本范围,该范围表示属于基于文本的控件的插入符号的当前位置。

source

pub fn range_from_annotation( &self, annotation: &UiAutomationElement, ) -> UiAutomationTextRange

查询包含文本的文本范围,该文本是与指定批注元素关联的批注的目标。 annotation 要检索其目标文本的批注元素。此元素是实现文档的 UiAutomationTextPattern2 的元素的同级元素。

Trait Implementations§

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

§

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.