/*
 * Copyright (c) 2006-2008 MiniMe. Code released under The MIT/X Window System
 * License. Full license text can be found in license.txt
 */
package minime.core;

/**
 * The EventListener interface is used to listen event.When an event happens, it
 * calls onEvent method to handle it.It will first handle higher priority event
 * based on event priority.
 * 
 * @author aaa
 * 
 */
public interface EventListener
{
    /** The event priority, it has 4 level priorites */
    public final short TOP_PRIORITY = (short) 0xFFFF;
    public final int HIGH_PRIORITY = (short) 0xFF00;
    public final int MEDIUM_PRIORITY = (short) 0x00FF;
    public final int LOW_PRIORITY = (short) 0x0000;

    /**
     * Handles event based on event type and event parameters, return true if
     * the event handled, else return false.
     * 
     * @param evt
     *            an event instance.
     * @return true if the event hanlded, else false;
     */
    public boolean onEvent(Event evt);

    // public int getMask();
    /**
     * Return the event priority.
     */
    public int getPriority();
}
