mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-22 09:18:55 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
59
Libraries/LibWeb/XHR/FormData.h
Normal file
59
Libraries/LibWeb/XHR/FormData.h
Normal file
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* Copyright (c) 2023-2024, Kenneth Myhra <kennethmyhra@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/Bindings/FormDataPrototype.h>
|
||||
#include <LibWeb/Bindings/PlatformObject.h>
|
||||
#include <LibWeb/DOMURL/URLSearchParams.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
#include <LibWeb/HTML/HTMLFormElement.h>
|
||||
#include <LibWeb/WebIDL/ExceptionOr.h>
|
||||
#include <LibWeb/XHR/FormDataEntry.h>
|
||||
|
||||
namespace Web::XHR {
|
||||
|
||||
// https://xhr.spec.whatwg.org/#interface-formdata
|
||||
class FormData : public Bindings::PlatformObject {
|
||||
WEB_PLATFORM_OBJECT(FormData, Bindings::PlatformObject);
|
||||
JS_DECLARE_ALLOCATOR(FormData);
|
||||
|
||||
public:
|
||||
virtual ~FormData() override;
|
||||
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<FormData>> construct_impl(JS::Realm&, JS::GCPtr<HTML::HTMLFormElement> form = {});
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<FormData>> construct_impl(JS::Realm&, Vector<FormDataEntry> entry_list);
|
||||
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<FormData>> create(JS::Realm&, Vector<DOMURL::QueryParam> entry_list);
|
||||
|
||||
WebIDL::ExceptionOr<void> append(String const& name, String const& value);
|
||||
WebIDL::ExceptionOr<void> append(String const& name, JS::NonnullGCPtr<FileAPI::Blob> const& blob_value, Optional<String> const& filename = {});
|
||||
void delete_(String const& name);
|
||||
Variant<JS::Handle<FileAPI::File>, String, Empty> get(String const& name);
|
||||
WebIDL::ExceptionOr<Vector<FormDataEntryValue>> get_all(String const& name);
|
||||
bool has(String const& name);
|
||||
WebIDL::ExceptionOr<void> set(String const& name, String const& value);
|
||||
WebIDL::ExceptionOr<void> set(String const& name, JS::NonnullGCPtr<FileAPI::Blob> const& blob_value, Optional<String> const& filename = {});
|
||||
|
||||
Vector<FormDataEntry> const& entry_list() const { return m_entry_list; }
|
||||
|
||||
using ForEachCallback = Function<JS::ThrowCompletionOr<void>(String const&, FormDataEntryValue const&)>;
|
||||
JS::ThrowCompletionOr<void> for_each(ForEachCallback);
|
||||
|
||||
private:
|
||||
friend class FormDataIterator;
|
||||
|
||||
explicit FormData(JS::Realm&, Vector<FormDataEntry> entry_list = {});
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
WebIDL::ExceptionOr<void> append_impl(String const& name, Variant<JS::NonnullGCPtr<FileAPI::Blob>, String> const& value, Optional<String> const& filename = {});
|
||||
WebIDL::ExceptionOr<void> set_impl(String const& name, Variant<JS::NonnullGCPtr<FileAPI::Blob>, String> const& value, Optional<String> const& filename = {});
|
||||
|
||||
Vector<FormDataEntry> m_entry_list;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue