Skip to main content

ferroui_base/input/platform/
i_platform_drag_source.rs

1use crate::input::{DragDropEffects, IDataTransfer, LocalBoxFuture, PointerPressedEventArgs};
2use std::rc::Rc;
3
4/// Starts drag-and-drop operations on the platform.
5///
6/// This is an implementation detail of the platform backends.
7pub trait IPlatformDragSource {
8    /// Starts a drag-and-drop operation with the given data and returns a
9    /// future that resolves to the effect of the operation when it ends.
10    fn do_drag_drop_async(
11        &self,
12        trigger_event: &PointerPressedEventArgs,
13        data_transfer: Rc<dyn IDataTransfer>,
14        allowed_effects: DragDropEffects,
15    ) -> LocalBoxFuture<DragDropEffects>;
16}