File include/brisk/window/Clipboard.hpp
¶
Clipboard
class¶
Clipboard
Content
class (Clipboard::Content
)¶
Content
Structure representing the content of the clipboard.
This structure holds optional text content and a map of format-specific data.
text
variable (Clipboard::Content::text
)¶
std::optional<std::string> text
Optional text content from the clipboard.
formats
variable (Clipboard::Content::formats
)¶
std::unordered_map<Format, Bytes> formats
A map of format-specific data stored in the clipboard, keyed by Format.
registerFormat
function (Clipboard::registerFormat
)¶
static Format registerFormat(std::string_view formatID)
Registers a custom clipboard format.
Param formatID
The identifier of the format to register.
Returns The registered Format.
textFormat
variable (Clipboard::textFormat
)¶
static Format textFormat
Global variable that represents the text format identifier for the clipboard.
hasFormat
function (Clipboard::hasFormat
)¶
static bool hasFormat(Format 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.
hasText
function (Clipboard::hasText
)¶
static bool hasText()
Checks if the clipboard contains text data.
Returns True if the clipboard has text data, otherwise false.
setContent
function (Clipboard::setContent
)¶
static bool setContent(const Content &content)
Sets the content of the clipboard.
Param content
The Content to set in the clipboard.
Returns True if the clipboard content was successfully set, otherwise false.
getContent
function (Clipboard::getContent
)¶
static Content
getContent(std::initializer_list<Format> formats)
Retrieves the content of the clipboard for the specified formats.
Param formats
A list of Formats to retrieve.
Returns The Content containing the data in the requested formats.
setText
function (Clipboard::setText
)¶
static bool setText(std::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.
setBytes
function (Clipboard::setBytes
)¶
static bool setBytes(BytesView content, Format format)
Copies binary data to the clipboard for a specific format.
Param content
The binary data to copy.
Param format
The Format to associate with the binary data.
Returns True if the binary data was successfully copied, otherwise false.
getText
function (Clipboard::getText
)¶
static std::optional<std::string> getText()
Retrieves text content from the clipboard.
Returns An optional string containing the clipboard text if available, otherwise std::nullopt.
getBytes
function (Clipboard::getBytes
)¶
static std::optional<Bytes> getBytes(Format format)
Retrieves binary data from the clipboard for a specific format.
Param format
The Format 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/