/* -----------------------------------------------------------------------------
	GSFramework
	Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
----------------------------------------------------------------------------- */


#ifndef	__NUI_WIDGET_CONTAINER__
#define	__NUI_WIDGET_CONTAINER__


		#include "ui/widget.h"


namespace GS {
	namespace S2D {

//
struct	ContainerCell
{
		iRect			cell_rect;		///< Cell rect in parent coordinate frame.
		sWidget			widget;			///< Cell widget.
};

/*!
	@short	Container widget.
	@author	Emmanuel Julien (ejulien@nworks.fr)
*/
class	ContainerWidget : public Widget
{
protected:

		List <ContainerCell *> cell_list;

public:

		void			Invalidate();

virtual	void			Refresh();
virtual	void			Compose(Picture &, const iRect &out_rect);

		ContainerCell	*GetCell(const Widget *) const;

		Widget			*Add(Widget *, const iRect &cell_rect);
		bool			Remove(Widget *);

		ContainerWidget(int id = -1) : Widget(id) { type = WidgetTypeContainer; }
		~ContainerWidget();
};

	} // S2D
} // GS


#endif	// __NWIDGETCONTAINER__
