Trait cosmic::iced_core::Clipboard

source ·
pub trait Clipboard {
Show 13 methods // Required methods fn read(&self) -> Option<String>; fn write(&mut self, contents: String); // Provided methods fn read_primary(&self) -> Option<String> { ... } fn write_primary(&mut self, _contents: String) { ... } fn read_data(&self, _mimes: Vec<String>) -> Option<(Vec<u8>, String)> { ... } fn write_data( &mut self, _contents: ClipboardStoreData<Box<dyn AsMimeTypes + Send + Sync>>, ) { ... } fn read_primary_data( &self, _mimes: Vec<String>, ) -> Option<(Vec<u8>, String)> { ... } fn write_primary_data( &mut self, _contents: ClipboardStoreData<Box<dyn AsMimeTypes + Send + Sync>>, ) { ... } fn register_dnd_destination( &self, _surface: DndSurface, _rectangles: Vec<DndDestinationRectangle>, ) { ... } fn set_action(&self, _action: DndAction) { ... } fn start_dnd( &self, _internal: bool, _source_surface: Option<DndSource>, _icon_surface: Option<Box<dyn Any>>, _content: Box<dyn AsMimeTypes + Send>, _actions: DndAction, ) { ... } fn end_dnd(&self) { ... } fn peek_dnd(&self, _mime: String) -> Option<(Vec<u8>, String)> { ... }
}
Expand description

A buffer for short-term storage and transfer within and between applications.

Required Methods§

source

fn read(&self) -> Option<String>

Reads the current content of the Clipboard as text.

source

fn write(&mut self, contents: String)

Writes the given text contents to the Clipboard.

Provided Methods§

source

fn read_primary(&self) -> Option<String>

Read the current content of the primary Clipboard as text.

source

fn write_primary(&mut self, _contents: String)

Writes the given text contents to the primary Clipboard.

source

fn read_data(&self, _mimes: Vec<String>) -> Option<(Vec<u8>, String)>

Consider using read_data instead Reads the current content of the Clipboard as text.

source

fn write_data( &mut self, _contents: ClipboardStoreData<Box<dyn AsMimeTypes + Send + Sync>>, )

Writes the given contents to the Clipboard.

source

fn read_primary_data(&self, _mimes: Vec<String>) -> Option<(Vec<u8>, String)>

Consider using read_primary_data instead Reads the current content of the primary Clipboard as text.

source

fn write_primary_data( &mut self, _contents: ClipboardStoreData<Box<dyn AsMimeTypes + Send + Sync>>, )

Writes the given text contents to the primary Clipboard.

source

fn register_dnd_destination( &self, _surface: DndSurface, _rectangles: Vec<DndDestinationRectangle>, )

Starts a DnD operation.

source

fn set_action(&self, _action: DndAction)

Set the final action for the DnD operation. Only should be done if it is requested.

source

fn start_dnd( &self, _internal: bool, _source_surface: Option<DndSource>, _icon_surface: Option<Box<dyn Any>>, _content: Box<dyn AsMimeTypes + Send>, _actions: DndAction, )

Registers Dnd destinations

source

fn end_dnd(&self)

Ends a DnD operation.

source

fn peek_dnd(&self, _mime: String) -> Option<(Vec<u8>, String)>

Consider using peek_dnd instead Peeks the data on the DnD with a specific mime type. Will return an error if there is no ongoing DnD operation.

Implementors§