#ifndef BUTTONEVENT_H
#define BUTTONEVENT_H

#include "IEvent.h"

namespace Salamander
{

/*
** Key Events are created when a key is either pressed or released. The event contains the key code, modifiers held at the time, 
** and the state of the key.
*/
class ButtonEvent : public IEvent
{
public:
	/*
	** Actions are fired by the system and can be handled by client applications if required. Each controller
	** type has a unique enum set with all button codes enumerated.
	*/
	static class buttonCode
	{
	public:
		static EventCode Unknown = 0;
	};

	/*
	** The keyboard is a standard US English layout.
	*/
	static class keyCode : public buttonCode
	{
	public:
		defineCode(Zero);
		defineCode(One);
		defineCode(Two);
		defineCode(Three);
		defineCode(Four);
		defineCode(Five);
		defineCode(Six);
		defineCode(Seven);
		defineCode(Eight);
		defineCode(Nine);

		defineCode(A);
		defineCode(B);
		defineCode(C);
		defineCode(D);
		defineCode(E);
		defineCode(F);
		defineCode(G);
		defineCode(H);
		defineCode(I);
		defineCode(J);
		defineCode(K);
		defineCode(L);
		defineCode(M);
		defineCode(N);
		defineCode(O);
		defineCode(P);
		defineCode(Q);
		defineCode(R);
		defineCode(S);
		defineCode(T);
		defineCode(U);
		defineCode(V);
		defineCode(W);
		defineCode(X);
		defineCode(Y);
		defineCode(Z);

		defineCode(Insert);
		defineCode(Delete);
		defineCode(Home);
		defineCode(End);
		defineCode(PageUp);
		defineCode(PageDown);

		defineCode(Up);
		defineCode(Down);
		defineCode(Left);
		defineCode(Right);

		defineCode(Space);
		defineCode(Return);
		defineCode(Backspace);
		defineCode(Tab);

		defineCode(CapsLock);
		defineCode(Shift);
		defineCode(Control);
		defineCode(Alternate);

		defineCode(Escape);
		defineCode(F1);
		defineCode(F2);
		defineCode(F3);
		defineCode(F4);
		defineCode(F5);
		defineCode(F6);
		defineCode(F7);
		defineCode(F8);
		defineCode(F9);
		defineCode(F10);
		defineCode(F11);
		defineCode(F12);
		
		defineCode(PrintScreen);
		defineCode(ScrollLock);
		defineCode(Pause);
	};

	/*
	** Mouse codes are covered for a single standard mouse.
	*/
	static class mouseCode : public buttonCode
	{
	public:
		defineCode(Left);
		defineCode(Middle);
		defineCode(Right);

		defineCode(ScrollUp);
		defineCode(ScrollDown);
	};

public:
	/*
	** Destructor.
	*/
	virtual ~ButtonEvent();

	/*
	** Button events must be created with relevant controller data
	*/
	registerEvent(IEvent);
	ButtonEvent(EventCode code);

	/*
	** Return the button code that fired this event.
	*/
	EventCode getCode() const;
	
protected:

private:
	EventCode code_;
};

}

#endif // BUTTONEVENT_H