# WindowBaseAutomationPeer

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

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

```rust
struct WindowBaseAutomationPeer
```

An automation peer which represents a [`WindowBase`](/docs/0.5.0/api/ferroui-controls/struct-windowbase/): the root of an
automation tree.

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

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`owner`](#function-owner)
- [`focus_changed`](#function-focus_changed)
- [`get_focus`](#function-get_focus)
- [`get_peer_from_point`](#function-get_peer_from_point)
- [`start_tracking_focus`](#function-start_tracking_focus)
- [`stop_tracking_focus`](#function-stop_tracking_focus)

<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/window_base_automation_peer.rs#L26)

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

### to_ref

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

Returns a strong reference to this object.

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

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

### construct

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

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

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

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

### new

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

Initializes a new peer of `owner`.

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

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

### owner

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

Gets the owning window.

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

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

### focus_changed

```rust
fn focus_changed(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
```

Raised when the focus changes (the root provider contract).

Dropping the returned guard removes the handler; `Subscription::detach` keeps it for the
life of the peer.

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

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

### get_focus

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

Gets the peer of the currently focused element (the root provider
contract).

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

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

### get_peer_from_point

```rust
fn get_peer_from_point(self: &Self, p: Point) -> Option<Ref<AutomationPeer>>
```

Gets the peer of the element at the specified point, expressed in
top-level coordinates (the root provider contract).

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

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

### start_tracking_focus

```rust
fn start_tracking_focus(self: &Self)
```

Starts following the focused element of the keyboard device.

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

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

### stop_tracking_focus

```rust
fn stop_tracking_focus(self: &Self)
```

Stops following the focused element of the keyboard device.

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

## 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<WindowBaseAutomationPeer>`](/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/).
