/* * Copyright (c) 2024, Tim Flynn * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include namespace Web::HTML { // https://html.spec.whatwg.org/multipage/dnd.html#the-datatransferitemlist-interface class DataTransferItemList : public Bindings::PlatformObject { WEB_PLATFORM_OBJECT(DataTransferItemList, Bindings::PlatformObject); GC_DECLARE_ALLOCATOR(DataTransferItemList); public: static GC::Ref create(JS::Realm&, GC::Ref); virtual ~DataTransferItemList() override; WebIDL::UnsignedLong length() const; WebIDL::ExceptionOr> add(String const& data, String const& type); GC::Ptr add(GC::Ref); private: DataTransferItemList(JS::Realm&, GC::Ref); virtual void initialize(JS::Realm&) override; virtual void visit_edges(JS::Cell::Visitor&) override; virtual Optional item_value(size_t index) const override; GC::Ref m_data_transfer; }; }