Struct iup::clipboard::Clipboard [] [src]

pub struct Clipboard(_);

An element that allows access to the clipboard.

You can use only one for the entire application because it does not store any data inside. Or you can simply create and drop every time you need to copy or paste.

See the clipboard module documentation for more details on how the system clipboard works.

Other platform-dependent attributes can be found on the IUP Clipboard Documentation.

Ownership

The clipboard must be manually destroyed, thus for the user safety it returns a guarded object on the new constructor.

Please refer to the crate level documentation of IUP-Rust (the main doc page) for details on ownership of elements.

Methods

impl Clipboard

fn new() -> Guard<Clipboard>

Creates a new clipboard operarator.

fn clear(&mut self) -> Self

Clears any data on the clipboard.

fn add_format<S: Into<String>>(&mut self, format: S) -> Self

Register a custom format for clipboard data given its name.

fn has_text(&mut self) -> bool

Informs if there is a text available at the clipboard.

fn set_text<S: Into<String>>(&mut self, text: S) -> Self

Copy text into the clipboard.

fn text(&mut self) -> Option<String>

Paste text off the clipboard.

fn has_image(&mut self) -> bool

Informs if there is a image available at the clipboard.

fn set_image<I: ImageElement>(&mut self, image: &I) -> Self

Copy text into the clipboard.

fn has_data<S: Into<String>>(&mut self, format: S) -> bool

Informs if there is data of the specified format available at the clipboard.

fn set_data<S, D>(&mut self, format: S, data: D) -> Self where S: Into<String>, D: AsRef<[u8]>

Copy data from the specified format into the clipboard.

fn data<S: Into<String>>(&mut self, format: S) -> Option<Vec<u8>>

Paste data from the specified format off the clipboard.

Trait Implementations

impl Element for Clipboard

fn raw(&self) -> *mut Ihandle

unsafe fn from_raw_unchecked(ih: *mut Ihandle) -> Self

unsafe fn target_classname() -> &'static str

fn from_handle(handle: Handle) -> Result<Self, Handle>

fn from_name<S: Into<String>>(name: S) -> Option<Handle>

fn from_raw(ih: *mut Ihandle) -> Self

unsafe fn classname(&self) -> &CStr

fn destroy(self)

fn does_attrib_exist(&self, cname: &CString) -> bool

fn attribs(&self) -> Vec<String>

fn set_attrib<S1, S2>(&mut self, name: S1, value: S2) -> Self where S1: Into<String>, S2: Into<String>

fn attrib<S: Into<String>>(&self, name: S) -> Option<String>

fn set_attrib_data<S1>(&mut self, name: S1, data: *const c_void) -> Self where S1: Into<String>

fn attrib_data<S1>(&mut self, name: S1) -> *mut c_void where S1: Into<String>

fn set_attrib_handle<S1, E>(&mut self, name: S1, elem: E) -> Self where S1: Into<String>, E: Element

fn attrib_handle<S1>(&mut self, name: S1) -> Option<Handle> where S1: Into<String>

fn clear_attrib<S: Into<String>>(&mut self, name: S) -> Self

fn reset_attrib<S: Into<String>>(&mut self, name: S) -> Self

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

fn add_handle_name<S: Into<String>>(&self, name: S) -> Option<Handle>

fn clear_handle_name<S: Into<String>>(name: S) -> Option<Handle>

impl Debug for Clipboard

fn fmt(&self, fmt: &mut Formatter) -> Result

impl Copy for Clipboard

impl Clone for Clipboard

fn clone(&self) -> Clipboard

fn clone_from(&mut self, source: &Self)

impl DestroyCb for Clipboard

fn set_destroy_cb<F>(&mut self, cb: F) -> Self where F: Callback<(Self,)>

fn remove_destroy_cb(&mut self) -> Option<Box<Callback<(Self,)>>>