# ITextProvider2

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/automation/provider/trait-itextprovider2/

**trait** · [`ferroui-controls`](/docs/0.5.0/api/ferroui-controls/) · v0.5.0

```rust
trait ITextProvider2: ITextProvider
```

The additional operations of the WinUI/UI Automation Text2 pattern.
Text ranges use the same live document and UTF-16 coordinates as Text.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/provider/i_text_provider2.rs#L19)

## Members

- [`range_from_annotation`](#function-range_from_annotation)
- [`get_caret_range`](#function-get_caret_range)

<a id="function-range_from_annotation"></a>

### range_from_annotation

```rust
fn range_from_annotation(self: &Self, annotation: &Ref<AutomationPeer>) -> Result<Rc<dyn ITextRangeProvider>, ProviderError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/provider/i_text_provider2.rs#L20)

<a id="function-get_caret_range"></a>

### get_caret_range

```rust
fn get_caret_range(self: &Self) -> Result<TextCaretRange, ProviderError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/provider/i_text_provider2.rs#L24)

## Trait implementations

- [`ITextProvider2`](/docs/0.5.0/api/ferroui-controls/automation/provider/trait-itextprovider2/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
