mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 07:52:45 +00:00 
			
		
		
		
	 c543ee5c5b
			
		
	
	
		c543ee5c5b
		
	
	
	
	
		
			
			This will allow us to distinguish between different types of data stored on the clipboard.
		
			
				
	
	
		
			30 lines
		
	
	
	
		
			678 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			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();
 | |
| };
 |