# LispKit System Pasteboard

Library `(lispkit system pasteboard)` provides a simple API for interfacing with the system pasteboard. The type of content copied to the pasteboard or pasted from it is described with lists of uniform type identifiers.

(pasteboard-change-count) [procedure]

Returns a change count number. Changes to this number reflect state changes to the system pasteboard.

(pasteboard-empty?) [procedure]

Returns `#t` if the system pasteboard is empty; `#f` otherwise.

(pasteboard-contains? type) [procedure]

Returns `#t` if the pasteboard contains an entry and this entry is of the given type. type is either a string or a list of strings. Each string is a uniform type identifier (UTI) such as `public.data`, `public.plain-text`, `public.utf8-plain-text`, `public.rtf`, `public.html`, `public.url`, `public.file-url`, `public.image`, `public.png`, `public.jpeg`, etc.

(pasteboard-types) [procedure]

Returns a list of strings describing the type of content available in the system pasteboard. Each type is a string containing a uniform type identifier (UTI) such as `public.data`, `public.plain-text`, `public.utf8-plain-text`, `public.rtf`, `public.html`, `public.url`, `public.file-url`, `public.image`, `public.png`, `public.jpeg`, etc. An empty list is returned when the pasteboard is empty.

(pasteboard-ref) [procedure]

Returns a value representing the content in the pasteboard. `#f` is returned if the pasteboard is empty. Values of the following data types are being returned: images, colors, styled text, strings, and bytevectors.

(pasteboard-ref-string) [procedure]
(pasteboard-ref-string type)

Returns a string representation of the content in the pasteboard for the given type. `#f` is returned if the pasteboard is empty. type is a uniform type identifier (UTI) such as `public.data`, `public.plain-text`, `public.utf8-plain-text`, `public.rtf`, `public.html`, `public.url`, `public.file-url`, `public.image`, `public.png`, `public.jpeg`, etc. If type is not provided, `public.plain-text` is used as a default.

(pasteboard-ref-data) [procedure]
(pasteboard-ref-data type)

Returns a string representation of the content in the pasteboard for the given type. `#f` is returned if the pasteboard is empty. type is a uniform type identifier (UTI) such as `public.data`, `public.plain-text`, `public.utf8-plain-text`, `public.rtf`, `public.html`, `public.url`, `public.file-url`, `public.image`, `public.png`, `public.jpeg`, etc. If type is not provided, `public.plain-text` is used as a default.

(pasteboard-set! expr) [procedure]
(pasteboard-set! expr type)
(pasteboard-set! expr type local)
(pasteboard-set! expr type local expiry)

Copies expr into the pasteboard, delaring it to be of the given type. type is a uniform type identifier (UTI) such as `public.data`, `public.plain-text`, `public.utf8-plain-text`, `public.rtf`, `public.html`, `public.url`, `public.file-url`, `public.image`, `public.png`, `public.jpeg`, etc. local is a boolean, indicating whether to keep the pasteboard content local to the device or allow it to be published to other devices. expiry is a date at which the pasteboard is automatically cleared. It is `#f` by default and only supported on iOS.

(pasteboard-clear!) [procedure]

Returns a value representing the content in the pasteboard. `#f` is returned if the pasteboard is empty. Values of the following data types are being returned: images, colors, styled text, strings, and bytevectors.