Module clipboard stdlib

clipboard
Version:
0.3.3
License:
MIT
Dependencies from vmod:
0
Imports:
3
Imported by:
1
Repository:
OS-specific
Show selected OS-specific symbols.
Backend-specific
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.

Imports

Imported by

  • Local Modules

Overview

clipboard provides access to the platform's clipboard mechanism. You can use it to read from the system clipboard, and write to it from your applications.

Examples:

import clipboard

fn main() {
    mut c := clipboard.new()
    println(c.get_text())
}

Aliases

#type Clipboard

Android
type Clipboard = dummy.Clipboard

Clipboard represents a system clipboard.

System "copy" and "paste" actions utilize the clipboard for temporary storage.

#fn (&Clipboard) copy

fn (mut cb &Clipboard) copy(text string) bool

copy copies text into the clipboard.

#fn (&Clipboard) paste

fn (mut cb &Clipboard) paste() string

paste returns current entry as a string from the clipboard.

#fn (&Clipboard) clear_all

fn (mut cb &Clipboard) clear_all()

clear_all clears the clipboard.

#fn (&Clipboard) destroy

fn (mut cb &Clipboard) destroy()

destroy destroys the clipboard and frees its resources.

#fn (Clipboard) check_ownership

fn (cb Clipboard) check_ownership() bool

check_ownership returns true if the Clipboard has the content ownership.

#fn (&Clipboard) is_available

fn (cb &Clipboard) is_available() bool

is_available returns true if the clipboard is available for use.

#fn (&Clipboard) check_availability

fn (cb &Clipboard) check_availability() bool

check_availability returns true if the clipboard is ready to be used.

#fn (&Clipboard) clear

fn (mut cb &Clipboard) clear()

clear empties the clipboard contents.

#fn (&Clipboard) free

fn (mut cb &Clipboard) free()

free releases all memory associated with the clipboard instance.

#fn (&Clipboard) has_ownership

fn (cb &Clipboard) has_ownership() bool

has_ownership returns true if the contents of the clipboard were created by this clipboard instance.

#fn (&Clipboard) set_text

fn (mut cb &Clipboard) set_text(text string) bool

set_text transfers text to the system clipboard.

This is often associated with a copy action (Cmd + C).

#fn (&Clipboard) get_text

fn (mut cb &Clipboard) get_text() string

get_text retrieves the contents of the system clipboard as a string.

This is often associated with a paste action (Cmd + V).

Constants

This section is empty.

Sum types

This section is empty.

Functions

#fn new

fn new() &Clipboard

new returns a new Clipboard instance allocated on the heap.

The Clipboard resources can be released with free

#fn new_primary

Solaris
fn new_primary() &Clipboard

new_primary returns a new X11 PRIMARY type Clipboard instance allocated on the heap.

Please note: new_primary only works on X11 based systems.

#fn new_primary

fn new_primary() &Clipboard

new_primary returns a new X11 PRIMARY type Clipboard instance allocated on the heap.

Please note: new_primary only works on X11 based systems.

#fn new_primary

fn new_primary() &Clipboard

new_primary returns a new X11 PRIMARY type Clipboard instance allocated on the heap.

Please note: new_primary only works on X11 based systems.

#fn new_primary

Android
fn new_primary() &Clipboard

new_primary returns a new X11 PRIMARY type Clipboard instance allocated on the heap.

Please note: new_primary only works on X11 based systems.

Structs

This section is empty.

Interfaces

This section is empty.

Enums

This section is empty.