#ifndef _FIELD_H_
#define _FIELD_H_

namespace event
{

/**
 * \brief Represent attribute of event, hold static list of all known event attributes.
 * \date 01-12-2006
 *
 * \author Ondrej Svejdar
 *
 * \todo 
 *
 * \bug 
 *
 */
class EField
{
	char id;
	const char* name;
public:
	/// Serial number for the event.
	static const EField SERIAL; 
	/// The above field for the event.
	static const EField ABOVE;
	/// Button number.
	static const EField BUTTON;
	/// The count field.
	static const EField COUNT;
	/// The detail field.
	static const EField DETAIL;
	/// The focus field.
	static const EField FOCUS;
	/// The height field.
	static const EField HEIGHT;
	/// The window field from the event, represented as hexadecimal integer.
	static const EField ID;
	/// The keycode field.
	static const EField KEYCODE;
	/// The mode field.
	static const EField MODE;
	/// The override_redirect field.
	static const EField OVERRIDE;
	/// The place field.
	static const EField PLACE;
	/// The state field.
	static const EField STATE;
	/// The time field.
	static const EField TIME;
	/// The value_mask field.
	static const EField VALUE_MASK;
	/// The width field.
	static const EField WIDTH;
	/// The X coordinate, widget relative.
	static const EField X;
	/// The Y coordinate, widget relative.
	static const EField Y;
	
	/// The printing character from the event,or {}.
	static const EField PRINT_CHAR;
	/// The border width.
	static const EField BORDER_WIDTH;
	/// The delta value.
	static const EField DELTA;
	/// The send_event field.
	static const EField SENDEVENT;
	/// The keysym from the event.
	static const EField KEYSYM;
	/// The keysym as a decimal number.
	static const EField KEYSYM_DECIMAL;
	/// The atom name for the property being changed or deleted.
	static const EField PROPERTY_ATOM_NAME;
	/// The root window ID.
	static const EField ROOT_WINDOW;
	/// The subwindow ID.
	static const EField SUB_WINDOW;
	// The type field.
	static const EField TYPE;
	/// The Tk pathname of the widget receiving the event.
	static const EField WIDGET_PATHNAME;
	/// The x_root field. Relative to the (virtual) root window.
	static const EField X_ROOT;
	/// The y_root field. Relative to the (virtual) root window.
	static const EField Y_ROOT;
	
	/// The end-of-array.
	static const EField END;

	/**
	 * \brief ctor
	 * \param id char representing event attribute in shell handle routine, see event binding
	 * \param name name of event
	 */
	EField(const char id,const char* name):id(id),name(name)
	{
	}

	/**
	 * \brief copy ctor
	 */
	EField(const EField& field):id(field.id),name(field.name)
	{
        
	}
	EField& operator=(const EField& field)
	{
		id=field.id;
		name=field.name;
		return *this;
	}

	/**
	 * \brief return event attribute char
	 */
	const char getId() const;

	/**
	 * \brief return name of event attribute
	 */
	const char* getName() const;
	
	bool operator==(const EField& e) const
	{
		return (e.id==id&&e.name==name);
	}

	bool operator!=(const EField& e) const
	{
		return !(operator==(e));
	}
};

};

#endif/*_FIELD_H_*/

