/*
 * @(#)PopListener.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.pop;

import java.util.EventListener;


/**
 * Implements methods for capturing events sourced from Pop class. Typicaly
 * your application will implement this interface to capture the following
 * events : <br>
 * PopConnectedEvent<br>
 * PopDisconnectedEvent<br>
 * PopCommandEvent<br>
 * PopResponseEvent<br>
 * PopMessageEvent<br>
 * PopMessageProgressEvent
 * <P>
 * In addition to implementing this interface your application should register
 * itself as an EventListener which may look somewhat like this:<br>
 * <pre>
 * public class Application ... implements PopListener
 * {
 *  ...
 *      public ... initMethod(...)
 *    {
 *      Pop pop = new Pop();
 *      pop.addPopListener(this);
 *    }
 *  ...
 * }
 * </pre>
 * </p>
 */
public interface PopListener
        extends EventListener {
    /**
     * Invoked when connection to POP3 server is established.
     *
     * @param event a <code>PopConnectedEvent</code>
     *
     * @see PopConnectedEvent
     */
    void connected(PopConnectedEvent event);

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

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

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

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

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