mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 09:12:13 -05:00
f87041bf3a
Resulting in a massive rename across almost everywhere! Alongside the namespace change, we now have the following names: * JS::NonnullGCPtr -> GC::Ref * JS::GCPtr -> GC::Ptr * JS::HeapFunction -> GC::Function * JS::CellImpl -> GC::Cell * JS::Handle -> GC::Root
51 lines
1.4 KiB
C++
51 lines
1.4 KiB
C++
/*
|
|
* Copyright (c) 2024, Jamie Mansfield <jmansfield@cadixdev.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/DOM/StaticRange.h>
|
|
#include <LibWeb/UIEvents/UIEvent.h>
|
|
|
|
namespace Web::UIEvents {
|
|
|
|
struct InputEventInit : public UIEventInit {
|
|
Optional<String> data;
|
|
bool is_composing { false };
|
|
FlyString input_type {};
|
|
};
|
|
|
|
class InputEvent final : public UIEvent {
|
|
WEB_PLATFORM_OBJECT(InputEvent, UIEvent);
|
|
GC_DECLARE_ALLOCATOR(InputEvent);
|
|
|
|
public:
|
|
[[nodiscard]] static GC::Ref<InputEvent> create_from_platform_event(JS::Realm&, FlyString const& type, InputEventInit const& event_init);
|
|
static WebIDL::ExceptionOr<GC::Ref<InputEvent>> construct_impl(JS::Realm&, FlyString const& event_name, InputEventInit const& event_init);
|
|
|
|
virtual ~InputEvent() override;
|
|
|
|
// https://w3c.github.io/uievents/#dom-inputevent-data
|
|
Optional<String> data() const { return m_data; }
|
|
|
|
// https://w3c.github.io/uievents/#dom-inputevent-iscomposing
|
|
bool is_composing() const { return m_is_composing; }
|
|
|
|
// https://w3c.github.io/uievents/#dom-inputevent-inputtype
|
|
FlyString input_type() const { return m_input_type; }
|
|
|
|
Vector<DOM::StaticRange> get_target_ranges() const;
|
|
|
|
private:
|
|
InputEvent(JS::Realm&, FlyString const& event_name, InputEventInit const&);
|
|
|
|
virtual void initialize(JS::Realm&) override;
|
|
|
|
Optional<String> m_data;
|
|
bool m_is_composing;
|
|
FlyString m_input_type;
|
|
};
|
|
|
|
}
|