mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-05 22:52:10 +02:00
LibWeb: Begin implementing the drag data store
(cherry picked from commit 9e98e63559ebaaf50e7260c62ea750869bb3613d)
This commit is contained in:
committed by
Nico Weber
parent
80c1ab0de1
commit
cfd1c66552
29
Userland/Libraries/LibWeb/HTML/DragDataStore.cpp
Normal file
29
Userland/Libraries/LibWeb/HTML/DragDataStore.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2024, Tim Flynn <trflynn89@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/HTML/DataTransfer.h>
|
||||
#include <LibWeb/HTML/DragDataStore.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
DragDataStore::DragDataStore()
|
||||
: m_allowed_effects_state(DataTransferEffect::uninitialized)
|
||||
{
|
||||
}
|
||||
|
||||
DragDataStore::~DragDataStore() = default;
|
||||
|
||||
bool DragDataStore::has_text_item() const
|
||||
{
|
||||
for (auto const& item : m_item_list) {
|
||||
if (item.kind == DragDataStoreItem::Kind::Text && item.type_string == "text/plain"sv)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user