Rocket::Core::Event Class Reference

#include <Event.h>

Inheritance diagram for Rocket::Core::Event:
Collaboration diagram for Rocket::Core::Event:

Public Types

enum  EventPhase { PHASE_UNKNOWN, PHASE_CAPTURE, PHASE_TARGET, PHASE_BUBBLE }

Public Member Functions

 Event ()
 Constructor.
 Event (Element *target, const String &type, const Dictionary &parameters, bool interruptible=false)
virtual ~Event ()
 Destructor.
EventPhase GetPhase () const
void SetPhase (EventPhase phase)
void SetCurrentElement (Element *element)
ElementGetCurrentElement () const
ElementGetTargetElement () const
const StringGetType () const
bool operator== (const String &type) const
bool IsPropagating () const
void StopPropagation ()
 Stops the propagation of the event wherever it is.
template<typename T>
GetParameter (const String &key, const T &default_value)
const DictionaryGetParameters () const
virtual void OnReferenceDeactivate ()
 Release this event.

Protected Attributes

String type
Dictionary parameters
Elementtarget_element
Elementcurrent_element

Friends

class Factory

Detailed Description

An event that propogates through the element hierarchy. Events follow the DOM3 event specification. See http://www.w3.org/TR/DOM-Level-3-Events/events.html.

Author:
Lloyd Weehuizen

Constructor & Destructor Documentation

Rocket::Core::Event::Event ( Element target,
const String type,
const Dictionary parameters,
bool  interruptible = false 
)

Constructor

Parameters:
[in] target The target element of this event
[in] type The event type
[in] parameters The event parameters
[in] interruptible Can this event have is propagation stopped?


Member Function Documentation

Event::EventPhase Rocket::Core::Event::GetPhase (  )  const

Get the current propagation phase.

Returns:
Current phase the event is in.

void Rocket::Core::Event::SetPhase ( EventPhase  phase  ) 

Set the current propagation phase

Parameters:
phase Switch the phase the event is in

void Rocket::Core::Event::SetCurrentElement ( Element element  ) 

Set the current element in the propagation.

Parameters:
[in] element The current element.

Element * Rocket::Core::Event::GetCurrentElement (  )  const

Get the current element in the propagation.

Returns:
The current element in propagation.

Element * Rocket::Core::Event::GetTargetElement (  )  const

Get the target element

Returns:
The target element of this event

const String & Rocket::Core::Event::GetType (  )  const

Get the event type.

Returns:
The event type.

bool Rocket::Core::Event::operator== ( const String type  )  const

Checks if the event is of a certain type.

Parameters:
type The name of the type to check for.
Returns:
True if the event is of the requested type, false otherwise.

bool Rocket::Core::Event::IsPropagating (  )  const

Has the event been stopped?

Returns:
True if the event is still propogating

template<typename T>
T Rocket::Core::Event::GetParameter ( const String key,
const T &  default_value 
) [inline]

Returns the value of one of the event's parameters.

Parameters:
key[in] The name of the desired parameter.
Returns:
The value of the requested parameter.

const Dictionary * Rocket::Core::Event::GetParameters (  )  const

Access the dictionary of parameters

Returns:
The dictionary of parameters


The documentation for this class was generated from the following files:
  • Include/Rocket/Core/Event.h
  • Source/Core/Event.cpp