/
IEventMap.as
48 lines (44 loc) · 1.8 KB
/
IEventMap.as
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* Copyright (c) 2009 the original author or authors
*
* Permission is hereby granted to use, modify, and distribute this file
* in accordance with the terms of the license agreement accompanying it.
*/
package org.robotlegs.core
{
import flash.events.IEventDispatcher;
/**
* The Robotlegs EventMap contract
*/
public interface IEventMap
{
/**
* The same as calling <code>addEventListener</code> directly on the <code>IEventDispatcher</code>,
* but keeps a list of listeners for easy (usually automatic) removal.
*
* @param dispatcher The <code>IEventDispatcher</code> to listen to
* @param type The <code>Event</code> type to listen for
* @param listener The <code>Event</code> handler
* @param eventClass Optional Event class for a stronger mapping. Defaults to <code>flash.events.Event</code>.
* @param useCapture
* @param priority
* @param useWeakReference
*/
function mapListener(dispatcher:IEventDispatcher, type:String, listener:Function, eventClass:Class = null, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = true):void;
/**
* The same as calling <code>removeEventListener</code> directly on the <code>IEventDispatcher</code>,
* but updates our local list of listeners.
*
* @param dispatcher The <code>IEventDispatcher</code>
* @param type The <code>Event</code> type
* @param listener The <code>Event</code> handler
* @param eventClass Optional Event class for a stronger mapping. Defaults to <code>flash.events.Event</code>.
* @param useCapture
*/
function unmapListener(dispatcher:IEventDispatcher, type:String, listener:Function, eventClass:Class = null, useCapture:Boolean = false):void;
/**
* Removes all listeners registered through <code>mapListener</code>
*/
function unmapListeners():void;
}
}