package org.easywechat.util;

import org.easywechat.msg.ImageMsg;
import org.easywechat.msg.MusicMsg;
import org.easywechat.msg.NewsMsg;
import org.easywechat.msg.TextMsg;
import org.easywechat.msg.VideoMsg;
import org.easywechat.msg.VoiceMsg;

/**
 * ¹¹½¨ÏìÓ¦ÏûÏ¢µÄ¹¤³§Àà
 */
public class MessageFactory {

	/**
	 * ·µ»ØÄÚÈÝÎª¿ÕµÄÎÄ±¾ÏûÏ¢
	 */
	public static TextMsg createTextMsg() {
		return new TextMsg();
	}

	/**
	 * ·µ»ØÖ¸¶¨ÄÚÈÝµÄÎÄ±¾ÏûÏ¢
	 * 
	 * @param content
	 *            »Ø¸´µÄÏûÏ¢ÄÚÈÝ
	 */
	public static TextMsg createTextMsg(String content) {
		return new TextMsg(content);
	}

	/**
	 * ·µ»ØÍ¼Æ¬ÏûÏ¢
	 * 
	 * @param mediaId
	 *            Í¨¹ýÉÏ´«¶àÃ½ÌåÎÄ¼þ£¬µÃµ½µÄid
	 */
	public static ImageMsg createImageMsg(String mediaId) {
		return new ImageMsg(mediaId);
	}

	/**
	 * ·µ»ØÓïÒôÏûÏ¢
	 * 
	 * @param mediaId
	 *            Í¨¹ýÉÏ´«¶àÃ½ÌåÎÄ¼þ£¬µÃµ½µÄid
	 */
	public static VoiceMsg createVoiceMsg(String mediaId) {
		return new VoiceMsg(mediaId);
	}

	/**
	 * ·µ»ØÊÓÆµÏûÏ¢
	 * 
	 * @param mediaId
	 *            Í¨¹ýÉÏ´«¶àÃ½ÌåÎÄ¼þ£¬µÃµ½µÄid
	 * @param title
	 *            ÊÓÆµÏûÏ¢µÄ±êÌâ¡£Èç²»ÐèÒª¿ÉÉèÎªnull
	 * @param description
	 *            ÊÓÆµÏûÏ¢µÄÃèÊö¡£Èç²»ÐèÒª¿ÉÉèÎªnull
	 */
	public static VideoMsg createVideoMsg(String mediaId, String title,
			String description) {
		return new VideoMsg(mediaId, title, description);
	}

	/**
	 * ·µ»ØÒôÀÖÏûÏ¢
	 * 
	 * @param thumbMediaId
	 *            ËõÂÔÍ¼µÄÃ½Ìåid£¬Í¨¹ýÉÏ´«¶àÃ½ÌåÎÄ¼þ£¬µÃµ½µÄid
	 * @param title
	 *            ÒôÀÖ±êÌâ¡£Èç²»ÐèÒª¿ÉÉèÎªnull
	 * @param description
	 *            ÒôÀÖÃèÊö¡£Èç²»ÐèÒª¿ÉÉèÎªnull
	 * @param musicUrl
	 *            ÒôÀÖÁ´½Ó¡£Èç²»ÐèÒª¿ÉÉèÎªnull
	 * @param hqMusicUrl
	 *            ¸ßÖÊÁ¿ÒôÀÖÁ´½Ó£¬WIFI»·¾³ÓÅÏÈÊ¹ÓÃ¸ÃÁ´½Ó²¥·ÅÒôÀÖ¡£Èç²»ÐèÒª¿ÉÉèÎªnull
	 */
	public static MusicMsg createMusicMsg(String thumbMediaId, String title,
			String description, String musicUrl, String hqMusicUrl) {
		return new MusicMsg(thumbMediaId, title, description, musicUrl,
				hqMusicUrl);
	}

	/**
	 * ·µ»ØÄÚÈÝÎª¿ÕµÄÍ¼ÎÄÏûÏ¢
	 */
	public static NewsMsg createNewsMsg() {
		return new NewsMsg();
	}

	/**
	 * ·µ»Ø¾ßÓÐÒ»ÌõArticleµÄÍ¼ÎÄÏûÏ¢
	 * 
	 * @param title
	 *            Í¼ÎÄÏûÏ¢±êÌâ¡£¿ÉÎªnull
	 * @param description
	 *            Í¼ÎÄÏûÏ¢ÃèÊö¡£¿ÉÎªnull
	 * @param picUrl
	 *            Í¼Æ¬Á´½Ó¡£¿ÉÎªnull
	 * @param url
	 *            µã»÷Í¼ÎÄÏûÏ¢Ìø×ªÁ´½Ó¡£¿ÉÎªnull
	 */
	public static NewsMsg createNewsMsg(String title, String description,
			String picUrl, String url) {
		return new NewsMsg().add(title, description, picUrl, url);
	}

}
