#ifndef __XLAYOUTUTILITY_G__
#define __XLAYOUTUTILITY_G__

#include "wxstldefs.h"
#include "XObject.h"

class XLayoutUtility
{
protected:
	XCollection* mpScene;
public:      
	void SetScene( XCollection* pScene );
	void SetPageBounds( const XRect& bounds ); 

	void AlignItems( int alignment );
	void MakeSameSize( bool width, bool height, bool both );
	void Center( bool vertically );
	void Arrange( bool right );

	void SendItemsBack();	   
	void SelectAllItems();

	bool CanLayout();
	bool CanAlign();

	// is called whenever group of selected objects
	// is going to be laid out, return TRUE if the 
	// algorithm should be applied for the given object
	// in the collection
	
	virtual bool CanLayout( XObject& obj ) { return TRUE; }

	// helpers

	XCollection& GetScene();

	XObject& GetFocusedItem();

	void StartBatch();
	void FinishBatch();

protected:
	XRect mR; // bounding rectangle of the page
};

#endif