⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 msnlistener.java

📁 J2me实现的MSN Messeger客户端程序。聊天、添加好友、删除好友、阻止好友
💻 JAVA
字号:
/*
 * @(#)MsnListener.java
 *
 * Copyright (c) 2001-2002, JangHo Hwang
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 	1. Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 *
 * 	2. Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 *
 * 	3. Neither the name of the JangHo Hwang nor the names of its contributors
 * may be used to endorse or promote products derived from this software
 * without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *    $Id: MsnListener.java,v 2.0 2004/12/21 16:15:08 chenzs Exp $
 */
package vitular.msnp.event;

/**
 * 灏哖roperties鏀规垚 Hashtable 浠ラ\uFFFD傚簲j2me 2004/5/27 ceze
 */
import java.util.Hashtable;

import vitular.msnp.SwitchboardSession;
import vitular.msnp.entity.MsnFriend;
//import rath.msnm.ftp.VolatileTransferServer;
//import rath.msnm.ftp.VolatileDownloader;
import vitular.msnp.msg.MimeMessage;

/**
 * 处理客户端和服务器之间事件的接口
 * <p>Title: MSNP Lib</p>
 * <p>Description: Unija 版Msn协议</p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: Vitular</p>
 * @author ceze
 * @version 1.0
 */
public interface MsnListener{

  /**
   * 验证登陆成功
   * @param own MsnFriend
   */
  public void loginComplete(MsnFriend own);

  /**
   * 登陆失败
   * @param header String 错误代码(911:用户名或密码错)
   */
  public void loginError(String header);

  /**
   * ??
   */
  public void listOnline(MsnFriend friend);

  /**
   * 好友上线,或状态发生改变
   * @param friend MsnFriend
   */
  public void userOnline(MsnFriend friend);

  /**
   * 好友下线
   * @param loginName String
   */
  public void userOffline(String loginName);

  /**
   * 开始一个中转服务器session
   * @param ss SwitchboardSession
   */
  public void switchboardSessionStarted(SwitchboardSession ss);

  /**
   * 某好友加入到一个会话中
   * @param ss SwitchboardSession 会话中转服务器session
   * @param join MsnFriend 好友
   */
  public void whoJoinSession(SwitchboardSession ss, MsnFriend join);

  /**
   *  好友离开ss此会话
   * @param ss SwitchboardSession
   * @param part MsnFriend
   */
  public void whoPartSession(SwitchboardSession ss, MsnFriend part);


  /**
   * 会话中转服务器结束
   * @param ss SwitchboardSession
   */
  public void switchboardSessionEnded(SwitchboardSession ss);

  /**
  *  放弃???
  */
  public void switchboardSessionAbandon(SwitchboardSession ss,
                                        String targetName);

  /**
   * 好友正在输入文字
   * @param ss SwitchboardSession 中转服务器session
   * @param friend MsnFriend
   * @param typingUser String
   */
  public void progressTyping(SwitchboardSession ss,
                             MsnFriend friend, String typingUser);

  /**
   * 即时消息进入
   * @param ss SwitchboardSession 中转服务器session
   * @param friend MsnFriend
   * @param mime MimeMessage
   */
  public void instantMessageReceived(SwitchboardSession ss,
                                     MsnFriend friend, MimeMessage mime);

//  /**
//   * 文件发送完成
//   * @param ss SwitchboardSession
//   * @param cookie int
//   * @param filename String
//   * @param filesize int
//   */
//  public void filePosted(SwitchboardSession ss, int cookie, String filename,
//                         int filesize);

//  /**
//   * 文件发送被接受
//   * @param ss SwitchboardSession
//   * @param cookie int
//   */
//  public void fileSendAccepted(SwitchboardSession ss, int cookie);

//  /**
//   * 文件发送被拒
//   * @param ss SwitchboardSession
//   * @param cookie int
//   * @param reason String
//   */
//  public void fileSendRejected(SwitchboardSession ss, int cookie, String reason);

//  /**
//   * 文件发送开始
//   * @param server VolatileTransferServer
//   */
//  public void fileSendStarted( VolatileTransferServer server );
//
//	/**
//	 * 发送结束
  //	 */
//	public void fileSendEnded( VolatileTransferServer server );
//
//	/**
//	 * 锟斤拷锟斤拷 锟劫匡拷蔚锟\uFFFD 锟桔撅拷锟斤拷 锟斤拷锟桔登撅拷=; 锟剿凤拷锟截达拷.
//	 *
//	 * @param  downloader  锟斤拷锟斤拷 锟劫匡拷蔚锟\uFFFD thread 锟斤拷眉.
//	 */
//	public void fileReceiveStarted( VolatileDownloader downloader );
//
//	/**
//	 * 锟斤拷锟斤拷; 锟桔斤拷锟较达拷锟斤拷 锟斤拷锟杰帮拷 锟竭伙拷锟较匡拷=; 锟剿凤拷锟街达拷 锟睫家碉拷锟教达拷.
//	 * 锟斤拷路锟斤拷, 锟斤拷锟斤拷 锟斤拷锟\uFFFD thread锟斤拷 ~锟斤拷却锟\uFFFD.
//	 */
//	public void fileSendError( VolatileTransferServer server, Throwable e );
//
//	/**
//	 * 锟斤拷锟斤拷; 锟斤拷锟斤拷洗锟斤拷锟\uFFFD 锟斤拷锟杰帮拷 锟竭伙拷锟较匡拷=; 锟剿凤拷锟街达拷 锟睫家碉拷锟教达拷.
//	 * 锟斤拷路锟斤拷, 锟斤拷锟斤拷 锟斤拷锟\uFFFD thread锟斤拷 ~锟斤拷却锟\uFFFD.
//	 */
//	public void fileReceiveError( VolatileDownloader downloader, Throwable e );

  /**
   * 有人添加我为好友
   * @param friend MsnFriend 对方信息
   */
  public void whoAddedMe(MsnFriend friend);

  /**
   * 有人将我从好友中删除
   * @param friend MsnFriend
   */
  public void whoRemovedMe(MsnFriend friend);

  /**
   * buddylist被改动,发出的事件
   */
  public void buddyListModified();

  /**
   * 添加好友失败
   * @param errorCode int
   */
  public void addFailed(int errorCode);

  /**
   * 昵称 被改变它是被派出的事件。
   * @param friend MsnFriend
   */
  public void renameNotify(MsnFriend friend);

  /**
   * 所有列表更新完成
   */
  public void allListUpdated();

  /**
  *  注销
  */
  public void logoutNotify();

  /**
   * 未读邮件通知
   * @param prop Hashtable
   * @param unread int
   */
  public void notifyUnreadMail(Hashtable prop, int unread);


  /**
   * 网络连接中断
   * @param code short 错误代码
   * @param isNotificationServer boolean 是否为与Notification Server出错
   */

  public void connectError(short errCode, boolean isNotificationServer);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -