Nui
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Nui::WebApi::Event Class Reference

#include <event.hpp>

Inheritance diagram for Nui::WebApi::Event:
Inheritance graph
[legend]
Collaboration diagram for Nui::WebApi::Event:
Collaboration graph
[legend]

Public Member Functions

 Event (Nui::val event)
 
bool bubbles () const
 A boolean value indicating whether or not the event bubbles up through the DOM.
 
bool cancelable () const
 A boolean value indicating whether the event is cancelable.
 
bool composed () const
 A boolean indicating whether or not the event can bubble across the boundary between the shadow DOM and the regular DOM.
 
Nui::val currentTarget () const
 A reference to the currently registered target for the event.
 
bool defaultPrevented () const
 Indicates whether or not the call to event.preventDefault() canceled the event.
 
EventPhase eventPhase () const
 Indicates which phase of the event flow is being processed.
 
bool isTrusted () const
 Indicates whether or not the event was initiated by the browser (after a user click, for instance) or by a script (using an event creation method, for example).
 
Nui::val target () const
 A reference to the object to which the event was originally dispatched.
 
std::chrono::milliseconds timeStamp () const
 The time at which the event was created (in milliseconds).
 
std::string type () const
 The name identifying the type of the event, e.g., "click", "hashchange", or "submit".
 
std::vector< Nui::valcomposedPath () const
 The composedPath() method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked.
 
void preventDefault () const
 Cancels the event (if it is cancelable).
 
void stopImmediatePropagation () const
 For this particular event, prevent all other listeners from being called.
 
void stopPropagation () const
 Stops the propagation of events further along in the DOM.
 
- Public Member Functions inherited from Nui::ValWrapper
 ValWrapper (Nui::val valObject)
 
virtual ~ValWrapper ()=default
 
 ValWrapper (ValWrapper const &)=default
 
 ValWrapper (ValWrapper &&) noexcept=default
 
ValWrapperoperator= (ValWrapper const &)=default
 
ValWrapperoperator= (ValWrapper &&) noexcept=default
 
Nui::val const & val () const &noexcept
 
Nui::val val () &&noexcept
 
 operator Nui::val const & () const &noexcept
 
 operator Nui::val () &&noexcept
 

Additional Inherited Members

- Protected Attributes inherited from Nui::ValWrapper
Nui::val val_
 

Detailed Description

See also
https://developer.mozilla.org/en-US/docs/Web/API/Event

Constructor & Destructor Documentation

◆ Event()

Nui::WebApi::Event::Event ( Nui::val  event)
explicit

Member Function Documentation

◆ bubbles()

bool Nui::WebApi::Event::bubbles ( ) const

A boolean value indicating whether or not the event bubbles up through the DOM.

◆ cancelable()

bool Nui::WebApi::Event::cancelable ( ) const

A boolean value indicating whether the event is cancelable.

◆ composed()

bool Nui::WebApi::Event::composed ( ) const

A boolean indicating whether or not the event can bubble across the boundary between the shadow DOM and the regular DOM.

◆ composedPath()

std::vector< Nui::val > Nui::WebApi::Event::composedPath ( ) const

The composedPath() method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked.

This does not include nodes in shadow trees if the shadow root was created with its ShadowRoot.mode closed.

◆ currentTarget()

Nui::val Nui::WebApi::Event::currentTarget ( ) const

A reference to the currently registered target for the event.

This is the object to which the event is currently slated to be sent. It's possible this has been changed along the way through retargeting.

◆ defaultPrevented()

bool Nui::WebApi::Event::defaultPrevented ( ) const

Indicates whether or not the call to event.preventDefault() canceled the event.

Returns
true
false

◆ eventPhase()

EventPhase Nui::WebApi::Event::eventPhase ( ) const

Indicates which phase of the event flow is being processed.

Returns
EventPhase

◆ isTrusted()

bool Nui::WebApi::Event::isTrusted ( ) const

Indicates whether or not the event was initiated by the browser (after a user click, for instance) or by a script (using an event creation method, for example).

◆ preventDefault()

void Nui::WebApi::Event::preventDefault ( ) const

Cancels the event (if it is cancelable).

◆ stopImmediatePropagation()

void Nui::WebApi::Event::stopImmediatePropagation ( ) const

For this particular event, prevent all other listeners from being called.

This includes listeners attached to the same element as well as those attached to elements that will be traversed later (during the capture phase, for instance).

◆ stopPropagation()

void Nui::WebApi::Event::stopPropagation ( ) const

Stops the propagation of events further along in the DOM.

◆ target()

Nui::val Nui::WebApi::Event::target ( ) const

A reference to the object to which the event was originally dispatched.

Returns
Nui::val

◆ timeStamp()

std::chrono::milliseconds Nui::WebApi::Event::timeStamp ( ) const

The time at which the event was created (in milliseconds).

By specification, this value is time since epoch—but in reality, browsers' definitions vary. In addition, work is underway to change this to be a DOMHighResTimeStamp instead.

◆ type()

std::string Nui::WebApi::Event::type ( ) const

The name identifying the type of the event, e.g., "click", "hashchange", or "submit".


The documentation for this class was generated from the following files: