GClipboard.h 678 B

123456789101112131415161718192021222324252627282930
  1. #pragma once
  2. #include <AK/Badge.h>
  3. #include <AK/Function.h>
  4. #include <AK/String.h>
  5. class GWindowServerConnection;
  6. class GClipboard {
  7. public:
  8. static GClipboard& the();
  9. String data() const { return data_and_type().data; }
  10. String type() const { return data_and_type().type; }
  11. void set_data(const StringView&, const String& data_type = "text");
  12. struct DataAndType {
  13. String data;
  14. String type;
  15. };
  16. DataAndType data_and_type() const;
  17. void did_receive_clipboard_contents_changed(Badge<GWindowServerConnection>, const String& data_type);
  18. Function<void(const String& data_type)> on_content_change;
  19. private:
  20. GClipboard();
  21. };