#ifndef _TK_PLACE_CONSTRAINTS_H_
#define _TK_PLACE_CONSTRAINTS_H_

#include "../../txmlobject.h"
#include <string>

using namespace std;

/**
 * \brief Constraints for TkPlaceLayout
 * \date 01-12-2006
 *
 * \author Ondrej Svejdar
 *
 * \todo 
 *
 * \bug 
 *
 */
class TkPlaceConstraints:public TXmlObject
{
protected:
	void doSerialize(TiXmlElement& element) const;
	void doDeserialize(const TiXmlElement& element);
public:
	static TXmlObject* newObject()
	{
		return new TkPlaceConstraints();
	}

	static const char* type;
	const char* getType() const
	{
		return type;
	}
	double width,height;
	double x,y;
	bool relSize,relPosition;
	
	TkPlaceConstraints()
	{
        width=0;
		height=0;
		x=0;
		y=0;
		relSize=false;
		relPosition=false;
	}
	
	
	/**
	 * ctor
	 * \param x x coordinate of widget in container
	 * \param y y coordinate of widget in container
	 * \param width width of widget
	 * \param height height of widget
	 * \return 
	 */
	TkPlaceConstraints(int x,int y,int width,int height):
		x((float)x),y((float)y),width((float)width),height((float)height)
	{
		relSize=false;
		relPosition=false;
	}

	/**
	 * ctor
	 * \param x x coordinate of widget in container
	 * \param y y coordinate of widget in container
	 * \param width width of widget
	 * \param height height of widget
	 * \return 
	 */
	TkPlaceConstraints(float x,float y,float width,float height):
		x(x),y(y),width(width),height(height)
	{
		relSize=false;
		relPosition=false;
	}

	TObject* clone();

	string& toString() const;
};

#endif/*_TK_LAYOUT_CONSTRAINTS_H_*/
