Skip to main content

FocusTraversalGroupNode

Struct FocusTraversalGroupNode 

Source
pub struct FocusTraversalGroupNode {
    pub policy: FocusTraversalPolicyRef,
    pub last_requested_focus: Option<FocusNodeRef>,
    /* private fields */
}
Expand description

A special focus node that only FocusTraversalGroup uses so that it can be used to cache the following in the focus tree:

  • the focus traversal policy — this allows traversal code to find groups in the focus tree.
  • the last focused node — this allows the policy to be invalidated when a focus change was not triggered via a traversal request.

Fields§

§policy: FocusTraversalPolicyRef

The policy this group imposes.

§last_requested_focus: Option<FocusNodeRef>

The node the policy last requested focus for.

Implementations§

Source§

impl FocusTraversalGroupNode

Source

pub fn new( app: &mut App, policy: FocusTraversalPolicyRef, ) -> Ref<FocusTraversalGroupNode>

Creates a FocusTraversalGroupNode with the given policy.

Trait Implementations§

Source§

impl ChangeNotifier for FocusTraversalGroupNode

Source§

fn change_notifier_data(&self) -> &ChangeNotifierData

Source§

fn change_notifier_data_mut(&mut self) -> &mut ChangeNotifierData

Source§

fn will_add_listener(self: Handle<Self>, app: &mut App)

Runs before the listener is stored. Dart overrides of addListener that work before super.addListener go here.
Source§

fn did_remove_listener(self: Handle<Self>, app: &mut App)

Runs after the listener is removed. Dart overrides of removeListener that work after super.removeListener go here.
Source§

impl FocusNodeLeaf for FocusTraversalGroupNode

Source§

fn focus_node_data(self: Handle<Self>, app: &App) -> &FocusNodeData

Dart’s FocusNode fields, held under the field focus_node (focus_node_accessors!).
Source§

fn focus_node_data_mut(self: Handle<Self>, app: &mut App) -> &mut FocusNodeData

Source§

fn as_node(self: Handle<Self>) -> AnyFocusNode

This node as the erased AnyFocusNode — what to pass where a Dart API takes a FocusNode. Read more
Source§

fn as_scope(self: Handle<Self>) -> Option<Handle<FocusScopeNode>>

Dart’s node is FocusScopeNode.
Source§

fn nearest_scope( self: Handle<Self>, app: &mut App, ) -> Option<Handle<FocusScopeNode>>

Returns the nearest enclosing scope node above this node, including this node, if it’s a scope.
Source§

fn descendants_are_focusable(self: Handle<Self>, app: &App) -> bool

If false, will disable focus for all of this node’s descendants.
Source§

fn traversal_children(self: Handle<Self>, app: &mut App) -> Vec<AnyFocusNode>

An iterator over the children that are allowed to be traversed by the FocusTraversalPolicy.
Source§

fn traversal_descendants(self: Handle<Self>, app: &mut App) -> Vec<AnyFocusNode>

Returns all descendants which do not have the skip_traversal and do have the can_request_focus flag set.
Source§

fn do_request_focus(self: Handle<Self>, app: &mut App, find_first_focus: bool)

Requests the primary focus for this node; overridden by FocusScopeNode.
Source§

fn debug_fill_properties( self: Handle<Self>, app: &App, properties: &mut DiagnosticPropertiesBuilder, )

Dart’s FocusNode.debugFillProperties, which FocusScopeNode’s own body calls where Dart writes super.
Source§

fn debug_describe_children( self: Handle<Self>, app: &mut App, ) -> Vec<Rc<dyn DiagnosticsNode>>

Dart’s FocusNode.debugDescribeChildren: each child, named Child 1, Child 2, ….
Source§

fn to_string_short(self: Handle<Self>, app: &App) -> String

Dart’s FocusNode.toStringShort: the identity, then the debug label and the focus markers.
Source§

fn skip_traversal(self: Handle<Self>, app: &mut App) -> bool

Source§

fn set_skip_traversal(self: Handle<Self>, app: &mut App, value: bool)

Source§

fn can_request_focus(self: Handle<Self>, app: &mut App) -> bool

Source§

fn set_can_request_focus(self: Handle<Self>, app: &mut App, value: bool)

Source§

fn set_descendants_are_focusable(self: Handle<Self>, app: &mut App, value: bool)

Source§

fn descendants_are_traversable(self: Handle<Self>, app: &App) -> bool

Source§

fn set_descendants_are_traversable( self: Handle<Self>, app: &mut App, value: bool, )

Source§

fn context(self: Handle<Self>, app: &App) -> Option<BuildContext>

Source§

fn on_key_event( self: Handle<Self>, app: &App, ) -> Option<FocusOnKeyEventCallback>

Source§

fn set_on_key_event( self: Handle<Self>, app: &mut App, value: Option<FocusOnKeyEventCallback>, )

Source§

fn debug_label(self: Handle<Self>, app: &App) -> Option<String>

Source§

fn set_debug_label(self: Handle<Self>, app: &mut App, value: Option<String>)

Source§

fn parent(self: Handle<Self>, app: &App) -> Option<AnyFocusNode>

Source§

fn children(self: Handle<Self>, app: &App) -> Vec<AnyFocusNode>

Source§

fn descendants(self: Handle<Self>, app: &mut App) -> Vec<AnyFocusNode>

Source§

fn ancestors(self: Handle<Self>, app: &mut App) -> Vec<AnyFocusNode>

Source§

fn has_focus(self: Handle<Self>, app: &mut App) -> bool

Source§

fn has_primary_focus(self: Handle<Self>, app: &App) -> bool

Source§

fn highlight_mode(self: Handle<Self>, app: &mut App) -> FocusHighlightMode

Source§

fn enclosing_scope( self: Handle<Self>, app: &mut App, ) -> Option<Handle<FocusScopeNode>>

Source§

fn size(self: Handle<Self>, app: &App) -> Size

Source§

fn offset(self: Handle<Self>, app: &App) -> Offset

Source§

fn rect(self: Handle<Self>, app: &App) -> Rect

Source§

fn unfocus(self: Handle<Self>, app: &mut App, disposition: UnfocusDisposition)

Source§

fn consume_keyboard_token(self: Handle<Self>, app: &mut App) -> bool

Source§

fn attach( self: Handle<Self>, app: &mut App, context: Option<BuildContext>, on_key_event: Option<FocusOnKeyEventCallback>, ) -> Ref<FocusAttachment>

Source§

fn dispose(self: Handle<Self>, app: &mut App)

Source§

fn request_focus(self: Handle<Self>, app: &mut App, node: Option<AnyFocusNode>)

Auto Trait Implementations§

§

impl !RefUnwindSafe for FocusTraversalGroupNode

§

impl !Send for FocusTraversalGroupNode

§

impl !Sync for FocusTraversalGroupNode

§

impl !UnwindSafe for FocusTraversalGroupNode

§

impl Forget for FocusTraversalGroupNode

§

impl Freeze for FocusTraversalGroupNode
where *const u8 is !null: Freeze, PhantomData<Option<Listener>>: Freeze, *const RcInner<Cell<usize>> is !null: Freeze, PhantomData<RcInner<Cell<usize>>>: Freeze, NonZero<u32>: Freeze, &'static ElementVTable: Freeze, *const RcInner<dyn Fn(&mut App, AnyFocusNode, &KeyEvent) -> KeyEventResult> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, AnyFocusNode, &KeyEvent) -> KeyEventResult>>: Freeze, PhantomData<fn() -> FocusManager>: Freeze, PhantomData<AnyFocusNode>: Freeze, PhantomData<Retained<AnyFocusNode>>: Freeze, &'static FocusNodeVTable: Freeze, PhantomData<u8>: Freeze, PhantomData<fn() -> FocusAttachment>: Freeze, *const RcInner<Keep> is !null: Freeze, PhantomData<RcInner<Keep>>: Freeze, PhantomData<fn() -> FocusScopeNode>: Freeze, &'static FocusTraversalPolicyVTable: Freeze,

§

impl Move for FocusTraversalGroupNode

§

impl Unpin for FocusTraversalGroupNode
where *const u8 is !null: Unpin, Rc<dyn Fn(&mut App)>: Unpin, NonZero<u32>: Unpin, *const (): Unpin, Rc<Cell<usize>>: Unpin, &'static ElementVTable: Unpin, Rc<dyn Fn(&mut App, AnyFocusNode, &KeyEvent) -> KeyEventResult>: Unpin, &'static FocusNodeVTable: Unpin, Rc<Keep>: Unpin, &'static FocusTraversalPolicyVTable: Unpin,

§

impl UnsafeUnpin for FocusTraversalGroupNode
where *const u8 is !null: UnsafeUnpin, PhantomData<Option<Listener>>: UnsafeUnpin, *const RcInner<Cell<usize>> is !null: UnsafeUnpin, PhantomData<RcInner<Cell<usize>>>: UnsafeUnpin, NonZeroU32Inner: UnsafeUnpin, &'static ElementVTable: UnsafeUnpin, *const RcInner<dyn Fn(&mut App, AnyFocusNode, &KeyEvent) -> KeyEventResult> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, AnyFocusNode, &KeyEvent) -> KeyEventResult>>: UnsafeUnpin, PhantomData<fn() -> FocusManager>: UnsafeUnpin, PhantomData<AnyFocusNode>: UnsafeUnpin, PhantomData<Retained<AnyFocusNode>>: UnsafeUnpin, &'static FocusNodeVTable: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, PhantomData<fn() -> FocusAttachment>: UnsafeUnpin, *const RcInner<Keep> is !null: UnsafeUnpin, PhantomData<RcInner<Keep>>: UnsafeUnpin, PhantomData<fn() -> FocusScopeNode>: UnsafeUnpin, &'static FocusTraversalPolicyVTable: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ListenableObject for T
where T: ChangeNotifier,

Source§

fn add_listener(self: Handle<T>, app: &mut App, listener: Listener)

Register a closure to be called when the object notifies its listeners.
Source§

fn remove_listener(self: Handle<T>, app: &mut App, listener: &Listener)

Remove a previously registered closure from the list of closures that the object notifies.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>