AutomationPeer
struct · ferroui-controls · v0.5.0
struct AutomationPeer
Provides a base class that exposes an element to UI Automation.
The members named *_core are the overridable ones; the members without
the suffix are the public surface that automation clients call. The
members the reference declares abstract panic in this class: a peer class
overrides every one of them (deriving from ControlAutomationPeer does).
Members
TYPEto_refget_localized_control_type_corebring_into_view_coreget_accelerator_key_coreget_access_key_coreget_automation_control_type_coreget_automation_id_coreget_bounding_rectangle_coreget_or_create_children_coreget_class_name_coreget_labeled_by_coreget_name_coreget_help_text_coreget_placeholder_text_coreget_landmark_type_coreget_heading_level_coreget_item_type_coreget_item_status_coreget_parent_corehas_keyboard_focus_coreis_content_element_coreis_control_element_coreis_enabled_coreis_keyboard_focusable_coreis_offscreen_coreset_focus_coreshow_context_menu_coreget_live_setting_coreget_control_type_override_coreget_class_name_override_coreget_automation_root_coreget_visual_root_coreto_screen_coreis_content_element_override_coreis_control_element_override_coreget_provider_coretry_set_parentis_element_available_coreconstructis_element_availablebring_into_viewget_accelerator_keyget_access_keyget_automation_control_typeget_automation_idget_bounding_rectangleget_childrenget_class_nameget_labeled_byget_localized_control_typeget_nameget_help_textget_placeholder_textget_landmark_typeget_heading_levelget_item_typeget_item_statusget_parentget_visual_rootget_automation_rootto_screenhas_keyboard_focusis_content_elementis_control_elementis_enabledis_keyboard_focusableis_offscreenset_focusshow_context_menuget_live_settingget_providerchildren_changedproperty_changedraise_children_changed_eventraise_property_changed_eventevents_sourceset_events_sourcetext_edit_text_changedraise_text_edit_text_changed_eventensure_enabled
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<AutomationPeer>
Returns a strong reference to this object.
get_localized_control_type_core
fn get_localized_control_type_core(self: &Self) -> String
Gets a human-readable localized string that represents the type of the control that is associated with this automation peer.
bring_into_view_core
fn bring_into_view_core(self: &Self)
get_accelerator_key_core
fn get_accelerator_key_core(self: &Self) -> Option<String>
get_access_key_core
fn get_access_key_core(self: &Self) -> Option<String>
get_automation_control_type_core
fn get_automation_control_type_core(self: &Self) -> AutomationControlType
get_automation_id_core
fn get_automation_id_core(self: &Self) -> Option<String>
get_bounding_rectangle_core
fn get_bounding_rectangle_core(self: &Self) -> Rect
get_or_create_children_core
fn get_or_create_children_core(self: &Self) -> Rc<Vec<Ref<AutomationPeer>>>
get_class_name_core
fn get_class_name_core(self: &Self) -> String
get_labeled_by_core
fn get_labeled_by_core(self: &Self) -> Option<Ref<AutomationPeer>>
get_name_core
fn get_name_core(self: &Self) -> Option<String>
get_help_text_core
fn get_help_text_core(self: &Self) -> Option<String>
get_placeholder_text_core
fn get_placeholder_text_core(self: &Self) -> Option<String>
get_landmark_type_core
fn get_landmark_type_core(self: &Self) -> Option<AutomationLandmarkType>
get_heading_level_core
fn get_heading_level_core(self: &Self) -> i32
get_item_type_core
fn get_item_type_core(self: &Self) -> Option<String>
get_item_status_core
fn get_item_status_core(self: &Self) -> Option<String>
get_parent_core
fn get_parent_core(self: &Self) -> Option<Ref<AutomationPeer>>
has_keyboard_focus_core
fn has_keyboard_focus_core(self: &Self) -> bool
is_content_element_core
fn is_content_element_core(self: &Self) -> bool
is_control_element_core
fn is_control_element_core(self: &Self) -> bool
is_enabled_core
fn is_enabled_core(self: &Self) -> bool
is_keyboard_focusable_core
fn is_keyboard_focusable_core(self: &Self) -> bool
is_offscreen_core
fn is_offscreen_core(self: &Self) -> bool
set_focus_core
fn set_focus_core(self: &Self)
show_context_menu_core
fn show_context_menu_core(self: &Self) -> bool
get_live_setting_core
fn get_live_setting_core(self: &Self) -> AutomationLiveSetting
get_control_type_override_core
fn get_control_type_override_core(self: &Self) -> AutomationControlType
get_class_name_override_core
fn get_class_name_override_core(self: &Self) -> String
get_automation_root_core
fn get_automation_root_core(self: &Self) -> Option<Ref<AutomationPeer>>
Gets the root of the automation tree of the peer (not for use outside the framework).
get_visual_root_core
fn get_visual_root_core(self: &Self) -> Option<Ref<AutomationPeer>>
Gets the peer of the visual root of the element (not for use outside the framework).
to_screen_core
fn to_screen_core(self: &Self, rect: Rect) -> Option<Rect>
Converts a rectangle in the coordinates of the visual root to screen coordinates (not for use outside the framework).
is_content_element_override_core
fn is_content_element_override_core(self: &Self) -> bool
is_control_element_override_core
fn is_control_element_override_core(self: &Self) -> bool
get_provider_core
fn get_provider_core(self: &Self, provider_type: ValueType) -> Option<BoxedValue>
Gets the handle of the provider contract provider_type (the
type of the handle, for example Rc<dyn IInvokeProvider>) if the
peer provides it.
try_set_parent
fn try_set_parent(self: &Self, parent: Option<Ref<AutomationPeer>>) -> bool
Sets the parent of the peer; returns whether the peer accepted it.
is_element_available_core
fn is_element_available_core(self: &Self) -> bool
Whether the element of the peer still exists (true by default;
a ControlAutomationPeer whose control is gone answers false).
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
is_element_available
fn is_element_available(self: &Self) -> bool
Whether the element of the peer still exists. The peer of a control
does not keep the control alive (the control owns its peer), so a
platform can still hold a peer whose control is gone; such a peer
answers every member below with an empty value (no name, no children,
no parent, no provider, not enabled) instead of reaching its control,
and a platform bridge reports the element as not available
(UIA_E_ELEMENTNOTAVAILABLE on Windows).
bring_into_view
fn bring_into_view(self: &Self)
Attempts to bring the element associated with the automation peer into view.
get_accelerator_key
fn get_accelerator_key(self: &Self) -> Option<String>
Gets the accelerator key combinations for the element that is associated with the UI Automation peer.
get_access_key
fn get_access_key(self: &Self) -> Option<String>
Gets the access key for the element that is associated with the automation peer.
get_automation_control_type
fn get_automation_control_type(self: &Self) -> AutomationControlType
Gets the control type for the element that is associated with the UI Automation peer.
get_automation_id
fn get_automation_id(self: &Self) -> Option<String>
Gets the automation ID of the element that is associated with the automation peer.
get_bounding_rectangle
fn get_bounding_rectangle(self: &Self) -> Rect
Gets the bounding rectangle of the element that is associated with the automation peer in top-level coordinates.
get_children
fn get_children(self: &Self) -> Rc<Vec<Ref<AutomationPeer>>>
Gets the child automation peers.
get_class_name
fn get_class_name(self: &Self) -> String
Gets a string that describes the class of the element.
get_labeled_by
fn get_labeled_by(self: &Self) -> Option<Ref<AutomationPeer>>
Gets the automation peer for the label that is targeted to the element.
get_localized_control_type
fn get_localized_control_type(self: &Self) -> String
Gets a human-readable localized string that represents the type of the control that is associated with this automation peer.
get_name
fn get_name(self: &Self) -> String
Gets text that describes the element that is associated with this automation peer.
get_help_text
fn get_help_text(self: &Self) -> String
Gets text that provides help for the element that is associated with this automation peer.
get_placeholder_text
fn get_placeholder_text(self: &Self) -> String
Gets the placeholder text for the element that is associated with this automation peer.
get_landmark_type
fn get_landmark_type(self: &Self) -> Option<AutomationLandmarkType>
Gets the control type for the element that is associated with the UI Automation peer.
get_heading_level
fn get_heading_level(self: &Self) -> i32
Gets the heading level that is associated with this automation peer.
get_item_type
fn get_item_type(self: &Self) -> Option<String>
Gets the item type that is associated with this automation peer.
get_item_status
fn get_item_status(self: &Self) -> Option<String>
Gets the item status that is associated with this automation peer.
get_parent
fn get_parent(self: &Self) -> Option<Ref<AutomationPeer>>
Gets the automation peer that is the parent of this automation peer.
get_visual_root
fn get_visual_root(self: &Self) -> Option<Ref<AutomationPeer>>
Gets the automation peer that is the root of this automation peer's visual tree (not for use outside the framework).
get_automation_root
fn get_automation_root(self: &Self) -> Option<Ref<AutomationPeer>>
Gets the automation peer that is the root of this automation peer's automation tree (not for use outside the framework).
to_screen
fn to_screen(self: &Self, rect: Rect) -> Option<Rect>
Converts a rectangle in the coordinates of the visual root to screen coordinates.
has_keyboard_focus
fn has_keyboard_focus(self: &Self) -> bool
Gets a value that indicates whether the element that is associated with this automation peer currently has keyboard focus.
is_content_element
fn is_content_element(self: &Self) -> bool
Gets a value that indicates whether the element that is associated with this automation peer contains data that is presented to the user.
is_control_element
fn is_control_element(self: &Self) -> bool
Gets a value that indicates whether the element is understood by the user as interactive or as contributing to the logical structure of the control in the GUI.
is_enabled
fn is_enabled(self: &Self) -> bool
Gets a value indicating whether the control is enabled for user interaction.
is_keyboard_focusable
fn is_keyboard_focusable(self: &Self) -> bool
Gets a value that indicates whether the element can accept keyboard focus.
is_offscreen
fn is_offscreen(self: &Self) -> bool
Gets a value that indicates whether an element is off the screen.
set_focus
fn set_focus(self: &Self)
Sets the keyboard focus on the element that is associated with this automation peer.
show_context_menu
fn show_context_menu(self: &Self) -> bool
Shows the context menu for the element that is associated with this automation peer. Returns true if a context menu is present for the element; otherwise false.
get_live_setting
fn get_live_setting(self: &Self) -> AutomationLiveSetting
Gets the current live setting that is associated with this automation peer.
get_provider
fn get_provider<I: ?Sized + 'static>(self: &Self) -> Option<Rc<I>>
Tries to get a provider of the specified contract from the peer:
peer.get_provider::<dyn IInvokeProvider>().
Returns the provider, or None if the peer does not provide it.
children_changed
fn children_changed(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
Occurs when the children of the automation peer have changed.
Dropping the returned guard removes the handler; Subscription::detach keeps it for the
life of the peer.
property_changed
fn property_changed(self: &Self, handler: impl Fn(&AutomationPropertyChangedEventArgs) -> () + 'static) -> Subscription
Occurs when a property value of the automation peer has changed.
Dropping the returned guard removes the handler; Subscription::detach keeps it for the
life of the peer.
raise_children_changed_event
fn raise_children_changed_event(self: &Self)
Raises an event to notify the automation client the peer's children have changed.
raise_property_changed_event
fn raise_property_changed_event(self: &Self, property: &'static AutomationProperty, old_value: Option<BoxedValue>, new_value: Option<BoxedValue>)
Raises an event to notify the automation client of a changed property value.
events_source
fn events_source(self: &Self) -> Option<Ref<AutomationPeer>>
The peer used as the source of this peer's native text-edit events. This relationship is weak: delegating an event never retains a control tree, and self references or cycles do not create ownership cycles.
set_events_source
fn set_events_source(self: &Self, value: impl Into<Nullable<AutomationPeer>>)
text_edit_text_changed
fn text_edit_text_changed(self: &Self, handler: impl Fn(&TextEditTextChangedEventArgs) -> () + 'static) -> Subscription
Observes the text-edit events explicitly raised by this peer. A platform receives the resolved EventsSource; this observation remains attached to the original peer. Disposal and the observer handle retain it weakly.
Dropping the returned guard removes the handler; Subscription::detach keeps it for the
life of the peer.
raise_text_edit_text_changed_event
fn raise_text_edit_text_changed_event(self: &Self, change_type: TextEditChangeType, changed_data: Vec<String>)
Raises the native text-edit event on any peer, independently of whether
it implements the TextEdit pattern. The platform creates its native
provider on demand. None has no event, matching the native contract.
EventsSource is read exactly once before invoking observers or platform code. Reentrant source changes therefore affect the next event only.
ensure_enabled
fn ensure_enabled(self: &Self) -> Result<(), ElementNotEnabledError>
Returns the error of an element that is not enabled unless the element of the peer is enabled.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeAutomationPeerImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyFerroObjectImplExtClassDefaultsErasedDestructorIntoEitherDerefUpcast<T>Upcast<AutomationPeer>StaticTypeObjectTypeSubclassable<T>FerroObjectImplAutomationPeerImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.