#ifndef TREEVIEW_H
#define TREEVIEW_H


#include <vector>
#include <string>
#include "GL/Panel.h"


#include "Namespace.h"
BEGIN_NAMESPACE


// Basic prototype expected for the template type parameter to the TreeView class
class TreeViewItem
{
public:
	bool hasChildren()                                  { return (m_children.size() > 0); }
	const std::vector<const TreeViewItem*>& children()  { return m_children; }
	const char* text()                                  { return m_name.c_str(); }
private:
	std::string m_name;
	std::vector<const TreeViewItem*> m_children;
};


template <typename T>
class TreeView : public Panel
{
public:
	TreeView(T* a_root, int a_x, int a_y, int a_w, int a_h, const char* a_name) : m_root(a_root), Panel(a_x, a_y, a_w, a_h, a_name) {}
	void draw();
private:
	T* m_root;
};


END_NAMESPACE


#include "GL/TreeView.inl"


#endif // TREEVIEW_H

