/*  $Id: layout_item.h,v 1.3 2004/02/05 18:29:43 grumbel Exp $
**
**  ClanLib Game SDK
**  Copyright (C) 2003  The ClanLib Team
**  For a total list of contributers see the file CREDITS.
**
**  This library is free software; you can redistribute it and/or
**  modify it under the terms of the GNU Lesser General Public
**  License as published by the Free Software Foundation; either
**  version 2.1 of the License, or (at your option) any later version.
**
**  This library is distributed in the hope that it will be useful,
**  but WITHOUT ANY WARRANTY; without even the implied warranty of
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
**  Lesser General Public License for more details.
**
**  You should have received a copy of the GNU Lesser General Public
**  License along with this library; if not, write to the Free Software
**  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
**
*/

#ifndef header_layout_item
#define header_layout_item

#if _MSC_VER > 1000
#pragma once
#endif

#include "API/GUI/component.h"
#include "API/Core/System/sharedptr.h"

class CL_Layout_Generic;

//: Layout item in a layout tree.
class CL_LayoutItem
{
//! Construction:
public:
	//: Constructs a layout item.
	CL_LayoutItem(CL_Component *component);

	CL_LayoutItem(CL_SharedPtr<CL_Layout_Generic> layout);

	~CL_LayoutItem();

//! Attributes:
public:
	//: Returns the preferred size of this layout item.
	CL_Size get_preferred_size() const;

	//: Returns the minimum size of this layout item.
	CL_Size get_minimum_size() const;

	//: Returns the maximum size of this layout item.
	CL_Size get_maximum_size() const;

	//: Returns the vertical size policy of this layout item.
	CL_LayoutPolicy get_vertical_policy() const;

	//: Returns the horizontal size policy of this layout item.
	CL_LayoutPolicy get_horizontal_policy() const;

	//: Component this layout item represents.
	//- <p>Null if its not a component.</p>
	CL_Component *component;

	//: Layout this layout item represents.
	//- <p>Null if its not a layout.</p>
	CL_SharedPtr<CL_Layout_Generic> layout;

//! Operations:
public:
	//: Copy assignment operator.
	CL_LayoutItem &operator =(const CL_LayoutItem &copy);

	//: Set layout item to use this size and position.
	void set_position(const CL_Rect &pos);

//! Implementation:
private:
};

#endif
