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.
37 lines
1.2 KiB
C++
37 lines
1.2 KiB
C++
/*
|
|
* Copyright (c) 2024, Jamie Mansfield <jmansfield@cadixdev.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/Bindings/CompositionEvent.h>
|
|
#include <LibWeb/UIEvents/UIEvent.h>
|
|
|
|
namespace Web::UIEvents {
|
|
|
|
class CompositionEvent final : public UIEvent {
|
|
WEB_PLATFORM_OBJECT(CompositionEvent, UIEvent);
|
|
GC_DECLARE_ALLOCATOR(CompositionEvent);
|
|
|
|
public:
|
|
[[nodiscard]] static GC::Ref<CompositionEvent> create(JS::Realm&, FlyString const& event_name, Bindings::CompositionEventInit const& = {});
|
|
static WebIDL::ExceptionOr<GC::Ref<CompositionEvent>> construct_impl(JS::Realm&, FlyString const& event_name, Bindings::CompositionEventInit const& event_init);
|
|
|
|
virtual ~CompositionEvent() override;
|
|
|
|
// https://w3c.github.io/uievents/#dom-compositionevent-data
|
|
String data() const { return m_data; }
|
|
|
|
void init_composition_event(String const& type, bool bubbles, bool cancelable, GC::Ptr<HTML::WindowProxy> view, String const& data);
|
|
|
|
private:
|
|
CompositionEvent(JS::Realm&, FlyString const& event_name, Bindings::CompositionEventInit const&);
|
|
|
|
virtual void initialize(JS::Realm&) override;
|
|
|
|
String m_data;
|
|
};
|
|
|
|
}
|