/src/serenity/Userland/Libraries/LibWeb/HTML/DragDataStore.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright (c) 2024, Tim Flynn <trflynn89@serenityos.org> |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #include <LibWeb/HTML/DataTransfer.h> |
8 | | #include <LibWeb/HTML/DragDataStore.h> |
9 | | |
10 | | namespace Web::HTML { |
11 | | |
12 | | NonnullRefPtr<DragDataStore> DragDataStore::create() |
13 | 0 | { |
14 | 0 | return adopt_ref(*new DragDataStore()); |
15 | 0 | } |
16 | | |
17 | | DragDataStore::DragDataStore() |
18 | 0 | : m_allowed_effects_state(DataTransferEffect::uninitialized) |
19 | 0 | { |
20 | 0 | } |
21 | | |
22 | 0 | DragDataStore::~DragDataStore() = default; |
23 | | |
24 | | bool DragDataStore::has_text_item() const |
25 | 0 | { |
26 | 0 | for (auto const& item : m_item_list) { |
27 | 0 | if (item.kind == DragDataStoreItem::Kind::Text && item.type_string == "text/plain"sv) |
28 | 0 | return true; |
29 | 0 | } |
30 | | |
31 | 0 | return false; |
32 | 0 | } |
33 | | |
34 | | } |