⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

ClipboardManager

Struct ClipboardManager 

Source
pub struct ClipboardManager { /* private fields */ }
Expand description

Clipboard manager with history and primary selection support.

Implementations§

Source§

impl ClipboardManager

Source

pub fn new() -> Self

Create a new clipboard manager.

Source

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.

Source

pub fn copy_multi( &mut self, selection: SelectionType, source_surface: u32, data: &[(ClipboardMime, Vec<u8>)], ) -> Result<(), ClipboardError>

Copy data with multiple MIME representations.

Source

pub fn paste( &self, selection: SelectionType, mime: ClipboardMime, ) -> Result<&[u8], ClipboardError>

Paste data from the clipboard or primary selection.

Source

pub fn available_mimes(&self, selection: SelectionType) -> Vec<ClipboardMime>

Get the list of MIME types available for pasting.

Source

pub fn clear(&mut self, selection: SelectionType)

Clear the clipboard or primary selection.

Source

pub fn history(&self) -> &[ClipboardEntry]

Get clipboard history entries.

Source

pub fn restore_from_history( &mut self, index: usize, ) -> Result<(), ClipboardError>

Restore a history entry to the current clipboard.

Source

pub fn clear_history(&mut self)

Clear all history.

Source

pub fn set_history_enabled(&mut self, enabled: bool)

Enable or disable clipboard history.

Source

pub fn has_data(&self, selection: SelectionType) -> bool

Check if clipboard has data.

Source

pub fn negotiate_mime( &self, selection: SelectionType, requested: &[ClipboardMime], ) -> Option<ClipboardMime>

Negotiate the best MIME type between offered types and requested types.

Source

pub fn current_tick(&self) -> u64

Get current tick count.

Trait Implementations§

Source§

impl Debug for ClipboardManager

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ClipboardManager

Available on crate feature alloc only.
Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for ClipboardManager

§

impl RefUnwindSafe for ClipboardManager

§

impl Send for ClipboardManager

§

impl Sync for ClipboardManager

§

impl Unpin for ClipboardManager

§

impl UnwindSafe for ClipboardManager

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.