1  /*
     2   * Copyright the original author or authors.
     3   * 
     4   * Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1 (the "License");
     5   * you may not use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   * 
     8   *      http://www.mozilla.org/MPL/MPL-1.1.html
     9   * 
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS,
    12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13   * See the License for the specific language governing permissions and
    14   * limitations under the License.
    15   */
    16  
    17  import org.as2lib.core.BasicInterface;
    18  
    19  /**
    20   * {@code EventListenerSource} acts as a source for listeners by declaring basic
    21   * methods to add, remove and get listeners.
    22   * 
    23   * @author Simon Wacker
    24   * @author Martin Heidegger
    25   * @version 1.1
    26   */
    27  interface org.as2lib.env.event.EventListenerSource extends BasicInterface {
    28  	
    29  	/**
    30  	 * Adds the passed-in {@code listener}.
    31  	 * 
    32  	 * @param listener the listener to add
    33  	 */
    34  	public function addListener(listener):Void;
    35  	
    36  	/**
    37  	 * Adds all listeners contained in the passed-in {@code listeners} array.
    38  	 * 
    39  	 * @param listeners the listeners to add
    40  	 */
    41  	public function addAllListeners(listeners:Array):Void;
    42  	
    43  	/**
    44  	 * Removes the passed-in {@code listener}.
    45  	 * 
    46  	 * @param listener the listener to remove
    47  	 */
    48  	public function removeListener(listener):Void;
    49  	
    50  	/**
    51  	 * Removes all added listeners.
    52  	 */
    53  	public function removeAllListeners(Void):Void;
    54  	
    55  	/**
    56  	 * Returns all added listeners.
    57  	 *
    58  	 * @return all added listeners
    59  	 */
    60  	public function getAllListeners(Void):Array;
    61  	
    62  	/**
    63  	 * Returns {@code true} if passed-in {@code listener} has been added.
    64  	 * 
    65  	 * @param listener the listener to check whether it has been added
    66  	 * @return {@code true} if the {@code listener} has been added
    67  	 */
    68  	public function hasListener(listener):Boolean;
    69  	
    70  }