package net.sourceforge.rtf.format;

import java.text.FieldPosition;
import java.text.Format;
import java.text.ParsePosition;

import net.sourceforge.rtf.context.image.ImageLink;
/**
 * Description : Format for Input Stream.
 * @version 1.0.0
 * @author <a href="mailto:angelo.zerr@gmail.com">Angelo ZERR</a>
 */
public class DefaultImageLinkFormat extends Format {

	public static final long serialVersionUID = 1L;
	
	public StringBuffer format(Object arg0, StringBuffer arg1, FieldPosition arg2) {
		ImageLink imagePath = (ImageLink) arg0;
        StringBuffer buf = new StringBuffer("{\\field{\\*\\fldinst {\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\f40\\insrsid10637227  INCLUDEPICTURE \"");
        buf.append(imagePath.getLinkPath()).append("\" \\\\* MERGEFORMAT \\\\d }}");
        buf.append("{\\fldrslt {\\rtlch\\fcs1 \\af0 \\ltrch\\fcs0 \\f40\\insrsid10637227 }}}\\sectd");
        
        return buf;
	}
	
	public Object parseObject(String arg0, ParsePosition arg1) {
		// TODO Auto-generated method stub
		return null;
	}

}
