# ITextProvider

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

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

```rust
trait ITextProvider
```

A portable text-pattern contract. Text offsets and maximum lengths use UTF-16
code units. Points and rectangles use the visual root's coordinate space, as
`AutomationPeer::get_bounding_rectangle` does; platform bridges convert to
native screen coordinates at their boundary.

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

## Members

- [`peer`](#function-peer)
- [`document_range`](#function-document_range)
- [`get_selection`](#function-get_selection)
- [`get_visible_ranges`](#function-get_visible_ranges)
- [`range_from_child`](#function-range_from_child)
- [`range_from_point`](#function-range_from_point)
- [`supported_text_selection`](#function-supported_text_selection)
- [`text_changed`](#function-text_changed)
- [`text_selection_changed`](#function-text_selection_changed)

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

### peer

```rust
fn peer(self: &Self) -> Ref<AutomationPeer>
```



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

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

### document_range

```rust
fn document_range(self: &Self) -> Result<Rc<dyn ITextRangeProvider>, ProviderError>
```



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

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

### get_selection

```rust
fn get_selection(self: &Self) -> Result<Vec<Rc<dyn ITextRangeProvider>>, ProviderError>
```



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

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

### get_visible_ranges

```rust
fn get_visible_ranges(self: &Self) -> Result<Vec<Rc<dyn ITextRangeProvider>>, ProviderError>
```



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

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

### range_from_child

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



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

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

### range_from_point

```rust
fn range_from_point(self: &Self, point: Point) -> Result<Rc<dyn ITextRangeProvider>, ProviderError>
```



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

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

### supported_text_selection

```rust
fn supported_text_selection(self: &Self) -> Result<SupportedTextSelection, ProviderError>
```



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

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

### text_changed

```rust
fn text_changed(self: &Self, handler: Rc<dyn Fn() -> ()>) -> Result<Rc<dyn IDisposable>, ProviderError>
```

Observes content and formatting changes, including replacement of the document.

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

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

### text_selection_changed

```rust
fn text_selection_changed(self: &Self, handler: Rc<dyn Fn() -> ()>) -> Result<Rc<dyn IDisposable>, ProviderError>
```

Observes changes to either selection endpoint, including the insertion point.

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

## Trait implementations

- [`ITextProvider`](/docs/0.5.0/api/ferroui-controls/automation/provider/trait-itextprovider/)

## Availability

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