ControlAutomationPeer
struct · ferroui-controls · v0.5.0
struct ControlAutomationPeer
An automation peer which represents a Control.
The peer does not keep its control alive (the control owns the peer); see
owner.
Members
TYPEto_refget_children_coreget_visual_parentconstructnewownertry_ownerget_or_createcreate_peer_for_elementfrom_elementinvalidate_childreninvalidate_parent
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<ControlAutomationPeer>
Returns a strong reference to this object.
get_children_core
fn get_children_core(self: &Self) -> Option<Vec<Ref<AutomationPeer>>>
Gets the child automation peers of the peer, or None if it has
none. The default implementation returns the peers of the visible
visual children of the owner.
get_visual_parent
fn get_visual_parent(self: &Self) -> Option<Ref<Visual>>
Gets the visual the peer of which is the parent of this peer (not for use outside the framework).
construct
fn construct(owner: &Control) -> Self
Creates the class data of a peer of owner; see
ferroui_base::FerroObject::construct.
new
fn new(owner: &Control) -> Ref<Self>
Initializes a new peer of owner.
owner
fn owner(self: &Self) -> Ref<Control>
Gets the owning control.
A control owns its peer, so the peer holds the control weakly.
Panics
Panics if the control no longer exists: a peer must not be used
after its control has been released (code that keeps a peer beyond
the life of the tree keeps the control with it, or asks
try_owner).
try_owner
fn try_owner(self: &Self) -> Option<Ref<Control>>
Gets the owning control, or None if it no longer exists.
get_or_create
fn get_or_create(self: &Self, element: &Control) -> Ref<AutomationPeer>
Gets or creates an automation peer for a control: this peer for its
owner, the peer of element otherwise.
create_peer_for_element
fn create_peer_for_element(element: &Control) -> Ref<AutomationPeer>
Gets an existing automation peer of a control, or creates a new one if it does not yet exist.
Despite the name (which comes from the analogous WPF API), this method does not create a new peer if one already exists: instead it returns the existing peer.
from_element
fn from_element(element: &Control) -> Option<Ref<AutomationPeer>>
Gets an existing automation peer of a control, or None if it does
not yet exist.
invalidate_children
fn invalidate_children(self: &Self)
Invalidates the peer's children and causes a re-read from
get_children_core.
invalidate_parent
fn invalidate_parent(self: &Self)
Invalidates the peer's parent.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeAutomationPeerImplExtControlAutomationPeerImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyFerroObjectImplExtClassDefaultsErasedDestructorIntoEitherDerefUpcast<T>Upcast<ControlAutomationPeer>StaticTypeObjectTypeSubclassable<T>FerroObjectImplControlAutomationPeerImplAutomationPeerImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.