/*
 *  Draco Econometrics
 *  Copyright (C) 2006-2007 Approximatrix, LLC
 *  http://www.approximatrix.com
 *  
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.approximatrix.draco.io.XMLio;

import org.w3c.dom.Element;

public final class TableTags {

	public static final String NO_DATA = "NA";
	
	public static final String TBL_TABLE = "table:table";
	public static final String TBL_TABLE_NAME_SUBELEMENT = "table:name";
	public static final String TBL_TABLE_STYLE_SUBELEMENT = "table:style-name";
	
	public static final String TBL_HEADER_COLS = "table:table-header-columns";
	public static final String TBL_HEADER_ROWS = "table:table-header-rows";
	
	public static final String TBL_COL = "table:table-column";
	public static final String TBL_COLS = "table:table-columns";
	public static final String TBL_COL_REPEATED_SUBELEMENT = "table:number-columns-repeated";
	
	public static final String TBL_ROWS = "table:table-rows";
	public static final String TBL_ROW = "table:table-row";
	
	public static final String TBL_CELL = "table:table-cell";
	public static final String TBL_CELL_TYPE_SUBELEMENT = "office:value-type";
	public static final String TBL_CELL_VALUE_SUBELEMENT = "office:value";
	public static final String TBL_CELL_CONTENTS_TEXT = "text:p";

	public static final String TBL_CELL_TYPE_FLOAT_ATTR = "float";
	
	// For drawing charts
	public static final String TBL_DRAW_FRM = "draw:frame";
	public static final String TBL_DRAW_OBJ = "draw:object";
	public static final String TBL_XLINK_HREF_SUBELEMENT = "xlink:href";
	public static final String TBL_XLINK_TYPE_SUBELEMENT = "xlink:type";
	public static final String TBL_XLINK_SHOW_SUBELEMENT = "xlink:show";
	public static final String TBL_XLINK_ACT_SUBELEMENT = "xlink:actuate";
	
	public static void GenerateNS(Element target) {
		target.setAttribute("xmlns:office","urn:oasis:names:tc:opendocument:xmlns:office:1.0");
		target.setAttribute("xmlns:style","urn:oasis:names:tc:opendocument:xmlns:style:1.0");
		target.setAttribute("xmlns:text","urn:oasis:names:tc:opendocument:xmlns:text:1.0");
		target.setAttribute("xmlns:table","urn:oasis:names:tc:opendocument:xmlns:table:1.0");
		target.setAttribute("xmlns:draw","urn:oasis:names:tc:opendocument:xmlns:drawing:1.0");
		target.setAttribute("xmlns:fo","urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0");
		target.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink");
		target.setAttribute("xmlns:dc","http://purl.org/dc/elements/1.1/");
		target.setAttribute("xmlns:meta","urn:oasis:names:tc:opendocument:xmlns:meta:1.0");
		target.setAttribute("xmlns:number","urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0");
		target.setAttribute("xmlns:svg","urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0");
		target.setAttribute("xmlns:chart","urn:oasis:names:tc:opendocument:xmlns:chart:1.0" );
		target.setAttribute("xmlns:dr3d","urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0");
		target.setAttribute("xmlns:math","http://www.w3.org/1998/Math/MathML");
		target.setAttribute("xmlns:form","urn:oasis:names:tc:opendocument:xmlns:form:1.0");
		target.setAttribute("xmlns:script","urn:oasis:names:tc:opendocument:xmlns:script:1.0");
		target.setAttribute("xmlns:ooo","http://openoffice.org/2004/office");
		target.setAttribute("xmlns:ooow","http://openoffice.org/2004/writer");
		target.setAttribute("xmlns:oooc","http://openoffice.org/2004/calc");
		target.setAttribute("xmlns:dom","http://www.w3.org/2001/xml-events");
		target.setAttribute("xmlns:xforms","http://www.w3.org/2002/xforms");
		target.setAttribute("xmlns:xsd","http://www.w3.org/2001/XMLSchema");
		target.setAttribute("xmlns:xsi","http://www.w3.org/2001/XMLSchema-instance");
	}
	
}
