#ifndef _EVENT_DOUBLE_H_
#define _EVENT_DOUBLE_H_

#include "ebase.h"

namespace event
{

/**
 * \brief Listener for Double event.
 * \date 01-12-2006
 *
 * \author Ondrej Svejdar
 *
 * \todo 
 *
 * \bug 
 *
 */
class DoubleListener:public TObject
{
public:
	virtual void onDouble(EHeader& header,int button,int x,int y,int x_root,int y_root)=0;
};

/**
 * \brief Handler for Double event.
 * \date 01-12-2006
 *
 * \author Ondrej Svejdar
 *
 * \todo 
 *
 * \bug 
 *
 */
class EDouble:public EBase
{
	typedef vector<Ptr<DoubleListener> > t_listeners;
	t_listeners listeners;

	static const char* eventType;
	static const EField* eventFields[];
protected:
	int preprocessEvent(EHeader& header,Tcl_Interp* interp,int objc,Tcl_Obj* CONST objv[]);
public:
	inline EDouble():EBase(eventType,eventFields) {}

	/**
	 * Add listener to collection of listeners
	 * \param listener 
	 */
	void addDoubleListener(DoubleListener* listener)
	{
		listeners.push_back(listener);
		afterListenerRegistred();
	}
};

};

#endif/*_EVENT_DOUBLE_H_*/
