mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibGUI: Add Clipboard::clear()
Does exactly what it says on the tin :^)
This commit is contained in:
parent
e81d35995e
commit
f15f03376b
Notes:
sideshowbarker
2024-07-18 18:21:38 +09:00
Author: https://github.com/bugaevc Commit: https://github.com/SerenityOS/serenity/commit/f15f03376b5 Pull-request: https://github.com/SerenityOS/serenity/pull/7012 Reviewed-by: https://github.com/linusg
2 changed files with 6 additions and 0 deletions
|
@ -78,6 +78,11 @@ void Clipboard::set_data(ReadonlyBytes data, const String& type, const HashMap<S
|
|||
connection().async_set_clipboard_data(move(buffer), type, metadata);
|
||||
}
|
||||
|
||||
void Clipboard::clear()
|
||||
{
|
||||
connection().async_set_clipboard_data({}, {}, {});
|
||||
}
|
||||
|
||||
void ClipboardServerConnection::clipboard_data_changed(String const& mime_type)
|
||||
{
|
||||
auto& clipboard = Clipboard::the();
|
||||
|
|
|
@ -22,6 +22,7 @@ public:
|
|||
ByteBuffer data() const { return data_and_type().data; }
|
||||
String mime_type() const { return data_and_type().mime_type; }
|
||||
void set_data(ReadonlyBytes, const String& mime_type = "text/plain", const HashMap<String, String>& metadata = {});
|
||||
void clear();
|
||||
|
||||
void set_plain_text(const String& text)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue