window_clipboard::dnd

Trait DndProvider

source
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§

source

fn init_dnd(&self, _tx: Box<dyn Sender<DndSurface> + Send + Sync + 'static>)

Set up DnD operations for the Clipboard

source

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

source

fn end_dnd(&self)

End the current DnD operation, if there is one

source

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.

source

fn set_action(&self, _action: DndAction)

Set the final action after presenting the user with a choice

source

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.

Implementors§