/***************************************************************************
                            KTabCtl.m -  description
                             -------------------
    begin                : Fri Mar  8 13:55:08 2002
    copyright            : (C) 2000-2002 Lost Highway Ltd. All rights reserved.
    email                : Lost_Highway@tipitina.demon.co.uk
    generated by         : duke@tipitina on Fri Mar  8 13:55:08 2002, 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 <kdec/kde_KTabCtl.h>
#include <kdeobjc/KDESupport.h>
#include <kdeobjc/KTabCtl.h>
#include <qtobjc/QFont.h>


@implementation  KTabCtl


- initWithWidget: (QWidget *)parent name: (NSString *)name
{
	if ([self qt] == 0L) {
		[self setQt: kde_new_KTabCtl((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: kde_new_KTabCtl(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) {
			kde_del_KTabCtl((kde_KTabCtl *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- show
{
	kde_KTabCtl_show((kde_KTabCtl *)[self qt]);
	return self;
}

- setFont: (QFont *)font
{
	kde_KTabCtl_setFont((kde_KTabCtl *)[self qt], (qt_QFont *) [font qt]);
	return self;
}

- setTabFont: (QFont *)font
{
	kde_KTabCtl_setTabFont((kde_KTabCtl *)[self qt], (qt_QFont *) [font qt]);
	return self;
}

- addTab: (QWidget *)arg1 string: (NSString *)arg2
{
static qt_QString * _qstring_arg2 = 0L;
	kde_KTabCtl_addTab((kde_KTabCtl *)[self qt], (qt_QWidget *) [arg1 qt], (qt_QString *) [arg2 toQString: &_qstring_arg2]);
	return self;
}

- (BOOL) isTabEnabled: (NSString *)arg1
{
static qt_QString * _qstring_arg1 = 0L;
	return (BOOL) kde_KTabCtl_isTabEnabled((kde_KTabCtl *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1]);
}

- setTabEnabled: (NSString *)arg1 bool: (BOOL)arg2
{
static qt_QString * _qstring_arg1 = 0L;
	kde_KTabCtl_setTabEnabled((kde_KTabCtl *)[self qt], (qt_QString *) [arg1 toQString: &_qstring_arg1], (int)arg2);
	return self;
}

- setBorder: (BOOL)arg1
{
	kde_KTabCtl_setBorder((kde_KTabCtl *)[self qt], (int)arg1);
	return self;
}

- setShape: (int)shape
{
	kde_KTabCtl_setShape((kde_KTabCtl *)[self qt], (int)shape);
	return self;
}

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

- setSizes
{
	kde_KTabCtl_setSizes((kde_KTabCtl *)[self qt]);
	return self;
}

- (QRect*) getChildRect
{
	return (QRect*) [QtSupport objectForQtKey: kde_KTabCtl_getChildRect((kde_KTabCtl *)[self qt]) withClass: [QRect class] allocatedInObjcWorld: YES];
}

- showTab: (int)i
{
	kde_KTabCtl_showTab((kde_KTabCtl *)[self qt], (int)i);
	return self;
}

@end
