Skip to content

File include/brisk/window/Clipboard.hpp


ClipboardContent class

ClipboardContent

Structure representing the content of the clipboard.

This structure holds optional text content and a map of format-specific data.

text variable (ClipboardContent::text)

std::optional<std::string> text

Optional text content from the clipboard.

formats variable (ClipboardContent::formats)

std::unordered_map<ClipboardFormat, Bytes> formats

A map of format-specific data stored in the clipboard, keyed by ClipboardFormat.


registerClipboardFormat function

ClipboardFormat
registerClipboardFormat(string_view formatID)

Registers a custom clipboard format.
Param formatID The identifier of the format to register.
Returns The registered ClipboardFormat.


textFormat variable

extern ClipboardFormat textFormat

Global variable that represents the text format identifier for the clipboard.


clipboardHasFormat function

bool clipboardHasFormat(ClipboardFormat format)

Checks if the clipboard contains data in the specified format.
Param format The format to check for.
Returns True if the clipboard has data in the specified format, otherwise false.


clipboardHasText function

inline bool clipboardHasText()

Checks if the clipboard contains text data.
Returns True if the clipboard has text data, otherwise false.


setClipboardContent function

bool setClipboardContent(const ClipboardContent &content)

Sets the content of the clipboard.
Param content The ClipboardContent to set in the clipboard.
Returns True if the clipboard content was successfully set, otherwise false.


getClipboardContent function

ClipboardContent getClipboardContent(
    std::initializer_list<ClipboardFormat> formats)

Retrieves the content of the clipboard for the specified formats.
Param formats A list of ClipboardFormats to retrieve.
Returns The ClipboardContent containing the data in the requested formats.


copyTextToClipboard function

inline bool copyTextToClipboard(string_view content)

Copies text content to the clipboard.
Param content The text content to copy to the clipboard.
Returns True if the text content was successfully copied, otherwise false.


copyBytesToClipboard function

inline bool copyBytesToClipboard(bytes_view content,
                                 ClipboardFormat format)

Copies binary data to the clipboard for a specific format.
Param content The binary data to copy.
Param format The ClipboardFormat to associate with the binary data.
Returns True if the binary data was successfully copied, otherwise false.


getTextFromClipboard function

inline optional<std::string> getTextFromClipboard()

Retrieves text content from the clipboard.
Returns An optional string containing the clipboard text if available, otherwise std::nullopt.


getBytesFromClipboard function

inline optional<Bytes>
getBytesFromClipboard(ClipboardFormat format)

Retrieves binary data from the clipboard for a specific format.
Param format The ClipboardFormat to retrieve data for.
Returns An optional vector of bytes containing the clipboard data for the specified format, or std::nullopt if not found.


Auto-generated from sources, Revision , https://github.com/brisklib/brisk/blob//include/brisk/