#ifndef _EVENT_MAP_H_
#define _EVENT_MAP_H_

#include "ebase.h"

namespace event
{

/**
 * \brief Listener for Map event.
 * \date 01-12-2006
 *
 * \author Ondrej Svejdar
 *
 * \todo 
 *
 * \bug 
 *
 */
class MapListener:public TObject
{
public:
	virtual void onMap(EHeader& header,int count,bool override)=0;
};

/**
 * \brief Handler for Map event.
 * \date 01-12-2006
 *
 * \author Ondrej Svejdar
 *
 * \todo 
 *
 * \bug 
 *
 */
class EMap:public EBase
{
	typedef vector<Ptr<MapListener> >  t_listeners;
	t_listeners listeners;
protected:
	static const char* eventType;
	static const EField* eventFields[];
	
	int preprocessEvent(EHeader& header,Tcl_Interp* interp,int objc,Tcl_Obj* CONST objv[]);
public:
	inline EMap():EBase(eventType,eventFields) {}
	void addMapListener(MapListener* listener)
	{
		listeners.push_back(listener);
		afterListenerRegistred();
	}
};

};

#endif/*_EVENT_MAP_H_*/
