pub struct KeyboardDragManager { /* private fields */ }Expand description
Manager for keyboard-driven drag operations.
Implementations§
Source§impl KeyboardDragManager
impl KeyboardDragManager
Sourcepub fn new(config: KeyboardDragConfig) -> Self
pub fn new(config: KeyboardDragConfig) -> Self
Create a new keyboard drag manager.
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create with default configuration.
Sourcepub fn mode(&self) -> KeyboardDragMode
pub fn mode(&self) -> KeyboardDragMode
Get the current drag mode.
Sourcepub fn state(&self) -> Option<&KeyboardDragState>
pub fn state(&self) -> Option<&KeyboardDragState>
Get the current drag state.
Sourcepub fn state_mut(&mut self) -> Option<&mut KeyboardDragState>
pub fn state_mut(&mut self) -> Option<&mut KeyboardDragState>
Get mutable access to the drag state.
Sourcepub fn start_drag(&mut self, source_id: WidgetId, payload: DragPayload) -> bool
pub fn start_drag(&mut self, source_id: WidgetId, payload: DragPayload) -> bool
Start a keyboard drag operation.
Returns true if the drag was started successfully.
Returns false if a drag is already in progress.
Navigate to the next drop target in the given direction.
Returns the newly selected target info if navigation succeeded.
Sourcepub fn select_target(
&mut self,
target_index: usize,
targets: &[DropTargetInfo],
) -> bool
pub fn select_target( &mut self, target_index: usize, targets: &[DropTargetInfo], ) -> bool
Navigate to a specific target by index.
Sourcepub fn complete_drag(&mut self) -> Option<(DragPayload, usize)>
pub fn complete_drag(&mut self) -> Option<(DragPayload, usize)>
Complete the drag operation (drop on selected target).
Returns None if no target is selected or no drag is active.
Returns Some((payload, target_index)) with the payload and target index.
Sourcepub fn drop_on_target(
&mut self,
targets: &[DropTargetInfo],
) -> Option<KeyboardDropResult>
pub fn drop_on_target( &mut self, targets: &[DropTargetInfo], ) -> Option<KeyboardDropResult>
Complete the drag with a specific target and get the drop result info.
Sourcepub fn cancel_drag(&mut self) -> Option<DragPayload>
pub fn cancel_drag(&mut self) -> Option<DragPayload>
Cancel the current drag operation.
Returns the payload if a drag was active.
Sourcepub fn handle_key(&mut self, key: KeyboardDragKey) -> KeyboardDragAction
pub fn handle_key(&mut self, key: KeyboardDragKey) -> KeyboardDragAction
Handle key press during keyboard drag.
Returns KeyboardDragAction indicating what action was triggered.
Sourcepub fn drain_announcements(&mut self) -> Vec<Announcement>
pub fn drain_announcements(&mut self) -> Vec<Announcement>
Get and clear pending announcements.
Sourcepub fn announcements(&self) -> &[Announcement]
pub fn announcements(&self) -> &[Announcement]
Peek at pending announcements without clearing.
Sourcepub fn render_highlight(
&self,
targets: &[DropTargetInfo],
frame: &mut Frame<'_>,
)
pub fn render_highlight( &self, targets: &[DropTargetInfo], frame: &mut Frame<'_>, )
Render the target highlight overlay.