/src/serenity/Userland/Libraries/LibWeb/UIEvents/TextEvent.h
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 2024, Jamie Mansfield <jmansfield@cadixdev.org> |
3 | | * |
4 | | * SPDX-License-Identifier: BSD-2-Clause |
5 | | */ |
6 | | |
7 | | #pragma once |
8 | | |
9 | | #include <LibWeb/UIEvents/UIEvent.h> |
10 | | |
11 | | namespace Web::UIEvents { |
12 | | |
13 | | class TextEvent final : public UIEvent { |
14 | | WEB_PLATFORM_OBJECT(TextEvent, UIEvent); |
15 | | JS_DECLARE_ALLOCATOR(TextEvent); |
16 | | |
17 | | public: |
18 | | [[nodiscard]] static JS::NonnullGCPtr<TextEvent> create(JS::Realm&, FlyString const& event_name); |
19 | | |
20 | | virtual ~TextEvent() override; |
21 | | |
22 | | // https://w3c.github.io/uievents/#dom-textevent-data |
23 | 0 | String data() const { return m_data; } |
24 | | |
25 | | void init_text_event(String const& type, bool bubbles, bool cancelable, HTML::Window* view, String const& data); |
26 | | |
27 | | private: |
28 | | TextEvent(JS::Realm&, FlyString const& event_name); |
29 | | |
30 | | virtual void initialize(JS::Realm&) override; |
31 | | |
32 | | String m_data; |
33 | | }; |
34 | | |
35 | | } |