ladybird/Userland/Libraries/LibWeb/HTML/DragDataStore.cpp
2024-08-19 13:29:19 +02:00

29 lines
594 B
C++

/*
* 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;
}
}