/*  $Id: button_generic.h,v 1.30 2004/02/18 14:32:15 sphair Exp $
	
	ClanGUI, copyrights by various people. Have a look in the CREDITS file.
	
	This sourcecode is distributed using the Library GNU Public Licence,
	version 2 or (at your option) any later version. Please read LICENSE
	for details.
*/

#ifndef header_button_generic
#define header_button_generic

#if _MSC_VER > 1000
#pragma once
#endif

#include "API/GUI/button.h"
#include "API/Core/System/clanstring.h"

class CL_Button_Generic
{
//! Construction:
public:
	CL_Button_Generic(
		CL_Button *self,
		const std::string &text,
		bool toggle_mode);

	~CL_Button_Generic() {};

//! Attributes:
public:
	std::string text;
	bool toggle_mode;

	bool toggled;
	bool visually_down;

//! Signals:
public:
	CL_Signal_v1<bool> sig_toggled;
	CL_Signal_v0 sig_clicked;
	CL_Signal_v0 sig_pressed;
	CL_Signal_v0 sig_released;

//! Callbacks:
private:
	void on_set_options(const CL_DomElement &options);
	void on_input_down(const CL_InputEvent &key);
	void on_input_up(const CL_InputEvent &key);
	void on_mouse_move(const CL_InputEvent &key);

//! Implementation:
private:
	CL_Button *button;

	CL_SlotContainer slots;
};  

#endif
