/***************************************************************************
                            QDialog.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_QDialog.h>
#include <qtobjc/QDialog.h>
#include <qtobjc/QPoint.h>
#include <qtobjc/QRect.h>
#include <qtobjc/QSize.h>


@implementation  QDialog


- initWithWidget: (QWidget *)parent name: (NSString *)name modal: (BOOL)modal f: (int)f
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QDialog((qt_QWidget *) [parent qt], (char*) [name cString], (int)modal, (int)f)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- init
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QDialog(0, 0, 0, 0)];
		[self setAllocatedInObjcWorld: YES];
		[QtSupport setObject: self forQtKey: [self qt]];
	}
	[super init];
	return self;
}

- (void) dealloc
{
	if ([self qt] != 0L) {
		if ([self allocatedInObjcWorld] && [self parentWidget: YES] == nil) {
			qt_del_QDialog((qt_QDialog *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- (int) result
{
	return (int) qt_QDialog_result((qt_QDialog *)[self qt]);
}

- show
{
	qt_QDialog_show((qt_QDialog *)[self qt]);
	return self;
}

- hide
{
	qt_QDialog_hide((qt_QDialog *)[self qt]);
	return self;
}

- move: (int)x y: (int)y
{
	qt_QDialog_move((qt_QDialog *)[self qt], (int)x, (int)y);
	return self;
}

- move: (QPoint*)p
{
	qt_QDialog_move1((qt_QDialog *)[self qt], (qt_QPoint*) [p qt]);
	return self;
}

- resize: (int)w h: (int)h
{
	qt_QDialog_resize((qt_QDialog *)[self qt], (int)w, (int)h);
	return self;
}

- resize: (QSize *)arg1
{
	qt_QDialog_resize1((qt_QDialog *)[self qt], (qt_QSize *) [arg1 qt]);
	return self;
}

- setGeometry: (int)x y: (int)y w: (int)w h: (int)h
{
	qt_QDialog_setGeometry((qt_QDialog *)[self qt], (int)x, (int)y, (int)w, (int)h);
	return self;
}

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

- setOrientation: (int)orientation
{
	qt_QDialog_setOrientation((qt_QDialog *)[self qt], (int)orientation);
	return self;
}

- (int) orientation
{
	return (int) qt_QDialog_orientation((qt_QDialog *)[self qt]);
}

- setExtension: (QWidget *)extension
{
	qt_QDialog_setExtension((qt_QDialog *)[self qt], (qt_QWidget *) [extension qt]);
	return self;
}

- (QWidget*) extension
{
	return (QWidget*) [QtSupport objectForQtKey: qt_QDialog_extension((qt_QDialog *)[self qt]) withClass: [QWidget class] allocatedInObjcWorld: YES];
}

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

- (QSize*) minimumSizeHint
{
	return (QSize*) [QtSupport objectForQtKey: qt_QDialog_minimumSizeHint((qt_QDialog *)[self qt]) withClass: [QSize class] allocatedInObjcWorld: YES];
}

- setSizeGripEnabled: (BOOL)arg1
{
	qt_QDialog_setSizeGripEnabled((qt_QDialog *)[self qt], (int)arg1);
	return self;
}

- (BOOL) isSizeGripEnabled
{
	return (BOOL) qt_QDialog_isSizeGripEnabled((qt_QDialog *)[self qt]);
}

- (int) exec
{
	return (int) qt_QDialog_exec((qt_QDialog *)[self qt]);
}

- setResult: (int)r
{
	qt_QDialog_setResult((qt_QDialog *)[self qt], (int)r);
	return self;
}

- (BOOL) eventFilter: (QObject *)arg1 event: (QEvent *)arg2
{
	return (BOOL) qt_QDialog_eventFilter((qt_QDialog *)[self qt], (qt_QObject *) [arg1 qt], (qt_QEvent *) [arg2 qt]);
}

- adjustPosition: (QWidget *)arg1
{
	qt_QDialog_adjustPosition((qt_QDialog *)[self qt], (qt_QWidget *) [arg1 qt]);
	return self;
}

- done: (int)arg1
{
	qt_QDialog_done((qt_QDialog *)[self qt], (int)arg1);
	return self;
}

- accept
{
	qt_QDialog_accept((qt_QDialog *)[self qt]);
	return self;
}

- reject
{
	qt_QDialog_reject((qt_QDialog *)[self qt]);
	return self;
}

- showExtension: (BOOL)arg1
{
	qt_QDialog_showExtension((qt_QDialog *)[self qt], (int)arg1);
	return self;
}

+ (int) Rejected
{
	return (int) QDIALOG_Rejected;
}

+ (int) Accepted
{
	return (int) QDIALOG_Accepted;
}

@end
