#region License
/*
Copyright (c) 2010-2014 Danko Kozar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#endregion License
namespace eDriven.Core.Events
{
///
/// The ability for dispatching events
///
/// Coded by Danko Kozar
public interface IEventDispatcher
{
///
/// Dispatches an event
///
/// Event to be dispatched
void DispatchEvent(Event e);
///
/// Dispatches an event with an option for switching on delayed processing
///
/// Event
/// Process immediatelly or on the next update?
void DispatchEvent(Event e, bool immediate);
///
/// Adds the event listener
///
/// Event type
/// Event handler
void AddEventListener(string eventType, EventHandler handler);
///
/// Adds the event listener
///
/// Event type
/// Event handler
/// Event priority
void AddEventListener(string eventType, EventHandler handler, int priority);
///
/// Adds the event listener
///
/// Event type
/// Event handler
/// Event bubbling phases that we listen to
void AddEventListener(string eventType, EventHandler handler, EventPhase phases);
///
/// Adds the event listener
///
/// Event type
/// Event handler
/// Event bubbling phases that we listen to
/// Event priority
void AddEventListener(string eventType, EventHandler handler, EventPhase phases, int priority);
///
/// Removes the event listener
///
/// Event type
/// Event handler
void RemoveEventListener(string eventType, EventHandler handler);
///
/// Removes the event listener
///
/// Event type
/// Event handler
///
void RemoveEventListener(string eventType, EventHandler handler, EventPhase phases);
///
/// Removes all event listeners of a certain type
///
/// Event type
void RemoveAllListeners(string eventType);
///
/// Checks whether the EventDispatcher has any listeners registered for a specific type of event
///
///
///
bool HasEventListener(string eventType);
///
/// Checks whether an event listener is registered with this EventDispatcher or any of its ancestors for the specified event type
/// Note: the implementation of event bubbling depends of the use-case and is not implemented by eDriven.Core
///
///
///
bool HasBubblingEventListener(string eventType);
}
}