/***************************************************************************
                            QLayoutItem.m -  description
                             -------------------
    begin                : Wed Nov 21 12:08:37 2001
    copyright            : (C) 2000-2001 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Wed Nov 21 12:08:37 2001, using kalyptus 0.9.
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This library is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Library General Public License as       *
 *   published by the Free Software Foundation; either version 2 of the    *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 ***************************************************************************/

#include <qtc/qt_QString.h>
#include <qtc/qt_QCString.h>
#include <qtc/qt_QLayoutItem.h>
#include <qtobjc/QLayoutItem.h>
#include <qtobjc/QRect.h>

@implementation  QLayoutItem


- (void) dealloc
{
	if ([self qt] != 0L) {
		if ([self allocatedInObjcWorld]) {
			qt_del_QLayoutItem((qt_QLayoutItem *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- (QSize*) sizeHint
{
	return (QSize*) [QtSupport objectForQtKey: qt_QLayoutItem_sizeHint((qt_QLayoutItem *)[self qt]) withClass: [QSize class] allocatedInObjcWorld: YES];
}

- (QSize*) minimumSize
{
	return (QSize*) [QtSupport objectForQtKey: qt_QLayoutItem_minimumSize((qt_QLayoutItem *)[self qt]) withClass: [QSize class] allocatedInObjcWorld: YES];
}

- (QSize*) maximumSize
{
	return (QSize*) [QtSupport objectForQtKey: qt_QLayoutItem_maximumSize((qt_QLayoutItem *)[self qt]) withClass: [QSize class] allocatedInObjcWorld: YES];
}

- (int) expanding
{
	return (int) qt_QLayoutItem_expanding((qt_QLayoutItem *)[self qt]);
}

- setGeometry: (QRect*)arg1
{
	qt_QLayoutItem_setGeometry((qt_QLayoutItem *)[self qt], (qt_QRect*) [arg1 qt]);
	return self;
}

- (QRect*) geometry
{
	return (QRect*) [QtSupport objectForQtKey: qt_QLayoutItem_geometry((qt_QLayoutItem *)[self qt]) withClass: [QRect class] allocatedInObjcWorld: YES];
}

- (BOOL) isEmpty
{
	return (BOOL) qt_QLayoutItem_isEmpty((qt_QLayoutItem *)[self qt]);
}

- (BOOL) hasHeightForWidth
{
	return (BOOL) qt_QLayoutItem_hasHeightForWidth((qt_QLayoutItem *)[self qt]);
}

- (int) heightForWidth: (int)arg1
{
	return (int) qt_QLayoutItem_heightForWidth((qt_QLayoutItem *)[self qt], (int)arg1);
}

- invalidate
{
	qt_QLayoutItem_invalidate((qt_QLayoutItem *)[self qt]);
	return self;
}

- (QWidget*) widget
{
	return (QWidget*) [QtSupport objectForQtKey: qt_QLayoutItem_widget((qt_QLayoutItem *)[self qt]) withClass: [QWidget class] allocatedInObjcWorld: YES];
}

//- (QLayoutIterator*) iterator
//{
//	return (QLayoutIterator*) [QtSupport objectForQtKey: qt_QLayoutItem_iterator((qt_QLayoutItem *)[self qt]) withClass: [QLayoutIterator class] allocatedInObjcWorld: YES];
//}

- (QLayout*) layout
{
	return (QLayout*) [QtSupport objectForQtKey: qt_QLayoutItem_layout((qt_QLayoutItem *)[self qt]) withClass: [QLayout class] allocatedInObjcWorld: YES];
}

- (QSpacerItem*) spacerItem
{
	return (QSpacerItem*) [QtSupport objectForQtKey: qt_QLayoutItem_spacerItem((qt_QLayoutItem *)[self qt]) withClass: [QSpacerItem class] allocatedInObjcWorld: YES];
}

- (int) alignment
{
	return (int) qt_QLayoutItem_alignment((qt_QLayoutItem *)[self qt]);
}

- setAlignment: (int)a
{
	qt_QLayoutItem_setAlignment((qt_QLayoutItem *)[self qt], (int)a);
	return self;
}
- (void *) qt
{
	return _qt;
}

- setQt: (void *) qt
{
	_qt = qt;
	return self;
}

- (BOOL) allocatedInObjcWorld
{
	return _allocatedInObjcWorld;
}

- setAllocatedInObjcWorld: (BOOL) yn
{
	_allocatedInObjcWorld = yn;
	return self;
}


@end
