/***************************************************************************
                            QSplitter.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_QSplitter.h>
#include <qtobjc/QSplitter.h>
#include <qtobjc/QPainter.h>
#include <qtobjc/QStyle.h>

@implementation  QSplitter


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

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

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

- initWithInt: (int)arg1 
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QSplitter1((int)arg1, 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_QSplitter((qt_QSplitter *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- setOrientation: (int)arg1
{
	qt_QSplitter_setOrientation((qt_QSplitter *)[self qt], (int)arg1);
	return self;
}

- (int) orientation
{
	return (int) qt_QSplitter_orientation((qt_QSplitter *)[self qt]);
}

- setResizeMode: (QWidget *)w int: (int)arg1
{
	qt_QSplitter_setResizeMode((qt_QSplitter *)[self qt], (qt_QWidget *) [w qt], (int)arg1);
	return self;
}

- setOpaqueResize: (BOOL)arg1
{
	qt_QSplitter_setOpaqueResize((qt_QSplitter *)[self qt], (int)arg1);
	return self;
}

- setOpaqueResize
{
	qt_QSplitter_setOpaqueResize((qt_QSplitter *)[self qt], 1);
	return self;
}

- (BOOL) opaqueResize
{
	return (BOOL) qt_QSplitter_opaqueResize((qt_QSplitter *)[self qt]);
}

- moveToFirst: (QWidget *)arg1
{
	qt_QSplitter_moveToFirst((qt_QSplitter *)[self qt], (qt_QWidget *) [arg1 qt]);
	return self;
}

- moveToLast: (QWidget *)arg1
{
	qt_QSplitter_moveToLast((qt_QSplitter *)[self qt], (qt_QWidget *) [arg1 qt]);
	return self;
}

- refresh
{
	qt_QSplitter_refresh((qt_QSplitter *)[self qt]);
	return self;
}

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

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

- (BOOL) event: (QEvent *)arg1
{
	return (BOOL) qt_QSplitter_event((qt_QSplitter *)[self qt], (qt_QEvent *) [arg1 qt]);
}

- (int) idAfter: (QWidget *)arg1
{
	return (int) qt_QSplitter_idAfter((qt_QSplitter *)[self qt], (qt_QWidget *) [arg1 qt]);
}

- moveSplitter: (short)pos identifier: (int)identifier
{
	qt_QSplitter_moveSplitter((qt_QSplitter *)[self qt], (short)pos, (int)identifier);
	return self;
}

- drawSplitter: (QPainter *)arg1 x: (short)x y: (short)y w: (short)w h: (short)h
{
	qt_QSplitter_drawSplitter((qt_QSplitter *)[self qt], (qt_QPainter *) [arg1 qt], (short)x, (short)y, (short)w, (short)h);
	return self;
}

- styleChange: (QStyle*)arg1
{
	qt_QSplitter_styleChange((qt_QSplitter *)[self qt], (qt_QStyle*) [arg1 qt]);
	return self;
}

- (int) adjustPos: (int)arg1 int: (int)arg2
{
	return (int) qt_QSplitter_adjustPos((qt_QSplitter *)[self qt], (int)arg1, (int)arg2);
}

- setRubberband: (int)arg1
{
	qt_QSplitter_setRubberband((qt_QSplitter *)[self qt], (int)arg1);
	return self;
}

- getRange: (int)identifier int: (int*)arg1 int: (int*)arg2
{
	qt_QSplitter_getRange((qt_QSplitter *)[self qt], (int)identifier, (int*)arg1, (int*)arg2);
	return self;
}

+ (int) Stretch
{
	return (int) QSPLITTER_Stretch;
}

+ (int) KeepSize
{
	return (int) QSPLITTER_KeepSize;
}

+ (int) FollowSizeHint
{
	return (int) QSPLITTER_FollowSizeHint;
}

@end
