diff options
Diffstat (limited to 'Userland/Libraries/LibWeb/UIEvents/FocusEvent.h')
-rw-r--r-- | Userland/Libraries/LibWeb/UIEvents/FocusEvent.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/UIEvents/FocusEvent.h b/Userland/Libraries/LibWeb/UIEvents/FocusEvent.h new file mode 100644 index 0000000000..4a244dbede --- /dev/null +++ b/Userland/Libraries/LibWeb/UIEvents/FocusEvent.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2022, Andreas Kling <kling@serenityos.org> + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include <LibWeb/UIEvents/UIEvent.h> + +namespace Web::UIEvents { + +struct FocusEventInit : public UIEventInit { + RefPtr<DOM::EventTarget> related_target; +}; + +class FocusEvent final : public UIEvent { +public: + using WrapperType = Bindings::FocusEventWrapper; + + virtual ~FocusEvent() override; + + static NonnullRefPtr<FocusEvent> create_with_global_object(Bindings::WindowObject&, FlyString const& event_name, FocusEventInit const& event_init) + { + return adopt_ref(*new FocusEvent(event_name, event_init)); + } + +private: + FocusEvent(FlyString const& event_name, FocusEventInit const&); +}; + +} |