docs
Loading...
Searching...
No Matches
FocusEvent

#include <Ultralight/dom/Event.h>

Overview

A focus event (FocusEvent).

Get one with Event::AsFocus(). It adds the other element of the focus change. It works for focus, blur, focusin, and focusout.

Inheritance diagram for FocusEvent:
Event

Public Member Functions

 FocusEvent (ULDOMEvent borrowed)
 Wrap an event handle from the C API (Event::AsFocus() is the usual way to get one).
Element relatedTarget () const
 Get the other element of the focus change (relatedTarget).
Public Member Functions inherited from Event
 Event (ULDOMEvent borrowed)
 Wrap an event handle from the C API.
 Event (const Event &)=delete
Event & operator= (const Event &)=delete
std::string type () const
 Get the event's type (type).
unsigned eventPhase () const
 Get the current dispatch phase (eventPhase).
bool bubbles () const
 Whether or not the event bubbles up the tree (bubbles).
bool cancelable () const
 Whether or not preventDefault() can cancel the event (cancelable).
bool isTrusted () const
 Whether or not the event came from user input or the library (isTrusted).
double timeStamp () const
 Get the time the event was created (timeStamp).
bool defaultPrevented () const
 Whether or not the event was canceled (defaultPrevented).
void preventDefault () const
 Cancel the event's default action (preventDefault).
void stopPropagation () const
 Stop the event from reaching other targets (stopPropagation).
void stopImmediatePropagation () const
 Stop the event from reaching any other listener (stopImmediatePropagation).
Element target () const
 Get the element the event was dispatched to (target).
Node targetNode () const
 Get the node the event was dispatched to (target).
Element currentTarget () const
 Get the element whose listener is running (currentTarget).
MouseEvent AsMouse () const
 View this event as a MouseEvent.
WheelEvent AsWheel () const
 View this event as a WheelEvent.
KeyboardEvent AsKeyboard () const
 View this event as a KeyboardEvent.
FocusEvent AsFocus () const
 View this event as a FocusEvent.
InputEvent AsInput () const
 View this event as an InputEvent.
SubmitEvent AsSubmit () const
 View this event as a SubmitEvent.
CustomEvent AsCustom () const
 View this event as a CustomEvent.
ULDOMEvent raw () const
 Get the C handle, for passing to the <Ultralight/CAPI/CAPI_DOMEvent.h> functions.

Constructor & Destructor Documentation

◆ FocusEvent()

FocusEvent ( ULDOMEvent borrowed)
inlineexplicit

Wrap an event handle from the C API (Event::AsFocus() is the usual way to get one).

Parameters
borrowedThe event handle passed to a C listener callback.

Member Function Documentation

◆ relatedTarget()

Element relatedTarget ( ) const
inline

Get the other element of the focus change (relatedTarget).

On focus and focusin this is the element losing focus. On blur and focusout it's the element gaining focus.

Returns
Returns the element (empty if there's none).

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