| 
									
										
										
										
											2019-03-08 13:27:19 +01:00
										 |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-14 09:19:05 +02:00
										 |  |  | #include <AK/Badge.h>
 | 
					
						
							|  |  |  | #include <AK/Function.h>
 | 
					
						
							| 
									
										
										
										
											2019-09-06 15:34:26 +02:00
										 |  |  | #include <AK/String.h>
 | 
					
						
							| 
									
										
										
										
											2019-03-08 13:27:19 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-14 09:19:05 +02:00
										 |  |  | class GWindowServerConnection; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-08 13:27:19 +01:00
										 |  |  | class GClipboard { | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2019-04-05 05:10:18 +02:00
										 |  |  |     static GClipboard& the(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-14 09:19:05 +02:00
										 |  |  |     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; | 
					
						
							| 
									
										
										
										
											2019-04-05 05:10:18 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |     GClipboard(); | 
					
						
							| 
									
										
										
										
											2019-03-08 13:27:19 +01:00
										 |  |  | }; |