/*******************************************************************************
 * Copyright (c) 2004 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.content;

import java.util.HashMap;

import org.eclipse.birt.report.engine.ir.ActionDesign;
import org.w3c.dom.Document;
import org.w3c.dom.Node;

/**
 * Provides the interfaces for the Text Content
 * 
 * @version $Revision: 1.3 $ $Date: 2005/03/11 07:53:12 $
 */
public interface ITextContent extends IReportItemContent
{

	/**
	 * @return Returns the value.
	 */
	public String getValue( );


	/**
	 * Gets the corresponding CSS properties of the specified node.
	 * <p>
	 * The caller calls it only if the Text-Item or multi-line is involved
	 * 
	 * @param node
	 *            the specified node
	 * @return the hashmap-type instance containing the CSS properties that the
	 *         key is the property name and the value is the property value.
	 */
	public HashMap getCssStyle( Node node );

	/**
	 * Gets the entire CSS style set,key--XML DOM node and value--the same as
	 * the return value of the method <code>getCssStyle(Node)</code>
	 * <p>
	 * The caller calls it only if the Text-Item or multi-line is involved
	 * 
	 * @return hash map if exists, otherwise null
	 */
	public HashMap getCssStyleSet( );


	/**
	 * Gets the image content according to the <tt>Node</tt>
	 * 
	 * @param node
	 *            the specified key
	 * @return the image content
	 */
	public IImageItemContent getImageContent( Node node );


	public Document getExpressionVal( Node expr );


	/**
	 * @return Returns the helpText.
	 */
	public String getHelpText( );

	/**
	 * @return Returns the singleLine.
	 */
	public boolean isSingleLine( );



	/**
	 * @return the action design
	 */
	public ActionDesign getAction( );

	/**
	 * @return Returns the domTree.
	 */
	public Node getDomTree( );


}
@@ -659,37 +659,8 @@
 gn;%0A
-import org.w3c.dom.Document;%0A
 impo
@@ -762,17 +762,17 @@
 sion: 1.
-3
+4
  $ $Date
@@ -786,18 +786,18 @@
 03/1
-1 07:53:12
+5 03:29:37
  $%0A 
@@ -1867,59 +1867,8 @@
 );%0A%0A
-%0A%09public Document getExpressionVal( Node expr );%0A%0A%0A
 %09/**
@@ -2019,18 +2019,16 @@
 ne( );%0A%0A
-%0A%0A
 %09/**%0A%09 *
@@ -2108,69 +2108,751 @@
 %09 * 
-@return Returns the domTree.%0A%09 */%0A%09public Node getDomTree( );%0A%0A%0A%7D
+Walks on every node%0A%09 * %0A%09 * @param visitor%0A%09 *            the ITextNodeVistor instance%0A%09 */%0A%09public void accessDOMTree( ITextNodeVisitor visitor );%0A%0A%09/**%0A%09 * Defines the interfaces of ITextNodeVisitor%0A%09 */%0A%09public interface ITextNodeVisitor%0A%09%7B%0A%0A%09%09/**%0A%09%09 * Starts the node%0A%09%09 * %0A%09%09 * @param node%0A%09%09 *            the Node instance%0A%09%09 */%0A%09%09void onNodeStart( Node node );%0A%0A%09%09/**%0A%09%09 * Outputs the text of the node%0A%09%09 * %0A%09%09 * @param text%0A%09%09 *            the text of the node%0A%09%09 * @param needEscape%0A%09%09 *            the flag indicating weather or not escaping the content%0A%09%09 */%0A%09%09void onText( String text, boolean needEscape );%0A%0A%09%09/**%0A%09%09 * Ends the node%0A%09%09 * %0A%09%09 * @param node%0A%09%09 *            the Node instance%0A%09%09 */%0A%09%09void onNodeEnd( Node node );%0A%09%7D%0A%7D%0A%0A

Refactor the way of accessing the DOM tree in Text-related items.