Files
serenity/Userland/Libraries/LibWeb/HTML/DragDataStore.cpp
Timothy Flynn cfd1c66552 LibWeb: Begin implementing the drag data store
(cherry picked from commit 9e98e63559ebaaf50e7260c62ea750869bb3613d)
2024-11-01 19:58:08 -04:00

30 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;
}
}