/*  $Id: treeitem_generic.h,v 1.10 2004/01/12 08:20:41 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_treeitem_generic
#define header_treeitem_generic

#if _MSC_VER > 1000
#pragma once
#endif

#include "API/GUI/treeitem.h"

class CL_TreeNode;

class CL_TreeItem_Generic
{
//! Construction:
public:
	CL_TreeItem_Generic(CL_TreeItem *self, CL_TreeNode *node);
	~CL_TreeItem_Generic();

//! Attributes:
public:
	struct TreeItemStruct
	{
		TreeItemStruct() { component = NULL; }

		CL_Component *component;
		std::string text;
	};
	std::vector<TreeItemStruct> items;

	CL_TreeNode *node;

	CL_Surface *sur_icon;
	bool delete_sur_icon;
	int custom_height;
	int text_margin;

//! Signals:
public:
	CL_Signal_v0 sig_clicked;

//! Callbacks:
private:
	void on_mouse_down(const CL_InputEvent &key);

//! Implementation:
private:
	CL_TreeItem *item;

	CL_Slot slot_mouse_down;
};

#endif
