# IExpandCollapseProvider

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

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

```rust
trait IExpandCollapseProvider
```

Exposes methods and properties to support UI Automation client access to controls that
visually expand to display content and collapse to hide content.

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

## Members

- [`peer`](#function-peer)
- [`expand_collapse_state`](#function-expand_collapse_state)
- [`shows_menu`](#function-shows_menu)
- [`expand`](#function-expand)
- [`collapse`](#function-collapse)

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

### peer

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

The automation peer that provides this contract.

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

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

### expand_collapse_state

```rust
fn expand_collapse_state(self: &Self) -> ExpandCollapseState
```

Gets the state, expanded or collapsed, of the control.

Windows: `IExpandCollapseProvider.ExpandCollapseState`.
macOS: `NSAccessibilityProtocol.isAccessibilityExpanded`.

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

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

### shows_menu

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

Gets a value indicating whether expanding the element shows a menu of items to the user,
such as drop-down list.

Used in OSX to enable the "Show Menu" action on the element.

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

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

### expand

```rust
fn expand(self: &Self) -> Result<(), AutomationError>
```

Displays all child nodes, controls, or content of the control.

Windows: `IExpandCollapseProvider.Expand`.
macOS: `NSAccessibilityProtocol.accessibilityPerformShowMenu`.
## Errors

An `AutomationError` when the state of the element refuses the call
(the exception the member throws in the original).

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

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

### collapse

```rust
fn collapse(self: &Self) -> Result<(), AutomationError>
```

Hides all nodes, controls, or content that are descendants of the control.

Windows: `IExpandCollapseProvider.Collapse`. macOS: no mapping.
## Errors

An `AutomationError` when the state of the element refuses the call
(the exception the member throws in the original).

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

## Trait implementations

- [`IExpandCollapseProvider`](/docs/0.5.0/api/ferroui-controls/automation/provider/trait-iexpandcollapseprovider/)

## Availability

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