16#ifndef AEONGUI_DOM_EVENT_H
17#define AEONGUI_DOM_EVENT_H
23#include "DOMString.hpp"
24#include "EventTarget.hpp"
31 using DOMHighResTimeStamp = std::chrono::time_point<std::chrono::high_resolution_clock>;
53 Event (
const DOMString&
type,
const std::optional<EventInit>& eventInitDict = {} );
71 constexpr const DOMString&
type()
const
85 return m_currentTarget;
109 return m_defaultPrevented;
133 EventTarget* m_currentTarget{};
134 uint16_t m_eventPhase{
NONE};
137 bool m_defaultPrevented{};
140 DOMHighResTimeStamp m_timeStamp{};
constexpr bool composed() const
Check whether the event is composed.
Definition Event.hpp:113
const uint16_t AT_TARGET
At-target phase.
Definition Event.hpp:66
const uint16_t CAPTURING_PHASE
Capture phase.
Definition Event.hpp:65
constexpr uint16_t eventPhase() const
Get the current event phase.
Definition Event.hpp:89
constexpr bool bubbles() const
Check whether the event bubbles.
Definition Event.hpp:95
constexpr const EventTarget *const currentTarget() const
Get the current target during dispatch.
Definition Event.hpp:83
void stopPropagation()
Stop the event from propagating further.
Definition Event.cpp:33
constexpr bool isTrusted() const
Check whether the event was generated by the user agent.
Definition Event.hpp:119
std::vector< EventTarget > composedPath() const
Build the composed path for this event.
Definition Event.cpp:29
constexpr const DOMString & type() const
Get the event type.
Definition Event.hpp:71
const uint16_t NONE
No phase.
Definition Event.hpp:64
const uint16_t BUBBLING_PHASE
Bubble phase.
Definition Event.hpp:67
constexpr const EventTarget *const target() const
Get the target of the event.
Definition Event.hpp:77
void stopImmediatePropagation()
Stop the event from propagating and prevent other listeners on the same target.
Definition Event.cpp:37
constexpr const DOMHighResTimeStamp & timeStamp() const
Get the event's creation timestamp.
Definition Event.hpp:125
constexpr bool defaultPrevented() const
Check whether the default action was prevented.
Definition Event.hpp:107
void preventDefault()
Cancel the event's default action, if cancelable.
Definition Event.cpp:41
constexpr bool cancelable() const
Check whether the event is cancelable.
Definition Event.hpp:101
Event(const DOMString &type, const std::optional< EventInit > &eventInitDict={})
Construct an event of the given type.
Definition Event.cpp:21
Base class for objects that can receive DOM events.
Definition EventTarget.hpp:58
Initialization dictionary for Event construction.
Definition Event.hpp:34
bool cancelable
Whether the event can be cancelled.
Definition Event.hpp:36
bool bubbles
Whether the event bubbles up the DOM tree.
Definition Event.hpp:35
bool composed
Whether the event crosses shadow DOM boundaries.
Definition Event.hpp:37