Nui
Loading...
Searching...
No Matches
event.hpp
Go to the documentation of this file.
1#pragma once
2
4
5#include <chrono>
6#include <string>
7
8namespace Nui::WebApi
9{
10 enum class EventPhase
11 {
12 NONE = 0,
14 AT_TARGET = 2,
16 };
17
21 class Event : public ValWrapper
22 {
23 public:
24 explicit Event(Nui::val event);
25
29 bool bubbles() const;
30
34 bool cancelable() const;
35
40 bool composed() const;
41
46 Nui::val currentTarget() const;
47
54 bool defaultPrevented() const;
55
61 EventPhase eventPhase() const;
62
67 bool isTrusted() const;
68
74 Nui::val target() const;
75
81 std::chrono::milliseconds timeStamp() const;
82
86 std::string type() const;
87
93 std::vector<Nui::val> composedPath() const;
94
98 void preventDefault() const;
99
105 void stopImmediatePropagation() const;
106
110 void stopPropagation() const;
111 };
112}
Common base class for classes that are just wrapping around val into js world.
Definition val_wrapper.hpp:11
Definition event.hpp:22
void preventDefault() const
Cancels the event (if it is cancelable).
Definition event.cpp:59
void stopPropagation() const
Stops the propagation of events further along in the DOM.
Definition event.cpp:67
void stopImmediatePropagation() const
For this particular event, prevent all other listeners from being called.
Definition event.cpp:63
bool isTrusted() const
Indicates whether or not the event was initiated by the browser (after a user click,...
Definition event.cpp:33
EventPhase eventPhase() const
Indicates which phase of the event flow is being processed.
Definition event.cpp:29
bool defaultPrevented() const
Indicates whether or not the call to event.preventDefault() canceled the event.
Definition event.cpp:25
std::string type() const
The name identifying the type of the event, e.g., "click", "hashchange", or "submit".
Definition event.cpp:45
Nui::val target() const
A reference to the object to which the event was originally dispatched.
Definition event.cpp:37
bool bubbles() const
A boolean value indicating whether or not the event bubbles up through the DOM.
Definition event.cpp:9
bool composed() const
A boolean indicating whether or not the event can bubble across the boundary between the shadow DOM a...
Definition event.cpp:17
std::chrono::milliseconds timeStamp() const
The time at which the event was created (in milliseconds).
Definition event.cpp:41
bool cancelable() const
A boolean value indicating whether the event is cancelable.
Definition event.cpp:13
std::vector< Nui::val > composedPath() const
The composedPath() method of the Event interface returns the event's path which is an array of the ob...
Definition event.cpp:49
Nui::val currentTarget() const
A reference to the currently registered target for the event.
Definition event.cpp:21
Definition abort_controller.hpp:8
EventPhase
Definition event.hpp:11
emscripten::val val
Definition val.hpp:5