Trait stdweb::traits::IEvent
[−]
[src]
pub trait IEvent: ReferenceType { fn bubbles(&self) -> bool { ... } fn cancel_bubble(&self) -> bool { ... } fn set_cancel_bubble(&self, value: bool) { ... } fn cancelable(&self) -> bool { ... } fn current_target(&self) -> Option<EventTarget> { ... } fn default_prevented(&self) -> bool { ... } fn event_phase(&self) -> EventPhase { ... } fn stop_immediate_propagation(&self) { ... } fn stop_propagation(&self) { ... } fn target(&self) -> Option<EventTarget> { ... } fn time_stamp(&self) -> Option<f64> { ... } fn is_trusted(&self) -> bool { ... } fn event_type(&self) -> String { ... } fn prevent_default(&self) { ... } }
The IEvent
interface represents any event which takes place in the DOM; some
are user-generated (such as mouse or keyboard events), while others are
generated by APIs (such as events that indicate an animation has finished
running, a video has been paused, and so forth). There are many types of event,
some of which use other interfaces based on the main IEvent
interface. IEvent
itself contains the properties and methods which are common to all events.
Provided Methods
fn bubbles(&self) -> bool
Indicates whether this event bubbles upward through the DOM.
fn cancel_bubble(&self) -> bool
A historical alias to Event.stopPropagation()
.
fn set_cancel_bubble(&self, value: bool)
A historical alias to Event.stopPropagation()
.
Setting this to true
before returning from an event handler will stop propagation
of the event.
fn cancelable(&self) -> bool
Indicates whether the event is cancelable.
fn current_target(&self) -> Option<EventTarget>
A reference to the currently registered target of this event.
fn default_prevented(&self) -> bool
Indicates whether preventDefault
has been called on this event.
fn event_phase(&self) -> EventPhase
Indicates which phase of event flow is currently being evaluated.
fn stop_immediate_propagation(&self)
Prevents any further listeners from being called for this event.
fn stop_propagation(&self)
Stops the propagation of this event to descendants in the DOM.
fn target(&self) -> Option<EventTarget>
Returns a reference to the target to which this event was originally registered.
fn time_stamp(&self) -> Option<f64>
Returns the time in milliseconds at which this event was created.
fn is_trusted(&self) -> bool
Indicates whether the event was generated by a user action.
fn event_type(&self) -> String
Returns a string containing the type of event. It is set when the event is constructed and is the name commonly used to refer to the specific event.
fn prevent_default(&self)
Cancels the event if it is cancelable, without stopping further propagation of the event.
Implementors
impl IEvent for ChangeEvent
impl IEvent for InputEvent
impl IEvent for ResourceLoadEvent
impl IEvent for ResourceAbortEvent
impl IEvent for ResourceErrorEvent
impl IEvent for ResizeEvent
impl IEvent for ReadyStateChangeEvent
impl IEvent for FocusEvent
impl IEvent for BlurEvent
impl IEvent for HashChangeEvent
impl IEvent for PopStateEvent
impl IEvent for KeyPressEvent
impl IEvent for KeyDownEvent
impl IEvent for KeyUpEvent
impl IEvent for ClickEvent
impl IEvent for DoubleClickEvent
impl IEvent for MouseDownEvent
impl IEvent for MouseUpEvent
impl IEvent for MouseMoveEvent
impl IEvent for ProgressEvent
impl IEvent for ProgressLoadEvent
impl IEvent for LoadStartEvent
impl IEvent for LoadEndEvent
impl IEvent for ProgressAbortEvent
impl IEvent for ProgressErrorEvent
impl IEvent for SocketCloseEvent
impl IEvent for SocketErrorEvent
impl IEvent for SocketOpenEvent
impl IEvent for SocketMessageEvent