# ITextRangeProvider

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

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

```rust
trait ITextRangeProvider
```

A live range of text exposed to accessibility. Range operations change the
range object; only selection methods change the control's selection. Ranges
follow edits and become unavailable when their host displays another document.

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

## Members

- [`as_any`](#function-as_any)
- [`peer`](#function-peer)
- [`clone_range`](#function-clone_range)
- [`compare`](#function-compare)
- [`compare_endpoints`](#function-compare_endpoints)
- [`expand_to_enclosing_unit`](#function-expand_to_enclosing_unit)
- [`find_attribute`](#function-find_attribute)
- [`find_text`](#function-find_text)
- [`get_attribute_value`](#function-get_attribute_value)
- [`get_bounding_rectangles`](#function-get_bounding_rectangles)
- [`get_enclosing_element`](#function-get_enclosing_element)
- [`get_text`](#function-get_text)
- [`move_by`](#function-move_by)
- [`move_endpoint_by_unit`](#function-move_endpoint_by_unit)
- [`move_endpoint_by_range`](#function-move_endpoint_by_range)
- [`select`](#function-select)
- [`add_to_selection`](#function-add_to_selection)
- [`remove_from_selection`](#function-remove_from_selection)
- [`scroll_into_view`](#function-scroll_into_view)
- [`get_children`](#function-get_children)

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

### as_any

```rust
fn as_any(self: &Self) -> &dyn Any
```



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

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

### peer

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

The text-pattern owner, also used by platform bridges for screen transforms.

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

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

### clone_range

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



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

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

### compare

```rust
fn compare(self: &Self, range: &dyn ITextRangeProvider) -> Result<bool, ProviderError>
```



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

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

### compare_endpoints

```rust
fn compare_endpoints(self: &Self, endpoint: TextPatternRangeEndpoint, range: &dyn ITextRangeProvider, target_endpoint: TextPatternRangeEndpoint) -> Result<i32, ProviderError>
```



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

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

### expand_to_enclosing_unit

```rust
fn expand_to_enclosing_unit(self: &Self, unit: TextUnit) -> Result<(), ProviderError>
```



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

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

### find_attribute

```rust
fn find_attribute(self: &Self, attribute: TextAttribute, value: &TextAttributeValue, backwards: bool) -> Result<Option<Rc<dyn ITextRangeProvider>>, ProviderError>
```



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

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

### find_text

```rust
fn find_text(self: &Self, text: &str, backwards: bool, ignore_case: bool) -> Result<Option<Rc<dyn ITextRangeProvider>>, ProviderError>
```



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

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

### get_attribute_value

```rust
fn get_attribute_value(self: &Self, attribute: TextAttribute) -> Result<TextAttributeValue, ProviderError>
```



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

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

### get_bounding_rectangles

```rust
fn get_bounding_rectangles(self: &Self) -> Result<Vec<Rect>, ProviderError>
```



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

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

### get_enclosing_element

```rust
fn get_enclosing_element(self: &Self) -> Result<Ref<AutomationPeer>, ProviderError>
```



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

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

### get_text

```rust
fn get_text(self: &Self, max_length: Option<usize>) -> Result<String, ProviderError>
```

`None` retrieves all text. A finite limit never splits a surrogate pair.

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

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

### move_by

```rust
fn move_by(self: &Self, unit: TextUnit, count: i32) -> Result<i32, ProviderError>
```



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

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

### move_endpoint_by_unit

```rust
fn move_endpoint_by_unit(self: &Self, endpoint: TextPatternRangeEndpoint, unit: TextUnit, count: i32) -> Result<i32, ProviderError>
```



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

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

### move_endpoint_by_range

```rust
fn move_endpoint_by_range(self: &Self, endpoint: TextPatternRangeEndpoint, range: &dyn ITextRangeProvider, target_endpoint: TextPatternRangeEndpoint) -> Result<(), ProviderError>
```



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

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

### select

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



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

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

### add_to_selection

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



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

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

### remove_from_selection

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



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

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

### scroll_into_view

```rust
fn scroll_into_view(self: &Self, align_to_top: bool) -> Result<(), ProviderError>
```



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

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

### get_children

```rust
fn get_children(self: &Self) -> Result<Vec<Ref<AutomationPeer>>, ProviderError>
```



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

## Availability

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