mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 08:10:02 +00:00
LibWeb: Begin implementing the drag data store
This commit is contained in:
parent
dcb76572e4
commit
9e98e63559
Notes:
github-actions[bot]
2024-08-19 11:30:55 +00:00
Author: https://github.com/trflynn89
Commit: 9e98e63559
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1111
4 changed files with 108 additions and 0 deletions
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;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue