2023-11-10 13:29:20 -05:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <AK/String.h>
|
2024-11-15 04:01:23 +13:00
|
|
|
#include <LibGC/Ptr.h>
|
2023-11-10 13:29:20 -05:00
|
|
|
#include <LibJS/Forward.h>
|
|
|
|
|
#include <LibWeb/DOM/EventTarget.h>
|
|
|
|
|
#include <LibWeb/Forward.h>
|
|
|
|
|
#include <LibWeb/WebIDL/ExceptionOr.h>
|
|
|
|
|
|
|
|
|
|
namespace Web::Clipboard {
|
|
|
|
|
|
|
|
|
|
class Clipboard final : public DOM::EventTarget {
|
|
|
|
|
WEB_PLATFORM_OBJECT(Clipboard, DOM::EventTarget);
|
2024-11-15 04:01:23 +13:00
|
|
|
GC_DECLARE_ALLOCATOR(Clipboard);
|
2023-11-10 13:29:20 -05:00
|
|
|
|
|
|
|
|
public:
|
2024-11-15 04:01:23 +13:00
|
|
|
static WebIDL::ExceptionOr<GC::Ref<Clipboard>> construct_impl(JS::Realm&);
|
2023-11-10 13:29:20 -05:00
|
|
|
virtual ~Clipboard() override;
|
|
|
|
|
|
2024-11-15 04:01:23 +13:00
|
|
|
GC::Ref<WebIDL::Promise> write_text(String);
|
2023-11-10 13:29:20 -05:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Clipboard(JS::Realm&);
|
|
|
|
|
|
|
|
|
|
virtual void initialize(JS::Realm&) override;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|