#ifndef _TK_ANCHOR_OPTION_H_
#define _TK_ANCHOR_OPTION_H_

#include <string>

#include "tk_enumoption.h"
using namespace std;

/**
 * \brief Represent position in eight basic directions - north,northeast,east, ... northwest or center.
 * 
 * \date 01-13-2006
 *
 * \author Ondrej Svejdar
 *
 * \todo 
 *
 * \bug 
 *
 */
class TkAnchorOption:public TkEnumOption
{
public:
	/**
	 * factory for TkAnchorOption
	 * \see TXmlObject
	 * \return new empty instance of TkAnchorOption
	 */
	static TXmlObject* newObject()
	{
		return new TkAnchorOption(0);
	}

	static const char* E_CENTER;
	static const char* E_N;
	static const char* E_NE;
	static const char* E_E;
	static const char* E_SE;
	static const char* E_S;
	static const char* E_SW;
	static const char* E_W;
	static const char* E_NW;

	static const char* type;
	static const char* enums[];

	/// C++ representation of this enumeration
	typedef enum opts
	{
		/// center position
		center	=0,
		/// north position
		n		=1,
		/// northeast position
		ne		=2,
		/// east position
		e		=3,
		/// southeast position
		se		=4,
		/// south position
		s		=5,
		/// southwest position
		sw		=6,
		/// west position
		w		=7,
		/// northwest position
		nw		=8
	};

	const char* getType() const;

	/**
	 * ctor
	 * \param value One of following : "center","n","ne","e","se","s","sw","w","nw" 
	 * or you can use static const members of TkAnchorOption :
	 * E_CENTER, E_N, E_NE, E_E, E_SE, E_S, E_SW, E_W, E_NW
	 */
	inline TkAnchorOption(const char* value):TkEnumOption(value,enums)
	{
	}

	/**
	 * ctor, use this constructor if you can, because it is faster
	 * \param value One of following : center,n,ne,e,se,s,sw,w,nw
	 */
	inline TkAnchorOption(opts value):TkEnumOption((int)value,enums)
	{
	}
};

#endif/*_TK_ANCHOR_OPTION_H_*/
