Files
ladybird/Libraries/LibWeb/HTML/CloseEvent.h
Shannon Booth 5adfd1c43a LibWeb/Bindings: Generate struct definitions from IDL dictionaries
Previously we were inconsistent by generating code for enum definitions
but not generating code for dictionaries. With future changes to the
IDL generator to expose helpers to convert to and from IDL values
this produced circular depdendencies. To solve this problem, also
generate the dictionary definitions in bindings headers.
2026-05-09 10:49:49 +02:00

41 lines
1.1 KiB
C++

/*
* Copyright (c) 2021, Dex♪ <dexes.ttp@gmail.com>
* Copyright (c) 2022, Andreas Kling <andreas@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/FlyString.h>
#include <LibWeb/Bindings/CloseEvent.h>
#include <LibWeb/DOM/Event.h>
namespace Web::HTML {
class CloseEvent : public DOM::Event {
WEB_PLATFORM_OBJECT(CloseEvent, DOM::Event);
GC_DECLARE_ALLOCATOR(CloseEvent);
public:
[[nodiscard]] static GC::Ref<CloseEvent> create(JS::Realm&, FlyString const& event_name, Bindings::CloseEventInit const& event_init = {});
static WebIDL::ExceptionOr<GC::Ref<CloseEvent>> construct_impl(JS::Realm&, FlyString const& event_name, Bindings::CloseEventInit const& event_init);
virtual ~CloseEvent() override;
bool was_clean() const { return m_was_clean; }
u16 code() const { return m_code; }
String reason() const { return m_reason; }
private:
CloseEvent(JS::Realm&, FlyString const& event_name, Bindings::CloseEventInit const& event_init);
virtual void initialize(JS::Realm&) override;
bool m_was_clean { false };
u16 m_code { 0 };
String m_reason;
};
}