#ifndef _TK_VALIDATION_TYPE_OPTION_H_
#define _TK_VALIDATION_TYPE_OPTION_H_

#include "tk_enumoption.h"
#include <string>

using namespace std;

/**
 * \brief Specifies condition, after which the validation is executed.
 * 
 * Specifies the mode in which validation should operate: none, focus,
 * focusin, focusout, key, or all. It defaults to none.
 * When you want validation, you must explicitly state which mode you wish to use.
 *
 * \date 01-13-2006
 *
 * \author Ondrej Svejdar
 *
 * \todo 
 *
 * \bug 
 *
 */
class TkValidationTypeOption:public TkEnumOption
{
public:
	static TXmlObject* newObject()
	{
		return new TkValidationTypeOption(0);
	}

	static const char* E_NONE;
	static const char* E_FOCUSIN;
	static const char* E_FOCUSOUT;
	static const char* E_KEY;
	static const char* E_ALL;

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

	/// C++ representation of this enumeration
	typedef enum opts
	{
		/// no validation
		none	=0,
		/// validation after FocusIn event
		focusin	=1,
		/// validation after FocusOut event
		focusout=2,
		/// validation after KeyPress event
		key		=3,
		/// validation after any of above events (FocusIn, FocusOut, KeyPress)
		all		=4
	};

	const char* getType() const;
	
	/**
	 * ctor
	 * \param value One of following : "none","focusin","focusout","key","all"
	 * or you can use static const members of TkValidationTypeOption :
	 * E_NONE, E_FOCUSIN, E_FOCUSOUT, E_KEY, E_ALL
	 */
	inline TkValidationTypeOption(const char* value):TkEnumOption(value,enums)
	{
	}

	/**
	 * ctor, use this constructor if you can, because it is faster
	 * \param value One of following : none, focusin, focusout, key, all
	 */
	inline TkValidationTypeOption(opts value):TkEnumOption((int)value,enums)
	{
	}
};

#endif/*_TK_VALIDATION_TYPE_OPTION_H_*/
