1/*
2 * Copyright (C) 2010-2018 Apple Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
14 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
17 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
20 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
21 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
25#pragma once
26
27#include "ArgumentCoders.h"
28#include "Connection.h"
29#include "SandboxExtension.h"
30#include "SharedMemory.h"
31#include <WebCore/PasteboardItemInfo.h>
32#include <wtf/Forward.h>
33#include <wtf/ThreadSafeRefCounted.h>
34#include <wtf/Vector.h>
35#include <wtf/text/WTFString.h>
36
37namespace WebCore {
38struct PasteboardItemInfo;
39class Color;
40struct PasteboardURL;
41struct PasteboardWebContent;
42struct PasteboardCustomData;
43struct PasteboardImage;
44}
45
46namespace WebKit {
47struct WebSelectionData;
48}
49
50namespace Messages {
51namespace WebPasteboardProxy {
52
53static inline IPC::StringReference messageReceiverName()
54{
55 return IPC::StringReference("WebPasteboardProxy");
56}
57
58#if PLATFORM(IOS_FAMILY)
59class WriteURLToPasteboard {
60public:
61 typedef std::tuple<const WebCore::PasteboardURL&, const String&> Arguments;
62
63 static IPC::StringReference receiverName() { return messageReceiverName(); }
64 static IPC::StringReference name() { return IPC::StringReference("WriteURLToPasteboard"); }
65 static const bool isSync = false;
66
67 WriteURLToPasteboard(const WebCore::PasteboardURL& url, const String& pasteboardName)
68 : m_arguments(url, pasteboardName)
69 {
70 }
71
72 const Arguments& arguments() const
73 {
74 return m_arguments;
75 }
76
77private:
78 Arguments m_arguments;
79};
80#endif
81
82#if PLATFORM(IOS_FAMILY)
83class WriteWebContentToPasteboard {
84public:
85 typedef std::tuple<const WebCore::PasteboardWebContent&, const String&> Arguments;
86
87 static IPC::StringReference receiverName() { return messageReceiverName(); }
88 static IPC::StringReference name() { return IPC::StringReference("WriteWebContentToPasteboard"); }
89 static const bool isSync = false;
90
91 WriteWebContentToPasteboard(const WebCore::PasteboardWebContent& content, const String& pasteboardName)
92 : m_arguments(content, pasteboardName)
93 {
94 }
95
96 const Arguments& arguments() const
97 {
98 return m_arguments;
99 }
100
101private:
102 Arguments m_arguments;
103};
104#endif
105
106#if PLATFORM(IOS_FAMILY)
107class WriteImageToPasteboard {
108public:
109 typedef std::tuple<const WebCore::PasteboardImage&, const String&> Arguments;
110
111 static IPC::StringReference receiverName() { return messageReceiverName(); }
112 static IPC::StringReference name() { return IPC::StringReference("WriteImageToPasteboard"); }
113 static const bool isSync = false;
114
115 WriteImageToPasteboard(const WebCore::PasteboardImage& pasteboardImage, const String& pasteboardName)
116 : m_arguments(pasteboardImage, pasteboardName)
117 {
118 }
119
120 const Arguments& arguments() const
121 {
122 return m_arguments;
123 }
124
125private:
126 Arguments m_arguments;
127};
128#endif
129
130#if PLATFORM(IOS_FAMILY)
131class WriteStringToPasteboard {
132public:
133 typedef std::tuple<const String&, const String&, const String&> Arguments;
134
135 static IPC::StringReference receiverName() { return messageReceiverName(); }
136 static IPC::StringReference name() { return IPC::StringReference("WriteStringToPasteboard"); }
137 static const bool isSync = false;
138
139 WriteStringToPasteboard(const String& pasteboardType, const String& text, const String& pasteboardName)
140 : m_arguments(pasteboardType, text, pasteboardName)
141 {
142 }
143
144 const Arguments& arguments() const
145 {
146 return m_arguments;
147 }
148
149private:
150 Arguments m_arguments;
151};
152#endif
153
154#if PLATFORM(IOS_FAMILY)
155class ReadStringFromPasteboard {
156public:
157 typedef std::tuple<uint64_t, const String&, const String&> Arguments;
158
159 static IPC::StringReference receiverName() { return messageReceiverName(); }
160 static IPC::StringReference name() { return IPC::StringReference("ReadStringFromPasteboard"); }
161 static const bool isSync = true;
162
163 using DelayedReply = CompletionHandler<void(const String& string)>;
164 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const String& string);
165 using Reply = std::tuple<String&>;
166 using ReplyArguments = std::tuple<String>;
167 ReadStringFromPasteboard(uint64_t index, const String& pasteboardType, const String& pasteboardName)
168 : m_arguments(index, pasteboardType, pasteboardName)
169 {
170 }
171
172 const Arguments& arguments() const
173 {
174 return m_arguments;
175 }
176
177private:
178 Arguments m_arguments;
179};
180#endif
181
182#if PLATFORM(IOS_FAMILY)
183class ReadURLFromPasteboard {
184public:
185 typedef std::tuple<uint64_t, const String&> Arguments;
186
187 static IPC::StringReference receiverName() { return messageReceiverName(); }
188 static IPC::StringReference name() { return IPC::StringReference("ReadURLFromPasteboard"); }
189 static const bool isSync = true;
190
191 using DelayedReply = CompletionHandler<void(const String& url, const String& title)>;
192 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const String& url, const String& title);
193 using Reply = std::tuple<String&, String&>;
194 using ReplyArguments = std::tuple<String, String>;
195 ReadURLFromPasteboard(uint64_t index, const String& pasteboardName)
196 : m_arguments(index, pasteboardName)
197 {
198 }
199
200 const Arguments& arguments() const
201 {
202 return m_arguments;
203 }
204
205private:
206 Arguments m_arguments;
207};
208#endif
209
210#if PLATFORM(IOS_FAMILY)
211class ReadBufferFromPasteboard {
212public:
213 typedef std::tuple<uint64_t, const String&, const String&> Arguments;
214
215 static IPC::StringReference receiverName() { return messageReceiverName(); }
216 static IPC::StringReference name() { return IPC::StringReference("ReadBufferFromPasteboard"); }
217 static const bool isSync = true;
218
219 using DelayedReply = CompletionHandler<void(const WebKit::SharedMemory::Handle& handle, uint64_t size)>;
220 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const WebKit::SharedMemory::Handle& handle, uint64_t size);
221 using Reply = std::tuple<WebKit::SharedMemory::Handle&, uint64_t&>;
222 using ReplyArguments = std::tuple<WebKit::SharedMemory::Handle, uint64_t>;
223 ReadBufferFromPasteboard(uint64_t index, const String& pasteboardType, const String& pasteboardName)
224 : m_arguments(index, pasteboardType, pasteboardName)
225 {
226 }
227
228 const Arguments& arguments() const
229 {
230 return m_arguments;
231 }
232
233private:
234 Arguments m_arguments;
235};
236#endif
237
238#if PLATFORM(IOS_FAMILY)
239class GetPasteboardItemsCount {
240public:
241 typedef std::tuple<const String&> Arguments;
242
243 static IPC::StringReference receiverName() { return messageReceiverName(); }
244 static IPC::StringReference name() { return IPC::StringReference("GetPasteboardItemsCount"); }
245 static const bool isSync = true;
246
247 using DelayedReply = CompletionHandler<void(uint64_t itemsCount)>;
248 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, uint64_t itemsCount);
249 using Reply = std::tuple<uint64_t&>;
250 using ReplyArguments = std::tuple<uint64_t>;
251 explicit GetPasteboardItemsCount(const String& pasteboardName)
252 : m_arguments(pasteboardName)
253 {
254 }
255
256 const Arguments& arguments() const
257 {
258 return m_arguments;
259 }
260
261private:
262 Arguments m_arguments;
263};
264#endif
265
266#if PLATFORM(IOS_FAMILY)
267class AllPasteboardItemInfo {
268public:
269 typedef std::tuple<const String&> Arguments;
270
271 static IPC::StringReference receiverName() { return messageReceiverName(); }
272 static IPC::StringReference name() { return IPC::StringReference("AllPasteboardItemInfo"); }
273 static const bool isSync = true;
274
275 using DelayedReply = CompletionHandler<void(const Vector<WebCore::PasteboardItemInfo>& allInfo)>;
276 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const Vector<WebCore::PasteboardItemInfo>& allInfo);
277 using Reply = std::tuple<Vector<WebCore::PasteboardItemInfo>&>;
278 using ReplyArguments = std::tuple<Vector<WebCore::PasteboardItemInfo>>;
279 explicit AllPasteboardItemInfo(const String& pasteboardName)
280 : m_arguments(pasteboardName)
281 {
282 }
283
284 const Arguments& arguments() const
285 {
286 return m_arguments;
287 }
288
289private:
290 Arguments m_arguments;
291};
292#endif
293
294#if PLATFORM(IOS_FAMILY)
295class InformationForItemAtIndex {
296public:
297 typedef std::tuple<uint64_t, const String&> Arguments;
298
299 static IPC::StringReference receiverName() { return messageReceiverName(); }
300 static IPC::StringReference name() { return IPC::StringReference("InformationForItemAtIndex"); }
301 static const bool isSync = true;
302
303 using DelayedReply = CompletionHandler<void(const WebCore::PasteboardItemInfo& info)>;
304 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const WebCore::PasteboardItemInfo& info);
305 using Reply = std::tuple<WebCore::PasteboardItemInfo&>;
306 using ReplyArguments = std::tuple<WebCore::PasteboardItemInfo>;
307 InformationForItemAtIndex(uint64_t index, const String& pasteboardName)
308 : m_arguments(index, pasteboardName)
309 {
310 }
311
312 const Arguments& arguments() const
313 {
314 return m_arguments;
315 }
316
317private:
318 Arguments m_arguments;
319};
320#endif
321
322#if PLATFORM(IOS_FAMILY)
323class UpdateSupportedTypeIdentifiers {
324public:
325 typedef std::tuple<const Vector<String>&, const String&> Arguments;
326
327 static IPC::StringReference receiverName() { return messageReceiverName(); }
328 static IPC::StringReference name() { return IPC::StringReference("UpdateSupportedTypeIdentifiers"); }
329 static const bool isSync = false;
330
331 UpdateSupportedTypeIdentifiers(const Vector<String>& identifiers, const String& pasteboardName)
332 : m_arguments(identifiers, pasteboardName)
333 {
334 }
335
336 const Arguments& arguments() const
337 {
338 return m_arguments;
339 }
340
341private:
342 Arguments m_arguments;
343};
344#endif
345
346class WriteCustomData {
347public:
348 typedef std::tuple<const WebCore::PasteboardCustomData&, const String&> Arguments;
349
350 static IPC::StringReference receiverName() { return messageReceiverName(); }
351 static IPC::StringReference name() { return IPC::StringReference("WriteCustomData"); }
352 static const bool isSync = true;
353
354 using DelayedReply = CompletionHandler<void(uint64_t changeCount)>;
355 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, uint64_t changeCount);
356 using Reply = std::tuple<uint64_t&>;
357 using ReplyArguments = std::tuple<uint64_t>;
358 WriteCustomData(const WebCore::PasteboardCustomData& data, const String& pasteboardName)
359 : m_arguments(data, pasteboardName)
360 {
361 }
362
363 const Arguments& arguments() const
364 {
365 return m_arguments;
366 }
367
368private:
369 Arguments m_arguments;
370};
371
372class TypesSafeForDOMToReadAndWrite {
373public:
374 typedef std::tuple<const String&, const String&> Arguments;
375
376 static IPC::StringReference receiverName() { return messageReceiverName(); }
377 static IPC::StringReference name() { return IPC::StringReference("TypesSafeForDOMToReadAndWrite"); }
378 static const bool isSync = true;
379
380 using DelayedReply = CompletionHandler<void(const Vector<String>& types)>;
381 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const Vector<String>& types);
382 using Reply = std::tuple<Vector<String>&>;
383 using ReplyArguments = std::tuple<Vector<String>>;
384 TypesSafeForDOMToReadAndWrite(const String& pasteboardName, const String& origin)
385 : m_arguments(pasteboardName, origin)
386 {
387 }
388
389 const Arguments& arguments() const
390 {
391 return m_arguments;
392 }
393
394private:
395 Arguments m_arguments;
396};
397
398#if PLATFORM(COCOA)
399class GetNumberOfFiles {
400public:
401 typedef std::tuple<const String&> Arguments;
402
403 static IPC::StringReference receiverName() { return messageReceiverName(); }
404 static IPC::StringReference name() { return IPC::StringReference("GetNumberOfFiles"); }
405 static const bool isSync = true;
406
407 using DelayedReply = CompletionHandler<void(uint64_t numberOfFiles)>;
408 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, uint64_t numberOfFiles);
409 using Reply = std::tuple<uint64_t&>;
410 using ReplyArguments = std::tuple<uint64_t>;
411 explicit GetNumberOfFiles(const String& pasteboardName)
412 : m_arguments(pasteboardName)
413 {
414 }
415
416 const Arguments& arguments() const
417 {
418 return m_arguments;
419 }
420
421private:
422 Arguments m_arguments;
423};
424#endif
425
426#if PLATFORM(COCOA)
427class GetPasteboardTypes {
428public:
429 typedef std::tuple<const String&> Arguments;
430
431 static IPC::StringReference receiverName() { return messageReceiverName(); }
432 static IPC::StringReference name() { return IPC::StringReference("GetPasteboardTypes"); }
433 static const bool isSync = true;
434
435 using DelayedReply = CompletionHandler<void(const Vector<String>& types)>;
436 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const Vector<String>& types);
437 using Reply = std::tuple<Vector<String>&>;
438 using ReplyArguments = std::tuple<Vector<String>>;
439 explicit GetPasteboardTypes(const String& pasteboardName)
440 : m_arguments(pasteboardName)
441 {
442 }
443
444 const Arguments& arguments() const
445 {
446 return m_arguments;
447 }
448
449private:
450 Arguments m_arguments;
451};
452#endif
453
454#if PLATFORM(COCOA)
455class GetPasteboardPathnamesForType {
456public:
457 typedef std::tuple<const String&, const String&> Arguments;
458
459 static IPC::StringReference receiverName() { return messageReceiverName(); }
460 static IPC::StringReference name() { return IPC::StringReference("GetPasteboardPathnamesForType"); }
461 static const bool isSync = true;
462
463 using DelayedReply = CompletionHandler<void(const Vector<String>& pathnames, const WebKit::SandboxExtension::HandleArray& sandboxExtensions)>;
464 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const Vector<String>& pathnames, const WebKit::SandboxExtension::HandleArray& sandboxExtensions);
465 using Reply = std::tuple<Vector<String>&, WebKit::SandboxExtension::HandleArray&>;
466 using ReplyArguments = std::tuple<Vector<String>, WebKit::SandboxExtension::HandleArray>;
467 GetPasteboardPathnamesForType(const String& pasteboardName, const String& pasteboardType)
468 : m_arguments(pasteboardName, pasteboardType)
469 {
470 }
471
472 const Arguments& arguments() const
473 {
474 return m_arguments;
475 }
476
477private:
478 Arguments m_arguments;
479};
480#endif
481
482#if PLATFORM(COCOA)
483class GetPasteboardStringForType {
484public:
485 typedef std::tuple<const String&, const String&> Arguments;
486
487 static IPC::StringReference receiverName() { return messageReceiverName(); }
488 static IPC::StringReference name() { return IPC::StringReference("GetPasteboardStringForType"); }
489 static const bool isSync = true;
490
491 using DelayedReply = CompletionHandler<void(const String& string)>;
492 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const String& string);
493 using Reply = std::tuple<String&>;
494 using ReplyArguments = std::tuple<String>;
495 GetPasteboardStringForType(const String& pasteboardName, const String& pasteboardType)
496 : m_arguments(pasteboardName, pasteboardType)
497 {
498 }
499
500 const Arguments& arguments() const
501 {
502 return m_arguments;
503 }
504
505private:
506 Arguments m_arguments;
507};
508#endif
509
510#if PLATFORM(COCOA)
511class GetPasteboardStringsForType {
512public:
513 typedef std::tuple<const String&, const String&> Arguments;
514
515 static IPC::StringReference receiverName() { return messageReceiverName(); }
516 static IPC::StringReference name() { return IPC::StringReference("GetPasteboardStringsForType"); }
517 static const bool isSync = true;
518
519 using DelayedReply = CompletionHandler<void(const Vector<String>& strings)>;
520 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const Vector<String>& strings);
521 using Reply = std::tuple<Vector<String>&>;
522 using ReplyArguments = std::tuple<Vector<String>>;
523 GetPasteboardStringsForType(const String& pasteboardName, const String& pasteboardType)
524 : m_arguments(pasteboardName, pasteboardType)
525 {
526 }
527
528 const Arguments& arguments() const
529 {
530 return m_arguments;
531 }
532
533private:
534 Arguments m_arguments;
535};
536#endif
537
538#if PLATFORM(COCOA)
539class GetPasteboardBufferForType {
540public:
541 typedef std::tuple<const String&, const String&> Arguments;
542
543 static IPC::StringReference receiverName() { return messageReceiverName(); }
544 static IPC::StringReference name() { return IPC::StringReference("GetPasteboardBufferForType"); }
545 static const bool isSync = true;
546
547 using DelayedReply = CompletionHandler<void(const WebKit::SharedMemory::Handle& handle, uint64_t size)>;
548 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const WebKit::SharedMemory::Handle& handle, uint64_t size);
549 using Reply = std::tuple<WebKit::SharedMemory::Handle&, uint64_t&>;
550 using ReplyArguments = std::tuple<WebKit::SharedMemory::Handle, uint64_t>;
551 GetPasteboardBufferForType(const String& pasteboardName, const String& pasteboardType)
552 : m_arguments(pasteboardName, pasteboardType)
553 {
554 }
555
556 const Arguments& arguments() const
557 {
558 return m_arguments;
559 }
560
561private:
562 Arguments m_arguments;
563};
564#endif
565
566#if PLATFORM(COCOA)
567class PasteboardCopy {
568public:
569 typedef std::tuple<const String&, const String&> Arguments;
570
571 static IPC::StringReference receiverName() { return messageReceiverName(); }
572 static IPC::StringReference name() { return IPC::StringReference("PasteboardCopy"); }
573 static const bool isSync = true;
574
575 using DelayedReply = CompletionHandler<void(uint64_t changeCount)>;
576 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, uint64_t changeCount);
577 using Reply = std::tuple<uint64_t&>;
578 using ReplyArguments = std::tuple<uint64_t>;
579 PasteboardCopy(const String& fromPasteboard, const String& toPasteboard)
580 : m_arguments(fromPasteboard, toPasteboard)
581 {
582 }
583
584 const Arguments& arguments() const
585 {
586 return m_arguments;
587 }
588
589private:
590 Arguments m_arguments;
591};
592#endif
593
594#if PLATFORM(COCOA)
595class GetPasteboardChangeCount {
596public:
597 typedef std::tuple<const String&> Arguments;
598
599 static IPC::StringReference receiverName() { return messageReceiverName(); }
600 static IPC::StringReference name() { return IPC::StringReference("GetPasteboardChangeCount"); }
601 static const bool isSync = true;
602
603 using DelayedReply = CompletionHandler<void(uint64_t changeCount)>;
604 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, uint64_t changeCount);
605 using Reply = std::tuple<uint64_t&>;
606 using ReplyArguments = std::tuple<uint64_t>;
607 explicit GetPasteboardChangeCount(const String& pasteboardName)
608 : m_arguments(pasteboardName)
609 {
610 }
611
612 const Arguments& arguments() const
613 {
614 return m_arguments;
615 }
616
617private:
618 Arguments m_arguments;
619};
620#endif
621
622#if PLATFORM(COCOA)
623class GetPasteboardUniqueName {
624public:
625 typedef std::tuple<> Arguments;
626
627 static IPC::StringReference receiverName() { return messageReceiverName(); }
628 static IPC::StringReference name() { return IPC::StringReference("GetPasteboardUniqueName"); }
629 static const bool isSync = true;
630
631 using DelayedReply = CompletionHandler<void(const String& pasteboardName)>;
632 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const String& pasteboardName);
633 using Reply = std::tuple<String&>;
634 using ReplyArguments = std::tuple<String>;
635 const Arguments& arguments() const
636 {
637 return m_arguments;
638 }
639
640private:
641 Arguments m_arguments;
642};
643#endif
644
645#if PLATFORM(COCOA)
646class GetPasteboardColor {
647public:
648 typedef std::tuple<const String&> Arguments;
649
650 static IPC::StringReference receiverName() { return messageReceiverName(); }
651 static IPC::StringReference name() { return IPC::StringReference("GetPasteboardColor"); }
652 static const bool isSync = true;
653
654 using DelayedReply = CompletionHandler<void(const WebCore::Color& color)>;
655 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const WebCore::Color& color);
656 using Reply = std::tuple<WebCore::Color&>;
657 using ReplyArguments = std::tuple<WebCore::Color>;
658 explicit GetPasteboardColor(const String& pasteboardName)
659 : m_arguments(pasteboardName)
660 {
661 }
662
663 const Arguments& arguments() const
664 {
665 return m_arguments;
666 }
667
668private:
669 Arguments m_arguments;
670};
671#endif
672
673#if PLATFORM(COCOA)
674class GetPasteboardURL {
675public:
676 typedef std::tuple<const String&> Arguments;
677
678 static IPC::StringReference receiverName() { return messageReceiverName(); }
679 static IPC::StringReference name() { return IPC::StringReference("GetPasteboardURL"); }
680 static const bool isSync = true;
681
682 using DelayedReply = CompletionHandler<void(const String& urlString)>;
683 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const String& urlString);
684 using Reply = std::tuple<String&>;
685 using ReplyArguments = std::tuple<String>;
686 explicit GetPasteboardURL(const String& pasteboardName)
687 : m_arguments(pasteboardName)
688 {
689 }
690
691 const Arguments& arguments() const
692 {
693 return m_arguments;
694 }
695
696private:
697 Arguments m_arguments;
698};
699#endif
700
701#if PLATFORM(COCOA)
702class AddPasteboardTypes {
703public:
704 typedef std::tuple<const String&, const Vector<String>&> Arguments;
705
706 static IPC::StringReference receiverName() { return messageReceiverName(); }
707 static IPC::StringReference name() { return IPC::StringReference("AddPasteboardTypes"); }
708 static const bool isSync = true;
709
710 using DelayedReply = CompletionHandler<void(uint64_t changeCount)>;
711 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, uint64_t changeCount);
712 using Reply = std::tuple<uint64_t&>;
713 using ReplyArguments = std::tuple<uint64_t>;
714 AddPasteboardTypes(const String& pasteboardName, const Vector<String>& pasteboardTypes)
715 : m_arguments(pasteboardName, pasteboardTypes)
716 {
717 }
718
719 const Arguments& arguments() const
720 {
721 return m_arguments;
722 }
723
724private:
725 Arguments m_arguments;
726};
727#endif
728
729#if PLATFORM(COCOA)
730class SetPasteboardTypes {
731public:
732 typedef std::tuple<const String&, const Vector<String>&> Arguments;
733
734 static IPC::StringReference receiverName() { return messageReceiverName(); }
735 static IPC::StringReference name() { return IPC::StringReference("SetPasteboardTypes"); }
736 static const bool isSync = true;
737
738 using DelayedReply = CompletionHandler<void(uint64_t changeCount)>;
739 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, uint64_t changeCount);
740 using Reply = std::tuple<uint64_t&>;
741 using ReplyArguments = std::tuple<uint64_t>;
742 SetPasteboardTypes(const String& pasteboardName, const Vector<String>& pasteboardTypes)
743 : m_arguments(pasteboardName, pasteboardTypes)
744 {
745 }
746
747 const Arguments& arguments() const
748 {
749 return m_arguments;
750 }
751
752private:
753 Arguments m_arguments;
754};
755#endif
756
757#if PLATFORM(COCOA)
758class SetPasteboardURL {
759public:
760 typedef std::tuple<const WebCore::PasteboardURL&, const String&> Arguments;
761
762 static IPC::StringReference receiverName() { return messageReceiverName(); }
763 static IPC::StringReference name() { return IPC::StringReference("SetPasteboardURL"); }
764 static const bool isSync = true;
765
766 using DelayedReply = CompletionHandler<void(uint64_t changeCount)>;
767 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, uint64_t changeCount);
768 using Reply = std::tuple<uint64_t&>;
769 using ReplyArguments = std::tuple<uint64_t>;
770 SetPasteboardURL(const WebCore::PasteboardURL& pasteboardURL, const String& pasteboardName)
771 : m_arguments(pasteboardURL, pasteboardName)
772 {
773 }
774
775 const Arguments& arguments() const
776 {
777 return m_arguments;
778 }
779
780private:
781 Arguments m_arguments;
782};
783#endif
784
785#if PLATFORM(COCOA)
786class SetPasteboardColor {
787public:
788 typedef std::tuple<const String&, const WebCore::Color&> Arguments;
789
790 static IPC::StringReference receiverName() { return messageReceiverName(); }
791 static IPC::StringReference name() { return IPC::StringReference("SetPasteboardColor"); }
792 static const bool isSync = true;
793
794 using DelayedReply = CompletionHandler<void(uint64_t changeCount)>;
795 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, uint64_t changeCount);
796 using Reply = std::tuple<uint64_t&>;
797 using ReplyArguments = std::tuple<uint64_t>;
798 SetPasteboardColor(const String& pasteboardName, const WebCore::Color& color)
799 : m_arguments(pasteboardName, color)
800 {
801 }
802
803 const Arguments& arguments() const
804 {
805 return m_arguments;
806 }
807
808private:
809 Arguments m_arguments;
810};
811#endif
812
813#if PLATFORM(COCOA)
814class SetPasteboardStringForType {
815public:
816 typedef std::tuple<const String&, const String&, const String&> Arguments;
817
818 static IPC::StringReference receiverName() { return messageReceiverName(); }
819 static IPC::StringReference name() { return IPC::StringReference("SetPasteboardStringForType"); }
820 static const bool isSync = true;
821
822 using DelayedReply = CompletionHandler<void(uint64_t changeCount)>;
823 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, uint64_t changeCount);
824 using Reply = std::tuple<uint64_t&>;
825 using ReplyArguments = std::tuple<uint64_t>;
826 SetPasteboardStringForType(const String& pasteboardName, const String& pasteboardType, const String& string)
827 : m_arguments(pasteboardName, pasteboardType, string)
828 {
829 }
830
831 const Arguments& arguments() const
832 {
833 return m_arguments;
834 }
835
836private:
837 Arguments m_arguments;
838};
839#endif
840
841#if PLATFORM(COCOA)
842class SetPasteboardBufferForType {
843public:
844 typedef std::tuple<const String&, const String&, const WebKit::SharedMemory::Handle&, uint64_t> Arguments;
845
846 static IPC::StringReference receiverName() { return messageReceiverName(); }
847 static IPC::StringReference name() { return IPC::StringReference("SetPasteboardBufferForType"); }
848 static const bool isSync = true;
849
850 using DelayedReply = CompletionHandler<void(uint64_t changeCount)>;
851 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, uint64_t changeCount);
852 using Reply = std::tuple<uint64_t&>;
853 using ReplyArguments = std::tuple<uint64_t>;
854 SetPasteboardBufferForType(const String& pasteboardName, const String& pasteboardType, const WebKit::SharedMemory::Handle& handle, uint64_t size)
855 : m_arguments(pasteboardName, pasteboardType, handle, size)
856 {
857 }
858
859 const Arguments& arguments() const
860 {
861 return m_arguments;
862 }
863
864private:
865 Arguments m_arguments;
866};
867#endif
868
869#if PLATFORM(GTK)
870class WriteToClipboard {
871public:
872 typedef std::tuple<const String&, const WebKit::WebSelectionData&> Arguments;
873
874 static IPC::StringReference receiverName() { return messageReceiverName(); }
875 static IPC::StringReference name() { return IPC::StringReference("WriteToClipboard"); }
876 static const bool isSync = false;
877
878 WriteToClipboard(const String& pasteboardName, const WebKit::WebSelectionData& pasteboardContent)
879 : m_arguments(pasteboardName, pasteboardContent)
880 {
881 }
882
883 const Arguments& arguments() const
884 {
885 return m_arguments;
886 }
887
888private:
889 Arguments m_arguments;
890};
891#endif
892
893#if PLATFORM(GTK)
894class ReadFromClipboard {
895public:
896 typedef std::tuple<const String&> Arguments;
897
898 static IPC::StringReference receiverName() { return messageReceiverName(); }
899 static IPC::StringReference name() { return IPC::StringReference("ReadFromClipboard"); }
900 static const bool isSync = true;
901
902 using DelayedReply = CompletionHandler<void(const WebKit::WebSelectionData& pasteboardContent)>;
903 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const WebKit::WebSelectionData& pasteboardContent);
904 using Reply = std::tuple<WebKit::WebSelectionData&>;
905 using ReplyArguments = std::tuple<WebKit::WebSelectionData>;
906 explicit ReadFromClipboard(const String& pasteboardName)
907 : m_arguments(pasteboardName)
908 {
909 }
910
911 const Arguments& arguments() const
912 {
913 return m_arguments;
914 }
915
916private:
917 Arguments m_arguments;
918};
919#endif
920
921#if USE(LIBWPE)
922class GetPasteboardTypes {
923public:
924 typedef std::tuple<> Arguments;
925
926 static IPC::StringReference receiverName() { return messageReceiverName(); }
927 static IPC::StringReference name() { return IPC::StringReference("GetPasteboardTypes"); }
928 static const bool isSync = true;
929
930 using DelayedReply = CompletionHandler<void(const Vector<String>& types)>;
931 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const Vector<String>& types);
932 using Reply = std::tuple<Vector<String>&>;
933 using ReplyArguments = std::tuple<Vector<String>>;
934 const Arguments& arguments() const
935 {
936 return m_arguments;
937 }
938
939private:
940 Arguments m_arguments;
941};
942#endif
943
944#if USE(LIBWPE)
945class ReadStringFromPasteboard {
946public:
947 typedef std::tuple<uint64_t, const String&> Arguments;
948
949 static IPC::StringReference receiverName() { return messageReceiverName(); }
950 static IPC::StringReference name() { return IPC::StringReference("ReadStringFromPasteboard"); }
951 static const bool isSync = true;
952
953 using DelayedReply = CompletionHandler<void(const String& string)>;
954 static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&, const String& string);
955 using Reply = std::tuple<String&>;
956 using ReplyArguments = std::tuple<String>;
957 ReadStringFromPasteboard(uint64_t index, const String& pasteboardType)
958 : m_arguments(index, pasteboardType)
959 {
960 }
961
962 const Arguments& arguments() const
963 {
964 return m_arguments;
965 }
966
967private:
968 Arguments m_arguments;
969};
970#endif
971
972#if USE(LIBWPE)
973class WriteWebContentToPasteboard {
974public:
975 typedef std::tuple<const WebCore::PasteboardWebContent&> Arguments;
976
977 static IPC::StringReference receiverName() { return messageReceiverName(); }
978 static IPC::StringReference name() { return IPC::StringReference("WriteWebContentToPasteboard"); }
979 static const bool isSync = false;
980
981 explicit WriteWebContentToPasteboard(const WebCore::PasteboardWebContent& content)
982 : m_arguments(content)
983 {
984 }
985
986 const Arguments& arguments() const
987 {
988 return m_arguments;
989 }
990
991private:
992 Arguments m_arguments;
993};
994#endif
995
996#if USE(LIBWPE)
997class WriteStringToPasteboard {
998public:
999 typedef std::tuple<const String&, const String&> Arguments;
1000
1001 static IPC::StringReference receiverName() { return messageReceiverName(); }
1002 static IPC::StringReference name() { return IPC::StringReference("WriteStringToPasteboard"); }
1003 static const bool isSync = false;
1004
1005 WriteStringToPasteboard(const String& pasteboardType, const String& text)
1006 : m_arguments(pasteboardType, text)
1007 {
1008 }
1009
1010 const Arguments& arguments() const
1011 {
1012 return m_arguments;
1013 }
1014
1015private:
1016 Arguments m_arguments;
1017};
1018#endif
1019
1020} // namespace WebPasteboardProxy
1021} // namespace Messages
1022