Guillaume 1.0.0
Guillaume.
|
Represents a UI event with type, target, and optional data. More...
#include <event.hpp>
Public Member Functions | |
Event (const std::string &type, std::shared_ptr< Component > target, const std::any &data=std::any()) | |
Construct an event. | |
const std::string & | getType (void) const |
Get the event type. | |
std::shared_ptr< Component > | getTarget (void) const |
Get the target component. | |
template<typename T > | |
T | getData (void) const |
Get the event data with type casting. | |
bool | hasData (void) const |
Check if the event has data. | |
Represents a UI event with type, target, and optional data.
The Event class encapsulates user interactions and system events that can be propagated through the component hierarchy. Events have a type (e.g., "click"), a target component, and optional type-erased data payload.
|
inline |
Construct an event.
type | The event type (e.g., "click", "hover", "change") |
target | The component that is the target of this event |
data | Optional data payload associated with the event |
|
inline |
Get the event data with type casting.
T | The type to cast the data to |
|
inline |
Get the target component.
|
inline |
Get the event type.
|
inline |
Check if the event has data.