ladybird/Libraries/LibGUI/GClipboard.h
Andreas Kling c543ee5c5b WindowServer+LibGUI: Store a "data type" with the clipboard content
This will allow us to distinguish between different types of data
stored on the clipboard.
2019-09-14 09:19:05 +02:00

30 lines
678 B
C++

#pragma once
#include <AK/Badge.h>
#include <AK/Function.h>
#include <AK/String.h>
class GWindowServerConnection;
class GClipboard {
public:
static GClipboard& the();
String data() const { return data_and_type().data; }
String type() const { return data_and_type().type; }
void set_data(const StringView&, const String& data_type = "text");
struct DataAndType {
String data;
String type;
};
DataAndType data_and_type() const;
void did_receive_clipboard_contents_changed(Badge<GWindowServerConnection>, const String& data_type);
Function<void(const String& data_type)> on_content_change;
private:
GClipboard();
};