/src/serenity/Userland/Libraries/LibWeb/Bindings/Transferable.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2023, Andrew Kaster <akaster@serenityos.org> |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #pragma once |
8 | | |
9 | | #include <AK/Vector.h> |
10 | | #include <LibIPC/Forward.h> |
11 | | #include <LibWeb/HTML/StructuredSerialize.h> |
12 | | #include <LibWeb/WebIDL/ExceptionOr.h> |
13 | | |
14 | | namespace Web::Bindings { |
15 | | |
16 | | // https://html.spec.whatwg.org/multipage/structured-data.html#transferable-objects |
17 | | class Transferable { |
18 | | public: |
19 | 0 | virtual ~Transferable() = default; |
20 | | |
21 | | // NOTE: It is an error to call Base::transfer_steps in your impl |
22 | | virtual WebIDL::ExceptionOr<void> transfer_steps(HTML::TransferDataHolder&) = 0; |
23 | | |
24 | | // NOTE: It is an error to call Base::transfer_receiving_steps in your impl |
25 | | virtual WebIDL::ExceptionOr<void> transfer_receiving_steps(HTML::TransferDataHolder&) = 0; |
26 | | |
27 | | virtual HTML::TransferType primary_interface() const = 0; |
28 | | |
29 | 0 | bool is_detached() const { return m_detached; } |
30 | 0 | void set_detached(bool b) { m_detached = b; } |
31 | | |
32 | | private: |
33 | | // https://html.spec.whatwg.org/multipage/structured-data.html#detached |
34 | | bool m_detached = false; |
35 | | }; |
36 | | |
37 | | } |