pub struct ClipboardManager { /* private fields */ }Expand description
Clipboard manager with history and primary selection support.
Implementations§
Source§impl ClipboardManager
impl ClipboardManager
Sourcepub fn copy(
&mut self,
selection: SelectionType,
source_surface: u32,
mime: ClipboardMime,
data: Vec<u8>,
) -> Result<(), ClipboardError>
pub fn copy( &mut self, selection: SelectionType, source_surface: u32, mime: ClipboardMime, data: Vec<u8>, ) -> Result<(), ClipboardError>
Copy data to the clipboard or primary selection.
Sourcepub fn copy_multi(
&mut self,
selection: SelectionType,
source_surface: u32,
data: &[(ClipboardMime, Vec<u8>)],
) -> Result<(), ClipboardError>
pub fn copy_multi( &mut self, selection: SelectionType, source_surface: u32, data: &[(ClipboardMime, Vec<u8>)], ) -> Result<(), ClipboardError>
Copy data with multiple MIME representations.
Sourcepub fn paste(
&self,
selection: SelectionType,
mime: ClipboardMime,
) -> Result<&[u8], ClipboardError>
pub fn paste( &self, selection: SelectionType, mime: ClipboardMime, ) -> Result<&[u8], ClipboardError>
Paste data from the clipboard or primary selection.
Sourcepub fn available_mimes(&self, selection: SelectionType) -> Vec<ClipboardMime>
pub fn available_mimes(&self, selection: SelectionType) -> Vec<ClipboardMime>
Get the list of MIME types available for pasting.
Sourcepub fn clear(&mut self, selection: SelectionType)
pub fn clear(&mut self, selection: SelectionType)
Clear the clipboard or primary selection.
Sourcepub fn history(&self) -> &[ClipboardEntry]
pub fn history(&self) -> &[ClipboardEntry]
Get clipboard history entries.
Sourcepub fn restore_from_history(
&mut self,
index: usize,
) -> Result<(), ClipboardError>
pub fn restore_from_history( &mut self, index: usize, ) -> Result<(), ClipboardError>
Restore a history entry to the current clipboard.
Sourcepub fn clear_history(&mut self)
pub fn clear_history(&mut self)
Clear all history.
Sourcepub fn set_history_enabled(&mut self, enabled: bool)
pub fn set_history_enabled(&mut self, enabled: bool)
Enable or disable clipboard history.
Sourcepub fn has_data(&self, selection: SelectionType) -> bool
pub fn has_data(&self, selection: SelectionType) -> bool
Check if clipboard has data.
Sourcepub fn negotiate_mime(
&self,
selection: SelectionType,
requested: &[ClipboardMime],
) -> Option<ClipboardMime>
pub fn negotiate_mime( &self, selection: SelectionType, requested: &[ClipboardMime], ) -> Option<ClipboardMime>
Negotiate the best MIME type between offered types and requested types.
Sourcepub fn current_tick(&self) -> u64
pub fn current_tick(&self) -> u64
Get current tick count.