/*******************************************************************************
 * Copyright (c) 2004, 2007 Actuate Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Actuate Corporation  - initial API and implementation
 *******************************************************************************/

package org.eclipse.birt.report.engine.presentation;

import org.eclipse.birt.report.engine.content.IAutoTextContent;
import org.eclipse.birt.report.engine.content.ICellContent;
import org.eclipse.birt.report.engine.content.IContainerContent;
import org.eclipse.birt.report.engine.content.IContent;
import org.eclipse.birt.report.engine.content.IDataContent;
import org.eclipse.birt.report.engine.content.IForeignContent;
import org.eclipse.birt.report.engine.content.IGroupContent;
import org.eclipse.birt.report.engine.content.IImageContent;
import org.eclipse.birt.report.engine.content.ILabelContent;
import org.eclipse.birt.report.engine.content.IListBandContent;
import org.eclipse.birt.report.engine.content.IListContent;
import org.eclipse.birt.report.engine.content.IListGroupContent;
import org.eclipse.birt.report.engine.content.IPageContent;
import org.eclipse.birt.report.engine.content.IReportContent;
import org.eclipse.birt.report.engine.content.IRowContent;
import org.eclipse.birt.report.engine.content.ITableBandContent;
import org.eclipse.birt.report.engine.content.ITableContent;
import org.eclipse.birt.report.engine.content.ITableGroupContent;
import org.eclipse.birt.report.engine.content.ITextContent;
import org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter;
import org.eclipse.birt.report.engine.emitter.IContentEmitter;
import org.eclipse.birt.report.engine.emitter.IEmitterServices;

public class WrappedEmitter extends ContentEmitterAdapter
{

	IContentEmitter emitter;

	public WrappedEmitter( IContentEmitter emitter )
	{
		this.emitter = emitter;
	}

	public void initialize( IEmitterServices service )
	{
		if ( emitter != null )
		{
			emitter.initialize( service );
		}
	}

	public String getOutputType( )
	{
		if ( emitter != null )
		{
			return emitter.getOutputFormat( );
		}
		return null;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#start(org.eclipse.birt.report.engine.content.IReportContent)
	 */
	public void start( IReportContent report )
	{
		if ( emitter != null )
		{
			emitter.start( report );
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#end(org.eclipse.birt.report.engine.content.IReportContent)
	 */
	public void end( IReportContent report )
	{
		if ( emitter != null )
		{
			emitter.end( report );
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#endCell(org.eclipse.birt.report.engine.content.ICellContent)
	 */
	public void endCell( ICellContent cell )
	{
		if ( emitter != null )
		{
			emitter.endCell( cell );
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#startContainer(org.eclipse.birt.report.engine.content.IContainerContent)
	 */
	public void startContainer( IContainerContent container )
	{
		if ( emitter != null )
		{
			emitter.startContainer( container );
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#endContainer(org.eclipse.birt.report.engine.content.IContainerContent)
	 */
	public void endContainer( IContainerContent container )
	{
		if ( emitter != null )
		{
			emitter.endContainer( container );
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#endPage(org.eclipse.birt.report.engine.content.IPageContent)
	 */
	public void endPage( IPageContent page )
	{
		if ( emitter != null )
		{
			emitter.endPage( page );
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#endRow(org.eclipse.birt.report.engine.content.IRowContent)
	 */
	public void endRow( IRowContent row )
	{
		if ( emitter != null )
		{
			emitter.endRow( row );
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#endTable(org.eclipse.birt.report.engine.content.ITableContent)
	 */
	public void endTable( ITableContent table )
	{
		if ( emitter != null )
		{
			emitter.endTable( table );
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#endTableFooter(org.eclipse.birt.report.engine.content.ITableBandContent)
	 */
	public void endTableBand( ITableBandContent band )
	{
		if ( emitter != null )
		{
			emitter.endTableBand( band );
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#startForeign(org.eclipse.birt.report.engine.content.IForeignContent)
	 */
	public void startForeign( IForeignContent foreign )
	{
		if ( emitter != null )
		{
			emitter.startForeign( foreign );
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#startImage(org.eclipse.birt.report.engine.content.IImageContent)
	 */
	public void startImage( IImageContent image )
	{
		if ( emitter != null )
		{
			emitter.startImage( image );
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#startPage(org.eclipse.birt.report.engine.content.IPageContent)
	 */
	public void startPage( IPageContent page )
	{
		if ( emitter != null )
		{
			emitter.startPage( page );
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#startRow(org.eclipse.birt.report.engine.content.IRowContent)
	 */
	public void startRow( IRowContent row )
	{
		if ( emitter != null )
		{
			emitter.startRow( row );
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#startTable(org.eclipse.birt.report.engine.content.ITableContent)
	 */
	public void startTable( ITableContent table )
	{
		if ( emitter != null )
		{
			emitter.startTable( table );
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#startTableBody(org.eclipse.birt.report.engine.content.ITableBandContent)
	 */
	public void startTableBand( ITableBandContent band )
	{
		if ( emitter != null )
		{
			emitter.startTableBand( band );
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#startText(org.eclipse.birt.report.engine.content.ITextContent)
	 */
	public void startText( ITextContent text )
	{
		if ( emitter != null )
		{
			emitter.startText( text );
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#startLabel(org.eclipse.birt.report.engine.content.ILabelContent)
	 */
	public void startLabel( ILabelContent label )
	{
		if ( emitter != null )
		{
			emitter.startLabel( label );
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#startData(org.eclipse.birt.report.engine.content.IDataContent)
	 */
	public void startData( IDataContent data )
	{
		if ( emitter != null )
		{
			emitter.startData( data );
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#startCell(org.eclipse.birt.report.engine.content.ICellContent)
	 */
	public void startCell( ICellContent cell )
	{
		if ( emitter != null )
		{
			emitter.startCell( cell );
		}
	}

	public String getOutputFormat( )
	{
		if ( emitter != null )
		{
			return emitter.getOutputFormat( );
		}
		return null;
	}

	/**
	 * @param content
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#endContent(org.eclipse.birt.report.engine.content.IContent)
	 */
	public void endContent( IContent content )
	{
		emitter.endContent( content );
	}

	/**
	 * @param group
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#endGroup(org.eclipse.birt.report.engine.content.IGroupContent)
	 */
	public void endGroup( IGroupContent group )
	{
		emitter.endGroup( group );
	}

	/**
	 * @param list
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#endList(org.eclipse.birt.report.engine.content.IListContent)
	 */
	public void endList( IListContent list )
	{
		emitter.endList( list );
	}

	/**
	 * @param listBand
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#endListBand(org.eclipse.birt.report.engine.content.IListBandContent)
	 */
	public void endListBand( IListBandContent listBand )
	{
		emitter.endListBand( listBand );
	}

	/**
	 * @param group
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#endListGroup(org.eclipse.birt.report.engine.content.IListGroupContent)
	 */
	public void endListGroup( IListGroupContent group )
	{
		emitter.endListGroup( group );
	}

	/**
	 * @param group
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#endTableGroup(org.eclipse.birt.report.engine.content.ITableGroupContent)
	 */
	public void endTableGroup( ITableGroupContent group )
	{
		emitter.endTableGroup( group );
	}

	/**
	 * @param autoText
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#startAutoText(org.eclipse.birt.report.engine.content.IAutoTextContent)
	 */
	public void startAutoText( IAutoTextContent autoText )
	{
		emitter.startAutoText( autoText );
	}

	/**
	 * @param content
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#startContent(org.eclipse.birt.report.engine.content.IContent)
	 */
	public void startContent( IContent content )
	{
		emitter.startContent( content );
	}

	/**
	 * @param group
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#startGroup(org.eclipse.birt.report.engine.content.IGroupContent)
	 */
	public void startGroup( IGroupContent group )
	{
		emitter.startGroup( group );
	}

	/**
	 * @param list
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#startList(org.eclipse.birt.report.engine.content.IListContent)
	 */
	public void startList( IListContent list )
	{
		emitter.startList( list );
	}

	/**
	 * @param listBand
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#startListBand(org.eclipse.birt.report.engine.content.IListBandContent)
	 */
	public void startListBand( IListBandContent listBand )
	{
		emitter.startListBand( listBand );
	}

	/**
	 * @param group
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#startListGroup(org.eclipse.birt.report.engine.content.IListGroupContent)
	 */
	public void startListGroup( IListGroupContent group )
	{
		emitter.startListGroup( group );
	}

	/**
	 * @param group
	 * @see org.eclipse.birt.report.engine.emitter.IContentEmitter#startTableGroup(org.eclipse.birt.report.engine.content.ITableGroupContent)
	 */
	public void startTableGroup( ITableGroupContent group )
	{
		emitter.startTableGroup( group );
	}
}
