001/**
002 *
003 * Copyright 2003-2007 Jive Software.
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 *     http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017
018package org.jivesoftware.smackx.xevent;
019
020import org.jxmpp.jid.Jid;
021
022/**
023 *
024 * A listener that is fired anytime a message event notification is received.
025 * Message event notifications are received as a consequence of the request
026 * to receive notifications when sending a message.
027 *
028 * @author Gaston Dombiak
029 */
030public interface MessageEventNotificationListener {
031
032    /**
033     * Called when a notification of message delivered is received.
034     *
035     * @param from the user that sent the notification.
036     * @param packetID the id of the message that was sent.
037     */
038    void deliveredNotification(Jid from, String packetID);
039
040    /**
041     * Called when a notification of message displayed is received.
042     *
043     * @param from the user that sent the notification.
044     * @param packetID the id of the message that was sent.
045     */
046    void displayedNotification(Jid from, String packetID);
047
048    /**
049     * Called when a notification that the receiver of the message is composing a reply is
050     * received.
051     *
052     * @param from the user that sent the notification.
053     * @param packetID the id of the message that was sent.
054     */
055    void composingNotification(Jid from, String packetID);
056
057    /**
058     * Called when a notification that the receiver of the message is offline is received.
059     *
060     * @param from the user that sent the notification.
061     * @param packetID the id of the message that was sent.
062     */
063    void offlineNotification(Jid from, String packetID);
064
065    /**
066     * Called when a notification that the receiver of the message cancelled the reply
067     * is received.
068     *
069     * @param from the user that sent the notification.
070     * @param packetID the id of the message that was sent.
071     */
072    void cancelledNotification(Jid from, String packetID);
073}