LibWeb: Begin implementing the drag data store

This commit is contained in:
Timothy Flynn 2024-08-16 13:31:42 -04:00 committed by Andreas Kling
commit 9e98e63559
Notes: github-actions[bot] 2024-08-19 11:30:55 +00:00
4 changed files with 108 additions and 0 deletions

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