summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibGUI/Clipboard.cpp5
-rw-r--r--Userland/Libraries/LibGUI/Clipboard.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/Clipboard.cpp b/Userland/Libraries/LibGUI/Clipboard.cpp
index d1f51b7794..844f7adaf1 100644
--- a/Userland/Libraries/LibGUI/Clipboard.cpp
+++ b/Userland/Libraries/LibGUI/Clipboard.cpp
@@ -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();
diff --git a/Userland/Libraries/LibGUI/Clipboard.h b/Userland/Libraries/LibGUI/Clipboard.h
index 178afaff99..47627cd84c 100644
--- a/Userland/Libraries/LibGUI/Clipboard.h
+++ b/Userland/Libraries/LibGUI/Clipboard.h
@@ -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)
{