pub struct DropListener {
pub binding: Handle<WidgetsBinding>,
pub on_change: Option<DragChangeCallback>,
pub on_dropped: Option<DroppedCallback>,
/* private fields */
}Expand description
Hears what is dragged from outside the application over the application’s views, through
the WidgetsBinding’s observers. Dispose it when done, as an
AppLifecycleListener.
Fields§
§binding: Handle<WidgetsBinding>The WidgetsBinding listened to.
on_change: Option<DragChangeCallback>Called for every report, whatever its phase.
on_dropped: Option<DroppedCallback>Called with the dropped items.
Implementations§
Source§impl DropListener
impl DropListener
Sourcepub fn new(app: &mut App) -> Ref<DropListener>
pub fn new(app: &mut App) -> Ref<DropListener>
A listener registered with the current WidgetsBinding.
pub fn on_change( self: Ref<Self>, app: &mut App, on_change: DragChangeCallback, ) -> Ref<Self>
pub fn on_dropped( self: Ref<Self>, app: &mut App, on_dropped: DroppedCallback, ) -> Ref<Self>
Trait Implementations§
Source§impl Debug for DropListener
impl Debug for DropListener
Source§impl WidgetsBindingObserverObject for DropListener
impl WidgetsBindingObserverObject for DropListener
Source§fn did_change_drag(self: Handle<Self>, app: &mut App, report: &DragReport)
fn did_change_drag(self: Handle<Self>, app: &mut App, report: &DragReport)
Source§fn did_change_metrics(self: Handle<Self>, app: &mut App)
fn did_change_metrics(self: Handle<Self>, app: &mut App)
Source§fn did_change_view_focus(
self: Handle<Self>,
app: &mut App,
event: ViewFocusEvent,
)
fn did_change_view_focus( self: Handle<Self>, app: &mut App, event: ViewFocusEvent, )
Source§fn did_change_text_scale_factor(self: Handle<Self>, app: &mut App)
fn did_change_text_scale_factor(self: Handle<Self>, app: &mut App)
Source§fn did_change_platform_brightness(self: Handle<Self>, app: &mut App)
fn did_change_platform_brightness(self: Handle<Self>, app: &mut App)
Source§fn did_change_caption_style(self: Handle<Self>, app: &mut App)
fn did_change_caption_style(self: Handle<Self>, app: &mut App)
Source§fn did_change_app_lifecycle_state(
self: Handle<Self>,
app: &mut App,
state: AppLifecycleState,
)
fn did_change_app_lifecycle_state( self: Handle<Self>, app: &mut App, state: AppLifecycleState, )
Source§fn did_request_app_exit(
self: Handle<Self>,
app: &mut App,
) -> Task<AppExitResponse> ⓘ
fn did_request_app_exit( self: Handle<Self>, app: &mut App, ) -> Task<AppExitResponse> ⓘ
Source§fn did_change_accessibility_features(self: Handle<Self>, app: &mut App)
fn did_change_accessibility_features(self: Handle<Self>, app: &mut App)
Source§fn handle_start_back_gesture(
self: Handle<Self>,
app: &mut App,
back_event: PredictiveBackEvent,
) -> bool
fn handle_start_back_gesture( self: Handle<Self>, app: &mut App, back_event: PredictiveBackEvent, ) -> bool
Source§fn handle_update_back_gesture_progress(
self: Handle<Self>,
app: &mut App,
back_event: PredictiveBackEvent,
)
fn handle_update_back_gesture_progress( self: Handle<Self>, app: &mut App, back_event: PredictiveBackEvent, )
Source§fn handle_commit_back_gesture(self: Handle<Self>, app: &mut App)
fn handle_commit_back_gesture(self: Handle<Self>, app: &mut App)
Source§fn handle_cancel_back_gesture(self: Handle<Self>, app: &mut App)
fn handle_cancel_back_gesture(self: Handle<Self>, app: &mut App)
Source§fn did_fail_view_request(
self: Handle<Self>,
app: &mut App,
request: RequestId,
error: &ViewError,
)
fn did_fail_view_request( self: Handle<Self>, app: &mut App, request: RequestId, error: &ViewError, )
Auto Trait Implementations§
impl !RefUnwindSafe for DropListener
impl !Send for DropListener
impl !Sync for DropListener
impl !UnwindSafe for DropListener
impl Forget for DropListener
impl Freeze for DropListenerwhere
NonZero<u32>: Freeze,
PhantomData<fn() -> WidgetsBinding>: Freeze,
*const RcInner<dyn Fn(&mut App, &DragReport)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, &DragReport)>>: Freeze,
*const RcInner<dyn Fn(&mut App, &[Rc<dyn DataTransferItem>])> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, &[Rc<dyn DataTransferItem>])>>: Freeze,
*const RcInner<dyn WidgetsBindingObserver> is !null: Freeze,
PhantomData<RcInner<dyn WidgetsBindingObserver>>: Freeze,
impl Move for DropListener
impl Unpin for DropListener
impl UnsafeUnpin for DropListenerwhere
NonZeroU32Inner: UnsafeUnpin,
PhantomData<fn() -> WidgetsBinding>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, &DragReport)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, &DragReport)>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, &[Rc<dyn DataTransferItem>])> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, &[Rc<dyn DataTransferItem>])>>: UnsafeUnpin,
*const RcInner<dyn WidgetsBindingObserver> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn WidgetsBindingObserver>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more