// This is the SIP interface definition for TQRect.
//
// Copyright (c) 2007
// 	Riverbank Computing Limited <info@riverbankcomputing.co.uk>
// 
// This file is part of PyTQt.
// 
// This copy of PyTQt is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2, or (at your option) any later
// version.
// 
// PyTQt is supplied 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 General Public License for more
// details.
// 
// You should have received a copy of the GNU General Public License along with
// PyTQt; see the file LICENSE.  If not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


%ExportedDoc
<Sect2><Title>TQRect</Title>
<Para>
The Python
<Literal>&amp;</Literal>, <Literal>&amp;=</Literal>,
<Literal>|</Literal>, <Literal>|=</Literal>,
<Literal>==</Literal>, <Literal>!=</Literal>, <Literal>in</Literal> and
<Literal>__nonzero__</Literal> operators are supported.
</Para>

<FuncSynopsis>
        <FuncDef>void <Function>coords</Function></FuncDef>
        <ParamDef>int *<Parameter>x1</Parameter></ParamDef>
        <ParamDef>int *<Parameter>y1</Parameter></ParamDef>
        <ParamDef>int *<Parameter>x2</Parameter></ParamDef>
        <ParamDef>int *<Parameter>y2</Parameter></ParamDef>
</FuncSynopsis>
<Para>
This takes no parameters and returns a tuple containing the four values.
</Para>

<FuncSynopsis>
        <FuncDef>void <Function>rect</Function></FuncDef>
        <ParamDef>int *<Parameter>x</Parameter></ParamDef>
        <ParamDef>int *<Parameter>y</Parameter></ParamDef>
        <ParamDef>int *<Parameter>w</Parameter></ParamDef>
        <ParamDef>int *<Parameter>h</Parameter></ParamDef>
</FuncSynopsis>
<Para>
This takes no parameters and returns a tuple containing the four values.
</Para>

<FuncSynopsis>
        <FuncDef>TQCOORD &amp;<Function>rBottom</Function></FuncDef>
        <ParamDef></ParamDef>
</FuncSynopsis>
<Para>
Not implemented. (TQt v2+)
</Para>

<FuncSynopsis>
        <FuncDef>TQCOORD &amp;<Function>rLeft</Function></FuncDef>
        <ParamDef></ParamDef>
</FuncSynopsis>
<Para>
Not implemented. (TQt v2+)
</Para>

<FuncSynopsis>
        <FuncDef>TQCOORD &amp;<Function>rRight</Function></FuncDef>
        <ParamDef></ParamDef>
</FuncSynopsis>
<Para>
Not implemented. (TQt v2+)
</Para>

<FuncSynopsis>
        <FuncDef>TQCOORD &amp;<Function>rTop</Function></FuncDef>
        <ParamDef></ParamDef>
</FuncSynopsis>
<Para>
Not implemented. (TQt v2+)
</Para>
</Sect2>
%End


class TQRect
{
%TypeHeaderCode
#include <tqrect.h>
%End

public:
	TQRect();
	TQRect(const TQPoint &,const TQPoint &);
	TQRect(const TQPoint &,const TQSize &);
	TQRect(int,int,int,int);

	bool isNull() const;
	bool isEmpty() const;
	bool isValid() const;
	TQRect normalize() const;

	int left() const;
	int top() const;
	int right() const;
	int bottom() const;

//	TQCOORD &rLeft();
//	TQCOORD &rTop();
//	TQCOORD &rRight();
//	TQCOORD &rBottom();

	int x() const;
	int y() const;
	void setLeft(int);
	void setTop(int);
	void setRight(int);
	void setBottom(int);
	void setX(int);
	void setY(int);

	void setTopLeft(const TQPoint &);
	void setBottomRight(const TQPoint &);
	void setTopRight(const TQPoint &);
	void setBottomLeft(const TQPoint &);

	TQPoint topLeft() const;
	TQPoint bottomRight() const;
	TQPoint topRight() const;
	TQPoint bottomLeft() const;
	TQPoint center() const;

	void rect(int *,int *,int *,int *) const;
	void coords(int *,int *,int *,int *) const;

	void moveLeft(int);
	void moveTop(int);
	void moveRight(int);
	void moveBottom(int);
	void moveTopLeft(const TQPoint &);
	void moveBottomLeft(const TQPoint &);
	void moveTopRight(const TQPoint &);
	void moveBottomRight(const TQPoint &);
	void moveCenter(const TQPoint &);
	void moveBy(int,int);

	void setRect(int,int,int,int);
	void setCoords(int,int,int,int);
	void addCoords(int,int,int,int);

	TQSize size() const;
	int width() const;
	int height() const;
	void setWidth(int);
	void setHeight(int);
	void setSize(const TQSize &);

	TQRect operator|(const TQRect &) const;
	TQRect operator&(const TQRect &) const;
	TQRect &operator|=(const TQRect &);
	TQRect &operator&=(const TQRect &);

	int __nonzero__() const;
%MethodCode
		sipRes = sipCpp -> isValid();
%End

	bool contains(const TQPoint &,bool = 0) const;

	int __contains__(const TQPoint &) const;
%MethodCode
		sipRes = sipCpp -> contains(*a0);
%End

	bool contains(int,int) const;
	bool contains(int,int,bool) const;
	bool contains(const TQRect &,bool = 0) const;

	int __contains__(const TQRect &) const;
%MethodCode
		sipRes = sipCpp -> contains(*a0);
%End

	TQRect unite(const TQRect &) const;
	TQRect intersect(const TQRect &) const;
	bool intersects(const TQRect &) const;
};

bool operator==(const TQRect &,const TQRect &);
bool operator!=(const TQRect &,const TQRect &);
