FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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).

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<AutomationPeer>
    

    Returns a strong reference to this object.

    Source

    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.

    Source

    bring_into_view_core

    fn bring_into_view_core(self: &Self)
    

    Source

    get_accelerator_key_core

    fn get_accelerator_key_core(self: &Self) -> Option<String>
    

    Source

    get_access_key_core

    fn get_access_key_core(self: &Self) -> Option<String>
    

    Source

    get_automation_control_type_core

    fn get_automation_control_type_core(self: &Self) -> AutomationControlType
    

    Source

    get_automation_id_core

    fn get_automation_id_core(self: &Self) -> Option<String>
    

    Source

    get_bounding_rectangle_core

    fn get_bounding_rectangle_core(self: &Self) -> Rect
    

    Source

    get_or_create_children_core

    fn get_or_create_children_core(self: &Self) -> Rc<Vec<Ref<AutomationPeer>>>
    

    Source

    get_class_name_core

    fn get_class_name_core(self: &Self) -> String
    

    Source

    get_labeled_by_core

    fn get_labeled_by_core(self: &Self) -> Option<Ref<AutomationPeer>>
    

    Source

    get_name_core

    fn get_name_core(self: &Self) -> Option<String>
    

    Source

    get_help_text_core

    fn get_help_text_core(self: &Self) -> Option<String>
    

    Source

    get_placeholder_text_core

    fn get_placeholder_text_core(self: &Self) -> Option<String>
    

    Source

    get_landmark_type_core

    fn get_landmark_type_core(self: &Self) -> Option<AutomationLandmarkType>
    

    Source

    get_heading_level_core

    fn get_heading_level_core(self: &Self) -> i32
    

    Source

    get_item_type_core

    fn get_item_type_core(self: &Self) -> Option<String>
    

    Source

    get_item_status_core

    fn get_item_status_core(self: &Self) -> Option<String>
    

    Source

    get_parent_core

    fn get_parent_core(self: &Self) -> Option<Ref<AutomationPeer>>
    

    Source

    has_keyboard_focus_core

    fn has_keyboard_focus_core(self: &Self) -> bool
    

    Source

    is_content_element_core

    fn is_content_element_core(self: &Self) -> bool
    

    Source

    is_control_element_core

    fn is_control_element_core(self: &Self) -> bool
    

    Source

    is_enabled_core

    fn is_enabled_core(self: &Self) -> bool
    

    Source

    is_keyboard_focusable_core

    fn is_keyboard_focusable_core(self: &Self) -> bool
    

    Source

    is_offscreen_core

    fn is_offscreen_core(self: &Self) -> bool
    

    Source

    set_focus_core

    fn set_focus_core(self: &Self)
    

    Source

    show_context_menu_core

    fn show_context_menu_core(self: &Self) -> bool
    

    Source

    get_live_setting_core

    fn get_live_setting_core(self: &Self) -> AutomationLiveSetting
    

    Source

    get_control_type_override_core

    fn get_control_type_override_core(self: &Self) -> AutomationControlType
    

    Source

    get_class_name_override_core

    fn get_class_name_override_core(self: &Self) -> String
    

    Source

    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).

    Source

    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).

    Source

    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).

    Source

    is_content_element_override_core

    fn is_content_element_override_core(self: &Self) -> bool
    

    Source

    is_control_element_override_core

    fn is_control_element_override_core(self: &Self) -> bool
    

    Source

    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.

    Source

    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.

    Source

    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).

    Source

    construct

    fn construct() -> Self
    

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

    Source

    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).

    Source

    bring_into_view

    fn bring_into_view(self: &Self)
    

    Attempts to bring the element associated with the automation peer into view.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    get_children

    fn get_children(self: &Self) -> Rc<Vec<Ref<AutomationPeer>>>
    

    Gets the child automation peers.

    Source

    get_class_name

    fn get_class_name(self: &Self) -> String
    

    Gets a string that describes the class of the element.

    Source

    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.

    Source

    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.

    Source

    get_name

    fn get_name(self: &Self) -> String
    

    Gets text that describes the element that is associated with this automation peer.

    Source

    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.

    Source

    get_placeholder_text

    fn get_placeholder_text(self: &Self) -> String
    

    Gets the placeholder text for the element that is associated with this automation peer.

    Source

    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.

    Source

    get_heading_level

    fn get_heading_level(self: &Self) -> i32
    

    Gets the heading level that is associated with this automation peer.

    Source

    get_item_type

    fn get_item_type(self: &Self) -> Option<String>
    

    Gets the item type that is associated with this automation peer.

    Source

    get_item_status

    fn get_item_status(self: &Self) -> Option<String>
    

    Gets the item status that is associated with this automation peer.

    Source

    get_parent

    fn get_parent(self: &Self) -> Option<Ref<AutomationPeer>>
    

    Gets the automation peer that is the parent of this automation peer.

    Source

    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).

    Source

    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).

    Source

    to_screen

    fn to_screen(self: &Self, rect: Rect) -> Option<Rect>
    

    Converts a rectangle in the coordinates of the visual root to screen coordinates.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    is_enabled

    fn is_enabled(self: &Self) -> bool
    

    Gets a value indicating whether the control is enabled for user interaction.

    Source

    is_keyboard_focusable

    fn is_keyboard_focusable(self: &Self) -> bool
    

    Gets a value that indicates whether the element can accept keyboard focus.

    Source

    is_offscreen

    fn is_offscreen(self: &Self) -> bool
    

    Gets a value that indicates whether an element is off the screen.

    Source

    set_focus

    fn set_focus(self: &Self)
    

    Sets the keyboard focus on the element that is associated with this automation peer.

    Source

    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.

    Source

    get_live_setting

    fn get_live_setting(self: &Self) -> AutomationLiveSetting
    

    Gets the current live setting that is associated with this automation peer.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    set_events_source

    fn set_events_source(self: &Self, value: impl Into<Nullable<AutomationPeer>>)
    

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.