2025-05-01 11:38:31 -04:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2025, Tim Flynn <trflynn89@ladybird.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <AK/ByteString.h>
|
|
|
|
|
#include <AK/String.h>
|
|
|
|
|
#include <AK/Vector.h>
|
|
|
|
|
#include <LibIPC/Forward.h>
|
2025-07-19 19:35:33 -07:00
|
|
|
#include <LibWeb/Export.h>
|
2025-05-01 11:38:31 -04:00
|
|
|
|
|
|
|
|
namespace Web::Clipboard {
|
|
|
|
|
|
|
|
|
|
// https://w3c.github.io/clipboard-apis/#system-clipboard-representation
|
|
|
|
|
struct SystemClipboardRepresentation {
|
|
|
|
|
ByteString data;
|
|
|
|
|
String mime_type;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// https://w3c.github.io/clipboard-apis/#system-clipboard-item
|
|
|
|
|
struct SystemClipboardItem {
|
|
|
|
|
Vector<SystemClipboardRepresentation> system_clipboard_representations;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace IPC {
|
|
|
|
|
|
|
|
|
|
template<>
|
2025-07-19 19:35:33 -07:00
|
|
|
WEB_API ErrorOr<void> encode(Encoder&, Web::Clipboard::SystemClipboardRepresentation const&);
|
2025-05-01 11:38:31 -04:00
|
|
|
|
|
|
|
|
template<>
|
2025-07-19 19:35:33 -07:00
|
|
|
WEB_API ErrorOr<Web::Clipboard::SystemClipboardRepresentation> decode(Decoder&);
|
2025-05-01 11:38:31 -04:00
|
|
|
|
|
|
|
|
template<>
|
2025-07-19 19:35:33 -07:00
|
|
|
WEB_API ErrorOr<void> encode(Encoder&, Web::Clipboard::SystemClipboardItem const&);
|
2025-05-01 11:38:31 -04:00
|
|
|
|
|
|
|
|
template<>
|
2025-07-19 19:35:33 -07:00
|
|
|
WEB_API ErrorOr<Web::Clipboard::SystemClipboardItem> decode(Decoder&);
|
2025-05-01 11:38:31 -04:00
|
|
|
|
|
|
|
|
}
|