/*
 * @(#)ImapListener.java
 *
 * Copyright (c) 2001-2002 JScape
 * 1147 S. 53rd Pl., Mesa, Arizona, 85206, U.S.A.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * JScape. ("Confidential Information").  You shall not disclose such
 * Confidential Information and shall use it only in accordance with
 * the terms of the license agreement you entered into with JScape.
 */
package com.jscape.inet.imap;

import java.util.EventListener;


/**
 * Implements methods for capturing connected and disconnected events from Imap
 * class. It also captures an event indicating retreival of a message. Your
 * application should implement this interface to capture the events of data
 * flow between remote host and local machine.
 * <pre>
 * public class Application ... implements ImapListener
 * {
 *  ...
 *     public ... initMethod(...)
 *    {
 *      Imap imap = new Imap();
 *      imap.addImapListener(this);
 *    }
 *  ...
 * }
 * </pre>
 */
public interface ImapListener
        extends EventListener {
    /**
     * Invoked when connection to IMAP server is established.
     *
     * @param event a <code>ImapConnectedEvent</code>
     *
     * @see ImapConnectedEvent
     */
    void connected(ImapConnectedEvent event);

    /**
     * Invoked when connection to IMAP server is released.
     *
     * @param event a <code>ImapDisconnectedEvent</code>
     *
     * @see ImapDisconnectedEvent
     */
    void disconnected(ImapDisconnectedEvent event);

    /**
     * Invoked when message is retrieved from IMAP server.
     *
     * @param event a <code>ImapMessageEvent</code>
     *
     * @see ImapMessageEvent
     */
    void messageRetrieved(ImapMessageEvent event);

    /**
     * Invoked frequently during the download process of a message from IMAP server
     *
     * @param event a <code>ImapMessageProgressEvent</code>
     *
     * @see ImapMessageProgressEvent
     */
    void progress(ImapMessageProgressEvent event);

    /**
     * Invoked when command is sent to the IMAP server
     *
     * @param event a <code>ImapCommandEvent</code>
     *
     * @see ImapCommandEvent
     */
    void commandSent(ImapCommandEvent event);

    /**
     * Invoked when a response is received from IMAP server
     *
     * @param event a <code>ImapResponseEvent</code>
     *
     * @see ImapResponseEvent
     */
    void responseReceived(ImapResponseEvent event);
}
