/* global.h  */
#ifndef FILE_GLOBAL_SEEN
#define FILE_GLOBAL_SEEN

//#include "SimpleFileLogger.h"
#include <string.h>

#include <new>
using namespace std;


/**
*
* global.h
*
* This class containd global definations.
*
*
*/
// Date created - 03 May 2002

/**
* Various datatypes allowed for a Field
*/
enum field_datatype { BooleanType = 1,
				 BitType,
				 UnsignedByteType,
				 ShortType,
				 IntType,
				 LongType,
				 CharType,
				 UnicodeCharType,
				 FloatType,
				 DoubleType, 
				 FloatComplexType,
				 DoubleComplexType
};

/**
* The types allowed for a field
*/
enum field_type {null_type = 0, 
				 hidden =1,
				 no_query,
				 trigger
};

/**
* 'content-role' types in a <LINK>
*/
enum content_role {null_role = 0, 
				   query = 1,
                   hints,
				   doc
};

/**
* Type in a <VALUES>.
*/
enum values_type { legal = 1,
					actual
};


//enum values_invalid_type { no = 0,
//						   yes
//};


/**
* 'system' types in a <COOSYS>.
*/
enum coosys_system {
	eq_FK4 = 1,
	eq_FK5,
	ICRS,
	ecl_FK4,
	ecl_FK5,
	galactic,
	supergalactic,
	xy,
	barycentric,
	geo_app
};


// TO DO - define error codes later.
/**
* Error status.
*/
const int SUCCESS = 0;
const int VOERROR = 1;

/* constant strings */

// element names
const char ELE_TABLE[] = "TABLE";
const char ELE_DESC[] = "DESCRIPTION";
const char ELE_FIELD[] = "FIELD";
const char ELE_LINK[] = "LINK";
const char ELE_DATA[] = "DATA";
const char ELE_TABLEDATA[] = "TABLEDATA";
const char ELE_TR[] = "TR";
const char ELE_TD[] = "TD";
const char ELE_VALUES[] = "VALUES";
const char ELE_MIN[] = "MIN";
const char ELE_MAX[] = "MAX";
const char ELE_OPTION[] = "OPTION";
const char ELE_RESOURCE[] = "RESOURCE";
const char ELE_INFO[] = "INFO";
const char ELE_COOSYS[] = "COOSYS";
const char ELE_PARAM[] = "PARAM";


// table attribute names
const char ATTR_ID[] = "ID";
const char ATTR_NAME[] = "name";
const char ATTR_REF[] = "ref";

// field attribute names
const char ATTR_UNIT[] = "unit";
const char ATTR_DATATYPE[] = "datatype";
const char ATTR_PRECISION[] = "precision";
const char ATTR_WIDTH[] = "width";
const char ATTR_UCD[] = "ucd";
const char ATTR_ARRAYSIZE[] = "arraysize";
const char ATTR_TYPE[] = "type";

// values attribute names
const char ATTR_NULL[] = "null";
const char ATTR_INVALID[] = "invalid";

// min attribute names
const char ATTR_VALUE[] = "value";
const char ATTR_INCLUSIVE[] = "inclusive";

// link attribute names
const char ATTR_CONTENT_ROLE[] = "content-role";
const char ATTR_CONTENT_TYPE[] = "content-type";
const char ATTR_TITLE[] = "title";
const char ATTR_HREF[] = "href";
const char ATTR_GREF[] = "gref";
const char ATTR_ACTION[] = "action";

// coosys attribute name
const char ATTR_EQUINOX[] = "equinox";
const char ATTR_EPOCH[] = "epoch";
const char ATTR_SYSTEM[] = "system";


const char FIELD_DATATYPE[][16] = {"", "boolean", "bit", "unsignedByte", 
			"short", "int", "long", "char", "unicodeChar", "float", "double",
			"floatComplex", "doubleComplex"};

const int NUM_OF_DATATYPES = 12;

const char FIELD_TYPE[][10] = {"", "hidden", "no_query", "trigger" };

const int NUM_OF_FIELD_TYPES = 4;

const char CONTENT_ROLE[][6] = {"", "query", "hints", "doc" };

const int NUM_OF_CONTENT_ROLES = 4;

const char COOSYS_SYSTEM[][15] = {"", "eq_FK4", "eq_FK5", "ICRS", "ecl_FK5",
		"galactic", "supergalactic", "xy", "barycentric", "geo_app"};
		
const int NUM_OF_COOSYS_SYSTEMS = 10;

const char VALUES_LEGAL_TYPE[] = "legal";
const char VALUES_ACTUAL_TYPE[] = "actual";

const char YES[] = "yes";
const char NO[] = "no";

const char BOOL_TRUE_TYPE1 = 'T';
const char BOOL_TRUE_TYPE2 = 't';
const char BOOL_TRUE_TYPE3 = '1';

const char BOOL_FALSE_TYPE1 = 'F';
const char BOOL_FALSE_TYPE2 = 'f';
const char BOOL_FALSE_TYPE3 = '0';


#endif /* !FILE_GLOBAL_SEEN */