pub struct UiAutomationTextPattern2(/* private fields */);Expand description
扩展 UiAutomationTextPattern。
Implementations§
source§impl UiAutomationTextPattern2
impl UiAutomationTextPattern2
sourcepub fn obtain(value: &UiAutomationElement) -> Result<Self, String>
pub fn obtain(value: &UiAutomationElement) -> Result<Self, String>
从UI元素获取此模式。
sourcepub fn get_caret_range(&self) -> Option<(bool, UiAutomationTextRange)>
pub fn get_caret_range(&self) -> Option<(bool, UiAutomationTextRange)>
查询属于基于文本的控件的插入符号位置的零长度文本范围。
此方法检索一个文本区域,客户端可以使用该文本区域查找属于基于文本的控件的插入符号的边界矩形,或查找插入符号附近的文本。
返回(is_active,range)。
is_active 如果包含插入符号的基于文本的控件具有键盘焦点,则为 true,否则为 false。如果 is_active 为 false,则属于基于文本的控件的插入符号可能与系统插入符号位于同一位置。
range 接收一个文本范围,该范围表示属于基于文本的控件的插入符号的当前位置。
sourcepub fn range_from_annotation(
&self,
annotation: &UiAutomationElement,
) -> UiAutomationTextRange
pub fn range_from_annotation( &self, annotation: &UiAutomationElement, ) -> UiAutomationTextRange
查询包含文本的文本范围,该文本是与指定批注元素关联的批注的目标。
annotation 要检索其目标文本的批注元素。此元素是实现文档的 UiAutomationTextPattern2 的元素的同级元素。
Trait Implementations§
impl Send for UiAutomationTextPattern2
impl Sync for UiAutomationTextPattern2
Auto Trait Implementations§
impl Freeze for UiAutomationTextPattern2
impl RefUnwindSafe for UiAutomationTextPattern2
impl Unpin for UiAutomationTextPattern2
impl UnwindSafe for UiAutomationTextPattern2
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more