/*
 * Created on 2004-08-30
 *
 * Part of the Symbian development plug-in for Eclipse
 * Copyright (C) Mikołaj Zalewski, 2004
 */
package pl.zalewski.mikolaj.symbdev.skins;

import java.io.BufferedWriter;
import java.io.IOException;

/**
 * The classes implementing this interface are responsible for changing a
 * line in epoc.ini (e.g. deleting a line, changing a parameter)
 *
 *  @author mikolaj
 *
 */
public interface IRewriterRule {

    /**
    * Called when the rewriting begins the epoc.ini file.
    * This function is called after the beginning writer rules 
    * @param output The output (the epoc.eclise.ini). The file is positioned
    * after an end-of-line. The class must end the output with an end-of-line
    * @throws IOException
    */
    public void fileBegin(BufferedWriter output)
		throws IOException;
    
    /**
     * Recieves a line from the input epoc.ini. The function can write the
     * this line after the modification needed to apply the configuration to
     * the output
     * @param token First token in the line - the command
     * @param args The rest of the line
     * @param output The output (the epoc.eclise.ini). The file is positioned
     * after an end-of-line. The class must end the output with an end-of-line
     * @throws IOException
     */
    public void rewrite(String token, String args, BufferedWriter output)
    	throws IOException;

    /**
     * Called when the rewriting arrives to the end of the epoc.ini file.
     * This function is called before the append writer rules 
     * @param output The output (the epoc.eclise.ini). The file is positioned
     * after an end-of-line. The class must end the output with an end-of-line
     * @throws IOException
     */
    public void fileEnd(BufferedWriter output)
    	throws IOException;
}
