# ScrollViewerAutomationPeer

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/automation/peers/struct-scrollviewerautomationpeer/

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

```rust
struct ScrollViewerAutomationPeer
```

An automation peer which represents a [`ScrollViewer`](/docs/0.5.0/api/ferroui-controls/struct-scrollviewer/).

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/peers/scroll_viewer_automation_peer.rs#L14)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`owner`](#function-owner)
- [`get_horizontal_scroll_bar_peer`](#function-get_horizontal_scroll_bar_peer)
- [`get_vertical_scroll_bar_peer`](#function-get_vertical_scroll_bar_peer)
- [`horizontally_scrollable`](#function-horizontally_scrollable)
- [`horizontal_scroll_percent`](#function-horizontal_scroll_percent)
- [`horizontal_view_size`](#function-horizontal_view_size)
- [`vertically_scrollable`](#function-vertically_scrollable)
- [`vertical_scroll_percent`](#function-vertical_scroll_percent)
- [`vertical_view_size`](#function-vertical_view_size)
- [`scroll`](#function-scroll)
- [`set_scroll_percent`](#function-set_scroll_percent)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/peers/scroll_viewer_automation_peer.rs#L18)

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

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<ScrollViewerAutomationPeer>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/peers/scroll_viewer_automation_peer.rs#L18)

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

### construct

```rust
fn construct(owner: &ScrollViewer) -> Self
```

Creates the class data; see `ferroui_base::FerroObject::construct`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/peers/scroll_viewer_automation_peer.rs#L87)

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

### new

```rust
fn new(owner: &ScrollViewer) -> Ref<Self>
```

Initializes a new peer of `owner`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/peers/scroll_viewer_automation_peer.rs#L92)

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

### owner

```rust
fn owner(self: &Self) -> Ref<ScrollViewer>
```

Gets the owning scroll viewer.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/peers/scroll_viewer_automation_peer.rs#L97)

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

### get_horizontal_scroll_bar_peer

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

Gets the peer of the horizontal scroll bar of the scroll viewer, if
it has one (not for use outside the framework).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/peers/scroll_viewer_automation_peer.rs#L103)

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

### get_vertical_scroll_bar_peer

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

Gets the peer of the vertical scroll bar of the scroll viewer, if it
has one (not for use outside the framework).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/peers/scroll_viewer_automation_peer.rs#L109)

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

### horizontally_scrollable

```rust
fn horizontally_scrollable(self: &Self) -> bool
```

Gets a value that indicates whether the control can scroll
horizontally (the scroll provider contract).

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

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

### horizontal_scroll_percent

```rust
fn horizontal_scroll_percent(self: &Self) -> f64
```

Gets the current horizontal scroll position (the scroll provider
contract).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/peers/scroll_viewer_automation_peer.rs#L122)

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

### horizontal_view_size

```rust
fn horizontal_view_size(self: &Self) -> f64
```

Gets the current horizontal view size (the scroll provider
contract).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/peers/scroll_viewer_automation_peer.rs#L132)

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

### vertically_scrollable

```rust
fn vertically_scrollable(self: &Self) -> bool
```

Gets a value that indicates whether the control can scroll
vertically (the scroll provider contract).

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

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

### vertical_scroll_percent

```rust
fn vertical_scroll_percent(self: &Self) -> f64
```

Gets the current vertical scroll position (the scroll provider
contract).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/peers/scroll_viewer_automation_peer.rs#L149)

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

### vertical_view_size

```rust
fn vertical_view_size(self: &Self) -> f64
```

Gets the vertical view size (the scroll provider contract).

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

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

### scroll

```rust
fn scroll(self: &Self, horizontal_amount: ScrollAmount, vertical_amount: ScrollAmount) -> Result<(), AutomationError>
```

Scrolls the visible region of the content area horizontally and
vertically (the scroll provider contract).
## Errors

`AutomationError::ElementNotEnabled` if the control is not
enabled, `AutomationError::InvalidOperation` if a direction that
cannot scroll is asked to scroll.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/peers/scroll_viewer_automation_peer.rs#L174)

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

### set_scroll_percent

```rust
fn set_scroll_percent(self: &Self, horizontal_percent: f64, vertical_percent: f64) -> Result<(), AutomationError>
```

Sets the horizontal and vertical scroll position as a percentage of
the total content area within the control (the scroll provider
contract).
## Errors

`AutomationError::ElementNotEnabled` if the control is not
enabled, `AutomationError::InvalidOperation` if a direction that
cannot scroll is asked to scroll, `AutomationError::ArgumentOutOfRange`
if a percentage is out of range.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/automation/peers/scroll_viewer_automation_peer.rs#L223)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`AutomationPeerImplExt`](/docs/0.5.0/api/ferroui-controls/automation/peers/trait-automationpeerimplext/)
- [`ControlAutomationPeerImplExt`](/docs/0.5.0/api/ferroui-controls/automation/peers/trait-controlautomationpeerimplext/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<ScrollViewerAutomationPeer>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`ControlAutomationPeerImpl`](/docs/0.5.0/api/ferroui-controls/automation/peers/trait-controlautomationpeerimpl/)
- [`AutomationPeerImpl`](/docs/0.5.0/api/ferroui-controls/automation/peers/trait-automationpeerimpl/)

## Availability

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