#ifndef _TK_GRID_CONSTRAINTS_H_
#define _TK_GRID_CONSTRAINTS_H_

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

using namespace std;

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

	static const int NORTH;
	static const int SOUTH;
	static const int EAST;
	static const int WEST;
	static const char* type;
	const char* getType() const
	{
		return type;
	}
	int row,column;
	int rowspan,columnspan;
	int flags;
	TkGridConstraints()
	{
		row=0;
		column=0;
		rowspan=0;
		columnspan=0;
		flags=0;
	}


	/**
	 * ctor
	 * \param row row position of cell in the container, rows are indexed from 0 
	 * \param column column position of cell in the container, columns are indexed from 0
	 * \param rowspan numer of rows, which will cell take
	 * \param columnspan number of columns, which will cell take 
	 * \param flags for anchoring, logical or combination of NORTH,SOUTH,EAST,WEST
	 */
	TkGridConstraints(int row,int column,int rowspan,int columnspan,int flags):
		row(row),column(column),rowspan(rowspan),columnspan(columnspan),flags(flags)
	{
	}

	/**
	 * ctor
	 * \param row row position of cell in the container, rows are indexed from 0 
	 * \param column column position of cell in the container, columns are indexed from 0
	 * \param rowspan numer of rows, which will cell take
	 * \param columnspan number of columns, which will cell take 
	 */
	TkGridConstraints(int row,int column,int rowspan,int columnspan):
		row(row),column(column),rowspan(rowspan),columnspan(columnspan),flags(0)
	{
	}

	/**
	 * ctor
	 * \param row row position of cell in the container, rows are indexed from 0 
	 * \param column column position of cell in the container, columns are indexed from 0
	 * \param flags for anchoring, logical or combination of NORTH,SOUTH,EAST,WEST
	 */
	TkGridConstraints(int row,int column,int flags):
		row(row),column(column),rowspan(1),columnspan(1),flags(flags)
	{
	}

	/**
	 * ctor
	 * \param row row position of cell in the container, rows are indexed from 0 
	 * \param column column position of cell in the container, columns are indexed from 0
	 */
	TkGridConstraints(int row,int column):
		row(row),column(column),rowspan(1),columnspan(1),flags(0)
	{
	}

	string& toString() const;

	TObject* clone();
};

#endif/*_TK_GRID_CONSTRAINTS_H_*/
