pub trait DndProvider {
// Provided methods
fn init_dnd(&self, _tx: Box<dyn Sender<DndSurface> + Send + Sync + 'static>) { ... }
fn start_dnd<D: AsMimeTypes + Send + 'static>(
&self,
_internal: bool,
_source_surface: DndSurface,
_icon_surface: Option<Icon>,
_content: D,
_actions: DndAction,
) { ... }
fn end_dnd(&self) { ... }
fn register_dnd_destination(
&self,
_surface: DndSurface,
_rectangles: Vec<DndDestinationRectangle>,
) { ... }
fn set_action(&self, _action: DndAction) { ... }
fn peek_offer<D: AllowedMimeTypes + 'static>(
&self,
_mime_type: Option<Cow<'static, str>>,
) -> Result<D> { ... }
}
Provided Methods§
sourcefn init_dnd(&self, _tx: Box<dyn Sender<DndSurface> + Send + Sync + 'static>)
fn init_dnd(&self, _tx: Box<dyn Sender<DndSurface> + Send + Sync + 'static>)
Set up DnD operations for the Clipboard
sourcefn start_dnd<D: AsMimeTypes + Send + 'static>(
&self,
_internal: bool,
_source_surface: DndSurface,
_icon_surface: Option<Icon>,
_content: D,
_actions: DndAction,
)
fn start_dnd<D: AsMimeTypes + Send + 'static>( &self, _internal: bool, _source_surface: DndSurface, _icon_surface: Option<Icon>, _content: D, _actions: DndAction, )
Start a DnD operation on the given surface with some data
sourcefn register_dnd_destination(
&self,
_surface: DndSurface,
_rectangles: Vec<DndDestinationRectangle>,
)
fn register_dnd_destination( &self, _surface: DndSurface, _rectangles: Vec<DndDestinationRectangle>, )
Register a surface for receiving DnD offers Rectangles should be provided in order of decreasing priority. This method can be called multiple time for a single surface if the rectangles change.
sourcefn set_action(&self, _action: DndAction)
fn set_action(&self, _action: DndAction)
Set the final action after presenting the user with a choice
sourcefn peek_offer<D: AllowedMimeTypes + 'static>(
&self,
_mime_type: Option<Cow<'static, str>>,
) -> Result<D>
fn peek_offer<D: AllowedMimeTypes + 'static>( &self, _mime_type: Option<Cow<'static, str>>, ) -> Result<D>
Peek at the contents of a DnD offer
Object Safety§
This trait is not object safe.