pub trait DataOfferHandler: Sized {
    // Required methods
    fn source_actions(
        &mut self,
        conn: &Connection,
        qh: &QueueHandle<Self>,
        offer: &mut DragOffer,
        actions: DndAction
    );
    fn selected_action(
        &mut self,
        conn: &Connection,
        qh: &QueueHandle<Self>,
        offer: &mut DragOffer,
        actions: DndAction
    );
}
Expand description

Handler trait for DataOffer events.

The functions defined in this trait are called as DataOffer events are received from the compositor.

Required Methods§

source

fn source_actions( &mut self, conn: &Connection, qh: &QueueHandle<Self>, offer: &mut DragOffer, actions: DndAction )

Called to advertise the available DnD Actions as set by the source.

source

fn selected_action( &mut self, conn: &Connection, qh: &QueueHandle<Self>, offer: &mut DragOffer, actions: DndAction )

Called to advertise the action selected by the compositor after matching the source/destination side actions. Only one action or none will be selected in the actions sent by the compositor. This may be called multiple times during a DnD operation. The most recent DndAction is the only valid one.

At the time of a drop event on the data device, this action must be used except in the case of an ask action. In the case that the last action received is ask, the destination asks the user for their preference, then calls set_actions & accept each one last time. Finally, the destination may then request data to be sent and finishing the data offer

Object Safety§

This trait is not object safe.

Implementors§