Struct dui::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][1]. [1]: http://webserver2.tecgraf.puc-rio.br/iup/en/elem/iupclipboard.html
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
[src]
pub fn new() -> Guard<Clipboard>
[src]
Creates a new clipboard operarator.
pub fn clear(&mut self) -> Self
[src]
Clears any data on the clipboard.
pub fn add_format<S: Into<String>>(&mut self, format: S) -> Self
[src]
Register a custom format for clipboard data given its name.
pub fn has_text(&mut self) -> bool
[src]
Informs if there is a text available at the clipboard.
pub fn set_text<S: Into<String>>(&mut self, text: S) -> Self
[src]
Copy text into the clipboard.
pub fn text(&mut self) -> Option<String>
[src]
Paste text off the clipboard.
pub fn has_image(&mut self) -> bool
[src]
Informs if there is a image available at the clipboard.
pub fn set_image<I: ImageElement>(&mut self, image: &I) -> Self
[src]
Copy text into the clipboard.
pub fn has_data<S: Into<String>>(&mut self, format: S) -> bool
[src]
Informs if there is data of the specified format available at the clipboard.
pub fn set_data<S, D>(&mut self, format: S, data: D) -> Self where
S: Into<String>,
D: AsRef<[u8]>,
[src]
S: Into<String>,
D: AsRef<[u8]>,
Copy data from the specified format into the clipboard.
pub fn data<S: Into<String>>(&mut self, format: S) -> Option<Vec<u8>>
[src]
Paste data from the specified format off the clipboard.
Trait Implementations
impl Element for Clipboard
[src]
fn raw(&self) -> *mut Ihandle
[src]
Gets the raw IUP handle associated with this element.
unsafe fn from_raw_unchecked(ih: *mut Ihandle) -> Self
[src]
Constructs an Element from a raw IUP handle. Read more
unsafe fn target_classname() -> &'static str
[src]
Gets the [class name][1] the derived object should be targeting. [1]: http://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetclassname.html Read more
fn from_handle(handle: Handle) -> Result<Self, Handle>
[src]
Constructs a specialized Element object from a general Handle if they are compatible.
fn from_name<S: Into<String>>(name: S) -> Option<Handle>
[src]
Constructs from a name associated with a element handle (with Element::add_handle_name
or LED).
fn from_raw(ih: *mut Ihandle) -> Self
[src]
Constructs an Element from a raw IUP handle. Read more
unsafe fn classname(&self) -> &CStr
[src]
Gets the [class name][1] of this element. [1]: http://webserver2.tecgraf.puc-rio.br/iup/en/func/iupgetclassname.html Read more
fn destroy(self)
[src]
Destroys an interface element and all its children. Read more
fn does_attrib_exist(&self, cname: &CString) -> bool
[src]
Checks if a specific attribute exists in the element.
fn attribs(&self) -> Vec<String>
[src]
Returns the names of all attributes of an element that are set in its internal hash table only. Read more
fn set_attrib<S1, S2>(&mut self, name: S1, value: S2) -> Self where
S1: Into<String>,
S2: Into<String>,
[src]
S1: Into<String>,
S2: Into<String>,
Sets an interface element attribute. Read more
fn attrib<S: Into<String>>(&self, name: S) -> Option<String>
[src]
Gets an interface element attribute. Read more
fn set_attrib_data<S1>(&mut self, name: S1, data: *const c_void) -> Self where
S1: Into<String>,
[src]
S1: Into<String>,
Sets a raw interface element attribute. Read more
fn attrib_data<S1>(&mut self, name: S1) -> *mut c_void where
S1: Into<String>,
[src]
S1: Into<String>,
Gets a raw interface element attribute.
fn set_attrib_handle<S1, E>(&mut self, name: S1, elem: E) -> Self where
S1: Into<String>,
E: Element,
[src]
S1: Into<String>,
E: Element,
Associates a element with an attribute. Read more
fn attrib_handle<S1>(&mut self, name: S1) -> Option<Handle> where
S1: Into<String>,
[src]
S1: Into<String>,
Gets the handle associated with an attribute.
fn clear_attrib<S: Into<String>>(&mut self, name: S) -> Self
[src]
Clears the value associated with an attribute and use the default value.
fn reset_attrib<S: Into<String>>(&mut self, name: S) -> Self
[src]
Removes an attribute from element and its children if the attrib is inheritable. Read more
fn handle_name(&self) -> Option<String>
[src]
Returns the identifier of an interface element that has an associated handle name using Element::add_handle_name
or using LED. Read more
fn add_handle_name<S: Into<String>>(&self, name: S) -> Option<Handle>
[src]
Associates a handle name with an interface element. Read more
fn clear_handle_name<S: Into<String>>(name: S) -> Option<Handle>
[src]
Clears the handle name association on the specified name. Read more
impl Debug for Clipboard
[src]
fn fmt(&self, fmt: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Copy for Clipboard
[src]
impl Clone for Clipboard
[src]
fn clone(&self) -> Clipboard
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl DestroyCb for Clipboard
[src]
fn set_destroy_cb<F>(&mut self, cb: F) -> Self where
F: Callback<(Self,)>,
[src]
F: Callback<(Self,)>,