pub trait IInputRoot {
// Required methods
fn focus_manager(&self) -> Option<Rc<FocusManager>>;
fn pointer_over_element(&self) -> Option<Ref<InputElement>>;
fn set_pointer_over_element(&self, value: Option<Ref<InputElement>>);
fn cursor_element(&self) -> Option<Ref<InputElement>>;
fn set_cursor_element(&self, value: Option<Ref<InputElement>>);
fn root_element(&self) -> Ref<InputElement>;
fn focus_root(&self) -> Ref<InputElement>;
fn pointer_over_invalidated(&self);
// Provided methods
fn input_method(&self) -> Option<Rc<dyn ITextInputMethodImpl>> { ... }
fn try_root_element(&self) -> Option<Ref<InputElement>> { ... }
fn hit_test_chrome_element(
&self,
_point: Point,
) -> Option<WindowDecorationsElementRole> { ... }
}Expand description
Defines the interface for top-level input elements: the part of a presentation source that input is delivered through.
Required Methods§
Sourcefn focus_manager(&self) -> Option<Rc<FocusManager>>
fn focus_manager(&self) -> Option<Rc<FocusManager>>
The focus manager of the root.
Sourcefn pointer_over_element(&self) -> Option<Ref<InputElement>>
fn pointer_over_element(&self) -> Option<Ref<InputElement>>
The input element that the pointer is currently over.
Sourcefn set_pointer_over_element(&self, value: Option<Ref<InputElement>>)
fn set_pointer_over_element(&self, value: Option<Ref<InputElement>>)
Sets the input element that the pointer is currently over.
Sourcefn cursor_element(&self) -> Option<Ref<InputElement>>
fn cursor_element(&self) -> Option<Ref<InputElement>>
The element whose cursor is shown.
Sourcefn set_cursor_element(&self, value: Option<Ref<InputElement>>)
fn set_cursor_element(&self, value: Option<Ref<InputElement>>)
Sets the element whose cursor is shown.
Sourcefn root_element(&self) -> Ref<InputElement>
fn root_element(&self) -> Ref<InputElement>
The root input element.
Sourcefn focus_root(&self) -> Ref<InputElement>
fn focus_root(&self) -> Ref<InputElement>
The element keyboard input is sent to when nothing is focused.
Sourcefn pointer_over_invalidated(&self)
fn pointer_over_invalidated(&self)
Called when what is under the pointer may have changed without the pointer moving, e.g. when the capture of a pointer changes.
The root re-evaluates the pointer-over element. This is a dispatcher seam: a host should update the pointer-over state from here, either immediately or posted to its dispatcher.
Provided Methods§
Sourcefn input_method(&self) -> Option<Rc<dyn ITextInputMethodImpl>>
fn input_method(&self) -> Option<Rc<dyn ITextInputMethodImpl>>
The input method of the platform for this root, if it has one.
A root that supports text input methods overrides this; the default is a root without one.
Sourcefn try_root_element(&self) -> Option<Ref<InputElement>>
fn try_root_element(&self) -> Option<Ref<InputElement>>
Deviation (DEVIATIONS.md, Input): the optional form of
root_element.
The root input element, or None once the root has closed: what the
reference reads as a null RootElement, for the code that runs while
an event that closed its root is still being processed.
Sourcefn hit_test_chrome_element(
&self,
_point: Point,
) -> Option<WindowDecorationsElementRole>
fn hit_test_chrome_element( &self, _point: Point, ) -> Option<WindowDecorationsElementRole>
Performs a hit-test for chrome/decoration elements at the given position, in root-relative coordinates.
Returns None if no chrome element was hit (no chrome involvement
at this point),
WindowDecorationsElementRole::DecorationsElement or
WindowDecorationsElementRole::User if an interactive chrome
element was hit — the platform should redirect non-client input to
regular client input. Any other value different from
WindowDecorationsElementRole::None indicates a specific
non-client role (titlebar, resize grip, etc.).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".