/***************************************************************************
                            QTabDialog.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_QTabDialog.h>

#include <qtobjc/QTabDialog.h>
#include <qtobjc/QFont.h>

#include <qtobjc/QTab.h>
#include <qtobjc/QStyle.h>
#include <qtobjc/QIconSet.h>

@implementation  QTabDialog


- initWithWidget: (QWidget *)parent name: (NSString *)name modal: (BOOL)modal f: (int)f
{
	if ([self qt] == 0L) {
		[self setQt: qt_new_QTabDialog((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_QTabDialog(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_QTabDialog((qt_QTabDialog *)[self qt]);
		}
		[QtSupport removeQtKey: [self qt]];
		[self setQt: 0L];
	}
	[super dealloc];
}

- show
{
	qt_QTabDialog_show((qt_QTabDialog *)[self qt]);
	return self;
}

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

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

- addTab: (QWidget *)child iconset: (QIconSet*)iconset label: (NSString *)label
{
static qt_QString * _qstring_label = 0L;
	qt_QTabDialog_addTab1((qt_QTabDialog *)[self qt], (qt_QWidget *) [child qt], (qt_QIconSet*) [iconset qt], (qt_QString *) [label toQString: &_qstring_label]);
	return self;
}

- addTab: (QWidget *)arg1 tab: (QTab*)arg2
{
	qt_QTabDialog_addTab2((qt_QTabDialog *)[self qt], (qt_QWidget *) [arg1 qt], (qt_QTab*) [arg2 qt]);
	return self;
}

- insertTab: (QWidget *)arg1 string: (NSString *)arg2 index: (int)index
{
static qt_QString * _qstring_arg2 = 0L;
	qt_QTabDialog_insertTab((qt_QTabDialog *)[self qt], (qt_QWidget *) [arg1 qt], (qt_QString *) [arg2 toQString: &_qstring_arg2], (int)index);
	return self;
}

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

- insertTab: (QWidget *)child iconset: (QIconSet*)iconset label: (NSString *)label index: (int)index
{
static qt_QString * _qstring_label = 0L;
	qt_QTabDialog_insertTab1((qt_QTabDialog *)[self qt], (qt_QWidget *) [child qt], (qt_QIconSet*) [iconset qt], (qt_QString *) [label toQString: &_qstring_label], (int)index);
	return self;
}

- insertTab: (QWidget *)child iconset: (QIconSet*)iconset label: (NSString *)label 
{
static qt_QString * _qstring_label = 0L;
	qt_QTabDialog_insertTab1((qt_QTabDialog *)[self qt], (qt_QWidget *) [child qt], (qt_QIconSet*) [iconset qt], (qt_QString *) [label toQString: &_qstring_label], -1);
	return self;
}

- insertTab: (QWidget *)arg1 tab: (QTab*)arg2 index: (int)index
{
	qt_QTabDialog_insertTab2((qt_QTabDialog *)[self qt], (qt_QWidget *) [arg1 qt], (qt_QTab*) [arg2 qt], (int)index);
	return self;
}

- insertTab: (QWidget *)arg1 tab: (QTab*)arg2 
{
	qt_QTabDialog_insertTab2((qt_QTabDialog *)[self qt], (qt_QWidget *) [arg1 qt], (qt_QTab*) [arg2 qt], -1);
	return self;
}

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

- changeTab: (QWidget *)child iconset: (QIconSet*)iconset label: (NSString *)label
{
static qt_QString * _qstring_label = 0L;
	qt_QTabDialog_changeTab1((qt_QTabDialog *)[self qt], (qt_QWidget *) [child qt], (qt_QIconSet*) [iconset qt], (qt_QString *) [label toQString: &_qstring_label]);
	return self;
}

- (BOOL) isTabEnabledForWidget: (QWidget *)arg1
{
	return (BOOL) qt_QTabDialog_isTabEnabled((qt_QTabDialog *)[self qt], (qt_QWidget *) [arg1 qt]);
}

- setTabEnabledForWidget: (QWidget *)arg1 bool: (BOOL)arg2
{
	qt_QTabDialog_setTabEnabled((qt_QTabDialog *)[self qt], (qt_QWidget *) [arg1 qt], (int)arg2);
	return self;
}

- (BOOL) isTabEnabled: (NSString *)arg1
{
	return (BOOL) qt_QTabDialog_isTabEnabled1((qt_QTabDialog *)[self qt], (char*) [arg1 cString]);
}

- setTabEnabled: (NSString *)arg1 bool: (BOOL)arg2
{
	qt_QTabDialog_setTabEnabled1((qt_QTabDialog *)[self qt], (char*) [arg1 cString], (int)arg2);
	return self;
}

- showPage: (QWidget *)arg1
{
	qt_QTabDialog_showPage((qt_QTabDialog *)[self qt], (qt_QWidget *) [arg1 qt]);
	return self;
}

- removePage: (QWidget *)arg1
{
	qt_QTabDialog_removePage((qt_QTabDialog *)[self qt], (qt_QWidget *) [arg1 qt]);
	return self;
}

- (NSString *) tabLabel: (QWidget *)arg1
{
static qt_QString * _qstring = 0L;
	_qstring = qt_QTabDialog_tabLabel((qt_QTabDialog *)[self qt], (qt_QWidget *) [arg1 qt]);
	return [NSString fromQString: _qstring];
}

- (QWidget*) currentPage
{
	return (QWidget*) [QtSupport objectForQtKey: qt_QTabDialog_currentPage((qt_QTabDialog *)[self qt]) withClass: [QWidget class] allocatedInObjcWorld: YES];
}

- setDefaultButton: (NSString *)text
{
static qt_QString * _qstring_text = 0L;
	qt_QTabDialog_setDefaultButton((qt_QTabDialog *)[self qt], (qt_QString *) [text toQString: &_qstring_text]);
	return self;
}

- setDefaultButton
{
	qt_QTabDialog_setDefaultButton1((qt_QTabDialog *)[self qt]);
	return self;
}

- (BOOL) hasDefaultButton
{
	return (BOOL) qt_QTabDialog_hasDefaultButton((qt_QTabDialog *)[self qt]);
}

- setHelpButton: (NSString *)text
{
static qt_QString * _qstring_text = 0L;
	qt_QTabDialog_setHelpButton((qt_QTabDialog *)[self qt], (qt_QString *) [text toQString: &_qstring_text]);
	return self;
}

- setHelpButton
{
	qt_QTabDialog_setHelpButton1((qt_QTabDialog *)[self qt]);
	return self;
}

- (BOOL) hasHelpButton
{
	return (BOOL) qt_QTabDialog_hasHelpButton((qt_QTabDialog *)[self qt]);
}

- setCancelButton: (NSString *)text
{
static qt_QString * _qstring_text = 0L;
	qt_QTabDialog_setCancelButton((qt_QTabDialog *)[self qt], (qt_QString *) [text toQString: &_qstring_text]);
	return self;
}

- setCancelButton
{
	qt_QTabDialog_setCancelButton1((qt_QTabDialog *)[self qt]);
	return self;
}

- (BOOL) hasCancelButton
{
	return (BOOL) qt_QTabDialog_hasCancelButton((qt_QTabDialog *)[self qt]);
}

- setApplyButton: (NSString *)text
{
static qt_QString * _qstring_text = 0L;
	qt_QTabDialog_setApplyButton((qt_QTabDialog *)[self qt], (qt_QString *) [text toQString: &_qstring_text]);
	return self;
}

- setApplyButton
{
	qt_QTabDialog_setApplyButton1((qt_QTabDialog *)[self qt]);
	return self;
}

- (BOOL) hasApplyButton
{
	return (BOOL) qt_QTabDialog_hasApplyButton((qt_QTabDialog *)[self qt]);
}

- setOKButton: (NSString *)text
{
static qt_QString * _qstring_text = 0L;
	qt_QTabDialog_setOKButton((qt_QTabDialog *)[self qt], (qt_QString *) [text toQString: &_qstring_text]);
	return self;
}

- setOKButton
{
	qt_QTabDialog_setOKButton((qt_QTabDialog *)[self qt], qt_QString_null());
	return self;
}

- setOkButton: (NSString *)text
{
static qt_QString * _qstring_text = 0L;
	qt_QTabDialog_setOkButton((qt_QTabDialog *)[self qt], (qt_QString *) [text toQString: &_qstring_text]);
	return self;
}

- setOkButton
{
	qt_QTabDialog_setOkButton1((qt_QTabDialog *)[self qt]);
	return self;
}

- (BOOL) hasOkButton
{
	return (BOOL) qt_QTabDialog_hasOkButton((qt_QTabDialog *)[self qt]);
}

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

- setTabBar: (QTabBar*)arg1
{
	qt_QTabDialog_setTabBar((qt_QTabDialog *)[self qt], (qt_QTabBar*) [arg1 qt]);
	return self;
}

- (QTabBar*) tabBar
{
	return (QTabBar*) [QtSupport objectForQtKey: qt_QTabDialog_tabBar((qt_QTabDialog *)[self qt]) withClass: [QTabBar class] allocatedInObjcWorld: YES];
}

@end
