pub struct FileDropManager { /* private fields */ }Expand description
Manager for file drop state and hovered file tracking.
MWA-B7: stores ALL files of a drag/drop (multi-file drops were silently truncated to the first path at every OS ingress site — the manager could only hold one). The single-file accessors remain as first-element views for existing callers.
Implementations§
Source§impl FileDropManager
impl FileDropManager
Sourcepub fn set_hovered_files(&mut self, files: Vec<AzString>)
pub fn set_hovered_files(&mut self, files: Vec<AzString>)
Set ALL currently hovered files (MWA-B7). An empty vec behaves like a drag-leave (latches the hover-cancel flag).
Sourcepub fn set_hovered_file(&mut self, file: Option<AzString>)
pub fn set_hovered_file(&mut self, file: Option<AzString>)
Single-file compatibility shim over set_hovered_files.
Platform backends call this with Some(path) on drag-enter
(macOS draggingEntered, Windows OLE IDropTarget::DragEnter) and
None on drag-leave (draggingExited / DragLeave). A Some -> None
transition latches FileDropManager::hover_was_cancelled so the
FileHoverCancel event can fire.
Sourcepub const fn hover_was_cancelled(&self) -> bool
pub const fn hover_was_cancelled(&self) -> bool
Whether a hover ended without a drop since the last
FileDropManager::clear_hover_cancelled (one-shot).
Sourcepub const fn clear_hover_cancelled(&mut self)
pub const fn clear_hover_cancelled(&mut self)
Clear the one-shot hover-cancel flag. Called by the platform drag
handler after determine_all_events has emitted the FileHoverCancel
event (mirrors the dropped-files reset after FileDrop).
Sourcepub fn get_hovered_file(&self) -> Option<&AzString>
pub fn get_hovered_file(&self) -> Option<&AzString>
First hovered file (single-file view; use
get_hovered_files for the full list).
Sourcepub fn get_hovered_files(&self) -> &[AzString]
pub fn get_hovered_files(&self) -> &[AzString]
ALL currently hovered files (MWA-B7).
Sourcepub fn get_dropped_file(&self) -> Option<&AzString>
pub fn get_dropped_file(&self) -> Option<&AzString>
First dropped file (single-file view; use
get_dropped_files for the full list).
Sourcepub fn get_dropped_files(&self) -> &[AzString]
pub fn get_dropped_files(&self) -> &[AzString]
ALL files of the drop this frame (MWA-B7; one-shot, cleared by the platform handler after event processing).
Sourcepub fn set_dropped_files(&mut self, files: Vec<AzString>)
pub fn set_dropped_files(&mut self, files: Vec<AzString>)
Set ALL dropped files (MWA-B7; cleared after one frame).
Sourcepub fn set_dropped_file(&mut self, file: Option<AzString>)
pub fn set_dropped_file(&mut self, file: Option<AzString>)
Single-file compatibility shim over set_dropped_files.
Trait Implementations§
Source§impl Clone for FileDropManager
impl Clone for FileDropManager
Source§fn clone(&self) -> FileDropManager
fn clone(&self) -> FileDropManager
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FileDropManager
impl Debug for FileDropManager
Source§impl Default for FileDropManager
impl Default for FileDropManager
Source§fn default() -> FileDropManager
fn default() -> FileDropManager
impl Eq for FileDropManager
Source§impl PartialEq for FileDropManager
impl PartialEq for FileDropManager
impl StructuralPartialEq for FileDropManager
Auto Trait Implementations§
impl Freeze for FileDropManager
impl RefUnwindSafe for FileDropManager
impl Send for FileDropManager
impl Sync for FileDropManager
impl Unpin for FileDropManager
impl UnsafeUnpin for FileDropManager
impl UnwindSafe for FileDropManager
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more