#ifndef _EVENT_UNMAP_H_
#define _EVENT_UNMAP_H_

#include "ebase.h"

namespace event
{

/**
 * \brief Listener for Unmap event.
 * \date 01-12-2006
 *
 * \author Ondrej Svejdar
 *
 * \todo 
 *
 * \bug 
 *
 */
class UnmapListener:public TObject
{
public:
	virtual void onUnmap(EHeader& header)=0;
};

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

};

#endif/*_EVENT_UNMAP_H_*/
